Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4365574ybi; Mon, 15 Jul 2019 07:53:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1Y0wUDH+OhucoZ9LP51T7xQDLeyYstzftVk0gFl1qMDEvvokfGcb3nk+xfjJxGfEGxTOp X-Received: by 2002:a17:90a:bf92:: with SMTP id d18mr30451708pjs.128.1563202426846; Mon, 15 Jul 2019 07:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563202426; cv=none; d=google.com; s=arc-20160816; b=vEhr+imaMvLInapmyQWunmG3uMHuAcwwvjtxrCJnChgrjjfjyAR425Izf/X/Vb/dpS Dyn/kK+Qpos2OHE0VkYu23M3gpwZzmdjTRpiLM9jp2Sf5v7hgGp2o2gFm4hlS2XQekxw oZBIUX+LEv6b96DTbcR1Eh7/afJ43L00jpESddFW2sOO+x0uHYxybEU/ACOpMR8I6z3v V433dSXpa1X+XnYTY1dxmm1PoiRExoWNsU8shhED8Kaw4t5z0kuxGYRBOY6f9JT1fJJK YlLtFspIloNSh4qg31y5L+6TYEGiJKiEpqbdUgD04qEoHjlV4+52mlnYF5nZQkVABfuG gERA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/4/OHBX4pwjEilIn84ShVf2ONLsfU7NA0AgF6HHY5fY=; b=W1SiUbuJjV8IdovAuSy5XwO0GuIBZKuT5gn9i1TNCfofAbw6ePRyxPUrK3xwyKjSb1 9Qb28VdHx/38in/N6lyBeeHI4WqkNYurWfUVvHtTQHKhyLr9+HVak7oDPDQA+ZIfenyl /fWS/Cuoo9soByb0b2aEuGfoFj1rdVZedNflYpuDQIzH7Q/5CSaRNnI9POf1gSYqz+yR zT6z9OQha77IWbPIFK6c8t06oLUAfvfHubh/llTrVpWA2CKTknyLhsBjq8sM68SwUMiB fPn/8HvtOhQhhikzXyw0nlB5gwYvnvxsIaySewDLTFOVIerfl29lhS4fv5fEiG8MHxeD 9Z3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l62si16140001pge.590.2019.07.15.07.53.29; Mon, 15 Jul 2019 07:53:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391066AbfGOOav (ORCPT + 99 others); Mon, 15 Jul 2019 10:30:51 -0400 Received: from verein.lst.de ([213.95.11.211]:33049 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391714AbfGOOaq (ORCPT ); Mon, 15 Jul 2019 10:30:46 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id C945368B05; Mon, 15 Jul 2019 16:30:39 +0200 (CEST) Date: Mon, 15 Jul 2019 16:30:39 +0200 From: Christoph Hellwig To: Halil Pasic Cc: Thiago Jung Bauermann , Janosch Frank , x86@kernel.org, iommu@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Konrad Rzeszutek Wilk , Alexey Dobriyan , Mike Anderson , Ram Pai , "Lendacky, Thomas" Subject: Re: [PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code Message-ID: <20190715143039.GA6892@lst.de> References: <20190712053631.9814-1-bauerman@linux.ibm.com> <20190712053631.9814-4-bauerman@linux.ibm.com> <20190712150912.3097215e.pasic@linux.ibm.com> <87tvbqgboc.fsf@morokweng.localdomain> <20190715160317.7e3dfb33.pasic@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190715160317.7e3dfb33.pasic@linux.ibm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 15, 2019 at 04:03:17PM +0200, Halil Pasic wrote: > > I thought about that but couldn't put my finger on a general concept. > > Is it "guest with memory inaccessible to the host"? > > > > Well, force_dma_unencrypted() is a much better name thatn sev_active(): > s390 has no AMD SEV, that is sure, but for virtio to work we do need to > make our dma accessible to the hypervisor. Yes, your "guest with memory > inaccessible to the host" shows into the right direction IMHO. > Unfortunately I don't have too many cycles to spend on this right now. In x86 it means that we need to remove dma encryption using set_memory_decrypted before using it for DMA purposes. In the SEV case that seems to be so that the hypervisor can access it, in the SME case that Tom just fixes it is because there is an encrypted bit set in the physical address, and if the device doesn't support a large enough DMA address the direct mapping code has to encrypt the pages used for the contigous allocation. > Being on cc for your patch made me realize that things got broken on > s390. Thanks! I've sent out a patch that fixes protvirt, but we are going > to benefit from your cleanups. I think with your cleanups and that patch > of mine both sev_active() and sme_active() can be removed. Feel free to > do so. If not, I can attend to it as well. Yes, I think with the dma-mapping fix and this series sme_active and sev_active should be gone from common code. We should also be able to remove the exports x86 has for them. I'll wait a few days and will then feed the dma-mapping fix to Linus, it might make sense to either rebase Thiagos series on top of the dma-mapping for-next branch, or wait a few days before reposting.