2014-01-03 15:05:17

by Stefano Stabellini

[permalink] [raw]
Subject: Re: [Xen-devel] [PATCH v11 09/12] xen/pvh: Piggyback on PVHVM XenBus and event channels for PVH.

On Tue, 31 Dec 2013, Konrad Rzeszutek Wilk wrote:
> > > --- a/drivers/xen/xenbus/xenbus_client.c
> > > +++ b/drivers/xen/xenbus/xenbus_client.c
> > > @@ -45,6 +45,7 @@
> > > #include <xen/grant_table.h>
> > > #include <xen/xenbus.h>
> > > #include <xen/xen.h>
> > > +#include <xen/features.h>
> > >
> > > #include "xenbus_probe.h"
> > >
> > > @@ -743,7 +744,7 @@ static const struct xenbus_ring_ops ring_ops_hvm = {
> > >
> > > void __init xenbus_ring_ops_init(void)
> > > {
> > > - if (xen_pv_domain())
> > > + if (xen_pv_domain() && !xen_feature(XENFEAT_auto_translated_physmap))
> >
> > Can we just change this test to
> >
> > if (!xen_feature(XENFEAT_auto_translated_physmap))
> >
> > ?
>
> No. If we do then the HVM domains (which are also !auto-xlat)
> will end up using the PV version of ring_ops.

Actually HVM guests have XENFEAT_auto_translated_physmap, so in this
case they would get &ring_ops_hvm.


> > > ring_ops = &ring_ops_pv;
> > > else
> > > ring_ops = &ring_ops_hvm;
> > > --
> > > 1.8.3.1
> > >
> > >
> > > _______________________________________________
> > > Xen-devel mailing list
> > > [email protected]
> > > http://lists.xen.org/xen-devel
> > >
>


2014-01-04 00:30:22

by Mukesh Rathor

[permalink] [raw]
Subject: Re: [Xen-devel] [PATCH v11 09/12] xen/pvh: Piggyback on PVHVM XenBus and event channels for PVH.

On Fri, 3 Jan 2014 15:04:27 +0000
Stefano Stabellini <[email protected]> wrote:

> On Tue, 31 Dec 2013, Konrad Rzeszutek Wilk wrote:
> > > > --- a/drivers/xen/xenbus/xenbus_client.c
> > > > +++ b/drivers/xen/xenbus/xenbus_client.c
> > > > @@ -45,6 +45,7 @@
> > > > #include <xen/grant_table.h>
> > > > #include <xen/xenbus.h>
> > > > #include <xen/xen.h>
> > > > +#include <xen/features.h>
> > > >
> > > > #include "xenbus_probe.h"
> > > >
> > > > @@ -743,7 +744,7 @@ static const struct xenbus_ring_ops
> > > > ring_ops_hvm = {
> > > > void __init xenbus_ring_ops_init(void)
> > > > {
> > > > - if (xen_pv_domain())
> > > > + if (xen_pv_domain()
> > > > && !xen_feature(XENFEAT_auto_translated_physmap))
> > >
> > > Can we just change this test to
> > >
> > > if (!xen_feature(XENFEAT_auto_translated_physmap))
> > >
> > > ?
> >
> > No. If we do then the HVM domains (which are also !auto-xlat)
> > will end up using the PV version of ring_ops.
>
> Actually HVM guests have XENFEAT_auto_translated_physmap, so in this
> case they would get &ring_ops_hvm.

Right. Back then I was confused about all the other PV modes, like
shadow, supervisor, ... but looks like they are all obsolete. It could
just be:

if (!xen_feature(XENFEAT_auto_translated_physmap))
ring_ops = &ring_ops_pv;
else
ring_ops = &ring_ops_hvm;

thanks,
Mukesh