lkml.org 
[lkml]   [2022]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: "dma-mapping: remove CONFIG_DMA_REMAP" causes AMD SME boot fail
On Wed, Mar 30, 2022 at 03:17:20PM -0400, Alex Xu (Hello71) wrote:
> Excerpts from Christoph Hellwig's message of March 30, 2022 2:01 pm:
> > Can you try this patch, which is a bit of a hack?
> >
> > diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
> > index 50d209939c66c..61997c2ee0a17 100644
> > --- a/arch/x86/mm/mem_encrypt.c
> > +++ b/arch/x86/mm/mem_encrypt.c
> > @@ -28,7 +28,8 @@ bool force_dma_unencrypted(struct device *dev)
> > * device does not support DMA to addresses that include the
> > * encryption mask.
> > */
> > - if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) {
> > + if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT) &&
> > + !get_dma_ops(dev)) {
> > u64 dma_enc_mask = DMA_BIT_MASK(__ffs64(sme_me_mask));
> > u64 dma_dev_mask = min_not_zero(dev->coherent_dma_mask,
> > dev->bus_dma_limit);
> >
>
> This seems to work for me.

Ok, I'll try to come up with a less hacky version and will start a
discussion with the AMD folks that know memory encryption better.
Thanks for the report and testing already!

\
 
 \ /
  Last update: 2022-03-31 06:20    [W:0.047 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site