Mailing List Archive

[PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move
Hi all,
after reviewing the patch "fix multiply issue for int and uint types"
with Ian Jackson, we realized that cpu_ioreq_pio and cpu_ioreq_move are
in much need for a simplification as well as removal of a possible
integer overflow.

This patch series tries to accomplish both switching to two new helper
functions and using a more obvious arithmetic. Doing so it should also
fix the original problem that Dongxiao was experiencing. The C language
can be a nasty backstabber when signed and unsigned integers are
involved.

The current patch series if for qemu-xen-traditional but if the patches
are deemed correct I'll submit an equivalent set for QEMU upstream (with
the appropriate code style changes).



Stefano Stabellini (2):
i should be uint32_t rather than int
introduce read_physical_offset and write_physical_offset

i386-dm/helper2.c | 66 +++++++++++++++++++++++++++++++++-------------------
1 files changed, 42 insertions(+), 24 deletions(-)



Cheers,

Stefano

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move [ In reply to ]
Hi Stefano,

Is these patches merged with Xen 4.2? I didn't see them in the upstream.
The uint/int fix is critical to fix the nested guest boot issue.

Thanks,
Dongxiao

> -----Original Message-----
> From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> Sent: Tuesday, September 11, 2012 2:05 AM
> To: xen-devel@lists.xensource.com
> Cc: Xu, Dongxiao; Ian Jackson; qemu-devel@nongnu.org; Stefano Stabellini
> Subject: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move
>
> Hi all,
> after reviewing the patch "fix multiply issue for int and uint types"
> with Ian Jackson, we realized that cpu_ioreq_pio and cpu_ioreq_move are in
> much need for a simplification as well as removal of a possible integer overflow.
>
> This patch series tries to accomplish both switching to two new helper
> functions and using a more obvious arithmetic. Doing so it should also fix the
> original problem that Dongxiao was experiencing. The C language can be a
> nasty backstabber when signed and unsigned integers are involved.
>
> The current patch series if for qemu-xen-traditional but if the patches are
> deemed correct I'll submit an equivalent set for QEMU upstream (with the
> appropriate code style changes).
>
>
>
> Stefano Stabellini (2):
> i should be uint32_t rather than int
> introduce read_physical_offset and write_physical_offset
>
> i386-dm/helper2.c | 66
> +++++++++++++++++++++++++++++++++-------------------
> 1 files changed, 42 insertions(+), 24 deletions(-)
>
>
>
> Cheers,
>
> Stefano

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move [ In reply to ]
On Tue, 18 Sep 2012, Xu, Dongxiao wrote:
> Hi Stefano,
>
> Is these patches merged with Xen 4.2? I didn't see them in the upstream.
> The uint/int fix is critical to fix the nested guest boot issue.

They are not. Ian decided that he wanted to merge a different version of
them.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move [ In reply to ]
> -----Original Message-----
> From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> Sent: Tuesday, September 18, 2012 6:24 PM
> To: Xu, Dongxiao
> Cc: Stefano Stabellini; xen-devel@lists.xensource.com; Ian Jackson;
> qemu-devel@nongnu.org; Keir (Xen.org)
> Subject: RE: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
> cpu_ioreq_move
>
> On Tue, 18 Sep 2012, Xu, Dongxiao wrote:
> > Hi Stefano,
> >
> > Is these patches merged with Xen 4.2? I didn't see them in the upstream.
> > The uint/int fix is critical to fix the nested guest boot issue.
>
> They are not. Ian decided that he wanted to merge a different version of them.

Hi Stefano and Ian,

What's the status of the two patches? I still didn't see them merged...
Also I think 4.2.1 need these patches to enable the basic Xen on Xen nested virtualization usage scenario.

Thanks,
Dongxiao

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move [ In reply to ]
On Thu, 29 Nov 2012, Xu, Dongxiao wrote:
> > -----Original Message-----
> > From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> > Sent: Tuesday, September 18, 2012 6:24 PM
> > To: Xu, Dongxiao
> > Cc: Stefano Stabellini; xen-devel@lists.xensource.com; Ian Jackson;
> > qemu-devel@nongnu.org; Keir (Xen.org)
> > Subject: RE: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
> > cpu_ioreq_move
> >
> > On Tue, 18 Sep 2012, Xu, Dongxiao wrote:
> > > Hi Stefano,
> > >
> > > Is these patches merged with Xen 4.2? I didn't see them in the upstream.
> > > The uint/int fix is critical to fix the nested guest boot issue.
> >
> > They are not. Ian decided that he wanted to merge a different version of them.
>
> Hi Stefano and Ian,
>
> What's the status of the two patches? I still didn't see them merged...

Ian, do you have any updates?


> Also I think 4.2.1 need these patches to enable the basic Xen on Xen nested virtualization usage scenario.

I agree.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move [ In reply to ]
On Thu, 2012-11-29 at 13:21 +0000, Stefano Stabellini wrote:
> > Also I think 4.2.1 need these patches to enable the basic Xen on Xen
> > nested virtualization usage scenario.
>
> I agree.

Nested virt was a tech preview in 4.2.0, is it really worth
backporting ?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move [ In reply to ]
On Thu, Nov 29, 2012 at 01:57:11PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-29 at 13:21 +0000, Stefano Stabellini wrote:
> > > Also I think 4.2.1 need these patches to enable the basic Xen on Xen
> > > nested virtualization usage scenario.
> >
> > I agree.
>
> Nested virt was a tech preview in 4.2.0, is it really worth
> backporting ?
>

IIRC AMD Nested Virt works on 4.2.0, so if this backport makes Intel Nested Virt
working aswell it'd be nice..

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move [ In reply to ]
Stefano Stabellini writes ("Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move"):
> On Fri, 7 Dec 2012, Ian Jackson wrote:
...
> > + if (req->df) addr -= offset;
> > + else addr -= offset;
>
> This can't be right, can it?

Indeed not. v2 has this fixed.

> The search/replace changes below look correct.

Thanks.

> For the sake of consistency, could you please send a patch against
> upstream QEMU to qemu-devel? The corresponding code is in xen-all.c
> (cpu_ioreq_pio and cpu_ioreq_move).

I will do that.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel