Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-21 Thread Julien Grall
Hi Stefano, On 21/08/2020 01:53, Stefano Stabellini wrote: On Thu, 20 Aug 2020, Oleksandr wrote: On 11/08/2020 23:48, Stefano Stabellini wrote: I have the impression that we disagree in what the Device Emulator is meant to do. IHMO, the goal of the device emulator is to emulate a device in an

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-20 Thread Stefano Stabellini
On Thu, 20 Aug 2020, Oleksandr wrote: > > On 11/08/2020 23:48, Stefano Stabellini wrote: > > > > I have the impression that we disagree in what the Device Emulator is > > > > meant to > > > > do. IHMO, the goal of the device emulator is to emulate a device in an > > > > arch-agnostic way. > > > >

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-20 Thread Oleksandr
On 12.08.20 11:19, Julien Grall wrote: Hi, Hi Julien, Stefano On 11/08/2020 23:48, Stefano Stabellini wrote: I have the impression that we disagree in what the Device Emulator is meant to do. IHMO, the goal of the device emulator is to emulate a device in an arch-agnostic way. That wo

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-16 Thread Oleksandr
On 15.08.20 20:30, Julien Grall wrote: Hi Oleksandr, Hi Julien. On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: +static int hvm_send_buffered_ioreq(struct hvm_ioreq_server *s, ioreq_t *p) +{ [...] +    /* Canonicalize read/write pointers to prevent their overflow. */ +    while ( (

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-15 Thread Julien Grall
Hi Oleksandr, On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: +static int hvm_send_buffered_ioreq(struct hvm_ioreq_server *s, ioreq_t *p) +{ [...] +/* Canonicalize read/write pointers to prevent their overflow. */ +while ( (s->bufioreq_handling == HVM_IOREQSRV_BUFIOREQ_ATOMIC) && +

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-13 Thread Julien Grall
On 13/08/2020 00:08, Stefano Stabellini wrote: It is very similar to your second patch with a small change on calling try_handle_mmio from handle_mmio and setting the register there. Do you think that would work? If I understood correctly what you had suggested and properly implemented then i

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-12 Thread Stefano Stabellini
On Wed, 12 Aug 2020, Oleksandr wrote: > On 12.08.20 01:47, Stefano Stabellini wrote: > > On Tue, 11 Aug 2020, Oleksandr wrote: > > > On 11.08.20 12:19, Julien Grall wrote: > > > > On 11/08/2020 00:34, Stefano Stabellini wrote: > > > > > On Mon, 10 Aug 2020, Oleksandr wrote: > > > > > > On 08.08.20

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-12 Thread Oleksandr
On 12.08.20 01:47, Stefano Stabellini wrote: Hi Stefano On Tue, 11 Aug 2020, Oleksandr wrote: On 11.08.20 12:19, Julien Grall wrote: On 11/08/2020 00:34, Stefano Stabellini wrote: On Mon, 10 Aug 2020, Oleksandr wrote: On 08.08.20 01:19, Oleksandr wrote: On 08.08.20 00:50, Stefano Stabell

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-12 Thread Julien Grall
Hi, On 11/08/2020 23:48, Stefano Stabellini wrote: I have the impression that we disagree in what the Device Emulator is meant to do. IHMO, the goal of the device emulator is to emulate a device in an arch-agnostic way. That would be great in theory but I am not sure it is achievable: if we us

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-11 Thread Stefano Stabellini
On Tue, 11 Aug 2020, Julien Grall wrote: > On 11/08/2020 00:34, Stefano Stabellini wrote: > > On Mon, 10 Aug 2020, Julien Grall wrote: > > > On 07/08/2020 00:48, Stefano Stabellini wrote: > > > > On Thu, 6 Aug 2020, Julien Grall wrote: > > > > > On 06/08/2020 01:37, Stefano Stabellini wrote: > > >

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-11 Thread Stefano Stabellini
On Tue, 11 Aug 2020, Oleksandr wrote: > On 11.08.20 12:19, Julien Grall wrote: > > On 11/08/2020 00:34, Stefano Stabellini wrote: > > > On Mon, 10 Aug 2020, Oleksandr wrote: > > > > On 08.08.20 01:19, Oleksandr wrote: > > > > > On 08.08.20 00:50, Stefano Stabellini wrote: > > > > > > On Fri, 7 Aug

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-11 Thread Julien Grall
On 11/08/2020 00:34, Stefano Stabellini wrote: On Mon, 10 Aug 2020, Julien Grall wrote: On 07/08/2020 00:48, Stefano Stabellini wrote: On Thu, 6 Aug 2020, Julien Grall wrote: On 06/08/2020 01:37, Stefano Stabellini wrote: On Wed, 5 Aug 2020, Julien Grall wrote: On 04/08/2020 20:11, Stefan

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-11 Thread Oleksandr
On 11.08.20 12:19, Julien Grall wrote: Hi Julien, Stefano Hi Stefano, On 11/08/2020 00:34, Stefano Stabellini wrote: On Mon, 10 Aug 2020, Oleksandr wrote: On 08.08.20 01:19, Oleksandr wrote: On 08.08.20 00:50, Stefano Stabellini wrote: On Fri, 7 Aug 2020, Oleksandr wrote: On 06.08.20 03

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-11 Thread Julien Grall
Hi Stefano, On 11/08/2020 00:34, Stefano Stabellini wrote: On Mon, 10 Aug 2020, Oleksandr wrote: On 08.08.20 01:19, Oleksandr wrote: On 08.08.20 00:50, Stefano Stabellini wrote: On Fri, 7 Aug 2020, Oleksandr wrote: On 06.08.20 03:37, Stefano Stabellini wrote: Hi Stefano Trying to simulate

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-10 Thread Stefano Stabellini
On Mon, 10 Aug 2020, Julien Grall wrote: > On 07/08/2020 00:48, Stefano Stabellini wrote: > > On Thu, 6 Aug 2020, Julien Grall wrote: > > > On 06/08/2020 01:37, Stefano Stabellini wrote: > > > > On Wed, 5 Aug 2020, Julien Grall wrote: > > > > > On 04/08/2020 20:11, Stefano Stabellini wrote: > > > >

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-10 Thread Stefano Stabellini
On Sat, 8 Aug 2020, Oleksandr wrote: > On 08.08.20 00:50, Stefano Stabellini wrote: > > On Fri, 7 Aug 2020, Oleksandr wrote: > > > On 06.08.20 03:37, Stefano Stabellini wrote: > > > > > > Hi Stefano > > > > > > Trying to simulate IO_RETRY handling mechanism (according to model below) > > > I > >

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-10 Thread Stefano Stabellini
On Mon, 10 Aug 2020, Oleksandr wrote: > On 08.08.20 01:19, Oleksandr wrote: > > On 08.08.20 00:50, Stefano Stabellini wrote: > > > On Fri, 7 Aug 2020, Oleksandr wrote: > > > > On 06.08.20 03:37, Stefano Stabellini wrote: > > > > > > > > Hi Stefano > > > > > > > > Trying to simulate IO_RETRY handl

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-10 Thread Julien Grall
On 07/08/2020 00:48, Stefano Stabellini wrote: On Thu, 6 Aug 2020, Julien Grall wrote: On 06/08/2020 01:37, Stefano Stabellini wrote: On Wed, 5 Aug 2020, Julien Grall wrote: On 04/08/2020 20:11, Stefano Stabellini wrote: On Tue, 4 Aug 2020, Julien Grall wrote: On 04/08/2020 12:10, Oleksan

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-10 Thread Oleksandr
On 10.08.20 19:29, Julien Grall wrote: Hi, Hi Julien On 06/08/2020 12:37, Oleksandr wrote: On 05.08.20 16:30, Julien Grall wrote: Hi, Hi Julien On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko As a lot of x86 code can be re-used on Arm later on, this

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-10 Thread Julien Grall
Hi, On 06/08/2020 12:37, Oleksandr wrote: On 05.08.20 16:30, Julien Grall wrote: Hi, Hi Julien On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko As a lot of x86 code can be re-used on Arm later on, this patch splits IOREQ support into common and arch specific

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-10 Thread Oleksandr
Hi On 08.08.20 01:19, Oleksandr wrote: On 08.08.20 00:50, Stefano Stabellini wrote: Hi Stefano On Fri, 7 Aug 2020, Oleksandr wrote: On 06.08.20 03:37, Stefano Stabellini wrote: Hi Stefano Trying to simulate IO_RETRY handling mechanism (according to model below) I continuously get IO_

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-07 Thread Oleksandr
On 08.08.20 00:50, Stefano Stabellini wrote: Hi On Fri, 7 Aug 2020, Oleksandr wrote: On 06.08.20 03:37, Stefano Stabellini wrote: Hi Stefano Trying to simulate IO_RETRY handling mechanism (according to model below) I continuously get IO_RETRY from try_fwd_ioserv() ... OK, thanks for the

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-07 Thread Oleksandr
On 08.08.20 00:50, Stefano Stabellini wrote: Hi Stefano On Fri, 7 Aug 2020, Oleksandr wrote: On 06.08.20 03:37, Stefano Stabellini wrote: Hi Stefano Trying to simulate IO_RETRY handling mechanism (according to model below) I continuously get IO_RETRY from try_fwd_ioserv() ... OK, thanks

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-07 Thread Stefano Stabellini
On Fri, 7 Aug 2020, Oleksandr wrote: > On 06.08.20 03:37, Stefano Stabellini wrote: > > Hi Stefano > > Trying to simulate IO_RETRY handling mechanism (according to model below) I > continuously get IO_RETRY from try_fwd_ioserv() ... > > > OK, thanks for the details. My interpretation seems to be

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-07 Thread Oleksandr
On 06.08.20 03:37, Stefano Stabellini wrote: Hi Stefano Trying to simulate IO_RETRY handling mechanism (according to model below) I continuously get IO_RETRY from try_fwd_ioserv() ... OK, thanks for the details. My interpretation seems to be correct. In which case, it looks like xen/arch/

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-07 Thread Oleksandr
On 06.08.20 23:32, Stefano Stabellini wrote: Hi Stefano On Thu, 6 Aug 2020, Jan Beulich wrote: On 06.08.2020 02:37, Stefano Stabellini wrote: What should do_trap_stage2_abort_guest do on IO_RETRY? Simply return early and let the scheduler do its job? Something like: enum io_st

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-06 Thread Stefano Stabellini
On Thu, 6 Aug 2020, Julien Grall wrote: > On 06/08/2020 01:37, Stefano Stabellini wrote: > > On Wed, 5 Aug 2020, Julien Grall wrote: > > > On 04/08/2020 20:11, Stefano Stabellini wrote: > > > > On Tue, 4 Aug 2020, Julien Grall wrote: > > > > > On 04/08/2020 12:10, Oleksandr wrote: > > > > > > On 04

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-06 Thread Stefano Stabellini
On Thu, 6 Aug 2020, Jan Beulich wrote: > On 06.08.2020 02:37, Stefano Stabellini wrote: > > What should do_trap_stage2_abort_guest do on IO_RETRY? Simply return > > early and let the scheduler do its job? Something like: > > > > enum io_state state = try_handle_mmio(regs, hsr, gpa); >

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-06 Thread Oleksandr
On 05.08.20 16:30, Julien Grall wrote: Hi, Hi Julien On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko As a lot of x86 code can be re-used on Arm later on, this patch splits IOREQ support into common and arch specific parts. This support is going to be used o

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-06 Thread Julien Grall
Hi, On 06/08/2020 01:37, Stefano Stabellini wrote: On Wed, 5 Aug 2020, Julien Grall wrote: On 04/08/2020 20:11, Stefano Stabellini wrote: On Tue, 4 Aug 2020, Julien Grall wrote: On 04/08/2020 12:10, Oleksandr wrote: On 04.08.20 10:45, Paul Durrant wrote: +static inline bool hvm_ioreq_needs_

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-06 Thread Oleksandr
On 05.08.20 19:15, Andrew Cooper wrote: Hi Andrew On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: diff --git a/xen/common/Makefile b/xen/common/Makefile index 06881d0..f6fc3f8 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -70,6 +70,7 @@ extra-y := symbols-dummy.o obj-$(

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-06 Thread Jan Beulich
On 06.08.2020 02:37, Stefano Stabellini wrote: > What should do_trap_stage2_abort_guest do on IO_RETRY? Simply return > early and let the scheduler do its job? Something like: > > enum io_state state = try_handle_mmio(regs, hsr, gpa); > > switch ( state ) > { >

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-05 Thread Stefano Stabellini
On Wed, 5 Aug 2020, Jan Beulich wrote: > On 04.08.2020 21:11, Stefano Stabellini wrote: > >> The point of the check isn't to determine whether to wait, but > >> what to do after having waited. Reads need a retry round through > >> the emulator (to store the result in the designated place), > >> whi

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-05 Thread Stefano Stabellini
On Wed, 5 Aug 2020, Julien Grall wrote: > On 04/08/2020 20:11, Stefano Stabellini wrote: > > On Tue, 4 Aug 2020, Julien Grall wrote: > > > On 04/08/2020 12:10, Oleksandr wrote: > > > > On 04.08.20 10:45, Paul Durrant wrote: > > > > > > +static inline bool hvm_ioreq_needs_completion(const ioreq_t *i

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-05 Thread Andrew Cooper
On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: > diff --git a/xen/common/Makefile b/xen/common/Makefile > index 06881d0..f6fc3f8 100644 > --- a/xen/common/Makefile > +++ b/xen/common/Makefile > @@ -70,6 +70,7 @@ extra-y := symbols-dummy.o > > obj-$(CONFIG_COVERAGE) += coverage/ > obj-y += sch

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-05 Thread Julien Grall
Hi, On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko As a lot of x86 code can be re-used on Arm later on, this patch splits IOREQ support into common and arch specific parts. This support is going to be used on Arm to be able run device emulator outside of Xen hyper

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-05 Thread Julien Grall
Hi, On 04/08/2020 20:11, Stefano Stabellini wrote: On Tue, 4 Aug 2020, Julien Grall wrote: On 04/08/2020 12:10, Oleksandr wrote: On 04.08.20 10:45, Paul Durrant wrote: +static inline bool hvm_ioreq_needs_completion(const ioreq_t *ioreq) +{ +    return ioreq->state == STATE_IOREQ_READY && +   

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-05 Thread Jan Beulich
On 04.08.2020 21:11, Stefano Stabellini wrote: >> The point of the check isn't to determine whether to wait, but >> what to do after having waited. Reads need a retry round through >> the emulator (to store the result in the designated place), >> while writes don't have such a requirement (and henc

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-04 Thread Stefano Stabellini
On Tue, 4 Aug 2020, Julien Grall wrote: > On 04/08/2020 12:10, Oleksandr wrote: > > On 04.08.20 10:45, Paul Durrant wrote: > > > > +static inline bool hvm_ioreq_needs_completion(const ioreq_t *ioreq) > > > > +{ > > > > +    return ioreq->state == STATE_IOREQ_READY && > > > > +   !ioreq->dat

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-04 Thread Jan Beulich
On 04.08.2020 15:52, Julien Grall wrote: > On 04/08/2020 12:10, Oleksandr wrote: >> On 04.08.20 10:45, Paul Durrant wrote: +static inline bool hvm_ioreq_needs_completion(const ioreq_t *ioreq) +{ +    return ioreq->state == STATE_IOREQ_READY && +   !ioreq->data_is_ptr &&

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-04 Thread Julien Grall
Hi, On 04/08/2020 12:10, Oleksandr wrote: On 04.08.20 10:45, Paul Durrant wrote: +static inline bool hvm_ioreq_needs_completion(const ioreq_t *ioreq) +{ +    return ioreq->state == STATE_IOREQ_READY && +   !ioreq->data_is_ptr && +   (ioreq->type != IOREQ_TYPE_PIO || ioreq->dir !

RE: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-04 Thread Paul Durrant
u > Monné' ; > 'George Dunlap' ; 'Ian Jackson' > ; 'Julien Grall' > ; 'Stefano Stabellini' ; 'Jun > Nakajima' > ; 'Kevin Tian' ; 'Tim Deegan' > ; 'Julien > Grall' > Subject: Re: [RFC PATCH V1

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-04 Thread Oleksandr
On 04.08.20 14:23, Paul Durrant wrote: diff --git a/xen/include/xen/hvm/ioreq.h b/xen/include/xen/hvm/ioreq.h new file mode 100644 index 000..40b7b5e --- /dev/null +++ b/xen/include/xen/hvm/ioreq.h @@ -0,0 +1,89 @@ +/* + * hvm.h: Hardware virtual machine assist interface definitions. + *

RE: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-04 Thread Paul Durrant
u > Monné' ; > 'George Dunlap' ; 'Ian Jackson' > ; 'Julien Grall' > ; 'Stefano Stabellini' ; 'Jun > Nakajima' > ; 'Kevin Tian' ; 'Tim Deegan' > ; 'Julien > Grall' > Subject: Re: [RFC PATCH V

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-04 Thread Oleksandr
Grall ; Stefano Stabellini ; Paul Durrant ; Jun Nakajima ; Kevin Tian ; Tim Deegan ; Julien Grall Subject: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common From: Oleksandr Tyshchenko As a lot of x86 code can be re-used on Arm later on, this patch splits IOREQ support into c

RE: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-04 Thread Paul Durrant
> ; Stefano Stabellini ; Paul Durrant > ; Jun > Nakajima ; Kevin Tian ; Tim > Deegan ; Julien > Grall > Subject: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common > > From: Oleksandr Tyshchenko > > As a lot of x86 code can be re-used on Arm

[RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-03 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko As a lot of x86 code can be re-used on Arm later on, this patch splits IOREQ support into common and arch specific parts. This support is going to be used on Arm to be able run device emulator outside of Xen hypervisor. Please note, this is a split/cleanup of Julien's