kvm/i386: Add xen-evtchn-max-pirq property

The default number of PIRQs is set to 256 to avoid issues with 32-bit MSI
devices. Allow it to be increased if the user desires.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
This commit is contained in:
David Woodhouse 2023-01-18 14:36:23 +00:00
parent 6096cf7877
commit e16aff4cc2
6 changed files with 54 additions and 10 deletions

View file

@ -5922,6 +5922,33 @@ static void kvm_arch_set_xen_gnttab_max_frames(Object *obj, Visitor *v,
s->xen_gnttab_max_frames = value;
}
static void kvm_arch_get_xen_evtchn_max_pirq(Object *obj, Visitor *v,
const char *name, void *opaque,
Error **errp)
{
KVMState *s = KVM_STATE(obj);
uint16_t value = s->xen_evtchn_max_pirq;
visit_type_uint16(v, name, &value, errp);
}
static void kvm_arch_set_xen_evtchn_max_pirq(Object *obj, Visitor *v,
const char *name, void *opaque,
Error **errp)
{
KVMState *s = KVM_STATE(obj);
Error *error = NULL;
uint16_t value;
visit_type_uint16(v, name, &value, &error);
if (error) {
error_propagate(errp, error);
return;
}
s->xen_evtchn_max_pirq = value;
}
void kvm_arch_accel_class_init(ObjectClass *oc)
{
object_class_property_add_enum(oc, "notify-vmexit", "NotifyVMexitOption",
@ -5954,6 +5981,13 @@ void kvm_arch_accel_class_init(ObjectClass *oc)
NULL, NULL);
object_class_property_set_description(oc, "xen-gnttab-max-frames",
"Maximum number of grant table frames");
object_class_property_add(oc, "xen-evtchn-max-pirq", "uint16",
kvm_arch_get_xen_evtchn_max_pirq,
kvm_arch_set_xen_evtchn_max_pirq,
NULL, NULL);
object_class_property_set_description(oc, "xen-evtchn-max-pirq",
"Maximum number of Xen PIRQs");
}
void kvm_set_max_apic_id(uint32_t max_apic_id)

View file

@ -1765,6 +1765,12 @@ uint16_t kvm_xen_get_gnttab_max_frames(void)
return s->xen_gnttab_max_frames;
}
uint16_t kvm_xen_get_evtchn_max_pirq(void)
{
KVMState *s = KVM_STATE(current_accel());
return s->xen_evtchn_max_pirq;
}
int kvm_put_xen_state(CPUState *cs)
{
X86CPU *cpu = X86_CPU(cs);