All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Avi Kivity <avi@redhat.com>, Liu Yu <yu.liu@freescale.com>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host
Date: Wed, 04 Jan 2012 19:25:33 +0000	[thread overview]
Message-ID: <4F04A7AD.80907@freescale.com> (raw)
In-Reply-To: <1F66722B-9268-4E3D-874A-1F24BC341F79@suse.de>

On 01/04/2012 06:04 AM, Alexander Graf wrote:
> 
> 
> On 04.01.2012, at 11:33, Avi Kivity <avi@redhat.com> wrote:
> 
>> 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).
> 
> The point is that we don't need opt_features. We already have a fearure bitmap in the struct.

Even if we did for whatever reason want a new field, the entire struct
is zeroed currently, so we only need a flag if we need to distinguish
"field is zero" from "field is not valid".

-Scott


WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Avi Kivity <avi@redhat.com>, Liu Yu <yu.liu@freescale.com>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host
Date: Wed, 4 Jan 2012 13:25:33 -0600	[thread overview]
Message-ID: <4F04A7AD.80907@freescale.com> (raw)
In-Reply-To: <1F66722B-9268-4E3D-874A-1F24BC341F79@suse.de>

On 01/04/2012 06:04 AM, Alexander Graf wrote:
> 
> 
> On 04.01.2012, at 11:33, Avi Kivity <avi@redhat.com> wrote:
> 
>> 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).
> 
> The point is that we don't need opt_features. We already have a fearure bitmap in the struct.

Even if we did for whatever reason want a new field, the entire struct
is zeroed currently, so we only need a flag if we need to distinguish
"field is zero" from "field is not valid".

-Scott

  parent reply	other threads:[~2012-01-04 19:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-31  6:16 [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host Liu Yu
2011-12-31  6:16 ` Liu Yu
2011-12-31  6:16 ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt guest linux Liu Yu
2011-12-31  6:16   ` Liu Yu
2012-01-02 18:23   ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt Scott Wood
2012-01-02 18:23     ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt guest linux Scott Wood
2012-01-04  9:23     ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt Liu Yu-B13201
2012-01-04  9:23       ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt guest linux Liu Yu-B13201
2012-01-04 19:21       ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt Scott Wood
2012-01-04 19:21         ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt guest linux Scott Wood
2012-01-02 18:17 ` [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host Scott Wood
2012-01-02 18:17   ` Scott Wood
2012-01-03 14:01 ` Avi Kivity
2012-01-03 14:01   ` Avi Kivity
2012-01-03 14:13   ` Alexander Graf
2012-01-03 14:13     ` Alexander Graf
2012-01-04 10:33     ` Avi Kivity
2012-01-04 10:33       ` Avi Kivity
2012-01-04 12:04       ` Alexander Graf
2012-01-04 12:04         ` Alexander Graf
2012-01-04 12:11         ` Avi Kivity
2012-01-04 12:11           ` Avi Kivity
2012-01-04 19:25         ` Scott Wood [this message]
2012-01-04 19:25           ` Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F04A7AD.80907@freescale.com \
    --to=scottwood@freescale.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=yu.liu@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.