[RFC PATCH 05/10] accel/kvm: Support nr_planes call-back
Jörg Rödel <[email protected]> Mon, 8 Jun 2026 17:21:04 +0200
| Newsgroups | dev.linux.lists.coconut-svsm,org.kernel.vger.kvm,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
From: Joerg Roedel <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> --- accel/kvm/kvm-all.c | 19 +++++++++++++++++++ dtc | 1 + ui/keycodemapdb | 1 + 3 files changed, 21 insertions(+) create mode 160000 dtc create mode 160000 ui/keycodemapdb diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 7429e2be8ba9..dbfef63a84b0 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -4247,6 +4247,24 @@ static bool kvm_accel_has_memory(AccelState *accel, AddressSpace *as, return false; } +static uint8_t kvm_nr_planes(AccelState *accel, MachineState *ms) +{ + uint8_t nr_planes = 1; + + // Planes are only supported with in-kernel APIC + if (kvm_irqchip_in_kernel()) { + int ret; + KVMState *kvm = KVM_STATE(accel); + + ret = kvm_vm_ioctl(kvm, KVM_CHECK_EXTENSION, KVM_CAP_PLANES); + if (ret > 0) { + nr_planes = ret; + } + } + + return nr_planes; +} + static void kvm_get_kvm_shadow_mem(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) @@ -4437,6 +4455,7 @@ static void kvm_accel_class_init(ObjectClass *oc, const void *data) ac->init_machine = kvm_init; ac->rebuild_guest = kvm_reset_vmfd; ac->has_memory = kvm_accel_has_memory; + ac->nr_planes = kvm_nr_planes; ac->allowed = &kvm_allowed; ac->gdbstub_supported_sstep_flags = kvm_gdbstub_sstep_flags; diff --git a/dtc b/dtc new file mode 160000 index 000000000000..b6910bec1161 --- /dev/null +++ b/dtc @@ -0,0 +1 @@ +Subproject commit b6910bec11614980a21e46fbccc35934b671bd81 diff --git a/ui/keycodemapdb b/ui/keycodemapdb new file mode 160000 index 000000000000..d21009b1c9f9 --- /dev/null +++ b/ui/keycodemapdb @@ -0,0 +1 @@ +Subproject commit d21009b1c9f94b740ea66be8e48a1d8ad8124023 -- 2.53.0