[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aKcdDQD8GWoYipbe@intel.com>
Date: Thu, 21 Aug 2025 21:20:13 +0800
From: Chao Gao <chao.gao@...el.com>
To: Sean Christopherson <seanjc@...gle.com>
CC: <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<mlevitsk@...hat.com>, <rick.p.edgecombe@...el.com>,
<weijiang.yang@...el.com>, <xin@...or.com>, Mathias Krause
<minipli@...ecurity.net>, John Allen <john.allen@....com>, Paolo Bonzini
<pbonzini@...hat.com>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar
<mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, Dave Hansen
<dave.hansen@...ux.intel.com>, <x86@...nel.org>, "H. Peter Anvin"
<hpa@...or.com>
Subject: Re: [PATCH v12 06/24] KVM: x86: Introduce KVM_{G,S}ET_ONE_REG uAPIs
support
On Wed, Aug 20, 2025 at 04:29:04PM +0800, Chao Gao wrote:
>>> +#define KVM_X86_REG_MSR (1 << 2)
>>> +#define KVM_X86_REG_SYNTHETIC (1 << 3)
>>> +
>>> +struct kvm_x86_reg_id {
>>> + __u32 index;
>>> + __u8 type;
>>> + __u8 rsvd;
>>> + __u16 rsvd16;
>>> +};
>>
>>Some feedback from a while back never got addressed[*]. That feedback still
>>looks sane/good, so this for the uAPI:
>
>I missed that comment. Below is the diff I end up with. I moved struct
>kvm_x86_reg_id to x86.c and added checks for ARCH (i.e., x86) and size.
>
>diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
>index e72d9e6c1739..bb17b7a85159 100644
>--- a/arch/x86/include/uapi/asm/kvm.h
>+++ b/arch/x86/include/uapi/asm/kvm.h
>@@ -411,15 +411,23 @@ struct kvm_xcrs {
> __u64 padding[16];
> };
>
>-#define KVM_X86_REG_MSR (1 << 2)
>-#define KVM_X86_REG_SYNTHETIC (1 << 3)
>-
>-struct kvm_x86_reg_id {
>- __u32 index;
>- __u8 type;
>- __u8 rsvd;
>- __u16 rsvd16;
>-};
>+#define KVM_X86_REG_TYPE_MSR 2
>+#define KVM_X86_REG_TYPE_SYNTHETIC_MSR 3
>+
>+#define KVM_x86_REG_TYPE_SIZE(type) \
>+{( \
There are two typos here. s/x86/X86 and s/{(/({
>+ __u64 type_size = type; \
and this should be __u64 type_size = (__u64)type << 32;
When I tried to add a kselftest for the new ioctls, I found this patch didn't
advertise KVM_CAP_ONE_REG support for x86.
Powered by blists - more mailing lists