lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Feb 2023 17:33:51 +0100
From:   Mathias Krause <minipli@...ecurity.net>
To:     kvm@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org,
        Sean Christopherson <seanjc@...gle.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Mathias Krause <minipli@...ecurity.net>
Subject: [PATCH 5/5] KVM: Shrink struct kvm_vcpu

Reshuffle the members of struct kvm_vcpu to make use of otherwise unused
padding holes, allowing denser packing without disrupting the grouping
nor introducing wrong cacheline sharing.

The embedded mutex and spinlocks continue to not share cachelines, so no
regressions because of lock contention leading to cacheline trashing is
expected.

This allows us to save 40 bytes for 64 bit builds.

Signed-off-by: Mathias Krause <minipli@...ecurity.net>
---
 include/linux/kvm_host.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 4f26b244f6d0..6e3e5a540037 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -330,8 +330,8 @@ struct kvm_vcpu {
 	int srcu_depth;
 #endif
 	int mode;
+	unsigned int guest_debug;
 	u64 requests;
-	unsigned long guest_debug;
 
 	struct mutex mutex;
 	struct kvm_run *run;
@@ -340,8 +340,8 @@ struct kvm_vcpu {
 	struct rcuwait wait;
 #endif
 	struct pid __rcu *pid;
-	int sigset_active;
 	sigset_t sigset;
+	int sigset_active;
 	unsigned int halt_poll_ns;
 	bool valid_wakeup;
 
@@ -356,10 +356,10 @@ struct kvm_vcpu {
 
 #ifdef CONFIG_KVM_ASYNC_PF
 	struct {
-		u32 queued;
 		struct list_head queue;
 		struct list_head done;
 		spinlock_t lock;
+		u32 queued;
 	} async_pf;
 #endif
 
-- 
2.39.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ