Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D252C4708C for ; Fri, 28 May 2021 06:57:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B4067613BA for ; Fri, 28 May 2021 06:57:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4067613BA Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.133786.249233 (Exim 4.92) (envelope-from ) id 1lmWR2-0001Ix-Ia; Fri, 28 May 2021 06:57:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 133786.249233; Fri, 28 May 2021 06:57:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lmWR2-0001Iq-Fc; Fri, 28 May 2021 06:57:32 +0000 Received: by outflank-mailman (input) for mailman id 133786; Fri, 28 May 2021 06:57:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lmWR1-0001Ig-OV for xen-devel@lists.xenproject.org; Fri, 28 May 2021 06:57:31 +0000 Received: from smtp-out2.suse.de (unknown [195.135.220.29]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 64b18428-a21e-467c-a817-0dd37c5f0d25; Fri, 28 May 2021 06:57:31 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6B93B1FD2F; Fri, 28 May 2021 06:57:30 +0000 (UTC) Received: from director2.suse.de (director2.suse-dmz.suse.de [192.168.254.72]) by imap.suse.de (Postfix) with ESMTPSA id 4F6C511A98; Fri, 28 May 2021 06:57:30 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 64b18428-a21e-467c-a817-0dd37c5f0d25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1622185050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ak8IN3tVVod3ou9ji6B4NVo7m0cuBbHRqWFoAb1mI0s=; b=XkvoW5xFonH7DFz/0V2StfxJJAB8PS2xOP6jcXMSHYH21sEeClWrm1iS2VYrQgtl0Gbavm hVddnQ6uvWmwSfiEyEYJkKG6yXGo2WkozkU/JmoX89lrW1CO4r8bJNlKGrPY0L0PQcDpT+ lRKrtCTOKyD3s2RnGNRZnxK17aJvzdc= Subject: [PATCH v2 2/2] x86/AMD: drop MSR_K7_HWCR From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: Message-ID: <3d1680ea-1089-3d25-db0d-06b5eab3f7a4@suse.com> Date: Fri, 28 May 2021 08:57:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit We don't support any K7 (32-bit only) hardware anymore, and the MSR is accessible as MSR_K8_HWCR as well. Using the K7 name was particularly odd for Hygon as well as in a Fam0F-specific piece of code. Signed-off-by: Jan Beulich --- v2: New. --- Of course there are more MSR_K7_* left - we'll have to convert them over time. --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -694,9 +694,9 @@ static void init_amd(struct cpuinfo_x86 * Errata 122 for all steppings (F+ have it disabled by default) */ if (c->x86 == 15) { - rdmsrl(MSR_K7_HWCR, value); + rdmsrl(MSR_K8_HWCR, value); value |= 1 << 6; - wrmsrl(MSR_K7_HWCR, value); + wrmsrl(MSR_K8_HWCR, value); } /* @@ -928,9 +928,9 @@ static void init_amd(struct cpuinfo_x86 } if (cpu_has(c, X86_FEATURE_EFRO)) { - rdmsr(MSR_K7_HWCR, l, h); + rdmsr(MSR_K8_HWCR, l, h); l |= (1 << 27); /* Enable read-only APERF/MPERF bit */ - wrmsr(MSR_K7_HWCR, l, h); + wrmsr(MSR_K8_HWCR, l, h); } /* Prevent TSC drift in non single-processor, single-core platforms. */ --- a/xen/arch/x86/cpu/hygon.c +++ b/xen/arch/x86/cpu/hygon.c @@ -70,9 +70,9 @@ static void init_hygon(struct cpuinfo_x8 __set_bit(X86_FEATURE_ARAT, c->x86_capability); if (cpu_has(c, X86_FEATURE_EFRO)) { - rdmsrl(MSR_K7_HWCR, value); + rdmsrl(MSR_K8_HWCR, value); value |= (1 << 27); /* Enable read-only APERF/MPERF bit */ - wrmsrl(MSR_K7_HWCR, value); + wrmsrl(MSR_K8_HWCR, value); } amd_log_freq(c); --- a/xen/include/asm-x86/msr-index.h +++ b/xen/include/asm-x86/msr-index.h @@ -295,7 +295,6 @@ #define MSR_K7_CLK_CTL 0xc001001b #define MSR_K8_TOP_MEM2 0xc001001d -#define MSR_K7_HWCR 0xc0010015 #define MSR_K8_HWCR 0xc0010015 #define K8_HWCR_MON_MWAIT_USER_EN (1ULL << 10) #define K8_HWCR_MCi_STATUS_WREN (1ULL << 18)