[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86: XENPF_set_processor_pminfo handler adjustments
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1216905407 -3600 # Node ID ab1d7db3facbbedcdfb311e8171afad21b8d4cef # Parent 379dd201c36c294fbf41897619cbdd7d1823be38 x86: XENPF_set_processor_pminfo handler adjustments Only handle information passed up from dom0 when actually controlling the respective functionality. Only count up CPUs once for each CPU. Allow dom0 to provide information incrementally. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx> --- xen/arch/x86/platform_hypercall.c | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) diff -r 379dd201c36c -r ab1d7db3facb xen/arch/x86/platform_hypercall.c --- a/xen/arch/x86/platform_hypercall.c Thu Jul 24 14:14:27 2008 +0100 +++ b/xen/arch/x86/platform_hypercall.c Thu Jul 24 14:16:47 2008 +0100 @@ -355,6 +355,11 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe struct processor_pminfo *pmpt; struct processor_performance *pxpt; + if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_PX) ) + { + ret = -ENOSYS; + break; + } if ( cpuid < 0 ) { ret = -EINVAL; @@ -373,6 +378,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe memcpy ((void *)&pxpt->status_register, (void *)&xenpxpt->status_register, sizeof(struct xen_pct_register)); + pxpt->init |= XEN_PX_PCT; } if ( xenpxpt->flags & XEN_PX_PSS ) { @@ -390,6 +396,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe break; } pxpt->state_count = xenpxpt->state_count; + pxpt->init |= XEN_PX_PSS; } if ( xenpxpt->flags & XEN_PX_PSD ) { @@ -397,14 +404,18 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe memcpy ((void *)&pxpt->domain_info, (void *)&xenpxpt->domain_info, sizeof(struct xen_psd_package)); + pxpt->init |= XEN_PX_PSD; } if ( xenpxpt->flags & XEN_PX_PPC ) + { pxpt->ppc = xenpxpt->ppc; - - if ( xenpxpt->flags == ( XEN_PX_PCT | XEN_PX_PSS | - XEN_PX_PSD | XEN_PX_PPC ) ) - { - pxpt->init =1; + pxpt->init |= XEN_PX_PPC; + } + + if ( pxpt->init == ( XEN_PX_PCT | XEN_PX_PSS | + XEN_PX_PSD | XEN_PX_PPC ) ) + { + pxpt->init |= 0x80000000; cpu_count++; } if ( cpu_count == num_online_cpus() ) @@ -418,10 +429,20 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe } case XEN_PM_CX: + if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_CX) ) + { + ret = -ENOSYS; + break; + } ret = set_cx_pminfo(op->u.set_pminfo.id, &op->u.set_pminfo.power); break; case XEN_PM_TX: + if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_TX) ) + { + ret = -ENOSYS; + break; + } ret = -EINVAL; break; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |