Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2316432rdb; Wed, 21 Feb 2024 04:07:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUfsdB1ufJI47MMC6QdwVEq7QvNbtS+9kMIY/XeXYCUlI9PwgxFVfP8ED77jwLSlnNdqjkMhct5vfmi0GOAJ6beIOfFSakKjrg0jY2TQQ== X-Google-Smtp-Source: AGHT+IEO9eVDRCE9XFpP8Xwd5v0JfhSZlrSXKbOO26vYF1qajZayGmssyyjrVrXcK1dsqnWSCeAs X-Received: by 2002:ac2:4c4d:0:b0:512:d534:4851 with SMTP id o13-20020ac24c4d000000b00512d5344851mr1098523lfk.62.1708517224733; Wed, 21 Feb 2024 04:07:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708517224; cv=pass; d=google.com; s=arc-20160816; b=LyRMTStGscRZ5ziWnnnZ41bR9zkIhF7RtH4YqEydEi9y0elV1kxcTevJ1o0WmokHsr 0MtxK49oXoLwMHOTgtJLVsKjwogi9K+XKOp7RjvzHJ3A2WZWJCIlwkq+QRSQvoA+MuDw +51/4H0amezpnZz+EDH13sF5vt4EXIsLUiRZ/7WBnjQ56D4O6IFLXcLy1F10Djo0ufJb fcHbzGJ0w/mMl4nJ9QQGOyjIa6Rm/wNOy2Vhh0EfrU67Jg06hG96JduFmObd92hhMS4I Lw1VJ0iRNFwZ3nTJHphJUBw7U0gh6v2j83kDIzDu0qr3s4/wUR73i1N9CoRXB55hfm7I Q/SQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=o2kiLp4otjNMxNJ16EpHphhDjpCOmVrtkFaB2bExhI0=; fh=6qjwob9I63ITev3ImN2QRESUCrawKOdlELct2SdMzSQ=; b=JrhjncBllKtnLoClqJszKa1pQAuSqTQvbZPUDV5Bp8F+gAUWr/1MFYyb92VpOsmKGj URkpssuWjQIK1UcB5Bmap6PMQ8TBF5sxbxFZebr8yVyR5ufxGZeYIXFePsg4Dg5OBmnE TChS9zRVbx2H8H2eq32TgYaNIUXrUpZzMuKNhzGLEeJHZ04aw73RNq7JDBX3un1gax1U eRMdzQJmge8YUF51I8rNSXgAj2SsVcmfGhANyqnkKZ3v3CFqgy9xnD6G78BKt9iC4zj/ wAqHLxlASVELxtZ/GfvUqOlUNTIhVY4LT3uEvl5huDrKhV+KYblODj1kWuhOy3Gbr8jf z52w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-74684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74684-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h28-20020a50cddc000000b0056382b02f44si4429372edj.37.2024.02.21.04.07.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 04:07:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-74684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74684-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 738271F22BFB for ; Wed, 21 Feb 2024 12:07:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0F724DA08; Wed, 21 Feb 2024 12:06:53 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A52B4E1B3 for ; Wed, 21 Feb 2024 12:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708517213; cv=none; b=nneFwTO0Nrj+OkI2B9i9XwOmYqU9R80hZIeO/sPRrBv7DKaO7P61lj5vNz4e6VEpkzYi52Ju2qTcMWIQFdXHGItIHcn6o55easyqxNJdig4uP3JdjveDqV8f6+SC+RxYLvK41HQUI4UJHRsQu7fJrIRFVA5vKVILlffUE1HM84o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708517213; c=relaxed/simple; bh=TbXTSyKoJMZy0xDnmGuwLUxJ+iI+gkmKCkVN0X/w7UE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IAB83B4+V95+YbAiD3kzPlLh4RGGcwRWb/8gvqwychvqBgfnG9MgTnDVJdaYYoLZjGl0GffwbYwdqwBt0Rzc40ss6ygGlEbvmoGIWs14uE9370N1HcU4rD+HduXTsIXpq5MonM7OFCFYTUPlQwsy64sQJXiGqCeRuB8wiHpYteo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 603DD1007; Wed, 21 Feb 2024 04:07:29 -0800 (PST) Received: from [10.1.197.60] (eglon.cambridge.arm.com [10.1.197.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CBBD13F762; Wed, 21 Feb 2024 04:06:47 -0800 (PST) Message-ID: <88097441-534d-4b81-9801-680334092ab8@arm.com> Date: Wed, 21 Feb 2024 12:06:46 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86/resctrl: Fix WARN in get_domain_from_cpu() Content-Language: en-GB To: Tony Luck , "Chatre, Reinette" , Thomas Gleixner Cc: Borislav Petkov , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "Yu, Fenghua" , Ingo Molnar , H Peter Anvin , Babu Moger , "shameerali.kolothum.thodi@huawei.com" , D Scott Phillips OS , "carl@os.amperecomputing.com" , "lcherian@marvell.com" , "bobo.shaobowang@huawei.com" , "tan.shaopeng@fujitsu.com" , "baolin.wang@linux.alibaba.com" , Jamie Iles , Xin Hao , "peternewman@google.com" , "dfustini@baylibre.com" , "amitsinght@marvell.com" , David Hildenbrand References: <20240213184438.16675-1-james.morse@arm.com> <20240217105543.GAZdCQr_nosDP4tGuO@fat_crate.local> <87zfvwieli.ffs@tglx> From: James Morse In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Tony, On 21/02/2024 00:34, Tony Luck wrote: > reset_all_ctrls() and resctrl_arch_update_domains() use > on_each_cpu_mask() to call rdt_ctrl_update() on potentially > one CPU from each domain. > > But this means rdt_ctrl_update() needs to figure out which domain > to apply changes to. Doing so requires a search of all domains > in a resource, which can only be done safely if cpus_lock is > held. Both callers do hold this lock, but there isn't a way > for a function called on another CPU via IPI to verify this. > > Fix by adding the target domain to the msr_param structure and > calling for each domain separately using smp_call_function_single() Cunning - this trades the memory allocation for multiple IPI. I think this is much better for the case where only the local domains configuration is modified. With the double-IPI when both CDP configurations are changed fixed: Reviewed-by: James Morse I think we should rip out the false positive check, I'll post a patch to do that. I'll double check this was the only IPI path, if so its safe again after this patch and we can add lockdep_assert_cpus_held(). If anyone ever hits this during a bisect its should be clear(er). Thanks, James