From patchwork Thu Mar 28 15:05:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Woods, Brian" X-Patchwork-Id: 10875097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC2091390 for ; Thu, 28 Mar 2019 15:06:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C683828565 for ; Thu, 28 Mar 2019 15:06:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA91628AB8; Thu, 28 Mar 2019 15:06:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 650EE28565 for ; Thu, 28 Mar 2019 15:06:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9WaZ-00025H-G5; Thu, 28 Mar 2019 15:05:07 +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.89) (envelope-from ) id 1h9WaX-00024s-UY for xen-devel@lists.xen.org; Thu, 28 Mar 2019 15:05:05 +0000 X-Inumbo-ID: dd514288-516a-11e9-893e-8f4752c72b0e Received: from NAM03-BY2-obe.outbound.protection.outlook.com (unknown [40.107.78.47]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dd514288-516a-11e9-893e-8f4752c72b0e; Thu, 28 Mar 2019 15:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9aM6keg6Rm2HBXd0Dmsh94N4yviivQaNsGru/0VLsmw=; b=dJNQCCjjNjbPEdDiob2hk3DUsdKKUfuQydbfOvH/qUEgwsWTLbhYAn4DTY7A6q2y88c0UQ9/AyKsjuQB5kXKqnfmaqU8trByleZa43YgaKDL9zvs/bv3K7rlfzNg7G2WRFyVjpRNrBk7zdMqa4MYVXRrNwKJC8gYMeo0mfy5HOg= Received: from MWHPR12MB1597.namprd12.prod.outlook.com (10.172.56.10) by MWHPR12MB1454.namprd12.prod.outlook.com (10.172.55.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Thu, 28 Mar 2019 15:05:01 +0000 Received: from MWHPR12MB1597.namprd12.prod.outlook.com ([fe80::d8d0:f630:f358:d1a8]) by MWHPR12MB1597.namprd12.prod.outlook.com ([fe80::d8d0:f630:f358:d1a8%9]) with mapi id 15.20.1730.019; Thu, 28 Mar 2019 15:05:01 +0000 From: "Woods, Brian" To: "xen-devel@lists.xen.org" Thread-Topic: [PATCH v2 3/3] mwait-idle: add enablement for AMD Naples and Rome Thread-Index: AQHU5XedzVi621xwIEyJ6kszHO00DA== Date: Thu, 28 Mar 2019 15:05:01 +0000 Message-ID: <20190328150426.7295-4-brian.woods@amd.com> References: <20190328150426.7295-1-brian.woods@amd.com> In-Reply-To: <20190328150426.7295-1-brian.woods@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN1PR12CA0048.namprd12.prod.outlook.com (2603:10b6:802:20::19) To MWHPR12MB1597.namprd12.prod.outlook.com (2603:10b6:301:10::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Brian.Woods@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [165.204.78.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cfb37d95-2974-4dd3-07ab-08d6b38ec034 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12MB1454; x-ms-traffictypediagnostic: MWHPR12MB1454: x-microsoft-antispam-prvs: x-forefront-prvs: 0990C54589 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(376002)(136003)(366004)(39860400002)(346002)(396003)(199004)(189003)(81156014)(54906003)(86362001)(71190400001)(71200400001)(81166006)(105586002)(102836004)(97736004)(50226002)(2906002)(106356001)(36756003)(2351001)(76176011)(26005)(5660300002)(8676002)(6116002)(3846002)(8936002)(186003)(386003)(6506007)(316002)(53936002)(446003)(478600001)(7736002)(66066001)(486006)(1076003)(11346002)(2616005)(4326008)(305945005)(476003)(2501003)(99286004)(72206003)(14454004)(5640700003)(6916009)(25786009)(68736007)(256004)(6436002)(6512007)(52116002)(6486002)(14444005)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1454; H:MWHPR12MB1597.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: A0USXHlMYaNlv90L8MHsot54vphTrS8nUFXvsnn1rguNfb49AwaI6HSwnfWC7gUQhhlB/R+MXP5P7uE2HnHi642Q36DO/aXmNyYv3sH/umera3kZ6EHJJ44sOnvkot2dNXqkj/4kJUSueviEqaITfvHjrFaShg5ZSM9D/FY1omMNC14ooT8jftMUvuHV+0liAf+sfMf9QDSORb/0dxLd5ConH/taBP21kaPfuAZ3EYUOhq3Oyk4AB751hIn5PSvf3+bPf/lGi74jMQWshmKPd2vYYgYDBdwpNS72iQBzKhHPim+SlC5crTVoC1GtHJLoWD06qlSjU0rTXSqHHGJwB377Ws8cf7S/FVxi506/3XK+YhB5MrHOsXJS7rsRDp0deY1jgrXJFtl5X3nx+EsWq7tY/t1j1Knvf3LEBh5m9sk= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfb37d95-2974-4dd3-07ab-08d6b38ec034 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2019 15:05:01.5100 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1454 Subject: [Xen-devel] [PATCH v2 3/3] mwait-idle: add enablement for AMD Naples and Rome X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , "Woods, Brian" , Jan Beulich , =?iso-8859-1?q?Roger_Pau_Monn=E9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Brian Woods Add the needed data structures for enabling Naples (F17h M01h). Since Rome (F17h M31h) has the same c-state latencies and entry methods, the c-state information can be used for Rome as well. For both Naples and Rome, mwait is used for c1 (cc1) and halt is functionally the same as c2 (cc6). If c2 (cc6) is disabled in BIOS, then halt functions similar to c1 (cc1). Signed-off-by: Brian Woods --- xen/arch/x86/cpu/mwait-idle.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c index 58629f1c29..0d5d4caa4d 100644 --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -720,6 +720,22 @@ static const struct cpuidle_state dnv_cstates[] = { {} }; +static const struct cpuidle_state naples_cstates[] = { + { + .name = "CC1", + .flags = MWAIT2flg(0x00), + .exit_latency = 1, + .target_residency = 2, + }, + { + .name = "CC6", + .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_USE_HALT, + .exit_latency = 400, + .target_residency = 1000, + }, + {} +}; + static void mwait_idle(void) { unsigned int cpu = smp_processor_id(); @@ -964,10 +980,16 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = { {} }; +static const struct idle_cpu idle_cpu_naples = { + .state_table = naples_cstates, +}; + #define ACPU(family, model, cpu) \ { X86_VENDOR_AMD, family, model, X86_FEATURE_ALWAYS, &idle_cpu_##cpu} static const struct x86_cpu_id amd_idle_ids[] __initconstrel = { + ACPU(0x17, 0x01, naples), + ACPU(0x17, 0x31, naples), /* Rome shares the same c-state config */ {} };