From patchwork Wed Feb 28 19:36:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luck, Tony" X-Patchwork-Id: 21106 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3568028dyb; Wed, 28 Feb 2024 11:37:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVhQ6+kDdKboBj0/E+xFnlWgFcKVLXniYahyj9dYw7vhzXXMWKhfLkI0Fbug7FP2kLEA60q7c1fJYOmWYuTeDzAAPrYIw== X-Google-Smtp-Source: AGHT+IGPCk1hxzIR0D0kvUrWviXIEqnOfcUgLbaE0kqaNT6LgrYqRAYR6L8Y4tLuGIX9QIC4mg/3 X-Received: by 2002:a05:6402:2c7:b0:565:7b61:4c82 with SMTP id b7-20020a05640202c700b005657b614c82mr275735edx.5.1709149078298; Wed, 28 Feb 2024 11:37:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709149078; cv=pass; d=google.com; s=arc-20160816; b=QEQY1TsFaGWRdae8rEemm9DG4E4dpkhP4eul98Znoi6ddv52eTk9vz3RKV02euaZcr VtcPhTxKdY0xXZQg/X4KQqmbiQ+E7JgMzP8gMYeN3QyThndFvj6mZPJp3gIwLWuOsJFu sPlugYGcNlgLWTwdFRCj+Ov0UXw4QC+RLxXmAqjKgHSt8S4fa5YswuPodrzidUZn4GjL f8O8Ut4n0rWCUQdRRXq87gjmHlQ/4m1H6z3OTAnWvNtcsh2+7FTrEy9RqVq9RoEt/LBs lnnxExoijLg8g3zX1NUwpY+xFiiMlxoxB9YErDdOOrMqIsrBWQU62IJu1csHnZCof5qU 7MQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tvSslJ1uTqxziD1YO8G1TSlsIeDSi3Ibc9GOOsbLEF8=; fh=kDu4WSgSKQjfqS0+uR7gDD47kd+EMQAW47hbuuOMwvI=; b=Xm6R5evnHDsuvPhoUFmWzpVgI5TlI22A9SFC5aOqvDjOp7vWZxSkVGXp5eUKqhi/eS xh3Fij+DW+9O6s1WMYFIiunO53dAQjk9PTndgzDTdsZpYkx42sqMADdsDyaxrhoGsmDg k9YEW/8VNajKDzHHM2KH4LnRWzmXlpyhsufJHkX5My+s6BitBIzJvZCkz9SLoFReEGvp csQvf7k28R08NZUMK1EKNBcjSsOHcZXuXu4Os/S5viSAalR2BN7AIOp7xOw8hV6+NB7M a+69vaZwo+SkzXUh3JD0/JGUt/VyLMgfhFvVyOTjkhHAzdxZhEJLqNl8RioAy7oHLuZP ezZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PoovqNOP; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85613-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85613-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z2-20020a05640240c200b005668feb45fdsi103948edb.36.2024.02.28.11.37.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 11:37:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85613-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PoovqNOP; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85613-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85613-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BF4651F263D3 for ; Wed, 28 Feb 2024 19:37:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 679B615F338; Wed, 28 Feb 2024 19:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PoovqNOP" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B90B574413; Wed, 28 Feb 2024 19:37:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709149040; cv=none; b=mhftdAfUsdtNvMIn7oLohMqmGLBbEZx5j8S+gKuRZtUGidYPFmPQTYG3afhGygOjr6ZjgtlDT1BHRA2HSGGQ4w7gga0MoaCjISxxYylw/xaJq20dYw/QgCWwAP1SLQc9gFlhqR5XQ9bD5EP8NJoSWeHrQNb8z2IQtj2aCtCWnxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709149040; c=relaxed/simple; bh=qRN8tgRWPtXi3u4gmjpERHUYkozuPU04HqhOdsqu3zY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oeOGV4wdQec6oEBtheOBqcuWGJZRpBDkMei+prcaB0o/XbMQo2VjJf06LW7su2NMRV4LDQ9RKg04YJhX43J1IobraM9jVYw3izWkpR8fI7KmfQlnzJRJS0+gEzK5Ur5TCaUI2BjYZYcY3vwTP7caQr0eKSU9r/kYmHmXJNX+apA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=PoovqNOP; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709149039; x=1740685039; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qRN8tgRWPtXi3u4gmjpERHUYkozuPU04HqhOdsqu3zY=; b=PoovqNOPh83g5hELR3CeUjXf9+EJV8xWLMvLCZddLeNFIzIqXaSDSz1d pP2At7L9ONjDTHF/w4YFXwph/Cm8K/h0IHySiEQ4pRbg/BBVfA6CFCjzE SPWY9AkowbuK9cZxRnAjrkA3lFuMHR+jod9NwOpIqCYIJWeh4ZFIDCA+q ykF9L2MXCX5ZulMnXNKJOM3lx4xcJnFBIcS5p3REbd2sFSNeVoEXQJjGb VHS7Sh7KR1cNQpOPe2OpDiY31LevW6sIcG/t/HEe5+/wyS2Uwq5ReS1UP 2Lqe6SyRbRRt1NJv74Ax6656jts8PaFDpLLtCoYI1c5ZwWgJ6CYrDVEfZ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="3495445" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="3495445" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 11:37:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="7485363" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 11:37:17 -0800 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Peter Newman , Jonathan Corbet , Shuah Khan , x86@kernel.org Cc: Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , Drew Fustini , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v4 0/2] x86/resctrl: Pass domain to target CPU Date: Wed, 28 Feb 2024 11:36:52 -0800 Message-ID: <20240228112952.8090-tony.luck@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240228112215.8044-tony.luck@intel.com> References: <20240228112215.8044-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792172703635418478 X-GMAIL-MSGID: 1792172703635418478 When a function is called via IPI, it isn't possible for assertions in source code to check that the right locks are held when those locks were obtained by the sender of the IPI. Restructure some code to avoid the need for the check. Patch 1 has the actual fix Patch 2 is just some code cleanups Changes since V3: https://lore.kernel.org/all/20240222185039.72201-1-tony.luck@intel.com/ Reinette: 1) Improve commit comments in both patches by changing to imperative. 2) Move initialzation of "m.res" in domain_setup_ctrlval() from patch 1 to patch 2 Tony Luck (2): x86/resctrl: Pass domain to target CPU x86/resctrl: Simplify call convention for MSR update functions arch/x86/kernel/cpu/resctrl/internal.h | 5 ++- arch/x86/kernel/cpu/resctrl/core.c | 55 +++++++++-------------- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 42 +++++------------ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 14 ++---- 4 files changed, 38 insertions(+), 78 deletions(-) base-commit: c0d848fcb09d80a5f48b99f85e448185125ef59f