Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp828508lqs; Fri, 14 Jun 2024 06:59:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVt5qbmFMZf7bJRrQRGqi846N7hW3hDZWCAJwyYORsrdT35XpIfkCvRxu2J9gQhV3iol92xSmQ0gKQjcH2Wq30xuQFbFjrtUvTXOZuUJA== X-Google-Smtp-Source: AGHT+IFqbdyV1HGE/xfflZaMIkQLinKvIIG4VVf2PL9kva2KnmeVA0ZrKCeHx67k/14pNsbT+w8B X-Received: by 2002:a17:906:c40e:b0:a6e:f6b0:c4a4 with SMTP id a640c23a62f3a-a6f60dc7fd8mr182168066b.57.1718373550576; Fri, 14 Jun 2024 06:59:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718373550; cv=pass; d=google.com; s=arc-20160816; b=UjLQEvhG1q1/VKNZyGdeGEOoyEqjiAAsmpNMbut7c2Nyfzks+oaS/H/p2H8gwXEJNO Flib3DuSyCKCd4YgFQ5jYVKpDPwpSZWAviF7rILUnvRxCPVKQHQhZkCwnziN+8hPH3cX y2VC/yr9/XRcVN5ePkK/o1lbjjs1etWKAE0oZb39rgbsVvcctkANkHs/2u9bBT5VwSx6 wrzdGuAX+m3oV5mwRvytiJ078gkPF6ufS9BUCUu00KVkdyKn4EzUg/huBhG15R0nBoy1 lDyh+Nov/DaPjcfy0Xc7/lGMMrwAaWBQYjrzL/7RJbZcnvFjoOf9wonT8txLygFT3aSD fZiA== 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=Uq4k9Ymzq711iCehq/BdJsgxVuC5YugWt7NSAxmw7N0=; fh=7upIMgUtviq1CkRSbyJ4u+IAMHcjlETsAITaLiAseHQ=; b=wlcJAoRnYMFxLvfeaVJIl0+zl8XMrMgZdYxOFhMFePJPCSCqDMMPMvaUuDXEhl7bZF x2Grf512ZUfRFtCMPs8HGeb8jncQwwWq9tklOGmO3y1Wjmg3uR8FAuO0PV4VRydFQqzs JPN+z4x3gpjYb/vyhLF0JPrHgN9njt/NbeRFNBiMCaKBUoB0GxEsvk0HfeonfKAjaJGL qVoLSoNBXY63zCWK2gBYPwwLVYjRkTTC9RfOotCKLYQKmPQMv9oZOHsbNjFRVS9dC4/j 3uu/7crwTGDElTl2dxoKHKeA+fMa3ZZ70BcEI1p0NsqmqsaE1+UYZX2oBrAg1YlOpWgl 1OVQ==; 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-214972-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214972-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 a640c23a62f3a-a6f65306015si71410166b.721.2024.06.14.06.59.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 06:59:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214972-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-214972-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214972-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 7EA771F28680 for ; Fri, 14 Jun 2024 13:58:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FE65C2E3; Fri, 14 Jun 2024 13:58:03 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDBDABA38 for ; Fri, 14 Jun 2024 13:58:00 +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=1718373482; cv=none; b=HlRatek7b1pCFWDXFP/jYedI3Z7HXrZskie2GL3QDNeWKqnrpdQ+JHO/dDcw3LA4btXVxg3n523NirDxKyBf1B6HGosFpSoVcbVgXFOBb0f8ZqIjFgQwYzASSaqkZTGPTAo0AXQ6EjnRm8Ic4PS2CvYCQTas3+q4fc8809doOkI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718373482; c=relaxed/simple; bh=yDvO26kar2hp3dxA/NNKku9cZonyj7JnpLHyF9Ib5gE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=J/uRJ59Y9OLSFOlaD3anCecFtqX69cIvsXzHXlEHCqJCX74cI7cUpkP7+jGCr8CH/LCj0rEi93xp/Jrm15ZKbytthuvk4Q2nvrWuJ5MuJO/n8uhc7wSgdPYpCYWnv3GACf6+E7iwccAJcCYlNQBPSXpaD1+s2L+mMe+echQdSow= 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 A1EF31480; Fri, 14 Jun 2024 06:58:24 -0700 (PDT) Received: from [10.1.196.28] (eglon.cambridge.arm.com [10.1.196.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 634763F8A4; Fri, 14 Jun 2024 06:57:54 -0700 (PDT) Message-ID: Date: Fri, 14 Jun 2024 14:57:52 +0100 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 v1 18/31] x86/resctrl: Allow resctrl_arch_mon_event_config_write() to return an error Content-Language: en-GB To: Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , 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 , Rex Nie , Dave Martin References: <20240321165106.31602-1-james.morse@arm.com> <20240321165106.31602-19-james.morse@arm.com> From: James Morse In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Reinette, On 09/04/2024 04:23, Reinette Chatre wrote: > On 3/21/2024 9:50 AM, James Morse wrote: >> resctrl_arch_mon_event_config_write() writes a bitmap of events provided >> by user-space into the configuration register for the monitors. >> >> This assumes that all architectures support all the features each bit >> corresponds to. >> >> MPAM can filter monitors based on read, write, or both, but there are >> many more options in the existing bitmap. To allow this interface to >> work for machines with MPAM, allow the architecture helper to return >> an error if an incompatible bitmap is set. >> >> When valid values are provided, there is no change in behaviour. If >> an invalid value is provided, currently it is silently ignored, but >> last_cmd_status is updated. After this change, the parser will stop >> at the first invalid value and return an error to user-space. This >> matches the way changes to the schemata file are made. >> > > Is this needed? With move of mbm_cfg_mask to rdt_resource I expect > MPAM would use it to set what the valid values are. With that done, > when user space provides a value, mon_config_write() compares user > provided value against mbm_cfg_mask and will already return early > (before attempting to write to hardware) with error > if value is not supported. This seems to accomplish the goal of this > patch? Aha, this is done in mon_config_write(), not mbm_config_write_domain(). I'd missed that. I'll drop this patch. Thanks! James