* [PATCH RESEND] i386/kvm: support guest access CORE cstate
@ 2019-07-15 1:28 Wanpeng Li
2019-07-15 9:16 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Wanpeng Li @ 2019-07-15 1:28 UTC (permalink / raw)
To: linux-kernel, kvm
Cc: Paolo Bonzini, Radim Krčmář, Eduardo Habkost
From: Wanpeng Li <wanpengli@tencent.com>
Allow guest reads CORE cstate when exposing host CPU power management capabilities
to the guest. PKG cstate is restricted to avoid a guest to get the whole package
information in multi-tenant scenario.
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
---
| 4 +++-
target/i386/kvm.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
--git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index b53ee59..d648fde 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -696,9 +696,11 @@ struct kvm_ioeventfd {
#define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)
#define KVM_X86_DISABLE_EXITS_HLT (1 << 1)
#define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)
+#define KVM_X86_DISABLE_EXITS_CSTATE (1 << 3)
#define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \
KVM_X86_DISABLE_EXITS_HLT | \
- KVM_X86_DISABLE_EXITS_PAUSE)
+ KVM_X86_DISABLE_EXITS_PAUSE | \
+ KVM_X86_DISABLE_EXITS_CSTATE)
/* for KVM_ENABLE_CAP */
struct kvm_enable_cap {
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 3b29ce5..49a0cc1 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1645,7 +1645,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
if (disable_exits) {
disable_exits &= (KVM_X86_DISABLE_EXITS_MWAIT |
KVM_X86_DISABLE_EXITS_HLT |
- KVM_X86_DISABLE_EXITS_PAUSE);
+ KVM_X86_DISABLE_EXITS_PAUSE |
+ KVM_X86_DISABLE_EXITS_CSTATE);
}
ret = kvm_vm_enable_cap(s, KVM_CAP_X86_DISABLE_EXITS, 0,
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] i386/kvm: support guest access CORE cstate
2019-07-15 1:28 [PATCH RESEND] i386/kvm: support guest access CORE cstate Wanpeng Li
@ 2019-07-15 9:16 ` Paolo Bonzini
2019-07-15 9:22 ` Wanpeng Li
2019-08-20 7:16 ` Wanpeng Li
0 siblings, 2 replies; 7+ messages in thread
From: Paolo Bonzini @ 2019-07-15 9:16 UTC (permalink / raw)
To: Wanpeng Li, linux-kernel, kvm
Cc: Radim Krčmář, Eduardo Habkost
On 15/07/19 03:28, Wanpeng Li wrote:
> From: Wanpeng Li <wanpengli@tencent.com>
>
> Allow guest reads CORE cstate when exposing host CPU power management capabilities
> to the guest. PKG cstate is restricted to avoid a guest to get the whole package
> information in multi-tenant scenario.
>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Hi,
QEMU is in hard freeze now. This will be applied after the release.
Thanks,
Paolo
> ---
> linux-headers/linux/kvm.h | 4 +++-
> target/i386/kvm.c | 3 ++-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
> index b53ee59..d648fde 100644
> --- a/linux-headers/linux/kvm.h
> +++ b/linux-headers/linux/kvm.h
> @@ -696,9 +696,11 @@ struct kvm_ioeventfd {
> #define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)
> #define KVM_X86_DISABLE_EXITS_HLT (1 << 1)
> #define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)
> +#define KVM_X86_DISABLE_EXITS_CSTATE (1 << 3)
> #define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \
> KVM_X86_DISABLE_EXITS_HLT | \
> - KVM_X86_DISABLE_EXITS_PAUSE)
> + KVM_X86_DISABLE_EXITS_PAUSE | \
> + KVM_X86_DISABLE_EXITS_CSTATE)
>
> /* for KVM_ENABLE_CAP */
> struct kvm_enable_cap {
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index 3b29ce5..49a0cc1 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -1645,7 +1645,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
> if (disable_exits) {
> disable_exits &= (KVM_X86_DISABLE_EXITS_MWAIT |
> KVM_X86_DISABLE_EXITS_HLT |
> - KVM_X86_DISABLE_EXITS_PAUSE);
> + KVM_X86_DISABLE_EXITS_PAUSE |
> + KVM_X86_DISABLE_EXITS_CSTATE);
> }
>
> ret = kvm_vm_enable_cap(s, KVM_CAP_X86_DISABLE_EXITS, 0,
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] i386/kvm: support guest access CORE cstate
2019-07-15 9:16 ` Paolo Bonzini
@ 2019-07-15 9:22 ` Wanpeng Li
2019-08-20 7:16 ` Wanpeng Li
1 sibling, 0 replies; 7+ messages in thread
From: Wanpeng Li @ 2019-07-15 9:22 UTC (permalink / raw)
To: Paolo Bonzini
Cc: LKML, kvm, Radim Krčmář, Eduardo Habkost, qemu-devel
On Mon, 15 Jul 2019 at 17:16, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 15/07/19 03:28, Wanpeng Li wrote:
> > From: Wanpeng Li <wanpengli@tencent.com>
> >
> > Allow guest reads CORE cstate when exposing host CPU power management capabilities
> > to the guest. PKG cstate is restricted to avoid a guest to get the whole package
> > information in multi-tenant scenario.
> >
> > Cc: Eduardo Habkost <ehabkost@redhat.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Radim Krčmář <rkrcmar@redhat.com>
> > Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
>
> Hi,
>
> QEMU is in hard freeze now. This will be applied after the release.
Thanks for the information. :)
Regards,
Wanpeng Li
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] i386/kvm: support guest access CORE cstate
2019-07-15 9:16 ` Paolo Bonzini
2019-07-15 9:22 ` Wanpeng Li
@ 2019-08-20 7:16 ` Wanpeng Li
2019-08-21 7:55 ` Paolo Bonzini
1 sibling, 1 reply; 7+ messages in thread
From: Wanpeng Li @ 2019-08-20 7:16 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: LKML, kvm, Radim Krčmář, Eduardo Habkost
Kindly reminder, :)
On Mon, 15 Jul 2019 at 17:16, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 15/07/19 03:28, Wanpeng Li wrote:
> > From: Wanpeng Li <wanpengli@tencent.com>
> >
> > Allow guest reads CORE cstate when exposing host CPU power management capabilities
> > to the guest. PKG cstate is restricted to avoid a guest to get the whole package
> > information in multi-tenant scenario.
> >
> > Cc: Eduardo Habkost <ehabkost@redhat.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Radim Krčmář <rkrcmar@redhat.com>
> > Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
>
> Hi,
>
> QEMU is in hard freeze now. This will be applied after the release.
>
> Thanks,
>
> Paolo
>
> > ---
> > linux-headers/linux/kvm.h | 4 +++-
> > target/i386/kvm.c | 3 ++-
> > 2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
> > index b53ee59..d648fde 100644
> > --- a/linux-headers/linux/kvm.h
> > +++ b/linux-headers/linux/kvm.h
> > @@ -696,9 +696,11 @@ struct kvm_ioeventfd {
> > #define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)
> > #define KVM_X86_DISABLE_EXITS_HLT (1 << 1)
> > #define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)
> > +#define KVM_X86_DISABLE_EXITS_CSTATE (1 << 3)
> > #define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \
> > KVM_X86_DISABLE_EXITS_HLT | \
> > - KVM_X86_DISABLE_EXITS_PAUSE)
> > + KVM_X86_DISABLE_EXITS_PAUSE | \
> > + KVM_X86_DISABLE_EXITS_CSTATE)
> >
> > /* for KVM_ENABLE_CAP */
> > struct kvm_enable_cap {
> > diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> > index 3b29ce5..49a0cc1 100644
> > --- a/target/i386/kvm.c
> > +++ b/target/i386/kvm.c
> > @@ -1645,7 +1645,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
> > if (disable_exits) {
> > disable_exits &= (KVM_X86_DISABLE_EXITS_MWAIT |
> > KVM_X86_DISABLE_EXITS_HLT |
> > - KVM_X86_DISABLE_EXITS_PAUSE);
> > + KVM_X86_DISABLE_EXITS_PAUSE |
> > + KVM_X86_DISABLE_EXITS_CSTATE);
> > }
> >
> > ret = kvm_vm_enable_cap(s, KVM_CAP_X86_DISABLE_EXITS, 0,
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] i386/kvm: support guest access CORE cstate
2019-08-20 7:16 ` Wanpeng Li
@ 2019-08-21 7:55 ` Paolo Bonzini
2019-08-22 0:31 ` Wanpeng Li
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2019-08-21 7:55 UTC (permalink / raw)
To: Wanpeng Li; +Cc: LKML, kvm, Radim Krčmář, Eduardo Habkost
On 20/08/19 09:16, Wanpeng Li wrote:
> Kindly reminder, :)
It's already in my pull request from yesterday.
Palo
> On Mon, 15 Jul 2019 at 17:16, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 15/07/19 03:28, Wanpeng Li wrote:
>>> From: Wanpeng Li <wanpengli@tencent.com>
>>>
>>> Allow guest reads CORE cstate when exposing host CPU power management capabilities
>>> to the guest. PKG cstate is restricted to avoid a guest to get the whole package
>>> information in multi-tenant scenario.
>>>
>>> Cc: Eduardo Habkost <ehabkost@redhat.com>
>>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>>> Cc: Radim Krčmář <rkrcmar@redhat.com>
>>> Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
>>
>> Hi,
>>
>> QEMU is in hard freeze now. This will be applied after the release.
>>
>> Thanks,
>>
>> Paolo
>>
>>> ---
>>> linux-headers/linux/kvm.h | 4 +++-
>>> target/i386/kvm.c | 3 ++-
>>> 2 files changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
>>> index b53ee59..d648fde 100644
>>> --- a/linux-headers/linux/kvm.h
>>> +++ b/linux-headers/linux/kvm.h
>>> @@ -696,9 +696,11 @@ struct kvm_ioeventfd {
>>> #define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)
>>> #define KVM_X86_DISABLE_EXITS_HLT (1 << 1)
>>> #define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)
>>> +#define KVM_X86_DISABLE_EXITS_CSTATE (1 << 3)
>>> #define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \
>>> KVM_X86_DISABLE_EXITS_HLT | \
>>> - KVM_X86_DISABLE_EXITS_PAUSE)
>>> + KVM_X86_DISABLE_EXITS_PAUSE | \
>>> + KVM_X86_DISABLE_EXITS_CSTATE)
>>>
>>> /* for KVM_ENABLE_CAP */
>>> struct kvm_enable_cap {
>>> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
>>> index 3b29ce5..49a0cc1 100644
>>> --- a/target/i386/kvm.c
>>> +++ b/target/i386/kvm.c
>>> @@ -1645,7 +1645,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
>>> if (disable_exits) {
>>> disable_exits &= (KVM_X86_DISABLE_EXITS_MWAIT |
>>> KVM_X86_DISABLE_EXITS_HLT |
>>> - KVM_X86_DISABLE_EXITS_PAUSE);
>>> + KVM_X86_DISABLE_EXITS_PAUSE |
>>> + KVM_X86_DISABLE_EXITS_CSTATE);
>>> }
>>>
>>> ret = kvm_vm_enable_cap(s, KVM_CAP_X86_DISABLE_EXITS, 0,
>>>
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] i386/kvm: support guest access CORE cstate
2019-08-21 7:55 ` Paolo Bonzini
@ 2019-08-22 0:31 ` Wanpeng Li
2019-08-22 8:07 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Wanpeng Li @ 2019-08-22 0:31 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: LKML, kvm, Radim Krčmář, Eduardo Habkost
On Wed, 21 Aug 2019 at 15:55, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 20/08/19 09:16, Wanpeng Li wrote:
> > Kindly reminder, :)
>
> It's already in my pull request from yesterday.
Do you mean this pull
https://www.mail-archive.com/qemu-devel@nongnu.org/msg638707.html ?
This patch is missing.
Regards,
Wanpeng Li
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] i386/kvm: support guest access CORE cstate
2019-08-22 0:31 ` Wanpeng Li
@ 2019-08-22 8:07 ` Paolo Bonzini
0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2019-08-22 8:07 UTC (permalink / raw)
To: Wanpeng Li; +Cc: LKML, kvm, Radim Krčmář, Eduardo Habkost
On 22/08/19 02:31, Wanpeng Li wrote:
> On Wed, 21 Aug 2019 at 15:55, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 20/08/19 09:16, Wanpeng Li wrote:
>>> Kindly reminder, :)
>>
>> It's already in my pull request from yesterday.
>
> Do you mean this pull
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg638707.html ?
> This patch is missing.
Oops, you're right. I must have removed it by mistake while bisecting a
failure. I've added it back now.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-08-22 8:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 1:28 [PATCH RESEND] i386/kvm: support guest access CORE cstate Wanpeng Li
2019-07-15 9:16 ` Paolo Bonzini
2019-07-15 9:22 ` Wanpeng Li
2019-08-20 7:16 ` Wanpeng Li
2019-08-21 7:55 ` Paolo Bonzini
2019-08-22 0:31 ` Wanpeng Li
2019-08-22 8:07 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).