From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19B4BC48BE9 for ; Mon, 24 Jun 2019 10:22:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3A3B2146E for ; Mon, 24 Jun 2019 10:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371776; bh=frhO+TbRuAu+T3t1CklAnZNS8Zq3HC8vnugaw+gMgaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=USzce56ZH+yDbMHuclRPBWTEUM5ghwPFUSjWR8EsI+AWWAAHYEQwxs9xO2/jGTpZU 05HZk+IudOzWNFfCp0KZ4oJztatFwl+iwqaMY4/yqB2zGi0IvTEavokzNAymzN61mr O0YPUyks1bgK9WIay0G4yXzJkynbJCvxTbPEpgbw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730931AbfFXKV7 (ORCPT ); Mon, 24 Jun 2019 06:21:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:57746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730921AbfFXKV7 (ORCPT ); Mon, 24 Jun 2019 06:21:59 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8BD0620645; Mon, 24 Jun 2019 10:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371718; bh=frhO+TbRuAu+T3t1CklAnZNS8Zq3HC8vnugaw+gMgaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MzUDWJ6/WkFGWxOMPQMT+U73rslePKscP2JHPdqodQUb+DrU2KTFOMMEQY4JOB93X hpZwifb/DV3SIknJh1nc7FJVKgcl8rQN5qFgCovZ7nUoXyA7VTyLiAzqexXaJ7/qvk hQqbiOWUkOuQ7rkltRtygRmIJY/qyhHevNd3I2hY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Morse , Thomas Gleixner , Reinette Chatre , Fenghua Yu , Borislav Petkov , H Peter Avin Subject: [PATCH 5.1 121/121] x86/resctrl: Dont stop walking closids when a locksetup group is found Date: Mon, 24 Jun 2019 17:57:33 +0800 Message-Id: <20190624092326.791973238@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: James Morse commit 87d3aa28f345bea77c396855fa5d5fec4c24461f upstream. 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 Signed-off-by: Thomas Gleixner Acked-by: Reinette Chatre Cc: Fenghua Yu Cc: Borislav Petkov Cc: H Peter Avin Cc: Link: https://lkml.kernel.org/r/20190603172531.178830-1-james.morse@arm.com [Dropped comment due to lack of space] Signed-off-by: James Morse Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2556,7 +2556,7 @@ static int rdtgroup_init_alloc(struct rd if (closid_allocated(i) && i != closid) { mode = rdtgroup_mode_by_closid(i); if (mode == RDT_MODE_PSEUDO_LOCKSETUP) - break; + continue; /* * If CDP is active include peer * domain's usage to ensure there