Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3115571rdg; Tue, 17 Oct 2023 05:18:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtoWko7oOBOxRBWx/Ec4I2kT5JG6o0wANUcQU7OU7Krg/X1zVw6o9zceM2gYtHIa95YoEn X-Received: by 2002:a17:90b:891:b0:276:e9ba:60c7 with SMTP id bj17-20020a17090b089100b00276e9ba60c7mr1919910pjb.13.1697545117975; Tue, 17 Oct 2023 05:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697545117; cv=none; d=google.com; s=arc-20160816; b=rbpnzPFrkE7qB/CFRgwaMf+Q0W6QinzqMrApZmByqamjmsDy6NQRTVN3Tt0i+7WZhw MSzMx7AWAXp0jcjljEXOUK7JsjnU6xTaJMuuydyXMGFYTCuro7q7WutT+TjJIQd2dBDM u2sZxzMdTIfLOYRdxu52SwuIEFJiYSnQFv++WxOlsxtXNQrPH6BWe8wpgfdlQWQRwIr3 uZ4ktKK9E5PhSYnxTdUWkjl68PyB5ufYAPVNOmDZ8CshCYLH4pSN7bm7oA2y547FfU/l B7P6ukBVHFYJo2hV5jiC3+QLTwvW+i3CYQCsV+ADfSVwL4iTrZXX5C/FoIA0LJ7XwQrZ li4Q== 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 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ds19-20020a17090b08d300b0027d047d9070si8164104pjb.91.2023.10.17.05.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:18:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; 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 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 98C08801C1AC; Tue, 17 Oct 2023 05:18:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235125AbjJQMSa (ORCPT + 99 others); Tue, 17 Oct 2023 08:18:30 -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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:18:36 -0700 (PDT) The following commit has been merged into the x86/cache branch of tip: Commit-ID: 6846dc1a31d1894a7acf52d8442fe73b34091022 Gitweb: https://git.kernel.org/tip/6846dc1a31d1894a7acf52d8442fe73b340= 91022 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=C3=A4rvinen 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/res= ctrl/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/res= ctrl/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 *paren= t_kn, goto out_destroy; } =20 - files =3D RFTYPE_BASE | BIT(RF_CTRLSHIFT + rtype); + if (rtype =3D=3D RDTCTRL_GROUP) + files =3D RFTYPE_BASE | RFTYPE_CTRL; + else + files =3D RFTYPE_BASE | RFTYPE_MON; + ret =3D rdtgroup_add_files(kn, files); if (ret) { rdt_last_cmd_puts("kernfs fill error\n");