Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1979324ybi; Sun, 16 Jun 2019 18:41:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxV5ZHM7S/L8hYau9vmkztlXZaylgrS3ewTjV47QXiOwBX5wgVmf6Piow7yAi9fa0aZTI0X X-Received: by 2002:a17:90a:3603:: with SMTP id s3mr6564815pjb.17.1560735687390; Sun, 16 Jun 2019 18:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560735687; cv=none; d=google.com; s=arc-20160816; b=au+9fn0FhCRwVtZueZsMAD4cohaZLT3/VMDXhRC5B3QoSVOQ7kUODPXuBVHZ34gRIP PA+7Hb521ULH7+A3JfXn5K9xJ14wb8Bucw/73GjyHW+dGYO5O6AodXSwE0hzZ+V4nqRi Aw84siONocqT1A+SpncYixd76//LlNHcR+FqVRvm4cPK7epdfAcDXgsyeXimRxvFJ4da ibhsbigVfQVmNNc1nwIxSbsWr8prOsSfwk0EuV1KRX20A23KpOk5GihbnOE7iM4OYm9g d05bf4GD53jw6VlrZoSBlQuKeyJ9jHoSqtdLqM2QhWa2rP54lo5u71w18+3arFgZ4elR ivpQ== 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=MbZimvRZJD2tAGDz777uAhVIaximO5YSBj7c92pCpWlJ2U3zOLVxF5oRoSRcEEeRbD qi2hVXVXRSuqWI0l8/xh8KbJJjdH6OEYWDW9OvWBBHVj5XI2M2iovuRgv5goSCodk723 gxiNxiF3TLCpa1rL9n8TWLihFbSTDJVrxvP74OeSGPVKF4RXpi7kuvvakq6yVCN2wLl/ mjhLb1emjOYFbcb94LzlwrhV4Je2HcEyvYzGqdVDdQ362l9V+R62ZOynWNTe0Uv/q0AW r1uWWoO2/KzBQycGY2e/G1mONs77I7MFH/nStlqOyU/aszUoGpmYVZAiJkq1Muau+vNH JTlQ== 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 a22si9090684pgw.60.2019.06.16.18.41.12; Sun, 16 Jun 2019 18:41:27 -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 S1727534AbfFQBjw convert rfc822-to-8bit (ORCPT + 99 others); Sun, 16 Jun 2019 21:39:52 -0400 Received: from ZXSHCAS2.zhaoxin.com ([203.148.12.82]:34605 "EHLO ZXSHCAS2.zhaoxin.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727389AbfFQBjv (ORCPT ); Sun, 16 Jun 2019 21:39:51 -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.1261.35; Mon, 17 Jun 2019 09:39:49 +0800 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) 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.1261.35; Mon, 17 Jun 2019 09:39:49 +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; Mon, 17 Jun 2019 09:39:49 +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: AdUkrXhnHd9IGiblThumHNDQwkBrAQ== Date: Mon, 17 Jun 2019 01:39:49 +0000 Message-ID: <1ee81e03f6fd4f989151d02fcf95d35b@zhaoxin.com> 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