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:48 +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 2/5] KVM: x86: Shrink struct kvm_queued_exception

Reshuffle the boolean members of struct kvm_queued_exception and make
them individual bits, allowing denser packing.

This allows us to shrink the object size from 24 to 16 bytes for 64 bit
builds.

Signed-off-by: Mathias Krause <minipli@...ecurity.net>
---
 arch/x86/include/asm/kvm_host.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 43329c60a6b5..040eee3e9583 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -701,13 +701,13 @@ struct kvm_vcpu_xen {
 };
 
 struct kvm_queued_exception {
-	bool pending;
-	bool injected;
-	bool has_error_code;
+	u8 pending : 1;
+	u8 injected : 1;
+	u8 has_error_code : 1;
+	u8 has_payload : 1;
 	u8 vector;
 	u32 error_code;
 	unsigned long payload;
-	bool has_payload;
 };
 
 struct kvm_vcpu_arch {
-- 
2.39.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ