[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 4 Feb 2021 16:01:08 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qyeC+rgF7z7nZMewkrDjJA8ro9Auxcty6b9jmd3lXiA=; b=WXSANyZtlGe5PyjLydx56khymVoavHk7CI0k/mmkNjmj1DAakmPjBjA7Kvv/8GTJ2surNH0U3FBstVOp7f0mNUoevB6Z7sq9vyIX7tG1KbFFDsXtF/jSScyz/VyhqjLoPqWOQcosqkcNxv54E5xV1jkgDDzzoG5oR58MLaqPx+R2mLTCSB7SR3nAGGRiRnQ73wjfzcDapXe87YrHlVnRubBHEQh2AZR1HyuDqXTJ8TwAyNTyc5QXNgvMNRRi0ugp5LoKxU+YNjipqRtrEsN7qEeV6WPzlOUPJla/MwrxV+blP0jiOpdnZNFdrqGgY3zpP57RHnNnGtG39tPEmZ9U4w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dp+UOsUQkg+ImPqtrwc+TnwhIC40wXpMGxa8b/CGcNNuqvgtHbnuGp0iqAvv8U7V0Ggl4PvPNuYbGchub5OuXSmZ4A5QTNoTg7sNYo81dzo+NQ9+abLQHjCsFoAsUOESqw4ByvtxaYPmxcq3woet1Zs05ndtR6nUIS8VnKSC5ExVePjA2dmcYaHU1LUPDN+7KOipzrTO7E9w1tNqs391wB4FYPaVSIXxj9WLUpbdoKeO8uGWdK2GM4xmuUYNUXJTh/PL+lZHA+h/089vHAUoTlTX36TVKrgwYDXK/Osf+5BzFAEAfSd2RJZuy0AH3szw90CuBQeQBOt9iAG9LI5tVQ==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, James Dingwall <james-xen@xxxxxxxxxxxxxx>
  • Delivery-date: Thu, 04 Feb 2021 16:16:32 +0000
  • Ironport-sdr: UiQh8a7BPeIiUXI9t/Gjm+GOYKmqxVAhAx2BXV24SdTEHBSh5JdZMirIDaYLUwzH6/JhBjQ9bi VuW5jjeFYVg5ioG22yw9Z98KZOJE2UVce0EmoHKjll9P1QH8w4VsUOVdEIGaWF3yuCYPysumv2 n8Hd6Lncj7C8YzrkUAcgnUnM2EpVlZ9+de7cPyClY5AdgxfRD64CadNNGS69p0EUagK9E9WH8W ESK9X8VQccLXvG9fs+ku7KqFIrkiFDs+HxrkB4xw3p8bODEtZeegpzWzh8GiQZdIrYjCCM8N1A 3lE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04/02/2021 15:53, Jan Beulich wrote:
> On 04.02.2021 10:36, Jan Beulich wrote:
>> X86_VENDOR_* aren't bit masks in the older trees.
>>
>> Reported-by: James Dingwall <james@xxxxxxxxxxxxxx>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> --- a/xen/arch/x86/msr.c
>> +++ b/xen/arch/x86/msr.c
>> @@ -226,7 +226,8 @@ int guest_rdmsr(const struct vcpu *v, ui
>>           */
>>      case MSR_IA32_PERF_STATUS:
>>      case MSR_IA32_PERF_CTL:
>> -        if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR)) )
>> +        if ( cp->x86_vendor != X86_VENDOR_INTEL &&
>> +             cp->x86_vendor != X86_VENDOR_CENTAUR )
>>              goto gp_fault;
>>  
>>          *val = 0;
> Darn - this was only half of it. There's a similar construct
> in guest_wrmsr() which also wants replacing.

I really should have renamed the constants when I changed their layout...

My R-by stands in light of that change.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.