From nobody Mon Feb 9 00:54:15 2026 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CDDD12F5B6 for ; Mon, 25 Mar 2024 17:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711387664; cv=none; b=bUR1elUgHZFR6ehAHOc4VITr5afFp30e0t94cpzD/bvZRSVjpMowKts0gmtfgtuyUJQA+nQ+GYCiZ8wMV2TqJqa27yzVq5Y5du8Vv5XP8BsvcvfctZT5ZE6efMyUoiHRRr6nZVH+h5R/4//EkV7eP9/2qJ8jQZDHNVCYlYapYLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711387664; c=relaxed/simple; bh=r3fjiYp+AgZHV3ei77GMW6DjlOuXQfdqooVdsxOJZz8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=JeQJMtsDn7XCrdex1pT7m3YBgoRf08UbEyyStwwTz5GpgmPHLe1QpoRCAgfU6vdX3fYx1UNpImVhEeYSWdkOax+Gdqb0ypQGuCrq94n68DZ5970kM97GGz3kYT2z+G3A2biyKI77a8lPmARa82LV2QnHrZumrHKPPuuwqi7WEnk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--peternewman.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tWFgFCu+; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--peternewman.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tWFgFCu+" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-60a3bb05c9bso74651097b3.1 for ; Mon, 25 Mar 2024 10:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711387661; x=1711992461; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Z+xKnD/Hk5bulpibeGFuTyXe+4qbZ8qSnGUgzX6Q+tg=; b=tWFgFCu+7+B8iCj4l+XNvEkD6WEFf837r+nJK2b9bKdKyecR4o6DmXl8TeRq8iLfHN QS1ETtisUldJfyfqDSZvaA/ZJjadZRdeDUGvuqD35eeBEoc4yBaY1T4Ka3sBu7AhlXHU CF6L/84pzItEDEBrsmMqmiJws1J5dA+E4XY6nKpZp8hThPwoR/253VFmTDdVpvnBiUvn FyXbsWATbxD+Z6cGQ6REWOT9XjmW+CmRrSxNxTzpcPgzDwpZEhSje9AETBNgVyLCC0R4 53wi/PoD5mqvao6C0HQsdVNbHj5oStlH5UiNX6pCLvRmLl95/1TPLEekK/85KkmK5AGi KXbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711387661; x=1711992461; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z+xKnD/Hk5bulpibeGFuTyXe+4qbZ8qSnGUgzX6Q+tg=; b=ZVU2EP9FaBZInAuEEwI4VC/ZsCYHuaRGOUb4Rq0WmyBVWyBIPmyhsl1OLf0bJ1Rjeb DmxwVzSODfEF/OQM8TxNtOHnOKsMuhDda/6mF4ikY4GZ8Hr/W6Lw+DprmomxR0tuHEEl TzenSWvd4rMgfWO3rbcVEsnfSm2167Lkc3LyDS7PBhbtI/21CApUQa7+YhJuizSTHv9t +U4Utg/nXCgNHWBP/JkY/lOW1Cxsptab9wNm8pvmZzHqJA+a/AlkXJP6nFojx+FMpZ0X aOupjzXwRtCMCl7RXYriuxS0dh+Og/xT18j/Ie861OxnENmQg7r+Tq0BbpYDF2qxeGW1 ZheA== X-Forwarded-Encrypted: i=1; AJvYcCX+U0ENzV6P5snj0Sz6EO0+JfeVF106u5dI4bBtFQFux2cXr8c/xAuExdj0glJ4F3PB4v/D5844jOpDACjtYj97+WuO1hfDN9gjcvRI X-Gm-Message-State: AOJu0Yz0B5QJBur+XKKRfuNcWMYpNqB+q4GFi0WQhgc+EVGMjToUjdRg 6lgzJMaUTx/ZpxZnmgV2J7K75CIXCPtkBRIMexd312jLpBRLxt9a8CEh5se3hIJ7VK4Q7tUFnmT jaGcBvB4GGD1apHFJJjaSTA== X-Google-Smtp-Source: AGHT+IGOXDCr9eFN0hGMBkiz/xvjtcpSPh1J7eXfROpiF4bMJ8dytnsQwF5v/Y0UX1Wt2YJvnTIPvhFgMbCVu+AJLg== X-Received: from peternewman-us.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:3dcc]) (user=peternewman job=sendgmr) by 2002:a81:8387:0:b0:611:a290:b8e3 with SMTP id t129-20020a818387000000b00611a290b8e3mr157140ywf.0.1711387661638; Mon, 25 Mar 2024 10:27:41 -0700 (PDT) Date: Mon, 25 Mar 2024 10:27:04 -0700 In-Reply-To: <20240325172707.73966-1-peternewman@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240325172707.73966-1-peternewman@google.com> X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog Message-ID: <20240325172707.73966-4-peternewman@google.com> Subject: [PATCH v1 3/6] x86/resctrl: Disallow mongroup rename on MPAM From: Peter Newman To: Fenghua Yu , Reinette Chatre , James Morse Cc: Stephane Eranian , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Uros Bizjak , Mike Rapoport , "Kirill A. Shutemov" , Rick Edgecombe , Xin Li , Babu Moger , Shaopeng Tan , Maciej Wieczor-Retman , Jens Axboe , Christian Brauner , Oleg Nesterov , Andrew Morton , Tycho Andersen , Nicholas Piggin , Beau Belgrave , "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, Peter Newman Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Moving a monitoring group to a different parent control assumes that the monitors will not be impacted. This is not the case on MPAM where the PMG is an extension of the PARTID. Detect this situation by requiring the change in CLOSID not to affect the result of resctrl_arch_rmid_idx_encode(), otherwise return -EOPNOTSUPP. Signed-off-by: Peter Newman --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/r= esctrl/rdtgroup.c index 9b1969e4235a..8d6979dbfd02 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -3879,6 +3879,19 @@ static int rdtgroup_rename(struct kernfs_node *kn, goto out; } =20 + /* + * If changing the CLOSID impacts the RMID, this operation is not + * supported. + */ + if (resctrl_arch_rmid_idx_encode(rdtgrp->mon.parent->closid, + rdtgrp->mon.rmid) !=3D + resctrl_arch_rmid_idx_encode(new_prdtgrp->closid, + rdtgrp->mon.rmid)) { + rdt_last_cmd_puts("changing parent control group not supported\n"); + ret =3D -EOPNOTSUPP; + goto out; + } + /* * If the MON group is monitoring CPUs, the CPUs must be assigned to the * current parent CTRL_MON group and therefore cannot be assigned to --=20 2.44.0.396.g6e790dbe36-goog