[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.15 12/33] accel/kvm: check for KVM_CAP_READONLY_MEM on VM
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.15 12/33] accel/kvm: check for KVM_CAP_READONLY_MEM on VM |
Date: |
Sat, 9 Nov 2024 09:38:38 +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 370ecab785..d8e831bcf9 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2578,7 +2578,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_eventfds_allowed =
(kvm_check_extension(s, KVM_CAP_IOEVENTFD) > 0);
--
2.39.5
- [Stable-7.2.15 02/33] target/ppc: Fix lxvx/stxvx facility check, (continued)
- [Stable-7.2.15 02/33] target/ppc: Fix lxvx/stxvx facility check, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 05/33] tracetool: avoid invalid escape in Python string, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 06/33] linux-user/flatload: Take mmap_lock in load_flt_binary(), Michael Tokarev, 2024/11/09
- [Stable-7.2.15 08/33] scsi: fetch unit attention when creating the request, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 10/33] hw/audio/hda: free timer on exit, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 09/33] hw/intc/arm_gicv3_cpuif: Add cast to match the documentation, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 07/33] linux-user: Fix parse_elf_properties GNU0_MAGIC check, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 11/33] KVM: Dynamic sized kvm memslots array, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 14/33] raw-format: Fix error message for invalid offset/size, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 13/33] tests: Wait for migration completion on destination QEMU to avoid failures, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 12/33] accel/kvm: check for KVM_CAP_READONLY_MEM on VM,
Michael Tokarev <=
- [Stable-7.2.15 16/33] target/i386: Avoid unreachable variable declaration in mmu_translate(), Michael Tokarev, 2024/11/09
- [Stable-7.2.15 15/33] tcg: Reset data_gen_ptr correctly, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 17/33] target/i386: Walk NPT in guest real mode, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 18/33] linux-user/ppc: Fix sigmask endianness issue in sigreturn, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 21/33] net/tap-win32: Fix gcc 14 format truncation errors, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 19/33] gitlab: make check-[dco|patch] a little more verbose, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 20/33] Fix calculation of minimum in colo_compare_tcp, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 25/33] hw/intc: Don't clear pending bits on IRQ lowering, Michael Tokarev, 2024/11/09