Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4731944pxt; Wed, 11 Aug 2021 12:43:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+LhvfOjmYDdvI5jowLzFj0sQHJqBIt8WyBR0P7pmaEG55D95lHCuxr7c69z2UW0/ICOKo X-Received: by 2002:aa7:d547:: with SMTP id u7mr687750edr.28.1628710990896; Wed, 11 Aug 2021 12:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628710990; cv=none; d=google.com; s=arc-20160816; b=krDrH3JNzdmj6Frw8XRZ0M7GqTRR1m2labkNo2jGV3FlVmmkK0GvRAMkESmsJpeqTn tk3Hl3//A5K/3Q48Z+oAJpb44a+8t5lG+7Xz86QfNkfyaVwpckok7TXTRLs4DGc5Bgej YgxWPo6EcUCYBSOuCcd2kIlyjNLkvv5m75ukjNE98MYcvaT787m6jHFE5KX/m9VHTAiB yasEy8o1AT+/eMVQYseW5CKdtT6ZOAbIAe6+pI13kTxs5R2NNL+gvaWPWJk9xCyqyohH 7ImLbCQuzfiYJlPaXpk7hEv5yDhqg5ZRKjH49h6JTEwXtgfLikq8/8+iWTRiBrK1DncO Y0kQ== 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=E1zsFiX6nDfZqCcRazvGkIOBDi1xpZUDS45ySvrLpoA=; b=RieCSuHuMUyCYl4YXyzVJ0OFaY8k/CB9N15v/7TkbK0qX2fRlDNVCc0alY6TYmpJl2 WB91cigYQnzGP2jCLpAF3vq1kEMBqCl4NNRNKmIUatzzpCd/1Em2XBaKvjQVjuCS4pQO 7TbGb7GoWxIlOpJj1LSK9ZYtON/KdvkFahWG56juOBOFEYWODyDZjXiropQQXRP1lH9j u35P7ZIAWhc+FuX/FGf5CtTm/oMqqCZH+0JAS6Phg06Ldm2Pfk0yWk1k8X1V4Iausxb5 13jJPBjOxUUvscBQMSSuloBw4BHUP6zTbxdc1EC2KDjC8f8JFZBG+EbS9jKeRpvcp1Gg f17Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=aS7K7EKD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=1gQ1hsrP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lf13si434ejc.336.2021.08.11.12.42.46; Wed, 11 Aug 2021 12:43:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=aS7K7EKD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=1gQ1hsrP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231444AbhHKTls (ORCPT + 99 others); Wed, 11 Aug 2021 15:41:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbhHKTls (ORCPT ); Wed, 11 Aug 2021 15:41:48 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BA87C0613D5; Wed, 11 Aug 2021 12:41:24 -0700 (PDT) Date: Wed, 11 Aug 2021 19:41:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628710882; 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=E1zsFiX6nDfZqCcRazvGkIOBDi1xpZUDS45ySvrLpoA=; b=aS7K7EKD2r+EC4ZTe8LOLDKd1bPCG6VOMxLuR0zhqJNvfhZo2PDwR16nRnNLSqeMYcZiKs tmCUDJvtKug+02wJtDJZGbHcrfuurE8svHFtjFw6h6YJOBObIYBigsOKN0UR68nrPsEDcp Miu4m+HAen0a0gpv5e6ifTVpdxdW5ptSPyEgds7gzcczK1t1cQTmkZXIjqxgjNQ8EHMHxh 4+CDQUJ1xP8A/JheLjtSmYfXm7Qgz8Exv0h69+iYVJTTRIqD3QFKuP7Bb/a1TAnz5xJoDA Rny7Wftyh1A64D1nKRB9l4VJTjLeJS1iteETA6YqCuAjMDD/UJDPFhk4+jiFhw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628710882; 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=E1zsFiX6nDfZqCcRazvGkIOBDi1xpZUDS45ySvrLpoA=; b=1gQ1hsrPgzvTM6dkl09Yc0/ATg1UNvNrQGuPhfmkYaXm8FnmkZc7/Ct/tX2d5A9dDLnh7f ZWJIJCSK4CKJhfDA== From: "tip-bot2 for James Morse" 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: Expand resctrl_arch_update_domains()'s msr_param range Cc: James Morse , Borislav Petkov , Reinette Chatre , Babu Moger , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210728170637.25610-24-james.morse@arm.com> References: <20210728170637.25610-24-james.morse@arm.com> MIME-Version: 1.0 Message-ID: <162871088210.395.8589186087042738185.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: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/cache branch of tip: Commit-ID: 327364d5b6b6f8c89d2d6253a986d80323512890 Gitweb: https://git.kernel.org/tip/327364d5b6b6f8c89d2d6253a986d80323512890 Author: James Morse AuthorDate: Wed, 28 Jul 2021 17:06:36 Committer: Borislav Petkov CommitterDate: Wed, 11 Aug 2021 18:37:02 +02:00 x86/resctrl: Expand resctrl_arch_update_domains()'s msr_param range resctrl_arch_update_domains() specifies the one closid that has been modified and needs copying to the hardware. resctrl_arch_update_domains() takes a struct rdt_resource and a closid as arguments, but copies all the staged configurations for that closid into the ctrl_val[] array. resctrl_arch_update_domains() is called once per schema, but once the resources and domains are merged, the second call of a L2CODE/L2DATA pair will find no staged configurations, as they were previously applied. The msr_param of the first call only has one index, so would only have update the hardware for the last staged configuration. To avoid a second round of IPIs when changing L2CODE and L2DATA in one go, expand the range of the msr_param if multiple staged configurations are found. Signed-off-by: James Morse Signed-off-by: Borislav Petkov Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lkml.kernel.org/r/20210728170637.25610-24-james.morse@arm.com --- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c index 92d79c8..a487cf7 100644 --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c @@ -292,6 +292,7 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid) return -ENOMEM; mba_sc = is_mba_sc(r); + msr_param.res = NULL; list_for_each_entry(d, &r->domains, list) { hw_dom = resctrl_to_arch_dom(d); for (t = 0; t < CDP_NUM_TYPES; t++) { @@ -303,9 +304,14 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid) if (!apply_config(hw_dom, cfg, idx, cpu_mask, mba_sc)) continue; - msr_param.low = idx; - msr_param.high = msr_param.low + 1; - msr_param.res = r; + if (!msr_param.res) { + msr_param.low = idx; + msr_param.high = msr_param.low + 1; + msr_param.res = r; + } else { + msr_param.low = min(msr_param.low, idx); + msr_param.high = max(msr_param.high, idx + 1); + } } }