Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp200634lfu; Wed, 30 Mar 2022 20:41:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxroUDKoP4VgAR4vqjEsLIM4GFQIH2IbVFGUZ8L9PEAwCqOxuYjzxZmBIZox+iD+96JiXNp X-Received: by 2002:a65:6751:0:b0:363:43a5:c7e3 with SMTP id c17-20020a656751000000b0036343a5c7e3mr8837541pgu.46.1648698079927; Wed, 30 Mar 2022 20:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648698079; cv=none; d=google.com; s=arc-20160816; b=Etdy0jGNHCBoSsfbOzwNrgvs6Ha/ulDFwCnNmVBUjWCvdjDLwJyW+xDI3yXj3GUyZY p4Z+zoUIfsAZg21VD8/gaA0fWj9UqUKalSxEOVM4i9v7FgfdODPd/Q889pOztF+osmoX UMhjAhwgVkqc2z/HEqBYcv0zRO5Mt8QvDwjrq7xMyDRrDVsoS1gx89IPOSfQlrAuvi9w 3//Uutk/q/XcCDrxAFYL1fAmgDfAPiBSPYjxTVKwcPlPeFzNQjhvsZ76qrP9uHk8fklg HgWvKAzlR4klFdG30AxMFVSrMQjsLSU/d25ISEgqIOPf6gPtKUZUHLALprJG0WVXllTZ lw2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id :mime-version:in-reply-to:references:cc:to:subject:from:date :dkim-signature; bh=bYSTBk56y7nX0vPVoAF05dNkFgg/1tnbzT061YMXM2k=; b=OvWjmHUaEIr1JqjCQyqjSvZdgNLN1klWJN6wzDX0GIfWl4Ki4DBR8g6rjFttGB1jwE LW6YlIJnNgylye/VWGA3UGJwIE+hKmMuB9SgD1UyX0EXsEz0h+xSz7Xi01pA1gjpAREf J1fGVs7Hymf4hlDySw1Hvsbp/xohaX3Vjk6oipL6V2dOeA8SKmy9U2ag7/TG+JqVnfE1 oAczBarQUApwYU3doQrAUSr4vICx1KfENMRmNwBiGO5AUSXnlF89Kh32wC3KOSLaYy9F 0J3rVwLqaVd2GAmoG/7AHmw3vZ/mHvrk0J+4uHbNZplIpLuu4sJElh+tG6rRavN0wUB/ JE0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.ca header.s=s2048 header.b=KiVoQpVu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.ca Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a13-20020a170902eccd00b00153be60734fsi25285970plh.363.2022.03.30.20.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:41:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.ca header.s=s2048 header.b=KiVoQpVu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.ca Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5FEBE885D; Wed, 30 Mar 2022 20:00:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350831AbiC3TUF (ORCPT + 99 others); Wed, 30 Mar 2022 15:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350620AbiC3TT6 (ORCPT ); Wed, 30 Mar 2022 15:19:58 -0400 Received: from sonic312-24.consmr.mail.gq1.yahoo.com (sonic312-24.consmr.mail.gq1.yahoo.com [98.137.69.205]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 287DC996A4 for ; Wed, 30 Mar 2022 12:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s2048; t=1648667849; bh=bYSTBk56y7nX0vPVoAF05dNkFgg/1tnbzT061YMXM2k=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From:Subject:Reply-To; b=KiVoQpVu2IEkIWY9oSArEAr122KpSKVGS15plheJv81DPFskuFZKxWaoEi+FtaoJ+dAyxYsP/3PDj/LOaOEFFjeOkV8utOi87ncgziib7MUKuqL5RZ3AHj8retdb3EG6b78EWgKQcJCqbzUunNYYfoVt9CR/qNL1nMpY2AXjPSwmimzLCiTne0cQN/gS5NwfhbH67+nO7MARxldKHRodknK4bvXqBFGKvXn5uBtp65e8XZllSh5MIpOR1gRk5iUAICROFiFWYroC5o1oJk04uhEe4o72eRomNfhebMiq8w6e5UnM1t4pLvPM/NJYGwEQ/OwqEme9/eO3dWzr7hAC9Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1648667849; bh=CW4yvdMcDnpz5h3u9cEx7UJb0s5+z1PvRcQjRkXueoE=; h=X-Sonic-MF:Date:From:Subject:To:From:Subject; b=kQF0CLAUunmIIT950c9pMc23YVDrCqSmTW806cKdOknkTllhBaDjSlrSH31NUjNy9aA6y9iobGC6hN/VWGMQD2I7GMGOtfj0+ktveCkeb437kAE499XJ8wZHBZJ8mXnnvC17si17KxWXWMEUTic5pJKXB37Z4jCVOK7cXRCom2D1r52RiyC7BnsmpLazKDLzCziygwsw7MaEqAIAUOPvs1SEQtX4H/3A5oloi0AoQULKG4RNjUU+gOMLGaoMHbyQYziE8lzOGKK0zoa7ch6kJOUgIYwxCv7NLt2Ws3BQcnqyXRlB5oxGnb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eq9mYrPlVtPqhwPdzQE eofaqtaREMRmXyQibLxhu9DHJQLRprqp6K6ii3.w1d70oLJXArHtG9be41y_IUfjg_TP6v9kyfDB 5kLqu.62MJK.M4ywzJqb.UG.41v9aTiiN1Ol0phQGW.rPZ_fu.ASRlDZ6wli8inmEHRuXoMNEyDA LJGaKmCX3FcC0f.Fec_EsQIZKOSt7gF_A9OXeNkaidrHHAgscqzIFCyFuNXn5vlp7REuOkGl4qAX onb6oHspv X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Wed, 30 Mar 2022 19:17:29 +0000 Received: by kubenode506.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 63db5f03f6392474c142bbf9cb253686; Wed, 30 Mar 2022 19:17:24 +0000 (UTC) Date: Wed, 30 Mar 2022 15:17:20 -0400 From: "Alex Xu (Hello71)" Subject: Re: "dma-mapping: remove CONFIG_DMA_REMAP" causes AMD SME boot fail To: Christoph Hellwig Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, regressions@lists.linux.dev References: <1648659326.eabkokyuym.none.ref@localhost> <1648659326.eabkokyuym.none@localhost> In-Reply-To: MIME-Version: 1.0 Message-Id: <1648667469.u35o6clg82.none@localhost> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.20001 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? >=20 > 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 =3D DMA_BIT_MASK(__ffs64(sme_me_mask)); > u64 dma_dev_mask =3D min_not_zero(dev->coherent_dma_mask, > dev->bus_dma_limit); >=20 This seems to work for me. Cheers, Alex.