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]
Message-ID: <20201008134942.GC2429573@rani.riverdale.lan>
Date:   Thu, 8 Oct 2020 09:49:42 -0400
From:   Arvind Sankar <nivedita@...m.mit.edu>
To:     Joerg Roedel <jroedel@...e.de>
Cc:     Arvind Sankar <nivedita@...m.mit.edu>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/5] x86/boot/64: Change add_identity_map() to take size
 for ease of use

On Thu, Oct 08, 2020 at 11:14:12AM +0200, Joerg Roedel wrote:
> On Wed, Oct 07, 2020 at 03:53:49PM -0400, Arvind Sankar wrote:
> > Change back the arguments of add_identity_map() to (start, size) instead
> > of (start, end). This reverts
> > 
> >   21cf2372618e ("x86/boot/compressed/64: Change add_identity_map() to take start and end")
> > 
> > since we will soon have more callers that know the size rather than the
> > end address.
> > 
> > This also makes the #PF handler print the original CR2 value in case of
> > error, instead of after aligning to PMD_SIZE.
> > 
> > Signed-off-by: Arvind Sankar <nivedita@...m.mit.edu>
> > ---
> >  arch/x86/boot/compressed/ident_map_64.c | 11 ++++-------
> >  1 file changed, 4 insertions(+), 7 deletions(-)
> > 
> > diff --git a/arch/x86/boot/compressed/ident_map_64.c b/arch/x86/boot/compressed/ident_map_64.c
> > index 063a60edcf99..070cda70aef3 100644
> > --- a/arch/x86/boot/compressed/ident_map_64.c
> > +++ b/arch/x86/boot/compressed/ident_map_64.c
> > @@ -90,8 +90,9 @@ static struct x86_mapping_info mapping_info;
> >  /*
> >   * Adds the specified range to the identity mappings.
> >   */
> > -static void add_identity_map(unsigned long start, unsigned long end)
> > +static void add_identity_map(unsigned long start, unsigned long size)
> >  {
> > +	unsigned long end = start + size;
> 
> This has been discussed during the SEV-ES patch-review already and we
> settled on making add_identity_map() take start and end as parameter, as
> that is what kernel_ident_mapping_init() also takes as parameters.
> 
> So please keep it that way :)
> 
> Regards,
> 
> 	Joerg

At the time, it was one caller knowing end and one knowing size, but now
there are two more callers that only know the size, so it seemed easier
to have add_identity_map() do the conversion.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ