Received: by 10.223.185.116 with SMTP id b49csp1437399wrg; Sun, 4 Mar 2018 01:43:22 -0800 (PST) X-Google-Smtp-Source: AG47ELs96V3JbOkfaKgiuZB4lS0G3365zHaS73NKoVabmOcWFsterioVC2tubVgbKAipwcPHcvcL X-Received: by 2002:a17:902:59d3:: with SMTP id d19-v6mr9783035plj.356.1520156602568; Sun, 04 Mar 2018 01:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520156602; cv=none; d=google.com; s=arc-20160816; b=jILtcjgUDGj+An0GKP7PTZT7qiAyWi6dD2fHhRCnTcYUopwU7qyBr27mk8XTTxgXKR vO3Oy1XfDvCRN9EfaakA7LsxTFnQRQGZIrcdrwBsSypcJMA+MK+TqShy96ALp775RduB k6I4dAqxPScCeZlo6eESA8M134ecnOS73kpymB9bADU9Zl6JFglFQdelzCsDT3QtOum7 6CYQUKbzCWS8UuYa0enbMYMbq+VD/SdEbYOvsF9EzAtZQ/J8ZPY+wh+kZnrdegoRfoN+ /Kb9gRewuiVt24Vv2/TKisqxdrnkmwkwBuxSsmT6ayLQOHu7/DMkHvodnhZUSSPCMof/ STCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=QbNMCavIM9JStPT4STIgB2luOuXSAE5su0pTIH/SU0M=; b=IGQB+pYezx90s/sGg1Bv+xjk/P12PZL9lDldsZEX+Ebt9yne7HEDEkCXhr/tYywuTz 6Y6xHU7ivizAVVALNs5ba99b3f/Tr2sp/iTLdKFJ26GKI1zyUj1uHi4JnzTCr5uWu7RZ xVNkHpDJzXkELbkzBhLEJ+rIk8BE76ulHzQ5jtNE1M/6Nk7aQD9ijv26tFpYgP93KOew H8XUf3OuGztno4Low/woYIFHlyQuspwPr9O+i6HRL5bRFQPmDvccaurv8RWJ/F/jzP52 NMG5SO6kxmZBwVe5SqwOpPVcOLETBWZAed4R3hmdm9tHCN4zopREdtlvNobkEFV0Zv/J 5rrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=HahdmPP7; 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 x14si6764289pgq.614.2018.03.04.01.43.02; Sun, 04 Mar 2018 01:43:22 -0800 (PST) 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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=HahdmPP7; 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 S932127AbeCDJby (ORCPT + 99 others); Sun, 4 Mar 2018 04:31:54 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34113 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831AbeCDJbv (ORCPT ); Sun, 4 Mar 2018 04:31:51 -0500 Received: by mail-wr0-f195.google.com with SMTP id o8so2715673wra.1 for ; Sun, 04 Mar 2018 01:31:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QbNMCavIM9JStPT4STIgB2luOuXSAE5su0pTIH/SU0M=; b=HahdmPP7BiPq+eaY76bx/Z9YsFHfJAXlCOZmsgKIhYMqSzURdCk0RP+TKpWtQsZJfu YLNbn6c4V+fQ+X31p5xFDuQBR1kq0jVk4qd98fIDt3m0eOmpEv15e5WXkYJ/5UKGGl1C OCyG6gh9Ppq0ujt0FhROjyqq8BapePloxM5oMF/vxhanD68YQe6hl4Qryp418AQE+P4P f814rUNAItfNw7SN/63yZN7cORAxA6ecxGbpY9ak1dObjVJnYG7GJuMQ36WJb13Mk0SD OKE02ECe8znxifIZiQjm4ha4r4iW3Ms2S3Lfhi4PW7yOE9ejQwRGRONDdonjv3q3Z3fq 026Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=QbNMCavIM9JStPT4STIgB2luOuXSAE5su0pTIH/SU0M=; b=AQQraR1CDjqb3/KLyvNkxvCCZ4hte05CBuGgsJajVac92tn67YIjtQQarFSAhfrT9L DACqM+wQRz7gtp27ZcUYyDmbail5f+i0y0lRRt0KvfAU5MwaRMzQnaoQvbQ6fdqttVoQ CmVqGPH07uHMu9OPkft/gCC70wfFYYP28dqr1t5lOUAc9urefRIJ5FS5FKtaxmDbN8Oa zJDlR0ygZqkBGo++/3mB3mCuDB5W/UODsYjr89mSMWViFgknTchEmllppQ9W7R4zhpOR Kh+TLG+zCsCkyIniRLQWBDxYnpoyWx5mel5B2Kf1etNagN+s3iKjkevSB20ytUQb2veH wZzA== X-Gm-Message-State: APf1xPBzhl4WaQhklIDZaUWLtubh/zNGzfT6iRUR/2z1n919d7wGeEGV C7Qpwz05kGXQzFkC61Zfyj8= X-Received: by 10.223.183.39 with SMTP id l39mr10209766wre.214.1520155910455; Sun, 04 Mar 2018 01:31:50 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id x26sm1849281wmc.32.2018.03.04.01.31.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Mar 2018 01:31:49 -0800 (PST) Date: Sun, 4 Mar 2018 10:31:46 +0100 From: Ingo Molnar To: David Wang Cc: rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-pm@kernel.org, linux-kernel@vger.kernel.org, brucechang@via-alliance.com, cooperyan@zhaoxin.com, qiyuanwang@zhaoxin.com, benjaminpan@viatech.com, lukelin@viacpu.com, timguo@zhaoxin.com, cobechen@zhaoxin.com, jiangbowang@zhaoxin.com Subject: Re: [PATCH] Delete some unusefull operations for centaur CPU/platform Message-ID: <20180304093146.rujp4f62fv6xotb7@gmail.com> References: <1519963908-4359-1-git-send-email-davidwang@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519963908-4359-1-git-send-email-davidwang@zhaoxin.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * David Wang wrote: > For Centaur CPU, the ucode will make sure that each CPU core can keep cache > coherency with each other when the CPU core entering to any C state. So the > cache flush operations when enter C3 is not necessary and will cause large > C3 enter/exit latency. > And the bus master disable operation when CPU core entering C3 state is not > needed too. Because the chipset will automatically do this operation. > > Signed-off-by: David Wang > --- > arch/x86/kernel/acpi/cstate.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c > index dde437f..1cd357b 100644 > --- a/arch/x86/kernel/acpi/cstate.c > +++ b/arch/x86/kernel/acpi/cstate.c > @@ -51,6 +51,18 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, > if (c->x86_vendor == X86_VENDOR_INTEL && > (c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 0x0f))) > flags->bm_control = 0; > + > + if (c->x86_vendor == X86_VENDOR_CENTAUR) { > + /* > + * on all centaur CPUs, sw need not execute cache flush operation > + * when entering C3 type State. > + * > + * On all Centaur platforms, sw need not execute ARB_DISABLE while > + * entering C3 type state. > + */ > + flags->bm_check = 1; > + flags->bm_control = 0; > + } Please clean up capitalization and spelling of the comment, and please also explain the ACPI-idle settings a bit better, i.e. something like: /* * On all Centaur CPUs the kernel does not have to * execute a cache flush operation (WBINVD) when * entering C3 state. * * On all Centaur platforms the kernel does not have to * disable bus-master arbitration (ARB_DISABLE) when * entering C3 state. */ Also, two questions: 1) I'm wondering about this logic in acpi_processor_power_verify_c3(): if (pr->flags.bm_check) { if (!pr->flags.bm_control) { if (pr->flags.has_cst != 1) { /* bus mastering control is necessary */ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "C3 support requires BM control\n")); return; So ->has_cst is set on Centaur CPUs? 2) There's this comment in acpi_idle_enter_bm(): /* * disable bus master * bm_check implies we need ARB_DIS * bm_control implies whether we can do ARB_DIS * * That leaves a case where bm_check is set and bm_control is * not set. In that case we cannot do much, we enter C3 * without doing anything. */ if (pr->flags.bm_control) { It says 'bm_check == 1 implies we need ARB_DIS' - but we do the opposite in the Centaur case? It it me who is confused or the comment? Thanks, Ingo