x86/hvm: widen condition for is_hvm_pv_evtchn_domain() and report fix in CPUID
authorJane Malalane <jane.malalane@citrix.com>
Wed, 15 Jun 2022 08:21:08 +0000 (10:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 15 Jun 2022 08:21:08 +0000 (10:21 +0200)
commite2d2b9fd7a2b349a1a9a75b482981cfd2d2407a8
tree7c4bc355d9627eda3982d7e06cff37dc5a004af4
parent80ad8db8a4d9bb24952f0aea788ce6f47566fa76
x86/hvm: widen condition for is_hvm_pv_evtchn_domain() and report fix in CPUID

Have is_hvm_pv_evtchn_domain() return true for vector callbacks for
evtchn delivery set up on a per-vCPU basis via
HVMOP_set_evtchn_upcall_vector.

Assume that if vCPU0 uses HVMOP_set_evtchn_upcall_vector, all
remaining vCPUs will too and thus remove is_hvm_pv_evtchn_vcpu() and
replace sole caller with is_hvm_pv_evtchn_domain().

is_hvm_pv_evtchn_domain() returning true is a condition for setting up
physical IRQ to event channel mappings. Therefore, also add a CPUID
bit so that guests know whether the check in is_hvm_pv_evtchn_domain()
will fail when using HVMOP_set_evtchn_upcall_vector. This matters for
guests that route PIRQs over event channels since
is_hvm_pv_evtchn_domain() is a condition in physdev_map_pirq().

The naming of the CPUID bit is quite generic about upcall support
being available. That's done so that the define name doesn't become
overly long.

A guest that doesn't care about physical interrupts routed over event
channels can just test for the availability of the hypercall directly
(HVMOP_set_evtchn_upcall_vector) without checking the CPUID bit.

Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/hvm/irq.c
xen/arch/x86/include/asm/domain.h
xen/arch/x86/traps.c
xen/include/public/arch-x86/cpuid.h