Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3848580pxk; Tue, 8 Sep 2020 04:20:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY7O18P+IKG99HwTv7GgTST7R9N2Mqqm+zjyozEjfTkREYFf4Aiu8VtdKET7mpjo4i7NXZ X-Received: by 2002:a50:c909:: with SMTP id o9mr26273726edh.148.1599564010575; Tue, 08 Sep 2020 04:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599564010; cv=none; d=google.com; s=arc-20160816; b=pIJmoRh6wC/HTJHRLU4Jh3VR0RUBSaAYezCXuCtCSVn7+tIbv/guBbhp+u3dybKFyC Z1JpgwZkkqdSIIg8RNxtAnova0JuVqkVBCshqMktgqJ/b6zowsqstwkm5+F4oAuC8v30 hSDMTiuorRepQpuTB2lX1Yzge75g/5e9A7itI7Ve8RKscUsNploUEQs+bfezPbSTTiYL kbbDMgtvg/+NUqC7RGTE6jvrmH5Fg095sFldy3y2poo3ZgsltmqJA3OUXT/qaiAuQv+e BJca/2YS3hP8OvuOjCeAqF8sF9gnRE4lva5qE/nI/3Iskk6xbRKGr+EujyjB0y07vcY/ DEBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=EyOODnnW/iwvgRFbjbEgmYevYoSEcgnvfd36ZuSqhD0=; b=y0MVr/Lti8idQdLzK/aq2QqYVwPsyMmZHjRRVDfeo2vrN5NxpeubD5wPoqWidBCwvA PLhU6FjY7zchkF1XZ2S/JSN5r54d1vI1vkK1NaE2H/+pfZ69ddo0QjeFDNYeqS3/uCXW zrv5vMwO5j9Zlk7CdrZqs1AECp4Vv5wYi0WxVnjYkaIQuuzad17uLJTLnKay7tQ798Z9 NjUG88xs5ArAClPLOYQ2rbxO+qKbtya0EcLR4nuTDZmLETKIJP6pemBTUCH4K3GoLk2u LVZFKjb45Jjuk+eEUuzj/Bo/9Gtz4y4O3z81LQ2VDVfJqwXPdxM3UwB7TgiKTK5Ps6+v PcqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx2si11367121ejb.202.2020.09.08.04.19.48; Tue, 08 Sep 2020 04:20:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729729AbgIHLSi (ORCPT + 99 others); Tue, 8 Sep 2020 07:18:38 -0400 Received: from ZXSHCAS2.zhaoxin.com ([203.148.12.82]:46821 "EHLO ZXSHCAS2.zhaoxin.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729894AbgIHLOf (ORCPT ); Tue, 8 Sep 2020 07:14:35 -0400 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS2.zhaoxin.com (10.28.252.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 8 Sep 2020 18:58:45 +0800 Received: from tony-HX002EA.zhaoxin.com (10.32.56.38) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 8 Sep 2020 18:58:43 +0800 From: Tony W Wang-oc To: , , , , , , , , CC: , , , , Subject: [PATCH v1 2/2] x86/cpu: add Centaur Family >=7 CPUs initialization support Date: Tue, 8 Sep 2020 18:57:46 +0800 Message-ID: <1599562666-31351-3-git-send-email-TonyWWang-oc@zhaoxin.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1599562666-31351-1-git-send-email-TonyWWang-oc@zhaoxin.com> References: <1599562666-31351-1-git-send-email-TonyWWang-oc@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.32.56.38] X-ClientProxiedBy: ZXSHCAS1.zhaoxin.com (10.28.252.161) To zxbjmbx1.zhaoxin.com (10.29.252.163) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org add Centaur Family >=7 CPUs specific initialization support in centaur.c Signed-off-by: Tony W Wang-oc --- arch/x86/kernel/cpu/centaur.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index 5f811586..345f7d9 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c @@ -65,6 +65,9 @@ static void init_c3(struct cpuinfo_x86 *c) c->x86_cache_alignment = c->x86_clflush_size * 2; set_cpu_cap(c, X86_FEATURE_REP_GOOD); } + + if (c->x86 >= 7) + set_cpu_cap(c, X86_FEATURE_REP_GOOD); } enum { @@ -95,7 +98,8 @@ static void early_init_centaur(struct cpuinfo_x86 *c) if (c->x86 == 5) set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR); #endif - if (c->x86 == 6 && c->x86_model >= 0xf) + if ((c->x86 == 6 && c->x86_model >= 0xf) || + (c->x86 >= 7)) set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); #ifdef CONFIG_X86_64 @@ -204,7 +208,7 @@ static void init_centaur(struct cpuinfo_x86 *c) sprintf(c->x86_model_id, "WinChip %s", name); } #endif - if (c->x86 == 6) + if (c->x86 == 6 || c->x86 >= 7) init_c3(c); #ifdef CONFIG_X86_64 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); -- 2.7.4