[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220803155011.43721-1-mlevitsk@redhat.com>
Date: Wed, 3 Aug 2022 18:49:58 +0300
From: Maxim Levitsky <mlevitsk@...hat.com>
To: kvm@...r.kernel.org
Cc: Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
linux-kernel@...r.kernel.org, Wanpeng Li <wanpengli@...cent.com>,
Maxim Levitsky <mlevitsk@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
Sean Christopherson <seanjc@...gle.com>, x86@...nel.org,
Jim Mattson <jmattson@...gle.com>,
Kees Cook <keescook@...omium.org>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, Joerg Roedel <joro@...tes.org>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: [PATCH v3 00/13] SMM emulation and interrupt shadow fixes
This patch series is a result of long debug work to find out why
sometimes guests with win11 secure boot
were failing during boot.
During writing a unit test I found another bug, turns out
that on rsm emulation, if the rsm instruction was done in real
or 32 bit mode, KVM would truncate the restored RIP to 32 bit.
I also refactored the way we write SMRAM so it is easier
now to understand what is going on.
The main bug in this series which I fixed is that we
allowed #SMI to happen during the STI interrupt shadow,
and we did nothing to both reset it on #SMI handler
entry and restore it on RSM.
V3: addressed most of the review feedback from Sean (thanks!)
Best regards,
Maxim Levitsky
Maxim Levitsky (13):
bug: introduce ASSERT_STRUCT_OFFSET
KVM: x86: emulator: em_sysexit should update ctxt->mode
KVM: x86: emulator: introduce emulator_recalc_and_set_mode
KVM: x86: emulator: update the emulation mode after rsm
KVM: x86: emulator: update the emulation mode after CR0 write
KVM: x86: emulator/smm: number of GPRs in the SMRAM image depends on
the image format
KVM: x86: emulator/smm: add structs for KVM's smram layout
KVM: x86: emulator/smm: use smram structs in the common code
KVM: x86: emulator/smm: use smram struct for 32 bit smram load/restore
KVM: x86: emulator/smm: use smram struct for 64 bit smram load/restore
KVM: x86: SVM: use smram structs
KVM: x86: SVM: don't save SVM state to SMRAM when VM is not long mode
capable
KVM: x86: emulator/smm: preserve interrupt shadow in SMRAM
arch/x86/include/asm/kvm_host.h | 11 +-
arch/x86/kvm/emulate.c | 305 +++++++++++++++++---------------
arch/x86/kvm/kvm_emulate.h | 223 ++++++++++++++++++++++-
arch/x86/kvm/svm/svm.c | 30 ++--
arch/x86/kvm/vmx/vmcs12.h | 5 +-
arch/x86/kvm/vmx/vmx.c | 4 +-
arch/x86/kvm/x86.c | 175 +++++++++---------
include/linux/build_bug.h | 9 +
8 files changed, 497 insertions(+), 265 deletions(-)
--
2.26.3
Powered by blists - more mailing lists