[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b9c7a953-dbfa-164f-7a18-1e230c70e124@oracle.com>
Date: Mon, 26 Sep 2022 16:09:15 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Juergen Gross <jgross@...e.com>, xen-devel@...ts.xenproject.org,
x86@...nel.org, linux-kernel@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH 1/3] xen/pv: allow pmu msr accesses to cause GP
On 9/26/22 10:18 AM, Juergen Gross wrote:
> bool pmu_msr_read(unsigned int msr, uint64_t *val, int *err)
> {
> if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
> - if (is_amd_pmu_msr(msr)) {
> - if (!xen_amd_pmu_emulate(msr, val, 1))
> - *val = native_read_msr_safe(msr, err);
> - return true;
> + if (!is_amd_pmu_msr(msr))
You should be able to move vendor check inside is_<vendor>_pmu_msr().
-boris
> + return false;
> + if (!xen_amd_pmu_emulate(msr, val, 1)) {
> + *val = err ? native_read_msr_safe(msr, err)
> + : native_read_msr(msr);
> }
> + return true;
> } else {
Powered by blists - more mailing lists