Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
qemu.15022
0131-kvm-Use-KVM_GET_MSR_INDEX_LIST-for-.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0131-kvm-Use-KVM_GET_MSR_INDEX_LIST-for-.patch of Package qemu.15022
From 764aa501f30a1da0c320d1020a2a125e32ec04c2 Mon Sep 17 00:00:00 2001 From: Bandan Das <bsd@redhat.com> Date: Sun, 25 Nov 2018 23:17:28 -0500 Subject: [PATCH] kvm: Use KVM_GET_MSR_INDEX_LIST for MSR_IA32_ARCH_CAPABILITIES support When writing to guest's MSR_IA32_ARCH_CAPABILITIES, check whether it's supported in the guest using the KVM_GET_MSR_INDEX_LIST ioctl. Fixes: d86f963694df27f11b3681ffd225c9362de1b634 Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Tested-by: balducci@units.it Signed-off-by: Bandan Das <bsd@redhat.com> Message-Id: <jpg4lc4iiav.fsf_-_@linux.bootlegged.copy> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> (cherry picked from commit aec5e9c3a94cf8b7920f59bef69a6f426092c4a0) [BR: BSC#1134883, FATE#327764] Signed-off-by: Bruce Rogers <brogers@suse.com> --- target/i386/kvm.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 40395cabb1..ba6b797ac3 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -93,6 +93,7 @@ static bool has_msr_hv_frequencies; static bool has_msr_xss; static bool has_msr_spec_ctrl; static bool has_msr_virt_ssbd; +static bool has_msr_arch_capabs; static bool has_msr_architectural_pmu; static uint32_t num_architectural_pmu_counters; @@ -1253,6 +1254,9 @@ static int kvm_get_supported_msrs(KVMState *s) case MSR_VIRT_SSBD: has_msr_virt_ssbd = true; break; + case MSR_IA32_ARCH_CAPABILITIES: + has_msr_arch_capabs = true; + break; } } } @@ -1754,14 +1758,9 @@ static int kvm_put_msrs(X86CPU *cpu, int level) #endif /* If host supports feature MSR, write down. */ - if (kvm_feature_msrs) { - int i; - for (i = 0; i < kvm_feature_msrs->nmsrs; i++) - if (kvm_feature_msrs->indices[i] == MSR_IA32_ARCH_CAPABILITIES) { - kvm_msr_entry_add(cpu, MSR_IA32_ARCH_CAPABILITIES, - env->features[FEAT_ARCH_CAPABILITIES]); - break; - } + if (has_msr_arch_capabs) { + kvm_msr_entry_add(cpu, MSR_IA32_ARCH_CAPABILITIES, + env->features[FEAT_ARCH_CAPABILITIES]); } /*
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor