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 8ACAB19E836 for ; Thu, 31 Oct 2024 13:10:40 +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=1730380240; cv=none; b=E9tf6daebmVzF3sHvVKKHnIcrVEo/MgaMs7G9V8li+l/IcRW9rTnrIPQqNzzsVv+TZhbyL8rPcLhVG0v4Ay8cwzrwWoB10WGYTITidUBiWMLmOzcpwMutuVwNTSrY7vULM8zpXi7MaMrsfJrXQm1gr+dzSORBLX2nXsuAHjPgUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730380240; c=relaxed/simple; bh=oCQiTJLRfPp/6kPFjAHkgEl5HJsM0xhf/6uOgNP0GPg=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=N4GIeH67EDieqsY2gj7jYC8WhKyIB1zIRYjaaUM0pSwkVllPx80oSnPhGVghQHv300I8B9A2o5rwvznrT2CvE6dmqI8EIeG/0b0EcaJjDifKefXI6TvR7aGIPhjlqOcL+8Zm21c+F/6ojlkKnAQPYTblTQ5Bdk+YMVNaMTIJ9/Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Klt25/4f; 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="Klt25/4f" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21AF2C4FEA5; Thu, 31 Oct 2024 13:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730380240; bh=oCQiTJLRfPp/6kPFjAHkgEl5HJsM0xhf/6uOgNP0GPg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Klt25/4fLBa+ebQ48URjP1Bl5DC4C2QXhEVRMI7tAq8dXgtymsVOogxOZU5l3ewjy jcuN9l+iXIArQK6Qc+2QXaoFOh0iq7hzThGWCCVwsr9JfR0Wfdb9z4lUofCb01WQ4M KBJN6ivvgEc5SOokNIvFzd/ex3JiM8kBc8XHMLOU1BiYhBSPClB+wHTWKBxcPzs0Ga FWKw9pabfgD5vkMxCHypLRTpIFN5NfkCcJPLUPELXWaUpQraqiZWvrn/6YOiEiup4U xR068vDSFN29ktWMKNPUz5MahwG+ue7GXdkMUB4g3C6LaLWtJff9cOc5WqcMn4Zx7w QZ6SzL1VHDSFQ== 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 1t6Uwf-008ZOj-Sr; Thu, 31 Oct 2024 13:10:37 +0000 Date: Thu, 31 Oct 2024 13:10:37 +0000 Message-ID: <86ttcs1kqa.wl-maz@kernel.org> From: Marc Zyngier To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, anshuman.khandual@arm.com, gshan@redhat.com, james.morse@arm.com, shameerali.kolothum.thodi@huawei.com, Oliver Upton , Suzuki K Poulose , Zenghui Yu , Jing Zhang , Catalin Marinas , Will Deacon Subject: Re: [PATCH v6 5/7] KVM: arm64: Add a macro for creating filtered sys_reg_descs entries In-Reply-To: <20241030160317.2528209-6-joey.gouly@arm.com> References: <20241030160317.2528209-1-joey.gouly@arm.com> <20241030160317.2528209-6-joey.gouly@arm.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/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev 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: joey.gouly@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, anshuman.khandual@arm.com, gshan@redhat.com, james.morse@arm.com, shameerali.kolothum.thodi@huawei.com, oliver.upton@linux.dev, suzuki.poulose@arm.com, yuzenghui@huawei.com, jingzhangos@google.com, catalin.marinas@arm.com, will@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, 30 Oct 2024 16:03:15 +0000, Joey Gouly wrote: > > From: James Morse > > The sys_reg_descs array holds function pointers and reset value for > managing the user-space and guest view of system registers. These > are mostly created by a set of macro's as only some combinations > of behaviour are needed. > > If a register needs special treatment, its sys_reg_descs entry is > open-coded. This is true of some id registers where the value provided > by user-space is validated by some helpers. > > Before adding another one of these, add a helper that covers the > existing special cases. 'ID_FILTERED' expects helpers to set the > user-space value, and retrieve the modified reset value. > > Like ID_WRITABLE() this uses id_visibility(), which should have no functional > change for the registers converted to use ID_FILTERED(). > > read_sanitised_id_aa64dfr0_el1() and read_sanitised_id_aa64pfr0_el1() have been > refactored to be called kvm_read_sanitised_id_reg(), to try be consistent with nit: called *from*? > ID_WRITABLE(). > > Signed-off-by: James Morse > Signed-off-by: Joey Gouly > Reviewed-by: Gavin Shan > Tested-by: Shameer Kolothum Thanks, M. -- Without deviation from the norm, progress is not possible.