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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 11 May 2011 11:40:45 +0100
From:	Catalin Marinas <catalin.marinas@....com>
To:	Sergei Shtylyov <sshtylyov@...sta.com>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Russell King - ARM Linux <linux@....linux.org.uk>
Subject: Re: [PATCH 20/19] ARM: LPAE: Invalidate the TLB before freeing the
 PMD

On Wed, 2011-05-11 at 11:31 +0100, Sergei Shtylyov wrote:
> > Similar to the PTE freeing, this patch introduced __pmd_free_tlb() which
> > invalidates the TLB before freeing a PMD page. This is needed because on
> > newer processors the entry in the upper page table may be cached by the
> > TLB and point to random data after the PMD has been freed.
> 
> > Signed-off-by: Catalin Marinas<catalin.marinas@....com>
> > ---
> 
> > This patch should be part of the LPAE series but I haven't included it in the
> > latest series post.
> 
> >   arch/arm/include/asm/tlb.h |   12 +++++++++++-
> >   1 files changed, 11 insertions(+), 1 deletions(-)
> 
> > diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
> > index f9f6ecd..ef72f19 100644
> > --- a/arch/arm/include/asm/tlb.h
> > +++ b/arch/arm/include/asm/tlb.h
> > @@ -181,8 +181,18 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
> >       tlb_remove_page(tlb, pte);
> >   }
> >
> > +static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
> > +                               unsigned long addr)
> > +{
> > +#ifdef CONFIG_ARM_LPAE
> > +     tlb_add_flush(tlb, addr);
> > +     tlb_flush(tlb);
> > +     pmd_free((tlb)->mm, pmdp);
> 
>     This is not a macro, so parens around 'tlb' are not needed.

True, just copy/paste error.
> 
> > +#endif
> > +}
> > +
> 
>     Perhaps a better style would be (as SubmittingPatches suggest):
> 
> +#ifdef CONFIG_ARM_LPAE
> +static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
> +                                 unsigned long addr)
> +{
> +       tlb_add_flush(tlb, addr);
> +       tlb_flush(tlb);
> +       pmd_free(tlb->mm, pmdp);
> +}
> +#else
> +static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
> +                                 unsigned long addr) {}
> +#endif
> +
> 
> WBR, Sergei

No real preference here though smaller number of lines changed in my
initial patch.

Thanks.

-- 
Catalin


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ