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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 16 Nov 2022 17:48:00 +0800
From:   章瑋麟 <r09922117@...e.ntu.edu.tw>
To:     Marc Zyngier <maz@...nel.org>
Cc:     james.morse@....com, alexandru.elisei@....com,
        suzuki.poulose@....com, oliver.upton@...ux.dev,
        catalin.marinas@....com, will@...nel.org,
        linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
        kvmarm@...ts.cs.columbia.edu, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: arm64: Update comment of create_hyp_mappings

On Sat, Nov 12, 2022 at 12:18 AM Marc Zyngier <maz@...nel.org> wrote:
> My problem with this comment is that neither va_mask, tag_val, nor
> tag_lsb mean anything in this context. All this is purely internal to
> kvm_compute_layout(), and is unnecessary here.
>
> I'd rather you have something along the lines of:
>
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index 60ee3d9f01f8..6d04818a1a5b 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -460,7 +460,7 @@ void kvm_unshare_hyp(void *from, void *to)
>   * @prot:      The protection to be applied to this range
>   *
>   * The same virtual address as the kernel virtual address is also used
> - * in Hyp-mode mapping (modulo HYP_PAGE_OFFSET) to the same underlying
> + * in Hyp-mode mapping (modulo a random offset) to the same underlying
>   * physical pages.
>   */
>  int create_hyp_mappings(void *from, void *to, enum kvm_pgtable_prot prot)
>
> Whoever is interested in understanding the generation of the offset
> can follow kern_hyp_va().

Yes I agree, thanks for the advice.
I'll update the patch.

Wei-Lin Chang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ