All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Oliver Upton <oliver.upton@linux.dev>,
	Mark Brown <broonie@kernel.org>,
	Ryan Roberts <ryan.roberts@arm.com>,
	kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 2/2] arm64/sysreg: Replace TCR_EL1 field macros
Date: Fri, 29 Aug 2025 09:13:20 +0100	[thread overview]
Message-ID: <867bymeean.wl-maz@kernel.org> (raw)
In-Reply-To: <20250829060215.1086792-3-anshuman.khandual@arm.com>

On Fri, 29 Aug 2025 07:02:15 +0100,
Anshuman Khandual <anshuman.khandual@arm.com> wrote:
> 
> This just replaces all used TCR_EL1 field macros with tools sysreg variant
> based fields and subsequently drops them from the header (pgtable-hwdef.h)
> and moves them into KVM header (asm/kvm_arm.h) for continued usage in KVM.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: kvmarm@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> Changes in V2:
> 
> - Dropped all TCR_EL1 replacements from KVM code
> - Moved existing TCR_XXX macros from (asm/pgtable-hwdef.h) into KVM header
>   (asm/kvm_arm.h) for their continued usage
> 
>  arch/arm64/include/asm/assembler.h     |   6 +-
>  arch/arm64/include/asm/cputype.h       |   2 +-
>  arch/arm64/include/asm/kvm_arm.h       |  92 +++++++++++++++++++++++
>  arch/arm64/include/asm/mmu_context.h   |   4 +-
>  arch/arm64/include/asm/pgtable-hwdef.h | 100 +------------------------
>  arch/arm64/include/asm/pgtable-prot.h  |   2 +-
>  arch/arm64/kernel/cpufeature.c         |   4 +-
>  arch/arm64/kernel/pi/map_kernel.c      |   8 +-
>  arch/arm64/kernel/vmcore_info.c        |   2 +-
>  arch/arm64/mm/proc.S                   |  36 +++++----
>  tools/arch/arm64/include/asm/cputype.h |   2 +-
>  11 files changed, 134 insertions(+), 124 deletions(-)
>

[...]

> diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
> index 1da290aeedce..ad3c305c6374 100644
> --- a/arch/arm64/include/asm/kvm_arm.h
> +++ b/arch/arm64/include/asm/kvm_arm.h
> @@ -107,6 +107,98 @@
>  
>  #define MPAMHCR_HOST_FLAGS	0
>  
> +#define TCR_T0SZ_OFFSET		0
> +#define TCR_T1SZ_OFFSET		16

These are unused by KVM.

> +#define TCR_TxSZ(x)		(TCR_T0SZ(x) | TCR_T1SZ(x))
> +#define TCR_TxSZ_WIDTH		6
> +#define TCR_T0SZ_MASK		(((UL(1) << TCR_TxSZ_WIDTH) - 1) << TCR_T0SZ_OFFSET)
> +#define TCR_T1SZ_MASK		(((UL(1) << TCR_TxSZ_WIDTH) - 1) << TCR_T1SZ_OFFSET)

[eyeroll]

Why do you need to repeat all of this, while you just introduced
new definitions? Surely you can write a script that express one in
term of the other, and add that to KVM, instead of just blindly moving
stuff around?

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2025-08-29  8:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29  6:02 [PATCH V2 0/2] arm64/sysreg: Clean up TCR_EL1 field macros Anshuman Khandual
2025-08-29  6:02 ` [PATCH V2 1/2] arm64/sysreg: Update TCR_EL1 register Anshuman Khandual
2025-08-29  6:02 ` [PATCH V2 2/2] arm64/sysreg: Replace TCR_EL1 field macros Anshuman Khandual
2025-08-29  8:13   ` Marc Zyngier [this message]
2025-08-29 13:34     ` Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867bymeean.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=anshuman.khandual@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=ryan.roberts@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.