lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/3] xen/pv: allow pmu msr accesses to cause GP
From
On 26.09.22 22:09, Boris Ostrovsky wrote:
>
> 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().

I like that. Together with Jan's suggestion this makes the code much
more readable!


Juergen

[unhandled content-type:application/pgp-keys][unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-09-27 07:43    [W:0.049 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site