All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Woodhouse <dwmw@amazon.co.uk>
Subject: [PATCH 5/5] KVM: x86/xen: Explicitly pad struct compat_vcpu_info to 64 bytes
Date: Wed, 10 Feb 2021 10:26:09 -0800	[thread overview]
Message-ID: <20210210182609.435200-6-seanjc@google.com> (raw)
In-Reply-To: <20210210182609.435200-1-seanjc@google.com>

Add a 2 byte pad to struct compat_vcpu_info so that the sum size of its
fields is actually 64 bytes.  The effective size without the padding is
also 64 bytes due to the compiler aligning evtchn_pending_sel to a 4-byte
boundary, but depending on compiler alignment is subtle and unnecessary.

Opportunistically replace spaces with tables in the other fields.

Cc: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kvm/xen.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/xen.h b/arch/x86/kvm/xen.h
index 4b32489c0cec..b66a921776f4 100644
--- a/arch/x86/kvm/xen.h
+++ b/arch/x86/kvm/xen.h
@@ -49,11 +49,12 @@ struct compat_arch_vcpu_info {
 };
 
 struct compat_vcpu_info {
-        uint8_t evtchn_upcall_pending;
-        uint8_t evtchn_upcall_mask;
-        uint32_t evtchn_pending_sel;
-        struct compat_arch_vcpu_info arch;
-        struct pvclock_vcpu_time_info time;
+	uint8_t evtchn_upcall_pending;
+	uint8_t evtchn_upcall_mask;
+	uint16_t pad;
+	uint32_t evtchn_pending_sel;
+	struct compat_arch_vcpu_info arch;
+	struct pvclock_vcpu_time_info time;
 }; /* 64 bytes (x86) */
 
 struct compat_arch_shared_info {
-- 
2.30.0.478.g8a0d178c01-goog


  parent reply	other threads:[~2021-02-10 18:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 18:26 [PATCH 0/5] KVM: x86/xen: Selftest fixes and a cleanup Sean Christopherson
2021-02-10 18:26 ` [PATCH 1/5] KVM: selftests: Ignore recently added Xen tests' build output Sean Christopherson
2021-02-10 20:52   ` [EXTERNAL] " David Woodhouse
2021-02-10 18:26 ` [PATCH 2/5] KVM: selftests: Fix size of memslots created by Xen tests Sean Christopherson
2021-02-10 20:53   ` [EXTERNAL] " David Woodhouse
2021-02-10 18:26 ` [PATCH 3/5] KVM: selftests: Fix hex vs. decimal snafu in Xen test Sean Christopherson
2021-02-10 20:54   ` Woodhouse, David
2021-02-10 18:26 ` [PATCH 4/5] KVM: sefltests: Don't bother mapping GVA for Xen shinfo test Sean Christopherson
2021-02-10 21:04   ` [EXTERNAL] " David Woodhouse
2021-02-10 18:26 ` Sean Christopherson [this message]
2021-02-10 20:51   ` [PATCH 5/5] KVM: x86/xen: Explicitly pad struct compat_vcpu_info to 64 bytes Woodhouse, David
2021-02-10 21:13     ` Sean Christopherson
2021-02-10 21:20       ` Woodhouse, David
2021-02-10 18:37 ` [PATCH 0/5] KVM: x86/xen: Selftest fixes and a cleanup Paolo Bonzini
2021-02-10 18:49   ` Sean Christopherson

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=20210210182609.435200-6-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=dwmw@amazon.co.uk \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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.