[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.2 04/58] accel/kvm: check for KVM_CAP_READONLY_MEM on VM
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.2 04/58] accel/kvm: check for KVM_CAP_READONLY_MEM on VM |
Date: |
Sat, 9 Nov 2024 15:08:05 +0300 |
From: Tom Dohrmann <erbse.13@gmx.de>
KVM_CAP_READONLY_MEM used to be a global capability, but with the
introduction of AMD SEV-SNP confidential VMs, this extension is not
always available on all VM types [1,2].
Query the extension on the VM level instead of on the KVM level.
[1]
https://patchwork.kernel.org/project/kvm/patch/20240809190319.1710470-2-seanjc@google.com/
[2]
https://patchwork.kernel.org/project/kvm/patch/20240902144219.3716974-1-erbse.13@gmx.de/
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Tom Dohrmann <erbse.13@gmx.de>
Link: https://lore.kernel.org/r/20240903062953.3926498-1-erbse.13@gmx.de
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 64e0e63ea16aa0122dc0c41a0679da0ae4616208)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 4db866f0ca..8c5e71f20c 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2660,7 +2660,7 @@ static int kvm_init(MachineState *ms)
}
kvm_readonly_mem_allowed =
- (kvm_check_extension(s, KVM_CAP_READONLY_MEM) > 0);
+ (kvm_vm_check_extension(s, KVM_CAP_READONLY_MEM) > 0);
kvm_resamplefds_allowed =
(kvm_check_extension(s, KVM_CAP_IRQFD_RESAMPLE) > 0);
--
2.39.5
- [Stable-9.1.2 00/58] Patch Round-up for stable 9.1.2, freeze on 2024-11-18, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 01/58] tcg/s390x: fix constraint for 32-bit TSTEQ/TSTNE, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 02/58] KVM: Dynamic sized kvm memslots array, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 03/58] target/i386/tcg: Use DPL-level accesses for interrupts and call gates, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 04/58] accel/kvm: check for KVM_CAP_READONLY_MEM on VM,
Michael Tokarev <=
- [Stable-9.1.2 05/58] target/i386: Use only 16 and 32-bit operands for IN/OUT, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 06/58] tests: Wait for migration completion on destination QEMU to avoid failures, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 07/58] Revert "hw/sh4/r2d: Realize IDE controller before accessing it", Michael Tokarev, 2024/11/09
- [Stable-9.1.2 08/58] tests/qemu-iotests/211.out: Update to expect MapEntry 'compressed' field, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 09/58] raw-format: Fix error message for invalid offset/size, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 11/58] target/i386: Walk NPT in guest real mode, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 10/58] tcg: Reset data_gen_ptr correctly, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 14/58] linux-user/ppc: Fix sigmask endianness issue in sigreturn, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 13/58] linux-user: Emulate /proc/self/maps under mmap_lock, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 12/58] target/i386: Use probe_access_full_mmu in ptw_translate, Michael Tokarev, 2024/11/09