Skip to contentSkip to conversation

KVM: i386: Default disable ignore guest PAT quirk

PATCH In review Paolo Bonzini 2 participants 2 messages Feb 27 – Mar 3

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: i386: Default disable ignore guest PAT quirk

From: myrslint <[email protected]>

Add a new accelerator option that allows the guest to adjust the PAT. This is already the case for TDX guests and allows using virtio-gpu Venus with RADV or NVIDIA drivers.

The quirk is disabled by default. Since this caused problems with Linux's Bochs video device driver, add a knob to leave it enabled, and for now do ont enable it by default.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2943

[Add property; for now leave it off by default. - Paolo]
---
 include/system/kvm_int.h |  1 +
 accel/kvm/kvm-all.c      |  1 +
 target/i386/kvm/kvm.c    | 50 +++++++++++++++++++++++++++++++++++++++-
 3 files changed, 51 insertions(+), 1 deletion(-)
include/system/kvm_int.h +1 -0
index baeb166d393..0876aac938d 100644
@@ -167,6 +167,7 @@ struct KVMState
     uint16_t xen_gnttab_max_frames;
     uint16_t xen_evtchn_max_pirq;
     char *device;
+    OnOffAuto honor_guest_pat;
 };
 
 void kvm_memory_listener_register(KVMState *s, KVMMemoryListener *kml,
accel/kvm/kvm-all.c +1 -0
index a1f910e9dff..ebd721c3d66 100644
@@ -4277,6 +4277,7 @@ static void kvm_accel_instance_init(Object *obj)
     s->xen_evtchn_max_pirq = 256;
     s->device = NULL;
     s->msr_energy.enable = false;
+    s->honor_guest_pat = ON_OFF_AUTO_OFF;
 }
 
 /**
target/i386/kvm/kvm.c +49 -1

69 lines not on this page · raw message

Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Paolo Bonzini

From: myrslint <[email protected]>

Add a new accelerator option that allows the guest to adjust the PAT. This is already the case for TDX guests and allows using virtio-gpu Venus with RADV or NVIDIA drivers.

The quirk is disabled by default. Since this caused problems with Linux's Bochs video device driver, add a knob to leave it enabled, and for now do ont enable it by default.

s/do ont/do not/

Quoted 12 lines

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2943

[Add property; for now leave it off by default. - Paolo]
---
  include/system/kvm_int.h |  1 +
  accel/kvm/kvm-all.c      |  1 +
  target/i386/kvm/kvm.c    | 50 +++++++++++++++++++++++++++++++++++++++-
  3 files changed, 51 insertions(+), 1 deletion(-)

...

target/i386/kvm/kvm.c void kvm_arch_accel_class_init(ObjectClass *oc) · line 7142

Quoted 8 lines
target/i386/kvm/kvm.c +8 -0
+
+    object_class_property_add_enum(oc, "honor-guest-pat", "OnOffAuto",
+                                   &OnOffAuto_lookup,
+                                   kvm_arch_get_honor_guest_pat,
+                                   kvm_arch_set_honor_guest_pat);
+    object_class_property_set_description(oc, "honor-guest-pat",
+                                          "Disable KVM quirk that ignores guest PAT "
+                                          "memory type settings (default: auto)");

s/default: auto/default: off/

With above fixed,