2024-02-19 15:28:03

by Marc Zyngier

[permalink] [raw]
Subject: Re: next-20240219: arm64: boot failed - gic_of_init

On Mon, 19 Feb 2024 14:46:46 +0000,
Zenghui Yu <[email protected]> wrote:
>
> On 2024/2/19 19:32, Marc Zyngier wrote:
> > For what it is worth, I've just tested both defconfig and my own
> > configuration with both 4k (kvmtool, QEMU+KVM and on SynQuacer) and
> > 16k (kvmtool), without any obvious problem.
>
> I had a quick test on top of next-20240219 with defconfig. I can
> reproduce it with QEMU parameter '-cpu max -accel tcg', but things are
> fine with '-cpu max,lpa2=off -accel tcg'.
>
> Bisection shows that the problem happens when we start putting the
> latest arm64 and kvmarm changes together. The following hack fixes the
> problem for me (but I **only** write it for kernel built with defconfig
> with ARM64_4K_PAGES=y atm).
>
> I can investigate it further tomorrow (as it's too late now ;-) ). Or
> maybe Marc or Catalin can help fix it with a proper approach.
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 4f7662008ede..babdc3f4721b 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -2798,6 +2798,7 @@ static const struct arm64_cpu_capabilities
> arm64_features[] = {
> | .sign = FTR_SIGNED,
> | .field_pos = ID_AA64MMFR0_EL1_TGRAN4_SHIFT,
> | .min_field_value = ID_AA64MMFR0_EL1_TGRAN4_52_BIT,
> |+ .max_field_value = BIT(ID_AA64MMFR0_EL1_TGRAN4_WIDTH - 1) - 1,
> | #else
> | .sign = FTR_UNSIGNED,
> | .field_pos = ID_AA64MMFR0_EL1_TGRAN16_SHIFT,

I've posted my take on this at [1], which hopefully matches what you
were aiming at.

Thanks,

M.

[1] https://lore.kernel.org/all/[email protected]/


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


2024-02-20 10:32:56

by Naresh Kamboju

[permalink] [raw]
Subject: Re: next-20240219: arm64: boot failed - gic_of_init

On Mon, 19 Feb 2024 at 20:57, Marc Zyngier <[email protected]> wrote:
>
> On Mon, 19 Feb 2024 14:46:46 +0000,
> Zenghui Yu <[email protected]> wrote:
> >
> > On 2024/2/19 19:32, Marc Zyngier wrote:
> > > For what it is worth, I've just tested both defconfig and my own
> > > configuration with both 4k (kvmtool, QEMU+KVM and on SynQuacer) and
> > > 16k (kvmtool), without any obvious problem.
> >
> > I had a quick test on top of next-20240219 with defconfig. I can
> > reproduce it with QEMU parameter '-cpu max -accel tcg', but things are
> > fine with '-cpu max,lpa2=off -accel tcg'.
> >
> > Bisection shows that the problem happens when we start putting the
> > latest arm64 and kvmarm changes together. The following hack fixes the
> > problem for me (but I **only** write it for kernel built with defconfig
> > with ARM64_4K_PAGES=y atm).
> >
> > I can investigate it further tomorrow (as it's too late now ;-) ). Or
> > maybe Marc or Catalin can help fix it with a proper approach.
> >
> > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> > index 4f7662008ede..babdc3f4721b 100644
> > --- a/arch/arm64/kernel/cpufeature.c
> > +++ b/arch/arm64/kernel/cpufeature.c
> > @@ -2798,6 +2798,7 @@ static const struct arm64_cpu_capabilities
> > arm64_features[] = {
> > | .sign = FTR_SIGNED,
> > | .field_pos = ID_AA64MMFR0_EL1_TGRAN4_SHIFT,
> > | .min_field_value = ID_AA64MMFR0_EL1_TGRAN4_52_BIT,
> > |+ .max_field_value = BIT(ID_AA64MMFR0_EL1_TGRAN4_WIDTH - 1) - 1,
> > | #else
> > | .sign = FTR_UNSIGNED,
> > | .field_pos = ID_AA64MMFR0_EL1_TGRAN16_SHIFT,
>
> I've posted my take on this at [1], which hopefully matches what you
> were aiming at.

This patch [1] applied on Linux next-20240219 and tested and the boot
test passed.
I have validated today's Linux next-20240220 and the boot test passed.

> Thanks,
>
> M.
>
> [1] https://lore.kernel.org/all/[email protected]/

- Naresh