* [PATCH] accel/kvm: check for KVM_CAP_READONLY_MEM on VM
@ 2024-10-11 8:50 Paolo Bonzini
2024-10-11 10:03 ` Gupta, Pankaj
0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2024-10-11 8:50 UTC (permalink / raw)
To: qemu-devel; +Cc: Tom Dohrmann
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
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
accel/kvm/kvm-all.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 482c5b24cf6..801cff16a5a 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2683,7 +2683,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.46.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] accel/kvm: check for KVM_CAP_READONLY_MEM on VM
2024-10-11 8:50 [PATCH] accel/kvm: check for KVM_CAP_READONLY_MEM on VM Paolo Bonzini
@ 2024-10-11 10:03 ` Gupta, Pankaj
0 siblings, 0 replies; 4+ messages in thread
From: Gupta, Pankaj @ 2024-10-11 10:03 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: Tom Dohrmann
> 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
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
> ---
> accel/kvm/kvm-all.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 482c5b24cf6..801cff16a5a 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -2683,7 +2683,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);
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] accel/kvm: check for KVM_CAP_READONLY_MEM on VM
@ 2024-09-03 6:29 Tom Dohrmann
2024-10-11 8:51 ` Paolo Bonzini
0 siblings, 1 reply; 4+ messages in thread
From: Tom Dohrmann @ 2024-09-03 6:29 UTC (permalink / raw)
To: Tom Dohrmann; +Cc: kvm, qemu-devel, Paolo Bonzini
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>
---
accel/kvm/kvm-all.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 75d11a07b2..acc23092e7 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2603,7 +2603,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.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-11 10:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 8:50 [PATCH] accel/kvm: check for KVM_CAP_READONLY_MEM on VM Paolo Bonzini
2024-10-11 10:03 ` Gupta, Pankaj
-- strict thread matches above, loose matches on Subject: below --
2024-09-03 6:29 Tom Dohrmann
2024-10-11 8:51 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).