|
From: | Paolo Bonzini |
Subject: | Re: [RFC PATCH v2 03/22] i386/xen: Add xen-version machine property and init KVM Xen support |
Date: | Mon, 12 Dec 2022 18:30:21 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 |
On 12/9/22 10:55, David Woodhouse wrote:
- m->default_machine_opts = "accel=xen,suppress-vmdesc=on"; + if (xen_enabled()) + m->default_machine_opts = "accel=xen,suppress-vmdesc=on"; + else + m->default_machine_opts = "accel=kvm,xen-version=0x30001";
Please do not modify pc_xen_hvm_init()."-M xenfv" should be the same as "-M pc-i440fx-...,suppress-vmdesc=on -accel xen -device xen-platform". It must work *without* "-accel xen", while here you're basically requiring it. For now, please make KVM-emulated Xen use "-M pc -device xen-platform". We can figure out "-M xenfv" later.
You can instead have:- a check in xen_init() that checks that xen_mode is XEN_ATTACH. If not, fail.
- an extra enum value for xen_mode, XEN_DISABLED, which is the default instead of XEN_EMULATE;
- an accelerator property "-accel kvm,xen-version=...", added in kvm_accel_class_init() instead of the machine property. The property, when set to a nonzero value, flips xen_mode from XEN_DISABLED to XEN_EMULATE.
The Xen overlay device can be created using the mc->kvm_type function (which you can set in DEFINE_PC_MACHINE); at that point, xen_mode has switched from XEN_DISABLED to XEN_EMULATE. Those xen_enabled() checks that apply to KVM then become xen_mode != XEN_DISABLED, as long as they run during mc->kvm_type or afterwards.
The platform device can be created either in mc->kvm_type or manually (not sure if it makes sense to have a "XenVMMXenVMM" CPUID + emulated hypercalls but no platform device---would it still use pvclock for example?).
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |