From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [V0 PATCH] pvh: expose feature flags from tools for domUs Date: Thu, 6 Feb 2014 17:15:37 -0800 Message-ID: <20140206171537.4ec98205@mantra.us.oracle.com> References: <1390612410-27384-1-git-send-email-mukesh.rathor@oracle.com> <1390612410-27384-2-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1390612410-27384-2-git-send-email-mukesh.rathor@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor Cc: roger.pau@citrix.com, Xen-devel@lists.xensource.com, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org ping? I think Roger you can ack from xen-pvh side. IanC/J, I guess one of you need to ack from tool side? Again this for 4.5, and not 4.4. thanks Mukesh On Fri, 24 Jan 2014 17:13:30 -0800 Mukesh Rathor wrote: > Expose features for pvh domUs from tools. > > Signed-off-by: Mukesh Rathor > --- > tools/libxc/xc_cpuid_x86.c | 26 ++++++++++++++++---------- > tools/libxc/xc_domain.c | 1 + > tools/libxc/xenctrl.h | 2 +- > 3 files changed, 18 insertions(+), 11 deletions(-) > > diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c > index bbbf9b8..33f6829 100644 > --- a/tools/libxc/xc_cpuid_x86.c > +++ b/tools/libxc/xc_cpuid_x86.c > @@ -433,7 +433,7 @@ static void xc_cpuid_hvm_policy( > > static void xc_cpuid_pv_policy( > xc_interface *xch, domid_t domid, > - const unsigned int *input, unsigned int *regs) > + const unsigned int *input, unsigned int *regs, int is_pvh) > { > DECLARE_DOMCTL; > unsigned int guest_width; > @@ -455,13 +455,16 @@ static void xc_cpuid_pv_policy( > > if ( (input[0] & 0x7fffffff) == 0x00000001 ) > { > - clear_bit(X86_FEATURE_VME, regs[3]); > - clear_bit(X86_FEATURE_PSE, regs[3]); > - clear_bit(X86_FEATURE_PGE, regs[3]); > - clear_bit(X86_FEATURE_MCE, regs[3]); > - clear_bit(X86_FEATURE_MCA, regs[3]); > + if ( !is_pvh ) > + { > + clear_bit(X86_FEATURE_VME, regs[3]); > + clear_bit(X86_FEATURE_PSE, regs[3]); > + clear_bit(X86_FEATURE_PGE, regs[3]); > + clear_bit(X86_FEATURE_MCE, regs[3]); > + clear_bit(X86_FEATURE_MCA, regs[3]); > + clear_bit(X86_FEATURE_PSE36, regs[3]); > + } > clear_bit(X86_FEATURE_MTRR, regs[3]); > - clear_bit(X86_FEATURE_PSE36, regs[3]); > } > > switch ( input[0] ) > @@ -524,8 +527,11 @@ static void xc_cpuid_pv_policy( > { > set_bit(X86_FEATURE_SYSCALL, regs[3]); > } > - clear_bit(X86_FEATURE_PAGE1GB, regs[3]); > - clear_bit(X86_FEATURE_RDTSCP, regs[3]); > + if ( !is_pvh ) > + { > + clear_bit(X86_FEATURE_PAGE1GB, regs[3]); > + clear_bit(X86_FEATURE_RDTSCP, regs[3]); > + } > > clear_bit(X86_FEATURE_SVM, regs[2]); > clear_bit(X86_FEATURE_OSVW, regs[2]); > @@ -561,7 +567,7 @@ static int xc_cpuid_policy( > if ( info.hvm ) > xc_cpuid_hvm_policy(xch, domid, input, regs); > else > - xc_cpuid_pv_policy(xch, domid, input, regs); > + xc_cpuid_pv_policy(xch, domid, input, regs, info.pvh); > > return 0; > } > diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c > index c2fdd74..f12999a 100644 > --- a/tools/libxc/xc_domain.c > +++ b/tools/libxc/xc_domain.c > @@ -316,6 +316,7 @@ int xc_domain_getinfo(xc_interface *xch, > info->running > = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_running); info->hvm > = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_hvm_guest); > info->debugged = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_debugged); > + info->pvh > = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_pvh_guest); > info->shutdown_reason = > (domctl.u.getdomaininfo.flags>>XEN_DOMINF_shutdownshift) > & diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h > index 13f816b..77d219a 100644 > --- a/tools/libxc/xenctrl.h > +++ b/tools/libxc/xenctrl.h > @@ -404,7 +404,7 @@ typedef struct xc_dominfo { > uint32_t ssidref; > unsigned int dying:1, crashed:1, shutdown:1, > paused:1, blocked:1, running:1, > - hvm:1, debugged:1; > + hvm:1, debugged:1, pvh:1; > unsigned int shutdown_reason; /* only meaningful if shutdown==1 > */ unsigned long nr_pages; /* current number, not maximum */ > unsigned long nr_outstanding_pages;