Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3499713ybi; Tue, 18 Jun 2019 01:40:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3d/cuuVFRnyurD99sE/nIeypO4Tk0GB5Y/3leb+/uQiZ0ZYfu9s3gORrgQCLe03IbSnth X-Received: by 2002:aa7:8d98:: with SMTP id i24mr50872398pfr.199.1560847203395; Tue, 18 Jun 2019 01:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560847203; cv=none; d=google.com; s=arc-20160816; b=WnQeYGFs3V4qES5KQ3ZezGgieetjH5G7uMI0zrTjMN5oivF+zD/RkVZfAo8AUV2yB+ a2IOpeogGm7ZoT+xcX2nfyya5ymPNPHpvMkKsLACNRZWHqpH64omT03dEKIWtOFnJie6 rzcrKsHVfbCNRB+JxVK5NATy50a/i6haws+23/jOhpCL4c69qsYFtdAdVL1hG1H5u6p/ F3JwSw28nP7KzEGOBwfNNVJ9oOi8ZyjE9iNn+BJOxqBHnZPi/NiRAGxdp2d/jcaGLGSL VB/1eY8N6eUIb+VpwKl0MHTU8IrDuqGUY6PwPXPrYyC7aBDuq3Ad+5e3jAa6uJvSU+QP 6f0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=GYCO7+N+v2rj3QRqPjLpkoRQq/nYt/CUx7hhL6ceAT8=; b=smmyZzZLFMBlFLrB987lJe8cEh3Wrr/DaFOeVVDkqJtHeaIvIfTscY10D+FMssS1D9 l3kS8O+AGdKwZgB9DGm/76PgYQH9MYzJpWILCquQNPgOjIwNPV8dzAveq/SR3NjVch2L 863ayTL7/x0txgGVS5TdP7bNoywpWQTVEGohmOcq44lpnNjwLH/C7SZx7L6mROLrL3Ix gl4IsBwfSo08VWZQM53fky7loWV4wRVkf+abPOHzGrYdciTrv6J7RvmJxUNq7ydZdYwH v0tYTxtlV7Iu5+cC7H/Eeo/BxOjvvZ+bRjIe9+pxsYfqP5iMaI/SFL1GFCfdtNcuI6G9 ywhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h194si13607821pfe.214.2019.06.18.01.39.45; Tue, 18 Jun 2019 01:40:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729262AbfFRIhc convert rfc822-to-8bit (ORCPT + 99 others); Tue, 18 Jun 2019 04:37:32 -0400 Received: from ZXSHCAS1.zhaoxin.com ([203.148.12.81]:21808 "EHLO ZXSHCAS1.zhaoxin.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729122AbfFRIhb (ORCPT ); Tue, 18 Jun 2019 04:37:31 -0400 Received: from zxbjmbx3.zhaoxin.com (10.29.252.165) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Tue, 18 Jun 2019 16:37:30 +0800 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by zxbjmbx3.zhaoxin.com (10.29.252.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Tue, 18 Jun 2019 16:37:29 +0800 Received: from zxbjmbx1.zhaoxin.com ([fe80::b41a:737:a784:b70d]) by zxbjmbx1.zhaoxin.com ([fe80::b41a:737:a784:b70d%16]) with mapi id 15.01.1261.035; Tue, 18 Jun 2019 16:37:29 +0800 From: Tony W Wang-oc To: "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "rjw@rjwysocki.net" , "lenb@kernel.org" CC: David Wang , "Cooper Yan(BJ-RD)" , "Qiyuan Wang(BJ-RD)" , "Herry Yang(BJ-RD)" Subject: [PATCH v2 3/3] x86/acpi/cstate: add Zhaoxin processors support for cache flush policy in C3 Thread-Topic: [PATCH v2 3/3] x86/acpi/cstate: add Zhaoxin processors support for cache flush policy in C3 Thread-Index: AdUlrXyaXF+iCRFCSOO5QfgXRuCt6w== Date: Tue, 18 Jun 2019 08:37:29 +0000 Message-ID: Accept-Language: en-US, zh-CN Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.32.64.75] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Same as Intel, Zhaoxin MP CPUs support C3 share cache and on all recent Zhaoxin platforms ARB_DISABLE is a nop. So set related flags correctly in the same way as Intel does. Signed-off-by: Tony W Wang-oc --- arch/x86/kernel/acpi/cstate.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index a5e5484..caf2edc 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c @@ -64,6 +64,21 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, c->x86_stepping >= 0x0e)) flags->bm_check = 1; } + + if (c->x86_vendor == X86_VENDOR_ZHAOXIN) { + /* + * All Zhaoxin CPUs that support C3 share cache. + * And caches should not be flushed by software while + * entering C3 type state. + */ + flags->bm_check = 1; + /* + * On all recent Zhaoxin platforms, ARB_DISABLE is a nop. + * So, set bm_control to zero to indicate that ARB_DISABLE + * is not required while entering C3 type state. + */ + flags->bm_control = 0; + } } EXPORT_SYMBOL(acpi_processor_power_init_bm_check); -- 2.7.4