From patchwork Tue Oct 17 12:18:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 154230 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4091512vqb; Tue, 17 Oct 2023 05:18:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4BbxSHsdhkJGTC5iG/f1LB2a4XZpmN/EWJBBEmm+4pfjWnzdOivAtAY0jLDVjB3j75hMK X-Received: by 2002:a05:6a20:8f28:b0:172:55c1:f1d4 with SMTP id b40-20020a056a208f2800b0017255c1f1d4mr2176327pzk.4.1697545124613; Tue, 17 Oct 2023 05:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697545124; cv=none; d=google.com; s=arc-20160816; b=Q6bvn5Iy3NzjHDiliSeZZhzJoqAM/27S8+hfuzCXs6tLN/Ly+PCWC15yGZuRNOxq5M Ag0x27J8wBBN7tQQqnp9mx/2/OxwwdaSeUNeWjMEhlTkIDrrLlE3hwAbvYwUxP/Bwl8a gYUiW4ON0lJit4+Wec4G2U6XrfyCmUcHvEPoE7Uc2RmfKylGVoiKNSj/a1Tn4SFs+1l4 WnUm9Ysh7wTuvR8IrA/5pUbkekpYqjaIFzl6ZNgtd+/Tq9G3u8aSp19LmzkyVIgE7Hn6 VPlOZcHAyjo8XeXCIsrpJI0WOWXxj0zFw9mP0VjWIIL8Nf6cdz4TdCjUzafWW9+ihIU3 Pu4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Zc6GlekuIaWruxlY92BP4Vwz5FKNVgtXn0mapz3PSMk=; fh=xlieDj8o+jXNpmF12Ogr15ctNOIP4IDTbgVIdoNwRD8=; b=FdCZj1Hdn7Y78CMOYoN9NL2zvZvIyihLW/1txqe6l38qUknNj+1WTKJYqvQjIstEkv /r1Q7dKrJYBfjnZGCWVAVDpeWW5e5ELioNCX6krxovMFxkm7ad+MJ9ieCcqeE835d6q9 rvjdFd5TLKWyOAg7WZ9pxutUdzFBKKuTvKl073eKhg/krmo31Ax8oWaWNY9OF9iK2e2i RU8Ej8D1bhaf1wi3TSdNDonO4+5QPZOinO0B7+nYsfvgFYP1U0NTdLtjhD7B5T02/1Sy 3maJonGsWirwQJreGAVSA1TPVmYlRuOCnvNQ69zjs19VKX8KIKO0wHZg8daFtwG18AyQ PEdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AiFhEcnK; dkim=neutral (no key) header.i=@linutronix.de header.b=D9XhXmUL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l5-20020a170903120500b001c75866c987si1683201plh.584.2023.10.17.05.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:18:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AiFhEcnK; dkim=neutral (no key) header.i=@linutronix.de header.b=D9XhXmUL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E6A89802955C; Tue, 17 Oct 2023 05:18:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235131AbjJQMSb (ORCPT + 19 others); Tue, 17 Oct 2023 08:18:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234341AbjJQMSG (ORCPT ); Tue, 17 Oct 2023 08:18:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D5D41A6; Tue, 17 Oct 2023 05:18:04 -0700 (PDT) Date: Tue, 17 Oct 2023 12:18:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697545083; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zc6GlekuIaWruxlY92BP4Vwz5FKNVgtXn0mapz3PSMk=; b=AiFhEcnKcFBlUPxppjSBgAuqlWHgVNN6+Wdnj82xoxc+MbIPFi3r/rSAC93GiGP9LBhOAe Z3GiAzYznFPAzwfHudDDxGktzmH3mykUJQVTiOcNXCC1WDh6gL6rCyba1tGWTp1ciVK4IP LIgIP6ldsp8bxKPskgLPA6rMtEvtsTn30L3YfwNKWKg8ORe96AB3Zv5Fsj/SqGz0i/xiNZ mTkxES5FImpF/3CpwFN+iakuQXuwosCQBpl6fB980OBhfDq96yUq+cIbgKQI4IxJHgJVgq X/X0R4zL5m7qMLXYulcxaB4/AMSoyzLytxv7vvJq4LEVYkyxnSBrVVgB2CijpQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697545083; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zc6GlekuIaWruxlY92BP4Vwz5FKNVgtXn0mapz3PSMk=; b=D9XhXmUL3J4Ympzru/pshdT8UtxcdKZKhSQTNGBYqaqoq0klOZqbsyjQqup5hLCITDdCyi SoO6F80L93cNJYDw== From: "tip-bot2 for Babu Moger" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cache] x86/resctrl: Simplify rftype flag definitions Cc: Babu Moger , "Borislav Petkov (AMD)" , Peter Newman , Tan Shaopeng , Fenghua Yu , Reinette Chatre , ilpo.jarvinen@linux.intel.com, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231017002308.134480-3-babu.moger@amd.com> References: <20231017002308.134480-3-babu.moger@amd.com> MIME-Version: 1.0 Message-ID: <169754508232.3135.14616801148439548823.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:18:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779960102899045185 X-GMAIL-MSGID: 1780005076449910765 The following commit has been merged into the x86/cache branch of tip: Commit-ID: 6846dc1a31d1894a7acf52d8442fe73b34091022 Gitweb: https://git.kernel.org/tip/6846dc1a31d1894a7acf52d8442fe73b34091022 Author: Babu Moger AuthorDate: Tue, 03 Oct 2023 18:54:22 -05:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 17 Oct 2023 11:51:16 +02:00 x86/resctrl: Simplify rftype flag definitions The rftype flags are bitmaps used for adding files under the resctrl filesystem. Some of these bitmap defines have one extra level of indirection which is not necessary. Drop the RF_* defines and simplify the macros. [ bp: Massage commit message. ] Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-3-babu.moger@amd.com --- arch/x86/kernel/cpu/resctrl/internal.h | 9 +++------ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 6 +++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index c47ef2f..0ad970c 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -243,12 +243,9 @@ struct rdtgroup { */ #define RFTYPE_INFO BIT(0) #define RFTYPE_BASE BIT(1) -#define RF_CTRLSHIFT 4 -#define RF_MONSHIFT 5 -#define RF_TOPSHIFT 6 -#define RFTYPE_CTRL BIT(RF_CTRLSHIFT) -#define RFTYPE_MON BIT(RF_MONSHIFT) -#define RFTYPE_TOP BIT(RF_TOPSHIFT) +#define RFTYPE_CTRL BIT(4) +#define RFTYPE_MON BIT(5) +#define RFTYPE_TOP BIT(6) #define RFTYPE_RES_CACHE BIT(8) #define RFTYPE_RES_MB BIT(9) #define RF_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index fe23969..09141f1 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -3260,7 +3260,11 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, goto out_destroy; } - files = RFTYPE_BASE | BIT(RF_CTRLSHIFT + rtype); + if (rtype == RDTCTRL_GROUP) + files = RFTYPE_BASE | RFTYPE_CTRL; + else + files = RFTYPE_BASE | RFTYPE_MON; + ret = rdtgroup_add_files(kn, files); if (ret) { rdt_last_cmd_puts("kernfs fill error\n");