]> xenbits.xensource.com Git - xen.git/commit
x86/platform: Improve MSR permission handling for XENPF_resource_op
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 10 Jun 2021 10:01:06 +0000 (11:01 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 15 Jun 2021 19:50:32 +0000 (20:50 +0100)
commit2cf3b4b92ab1a34e8cb1e859196e1492c89299de
treecef6c32ac4048d4e73834b80e8e1effe351396c8
parent5d3e4ebb5c71477d74a0c503438545a0126d3863
x86/platform: Improve MSR permission handling for XENPF_resource_op

The logic to disallow writes to the TSC is out-of-place, and should be in
check_resource_access() rather than in resource_access().

Split the existing allow_access_msr() into two - msr_{read,write}_allowed() -
and move all permissions checks here.

Furthermore, guard access to MSR_IA32_CMT_{EVTSEL,CTR} to prohibit their use
on hardware which is lacking the QoS Monitoring feature.  Introduce
cpu_has_pqe to help with the logic.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/platform_hypercall.c
xen/arch/x86/psr.c
xen/include/asm-x86/cpufeature.h