[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aD-O6EBMqPwLzgd_@google.com>
Date: Tue, 3 Jun 2025 17:10:16 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org, roy.hopkins@...e.com,
thomas.lendacky@....com, ashish.kalra@....com, michael.roth@....com,
jroedel@...e.de, nsaenz@...zon.com, anelkz@...zon.de,
James.Bottomley@...senpartnership.com
Subject: Re: [PATCH 02/29] KVM: API definitions for plane userspace exit
On Tue, Apr 01, 2025, Paolo Bonzini wrote:
> Copy over the uapi definitions from the Documentation/ directory.
>
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
> ---
> include/uapi/linux/kvm.h | 25 +++++++++++++++++++++++--
> 1 file changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index 1e0a511c43d0..b0cca93ebcb3 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -135,6 +135,16 @@ struct kvm_xen_exit {
> } u;
> };
>
> +struct kvm_plane_event_exit {
> +#define KVM_PLANE_EVENT_INTERRUPT 1
> + __u16 cause;
> + __u16 pending_event_planes;
> + __u16 target;
> + __u16 padding;
> + __u32 flags;
> + __u64 extra[8];
> +};
> +
> struct kvm_tdx_exit {
> #define KVM_EXIT_TDX_VMCALL 1
> __u32 type;
> @@ -262,7 +272,8 @@ struct kvm_tdx_exit {
> #define KVM_EXIT_NOTIFY 37
> #define KVM_EXIT_LOONGARCH_IOCSR 38
> #define KVM_EXIT_MEMORY_FAULT 39
> -#define KVM_EXIT_TDX 40
> +#define KVM_EXIT_PLANE_EVENT 40
> +#define KVM_EXIT_TDX 41
>
> /* For KVM_EXIT_INTERNAL_ERROR */
> /* Emulate instruction failed. */
> @@ -295,7 +306,13 @@ struct kvm_run {
> /* in */
> __u8 request_interrupt_window;
> __u8 HINT_UNSAFE_IN_KVM(immediate_exit);
> - __u8 padding1[6];
> +
> + /* in/out */
> + __u8 plane;
We should add padding before or after "plane"; there's a 1-byte hole here that's
hard to spot at first glance (ran pahole just to verify my eyeballs):
struct kvm_run {
__u8 request_interrupt_window; /* 0 1 */
__u8 immediate_exit__unsafe; /* 1 1 */
__u8 plane; /* 2 1 */
/* XXX 1 byte hole, try to pack */
__u16 suspended_planes; /* 4 2 */
__u16 req_exit_planes; /* 6 2 */
}
Probably pad before, so that "plane" is just before the xxx_planes fields?
Powered by blists - more mailing lists