From patchwork Mon Jan 9 16:43:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 40968 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2258985wrt; Mon, 9 Jan 2023 08:46:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXvr9qsG1biiJRgPz59zKFiiQnFkabOjqN2KR4LTeXruRKS30u4zOMeV7xBIPNJ8xRNQxP6I X-Received: by 2002:a17:902:e54b:b0:191:24d1:8af6 with SMTP id n11-20020a170902e54b00b0019124d18af6mr98123102plf.42.1673282794781; Mon, 09 Jan 2023 08:46:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673282794; cv=pass; d=google.com; s=arc-20160816; b=v2i4CnTzg7w8MUmqx76YWkkJPIrunbKO2RT3Kv217VAey9xVyL5wf3+1/trThNlCnh AKVpSvXHwHEq/An6/9n0DbmkHEsQXsqkmbub6y14XQJaOxB9XQ8bnUR5bXVFNnv7/HZ/ S0+Pup9UgsFAKisrz44NuE5Z2mIO0EbIS8dmQb9gfGTd183m4Norhq1dJKhuRp6UXkDz GBvKWRGGHQx3qT3VOIuIJE9uwdDMDHO1ZizQP1n6H+Jm4yB+hdgod/Iz64t1PaG6uvGp Twy5lwbJzCtwWy5qS5exBTn3m4p9ET/r5SwWWi8kpmAPEzP9cgYHHSwTpU8np+IKrhZo glGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1F1GLlMLfSr5l7CElB+d0nCVkbg0nKh2QbK6amZ2zIc=; b=Y0x0WDcm1ZGPHfyV7tzA6X8g1rkCc9qx7guqbj0eySGNx+srAhwFd+xz/FbnrSSViH EDI1KGuBTn0XtHPHy89g+v7OnOxq0fGKufhJSbTokYE06XCZIkap5WV2fi8/hTkU84OQ /3PpcSnJd/+k2acZ0ck7e8qRexOmFIgQA113XjieM0RgBbi4rG+3i9UwBqUdEdLytncF sZ6Ehn4xFjpf94M3xwY7ObdbE7tptJsGFwEyB7OQ1BIWsObAiYi25GZlWHoHR0J9oDDX 0PT8TnNcgfS4P6GBsNnL8XV/er+O8AIA6oLNxQCyi346aFsoZh55Xb2zr9mlOUm3tS1l 8VUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="w/2UbkR4"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a170902ce8500b00188c9c17571si9841155plg.391.2023.01.09.08.46.22; Mon, 09 Jan 2023 08:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="w/2UbkR4"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236677AbjAIQpB (ORCPT + 99 others); Mon, 9 Jan 2023 11:45:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234410AbjAIQoX (ORCPT ); Mon, 9 Jan 2023 11:44:23 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2042.outbound.protection.outlook.com [40.107.220.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A5AD12634; Mon, 9 Jan 2023 08:44:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UW+pzvyOAHxIVbKl4Hq8Ot7Ve9Jo50YwQuXULq/K856imnZTSvSoB1to8jYnJwAfTd9navvzVR7+iB03XIjtTXZtV3h8wbP9u9czXR5ojaJXhqLeP0PQufIDwHX9i9DGSNvHBmCrTUs7h89zH7tkqp84Q4kElnmHQt6/eENr7tH9R6H6jBZKWK8jK3Pb2VdCdhMjLA2aIHFf9jKi39Natc8gvbAe7asCrQ/YeQlGObCwseHdseiBgYxy7koXRo4qXFPqrX8VMVB9YImiomSI5m2floAOMD8M3yYBgm0BcxU4HNbOGdnals0pMMrYVyf9wyU0qPbbNr0PweiCgqv0MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1F1GLlMLfSr5l7CElB+d0nCVkbg0nKh2QbK6amZ2zIc=; b=jzFytgFnM2nfEipn/p6iI5mDp1HdLH0b3jIVxTyOoafp6q45LviTn3Dy0r3tOmA/QOy9a2jPrJEXj3fq+MbV2goV/5pXTgWJVP+5QSOR48f9M7IT31gTIUX1UCOq1mTneSzkPiPk1VMbcR1NHCiS3gxVeXCxPPHgwqT3GjWmcb8EDZMlJhkl2lxPx1hm2j5VaLlNNiVnPCY5zZwLRUpzTzNDa4I/mimxATjTidF8xeVBzGFpGFUmEd5jNVf7DoTzxJEc9bfjGbMKtcNJD4L/zbuHravnQv442rXgWVZKbiAw/p5OsPL2fcgtnPXyiWkmCYwJTWdWB/mheRxc0bJxuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1F1GLlMLfSr5l7CElB+d0nCVkbg0nKh2QbK6amZ2zIc=; b=w/2UbkR4duGFBbebpzmQATr1NFj3SQsqNnrMaUea3tTyb3Uz1+wU2SLXRtt34ehjwpNRNwVDGaRT4eEwrvFBTU4LLCuUAwwgSkD3BuRp0zMRSlPxYOimcAi7+z/Sffvffdo8f26tNaarX9TT0A3kndXQsWnqRxWPrZtD5kKBSZM= Received: from DM6PR04CA0007.namprd04.prod.outlook.com (2603:10b6:5:334::12) by MW4PR12MB5628.namprd12.prod.outlook.com (2603:10b6:303:185::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Mon, 9 Jan 2023 16:44:18 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:5:334:cafe::1b) by DM6PR04CA0007.outlook.office365.com (2603:10b6:5:334::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Mon, 9 Jan 2023 16:44:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Mon, 9 Jan 2023 16:44:18 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 9 Jan 2023 10:44:16 -0600 From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v11 03/13] x86/resctrl: Add a new resource type RDT_RESOURCE_SMBA Date: Mon, 9 Jan 2023 10:43:55 -0600 Message-ID: <20230109164405.569714-4-babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230109164405.569714-1-babu.moger@amd.com> References: <20230109164405.569714-1-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT033:EE_|MW4PR12MB5628:EE_ X-MS-Office365-Filtering-Correlation-Id: ab5d3b52-6ceb-4b98-ead2-08daf260c04f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kCsXxt8dbTNvnPFKS40KR0EW1OHaNhs8Hh356nClUbc1crqmIe5XKfF0HmtlFQTtCByM3+ER+YP0fRDCD+mG12M2lUK24I2rS2hcocMwGYj1VkBvSP/go9Ec1gqG7I5hCy08Z9VCiS8ff27S8hTEXyP5JGOuE2QVgngdHqH5MrOXQ0lK4DFGKOsh8/MuHGhDANVMdEEV1tmYPglj0K2nsXn/lJFNYPe8VrvnVCcaJXTUcfPNveCwl4X/sly6yaTVCRBnBbuVinPKWiKUaS+v15Un7owXOr4aluLimyk7EVMuI35XD2NwiTdjqDIM5fvWGwjLcFOfha3KixDS8liXfBq64EOgbhZjZJFBvJdtntYlCiR7SH4uR2S1Wi39tixDmObRLdOsB/KBhvcYQwbMaaJ5nXEsC1uIutoaCeoMo28HEwvihGNG+vrn641Z4b/sSA5Zaf81kuC6Z7WLh5oXVYl4MlwgtJbh2Vrxb8ZCSgY55UCWrWey4NcLBpoJN1oO2V4mtixc/LgUlr+SdnDzLs7MWE0fW8dNPSMyQswT3e0uQbbnbNxxJP4uE3KKtsvqMEonYqMwzOkjFQtqEKShmN3JyoMtDPNdSmHwAWCr6srFNlXZplVTQbLqcqeya8pPHlqRiq2MsWsLDhDAWJwIPJ3ew2kNKJ4XZUoLdxMqN4rMh1mLftjtcC5XLOyklWufbHuwlU5VKArI7/MR5kcv1eoiZF8bvaEtOMoSe/vX+L0= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199015)(46966006)(40470700004)(36840700001)(82310400005)(8936002)(40460700003)(2906002)(7406005)(5660300002)(426003)(47076005)(41300700001)(81166007)(7416002)(7696005)(70206006)(4326008)(70586007)(8676002)(316002)(356005)(44832011)(110136005)(54906003)(186003)(16526019)(82740400003)(26005)(40480700001)(1076003)(2616005)(336012)(86362001)(36860700001)(36756003)(478600001)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2023 16:44:18.2966 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab5d3b52-6ceb-4b98-ead2-08daf260c04f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5628 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754564180007951610?= X-GMAIL-MSGID: =?utf-8?q?1754564180007951610?= Add a new resource type RDT_RESOURCE_SMBA to handle the QoS enforcement policies on the external slow memory. Mostly initialization of the essentials. Setting fflags to RFTYPE_RES_MB configures the SMBA resource to have the same resctrl files as the existing MBA resource. The SMBA resource has identical properties to the existing MBA resource. These properties will be enumerated in an upcoming change and exposed via resctrl because of this flag. Reviewed-by: Reinette Chatre Signed-off-by: Babu Moger --- arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++++++++ arch/x86/kernel/cpu/resctrl/internal.h | 1 + 2 files changed, 13 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index c98e52ff5f20..f6af3ac1ef20 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -100,6 +100,18 @@ struct rdt_hw_resource rdt_resources_all[] = { .fflags = RFTYPE_RES_MB, }, }, + [RDT_RESOURCE_SMBA] = + { + .r_resctrl = { + .rid = RDT_RESOURCE_SMBA, + .name = "SMBA", + .cache_level = 3, + .domains = domain_init(RDT_RESOURCE_SMBA), + .parse_ctrlval = parse_bw, + .format_str = "%d=%*u", + .fflags = RFTYPE_RES_MB, + }, + }, }; /* diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 5ebd28e6aa0c..fdbbf66312ec 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -409,6 +409,7 @@ enum resctrl_res_level { RDT_RESOURCE_L3, RDT_RESOURCE_L2, RDT_RESOURCE_MBA, + RDT_RESOURCE_SMBA, /* Must be the last */ RDT_NUM_RESOURCES,