Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp935908ybi; Thu, 30 May 2019 08:59:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9ba2lbWI/Rdx4IqlAuVfZFCi7Ta2oro54/vL93YUYJsYdjfIARUjfFj/KnsHdqH9cRooH X-Received: by 2002:a17:902:bd06:: with SMTP id p6mr4346769pls.112.1559231966985; Thu, 30 May 2019 08:59:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559231966; cv=none; d=google.com; s=arc-20160816; b=YZnEHRxOLPticZkary2yrwaIlQu/MaYtNaoKVt79NNf/gXpLRYbVmXfHg79zezOnGv AWd0TBlMgz4M6e7ru6KkazAoReP112SCWbHqlG2pbxR0MUIo6JCDjhoUX39vu1E4R8jF 6AVyt9z1/rvWhsGW76qf5BcT4r5RxBVK0wFhFoXfM8LLFlZymfRMetS86IIMn+Vj2IsU 4v0qZs0EsBeRgVDk9u23pwCCeYehQfdKHH5QoDUlcHH9GmrrPmyXgym4dJamBDUOHIaa kywyiYX5NdTeyZq4Pu3ZDRm/D6pdcCSFJX+ghxoN9Gy9qQtnmjADH/fZJqpC5Gm3hbwi +XIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RA6hrIoIPLkKfm2eRqstIB0cpfu+Y834q+EsC8orjmY=; b=MFZQqbkOzAbyugxb/5bmIEmqcHBKCzy6fkZS9iIy3brJ7n706g6dbjyMoSCKohP5gJ /c7mvvar+Lz+ULg9wOtYhqYP47fokAQAJcMtLeuLtO86vkVu9ZICwrOnVGOyEn7VbuNI kFckV+RGfoWYD6tyJr6Y9Qzd4qGQhwJOodY2/sLaam2wMrEWvPB8iGJ0NwQ7i8/h1zA1 gejR8mSsPN3A4OSzXjPKvM29MV6NDhFrU+TiFGQjW1xa9IJnP5rlLnlBVtbMYMvs0A1S mC/hGCRQohKZCFB4aQxRPMFT7wE7mYVPpy+hcoZQRuiuO81jvjjCyU2at+FQkOHonxkX YIhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p7si3321302pgh.497.2019.05.30.08.59.11; Thu, 30 May 2019 08:59:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727279AbfE3P5x (ORCPT + 99 others); Thu, 30 May 2019 11:57:53 -0400 Received: from foss.arm.com ([217.140.101.70]:39026 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbfE3P5w (ORCPT ); Thu, 30 May 2019 11:57:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B1E0341; Thu, 30 May 2019 08:57:52 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 909743F59C; Thu, 30 May 2019 08:57:50 -0700 (PDT) From: James Morse To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Avin , James Morse Subject: [PATCH] x86/resctrl: Don't stop walking closids when a locksetup group is found Date: Thu, 30 May 2019 16:57:42 +0100 Message-Id: <20190530155742.84547-1-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a new control group is created __init_one_rdt_domain() walks all the other closids to calculate the sets of used and unused bits. If it discovers a pseudo_locksetup group, it breaks out of the loop. This means any later closid doesn't get its used bits added to used_b. These bits will then get set in unused_b, and added to the new control group's configuration, even if they were marked as exclusive for a later closid. When encountering a pseudo_locksetup group, we should continue. This is because "a resource group enters 'pseudo-locked' mode after the schemata is written while the resource group is in 'pseudo-locksetup' mode." When we find a pseudo_locksetup group, its configuration is expected to be overwritten, we can skip it. Fixes: dfe9674b04ff6 ("x86/intel_rdt: Enable entering of pseudo-locksetup mode") Signed-off-by: James Morse --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 333c177a2471..049ccb709957 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2541,8 +2541,15 @@ static int __init_one_rdt_domain(struct rdt_domain *d, struct rdt_resource *r, for (i = 0; i < closids_supported(); i++, ctrl++) { if (closid_allocated(i) && i != closid) { mode = rdtgroup_mode_by_closid(i); - if (mode == RDT_MODE_PSEUDO_LOCKSETUP) - break; + if (mode == RDT_MODE_PSEUDO_LOCKSETUP) { + /* + * ctrl values for locksetup aren't relevant + * until the schemata is written, and the mode + * becomes RDT_MODE_PSEUDO_LOCKED. + */ + continue; + } + /* * If CDP is active include peer domain's * usage to ensure there is no overlap -- 2.20.1