From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Date: Wed, 04 Jan 2012 10:33:53 +0000 Subject: Re: [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host Message-Id: <4F042B11.1080104@redhat.com> List-Id: References: <1325312176-17697-1-git-send-email-yu.liu@freescale.com> <4F030A51.3020309@redhat.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexander Graf Cc: Liu Yu , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org On 01/03/2012 04:13 PM, Alexander Graf wrote: > On 03.01.2012, at 15:01, Avi Kivity wrote: > > > On 12/31/2011 08:16 AM, Liu Yu wrote: > >> Add a new field opt_feature in struct kvm_ppc_pvinfo > >> to tell userspace whether it support hcall idle. > >> > >> diff --git a/include/linux/kvm.h b/include/linux/kvm.h > >> index c107fae..5af21f3 100644 > >> --- a/include/linux/kvm.h > >> +++ b/include/linux/kvm.h > >> @@ -426,9 +426,12 @@ struct kvm_ppc_pvinfo { > >> /* out */ > >> __u32 flags; > >> __u32 hcall[4]; > >> - __u8 pad[108]; > >> + __u32 opt_features; > >> + __u8 pad[104]; > >> }; > >> > >> +#define KVM_PPC_PVINFO_HAS_EV_IDLE (1<<0) > >> + > >> > > > > Needs to be documented, plus a KVM_CAP so userspace can discover that > > this feature is available, > > Not if we put the bit into flags. Then user space can just check the flags bitmap and know that it's there regardless of capabilities, because older kernels will set the bit to 0. It needs to detect that opt_features is available during compile time (qemu copies headers, but we don't want to force everyone to do that). -- error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host Date: Wed, 04 Jan 2012 12:33:53 +0200 Message-ID: <4F042B11.1080104@redhat.com> References: <1325312176-17697-1-git-send-email-yu.liu@freescale.com> <4F030A51.3020309@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Liu Yu , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Alexander Graf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10111 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236Ab2ADKeB (ORCPT ); Wed, 4 Jan 2012 05:34:01 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 01/03/2012 04:13 PM, Alexander Graf wrote: > On 03.01.2012, at 15:01, Avi Kivity wrote: > > > On 12/31/2011 08:16 AM, Liu Yu wrote: > >> Add a new field opt_feature in struct kvm_ppc_pvinfo > >> to tell userspace whether it support hcall idle. > >> > >> diff --git a/include/linux/kvm.h b/include/linux/kvm.h > >> index c107fae..5af21f3 100644 > >> --- a/include/linux/kvm.h > >> +++ b/include/linux/kvm.h > >> @@ -426,9 +426,12 @@ struct kvm_ppc_pvinfo { > >> /* out */ > >> __u32 flags; > >> __u32 hcall[4]; > >> - __u8 pad[108]; > >> + __u32 opt_features; > >> + __u8 pad[104]; > >> }; > >> > >> +#define KVM_PPC_PVINFO_HAS_EV_IDLE (1<<0) > >> + > >> > > > > Needs to be documented, plus a KVM_CAP so userspace can discover that > > this feature is available, > > Not if we put the bit into flags. Then user space can just check the flags bitmap and know that it's there regardless of capabilities, because older kernels will set the bit to 0. It needs to detect that opt_features is available during compile time (qemu copies headers, but we don't want to force everyone to do that). -- error compiling committee.c: too many arguments to function