lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+G9fYtKxd8C5W4e5sO93TMC77pRVyJYL8w+i6q988jHk6ztxw@mail.gmail.com>
Date: Thu, 13 Feb 2025 14:22:39 +0530
From: Naresh Kamboju <naresh.kamboju@...aro.org>
To: Marc Zyngier <maz@...nel.org>
Cc: Dan Carpenter <dan.carpenter@...aro.org>, kvmarm@...ts.linux.dev, 
	Linux ARM <linux-arm-kernel@...ts.infradead.org>, 
	open list <linux-kernel@...r.kernel.org>, virtualization@...ts.linux.dev, 
	Mark Brown <broonie@...nel.org>, Catalin Marinas <catalin.marinas@....com>, 
	Arnd Bergmann <arnd@...db.de>, Anders Roxell <anders.roxell@...aro.org>, 
	Aishwarya TCV <Aishwarya.TCV@....com>
Subject: Re: kvm: nVHE hyp panic at: __kvm_nvhe_kvm_hyp_handle_sysre

On Wed, 12 Feb 2025 at 19:30, Marc Zyngier <maz@...nel.org> wrote:
>
> On Wed, 12 Feb 2025 11:41:38 +0000,
> Dan Carpenter <dan.carpenter@...aro.org> wrote:
> >
> > On Tue, Feb 11, 2025 at 11:36:31AM +0000, Marc Zyngier wrote:
> > > For the crash at hand, which clearly shows nVHE, can you report
> > > whether the following hack fixes it for you?
> > >
> > >     M.
> >
> > No luck, I'm afraid.  It still crashes the same way.
>
> Right. It was one level deeper. The following change fixes it for
> me. YMMV.

Anders applied this patch and tested on rk3399-rock-pi-4b,
and confirmed that the regression is resolved.

Tested-by: Linux Kernel Functional Testing <lkft@...aro.org>

Link:
 - https://lkft.validation.linaro.org/scheduler/job/8119717#L1251

>
>         M.
>
> diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h
> index f838a45665f26..b899d815d272f 100644
> --- a/arch/arm64/kvm/hyp/include/hyp/switch.h
> +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h
> @@ -501,9 +501,22 @@ static inline bool handle_tx2_tvm(struct kvm_vcpu *vcpu)
>         return true;
>  }
>
> +/* Open-coded version of timer_get_offset() to allow for kern_hyp_va() */
> +static inline u64 hyp_timer_get_offset(struct arch_timer_context *ctxt)
> +{
> +       u64 offset = 0;
> +
> +       if (ctxt->offset.vm_offset)
> +               offset += *kern_hyp_va(ctxt->offset.vm_offset);
> +       if (ctxt->offset.vcpu_offset)
> +               offset += *kern_hyp_va(ctxt->offset.vcpu_offset);
> +
> +       return offset;
> +}
> +
>  static inline u64 compute_counter_value(struct arch_timer_context *ctxt)
>  {
> -       return arch_timer_read_cntpct_el0() - timer_get_offset(ctxt);
> +       return arch_timer_read_cntpct_el0() - hyp_timer_get_offset(ctxt);
>  }
>
>  static bool kvm_handle_cntxct(struct kvm_vcpu *vcpu)
>
> --
> Without deviation from the norm, progress is not possible.

--
Linaro LKFT
https://lkft.linaro.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ