From patchwork Mon Oct 10 08:11:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9369097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 255B3607D2 for ; Mon, 10 Oct 2016 08:14:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18D5029138 for ; Mon, 10 Oct 2016 08:14:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D6D22913D; Mon, 10 Oct 2016 08:14:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 846C029138 for ; Mon, 10 Oct 2016 08:14:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btVga-0006yP-Uf; Mon, 10 Oct 2016 08:11:48 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btVgZ-0006yJ-LD for xen-devel@lists.xenproject.org; Mon, 10 Oct 2016 08:11:47 +0000 Received: from [193.109.254.147] by server-8.bemta-6.messagelabs.com id 6A/CC-28497-24D4BF75; Mon, 10 Oct 2016 08:11:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRWlGSWpSXmKPExsXS6fjDS9fJ93e 4wdIl/Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bPzytYC/YLV8xvVmhgnCjQxcjJISSQJ3G7 9wt7FyMHB6+AncSJpnSQsISAocTT99fZQGwWAVWJPXMPs4PYbALqEm3PtrOClIsIGEicO5oEY jIL6EtsW8cCUiEsYCPRe/4xG8RAQYm/O4RBwsxAs9+vmcE6gZFrFkJmFpIMhK0l8fDXLRYIW1 ti2cLXzLPA5ktLLP/HARG2kug/uJIVVQmI7Spxc9415gWMHKsYNYpTi8pSi3SNzPWSijLTM0p yEzNzdA0NzPRyU4uLE9NTcxKTivWS83M3MQLDjgEIdjAuXht4iFGSg0lJlDfxxI9wIb6k/JTK jMTijPii0pzU4kOMMhwcShK8nD6/w4UEi1LTUyvSMnOAEQCTluDgURLh/eYNlOYtLkjMLc5Mh 0idYlSUEodICIAkMkrz4NpgUXeJUVZKmJcR6BAhnoLUotzMElT5V4ziHIxKwrxPQKbwZOaVwE 1/BbSYCWgxy+IfIItLEhFSUg2MG57d2hR0221D+yy2VEuZxm0HrwSoSRzKfflKwPbNR7MQJkO /TR7s2ztPyx7alFnb+Xr+xPZE62/zvi+9qvkwxT9zY/Nx2SUsnbI5qpdeMS3k3jfx/wkWnaNf 5rpJH76n6Wa1aqlPdBpbbG/Bb8aP+836RCMd88W49Nx+f7zvd6t2X8yMNffmKLEUZyQaajEXF ScCAA3LPeq1AgAA X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1476087104!59702971!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10838 invoked from network); 10 Oct 2016 08:11:45 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 10 Oct 2016 08:11:45 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Mon, 10 Oct 2016 02:11:43 -0600 Message-Id: <57FB695D0200007800115FA7@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.1 Date: Mon, 10 Oct 2016 02:11:41 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Cc: Andrew Cooper Subject: [Xen-devel] [PATCH] x86: replace redundant MTRR MSR definitions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP We really should have only one set of #define-s for them. Signed-off-by: Jan Beulich x86: replace redundant MTRR MSR definitions We really should have only one set of #define-s for them. Signed-off-by: Jan Beulich --- a/xen/arch/x86/e820.c +++ b/xen/arch/x86/e820.c @@ -419,8 +419,6 @@ static void __init clip_to_limit(uint64_ } /* Conservative estimate of top-of-RAM by looking for MTRR WB regions. */ -#define MSR_MTRRphysBase(reg) (0x200 + 2 * (reg)) -#define MSR_MTRRphysMask(reg) (0x200 + 2 * (reg) + 1) static uint64_t __init mtrr_top_of_ram(void) { uint32_t eax, ebx, ecx, edx; @@ -477,8 +475,8 @@ static uint64_t __init mtrr_top_of_ram(v top = 0; for ( i = 0; i < (uint8_t)mtrr_cap; i++ ) { - rdmsrl(MSR_MTRRphysBase(i), base); - rdmsrl(MSR_MTRRphysMask(i), mask); + rdmsrl(MSR_IA32_MTRR_PHYSBASE(i), base); + rdmsrl(MSR_IA32_MTRR_PHYSMASK(i), mask); if ( e820_verbose ) printk(" MTRR[%d]: base %"PRIx64" mask %"PRIx64"\n", --- a/xen/arch/x86/e820.c +++ b/xen/arch/x86/e820.c @@ -419,8 +419,6 @@ static void __init clip_to_limit(uint64_ } /* Conservative estimate of top-of-RAM by looking for MTRR WB regions. */ -#define MSR_MTRRphysBase(reg) (0x200 + 2 * (reg)) -#define MSR_MTRRphysMask(reg) (0x200 + 2 * (reg) + 1) static uint64_t __init mtrr_top_of_ram(void) { uint32_t eax, ebx, ecx, edx; @@ -477,8 +475,8 @@ static uint64_t __init mtrr_top_of_ram(v top = 0; for ( i = 0; i < (uint8_t)mtrr_cap; i++ ) { - rdmsrl(MSR_MTRRphysBase(i), base); - rdmsrl(MSR_MTRRphysMask(i), mask); + rdmsrl(MSR_IA32_MTRR_PHYSBASE(i), base); + rdmsrl(MSR_IA32_MTRR_PHYSMASK(i), mask); if ( e820_verbose ) printk(" MTRR[%d]: base %"PRIx64" mask %"PRIx64"\n",