From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 507A91442F4 for ; Thu, 7 Aug 2025 08:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754554121; cv=none; b=LjG+fFAULarYr7mW+r2gi4S/4D+00eVO9kk70An35q5Xmi2ueOMcIG8Z+CY4pf0rxLF8DxlxQTJgjeHPX1UFFWsQOLVHtGJCa1yznzSK0bjG042KauD2V2HHBrN0l+4r/AoL3ytOCiF+aV56Zat2iv6/Jwb3hLMXslia9FYoZMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754554121; c=relaxed/simple; bh=JCjp51GetSGxJBSbju8WEKymJlfBVo038kfQlZQ8YKE=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=gfHiXei6ujENgsx+G6qKh5HtxIHsPJuoEAcq5GtE+ifDlDjH/JcoCUIPanmLEdHbc0Wnl+CXCnKqlQXZVR6uD8hHv298vdTYrtw+e5+hUS+7g4Zd4PCI3wbR/5SKD98xQPLiMJ1uTwwsdGULCJpzvqMlHM1e7Db5u8WlO5KWtiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WPEJYhOT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WPEJYhOT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8A7AC4CEEB; Thu, 7 Aug 2025 08:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754554120; bh=JCjp51GetSGxJBSbju8WEKymJlfBVo038kfQlZQ8YKE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WPEJYhOT6hOQ3atLqNwK4S8HXVgi4w8J7j2F+rhma3uNR3JIjJCtjRFxd70gNbGJh qxpqBnxdr7KSBkOONBN2mm+XMtXnam2/toGcNPLQwJqbTRZOXC4q+cAvro8QKyypYZ kRrERMgqt1y9V5uidKwIV3d5vceB4xSLbaot9RsIwGOqNFIYn+BHz7+CbsAxSubPDn X4jiUzrlGUZhiCyl74XOmtHLSy0pa/RzXIYIAtTiSTL8g4EBQVbx1zAfr+0xOqjbdG D6fSxMjZgCuDZeSz8tvlEAFEGvkTvvn71I+na2wEFyZr62JZoFlsegyvahmR30BCly ZIiy7dYVab2gQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ujvfn-004mcZ-6S; Thu, 07 Aug 2025 09:08:27 +0100 Date: Thu, 07 Aug 2025 09:08:26 +0100 Message-ID: <864iuja70l.wl-maz@kernel.org> From: Marc Zyngier To: Palmer Dabbelt Cc: Catalin Marinas , Mark Rutland , Will Deacon , oliver.upton@linux.dev, james.morse@arm.com, cohuck@redhat.com, anshuman.khandual@arm.com, palmerdabbelt@meta.com, lpieralisi@kernel.org, kevin.brodsky@arm.com, scott@os.amperecomputing.com, broonie@kernel.org, james.clark@linaro.org, yeoreum.yun@arm.com, joey.gouly@arm.com, huangxiaojia2@huawei.com, yebin10@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: Expose CPUECTLR{,2}_EL1 via sysfs In-Reply-To: <20250806194812.46598-2-palmer@dabbelt.com> References: <20250806194812.46598-2-palmer@dabbelt.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: palmer@dabbelt.com, catalin.marinas@arm.com, mark.rutland@arm.com, will@kernel.org, oliver.upton@linux.dev, james.morse@arm.com, cohuck@redhat.com, anshuman.khandual@arm.com, palmerdabbelt@meta.com, lpieralisi@kernel.org, kevin.brodsky@arm.com, scott@os.amperecomputing.com, broonie@kernel.org, james.clark@linaro.org, yeoreum.yun@arm.com, joey.gouly@arm.com, huangxiaojia2@huawei.com, yebin10@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 06 Aug 2025 20:48:13 +0100, Palmer Dabbelt wrote: > > From: Palmer Dabbelt > > We've found that some of our workloads run faster when some of these > fields are set to non-default values on some of the systems we're trying > to run those workloads on. This allows us to set those values via > sysfs, so we can do workload/system-specific tuning. > > Signed-off-by: Palmer Dabbelt > --- > I've only really smoke tested this, but I figured I'd send it along because I'm > not sure if this is even a sane thing to be doing -- these extended control > registers have some wacky stuff in them, so maybe they're not exposed to > userspace on purpose. IIUC firmware can gate these writes, though, so it > should be possible for vendors to forbid the really scary values. That's really wrong. For a start, these encodings fall into the IMPDEF range. They won't exist on non-ARM implementations. Next, this will catch fire as a guest, either because the hypervisor will simply refuse to entertain letting it access registers that have no definition, or because the VM has been migrated from one implementation to another, and you have no idea this is doing on the new target. > > That said, we do see some performance improvements here on real workloads. So > we're hoping to roll some of this tuning work out more widely, but we also > don't want to adopt some internal interface. Thus it'd make our lives easier > if we could twiddle these bits in a standard way. Honestly, this is the sort of bring-up stuff that is better kept in your private sandbox, and doesn't really help in general. Thanks, M. -- Without deviation from the norm, progress is not possible.