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: <20201209131946.GA6495@ashkalra_ubuntu_server>
Date:   Wed, 9 Dec 2020 13:19:46 +0000
From:   Ashish Kalra <ashish.kalra@....com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     konrad.wilk@...cle.com, hch@....de, tglx@...utronix.de,
        mingo@...hat.com, hpa@...or.com, x86@...nel.org, luto@...nel.org,
        peterz@...radead.org, dave.hansen@...ux-intel.com,
        iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
        brijesh.singh@....com, Thomas.Lendacky@....com, Jon.Grimm@....com,
        rientjes@...gle.com
Subject: Re: [PATCH v8] swiotlb: Adjust SWIOTBL bounce buffer size for SEV
 guests.

On Wed, Dec 09, 2020 at 01:54:42PM +0100, Borislav Petkov wrote:
> On Wed, Dec 09, 2020 at 12:29:07PM +0000, Ashish Kalra wrote:
> > As i mentioned in the main comments above, this cannot be called in
> > mem_encrypt_init() as that breaks reserve_crashkernel() which depends
> > on SWIOTLB buffer size
> 
> Please elaborate how does it break.
> 

reserve_crashkernel() calls swiotlb_size_or_default() to get SWIOTLB
buffer size and then accordingly allocates low memory for crashkernel. 
If SWIOTLB buffer size is adjusted after reserve_crashkernel() and
swiotlb_size_or_default(), then SWIOTLB buffers will overlap the memory
reserved for crashkernel. Hence any SWIOTLB buffer adjustment needs to
be done before or in swiotlb_size_or_default(), but Konrad is not in
favor of modifying swiotlb_size_or_default(), hence this separate
swiotlb_adjust() interface is introduced. 

> > and is called before mem_encrypt_init(), therefore, it needs to be
> > called from setup_atch() before reserve_crashkernel().
> 
> I know you have your requirements what needs to be called when like all
> the other vendors who want to run stuff early in a particular order but
> our boot init order is a single fragile mess. So this better be done
> right!
> 
> Also,
> 
> [    0.016630] software IO TLB: swiotlb_adjust:
> [    0.017005] reserve_crashkernel:
> [    0.050523] software IO TLB: swiotlb_init:
> 
> this looks strange - we're doing a swiotlb size adjust before init.
> 
> It probably makes sense as in: adjust the size before the SWIOTLB is
> initialized so that it uses the correct size but this better be spelled
> out.
> 

Yes the adjustment is done before init. 

> > I believe that other memory encryption architectures such as s390 are
> > also looking for something similar to be available.
> 
> Until you have something more palpable than belief, "let the others
> extend it when they really need it." as I already mentioned.

There is a need to introduce an architecture specific callback
for swiotlb_adjust() because of the following reason :

The sev_active() function is only available to x86, so this will break
other archs, if we use this function in generic swiotlb code.

Therefore, we need arch-specific callback/interface to be invoked from
generic swiotlb code to do the SEV specific actions such as SWIOTLB
buffer size adjustment.

Thanks,
Ashish

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ