Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp535260ybm; Mon, 20 May 2019 22:17:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwso74i0P6wxQXstnf1TGxad5+XX7mGsr1UNVw9fhjDT/RtBc4MLv7CInnDVvMM0Zq3vtJw X-Received: by 2002:a63:184:: with SMTP id 126mr53305981pgb.420.1558415828492; Mon, 20 May 2019 22:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558415828; cv=none; d=google.com; s=arc-20160816; b=vl4LCK5ylgiu4me0AD5aGal2LIbQiiF0V45SAXqBDiq99I5mc06GWdJ4+AKjKG4KLq l5n3eYRS+e2/lV/rdz/yH0C2ZknEi1YhxgQ59l+3DjhazPcfTn6Me0D8EUwyZ7P9xgLh qmrTk3I61o1H9yTB5r1lrGLpbsWJ46qY1Epl+S17raNMbVAyHGDGrXZSiWz4CUjIYHNX oXpk6Z+ASSeJQd1RDXFe7v+4aKS/+sXtu2qQ0r3xYNG9ufGfLHNO6K2r6ors8Vs7Lqij SQ25JDDVAfgMznOa13Pa2uF8EPWhKePCbfIv7FJIM+Ik+rzM6UoGTHcZ0CnCuXy81poZ xGvg== 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=yTkfPVde3heU197y/9zhX2ofl0rM03s8VNv7iveicEo=; b=YRHv+kIk4cJSDHV4JGgL4g0gf9BHgsemOB6MngVzV0RIeRsS0G+RwDy6Jf4CvwlPq2 GXPjL9VLPdZ33F/Jbp2lEYGXtyGV9ZKz6dAQVdnsvgv/SX31n1FIuyyhgrAtiYxpl77D WQ2jccs7Kx9ya4iHlv81ctB4YtOupudnkFimFfxwMWfyxe2hcP4z52XXAQZouyT0XSb4 1rWxi4yJ+RJS/FgUO95b1qKbAzDD9fbgBtssylZ43BzfITr187xKL32R2u5ZXwQYMaTi TZU64EosUuSevocD29sEPA9ihKwJadlqFQ8M8p0Kanau2WrWgDP0rbz9Llhtq6iKEy/E QquA== 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 x143si20734915pgx.504.2019.05.20.22.16.53; Mon, 20 May 2019 22:17:08 -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 S1727805AbfEUFPa (ORCPT + 99 others); Tue, 21 May 2019 01:15:30 -0400 Received: from verein.lst.de ([213.95.11.211]:57345 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbfEUFP3 (ORCPT ); Tue, 21 May 2019 01:15:29 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 71C1968B05; Tue, 21 May 2019 07:15:07 +0200 (CEST) Date: Tue, 21 May 2019 07:15:07 +0200 From: Christoph Hellwig To: Thiago Jung Bauermann Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Alexey Kardashevskiy , Anshuman Khandual , Benjamin Herrenschmidt , Christoph Hellwig , Michael Ellerman , Mike Anderson , Paul Mackerras , Ram Pai , Claudio Carvalho , Anshuman Khandual Subject: Re: [PATCH 11/12] powerpc/pseries/svm: Force SWIOTLB for secure guests Message-ID: <20190521051507.GD29120@lst.de> References: <20190521044912.1375-1-bauerman@linux.ibm.com> <20190521044912.1375-12-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190521044912.1375-12-bauerman@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 > diff --git a/arch/powerpc/include/asm/mem_encrypt.h b/arch/powerpc/include/asm/mem_encrypt.h > new file mode 100644 > index 000000000000..45d5e4d0e6e0 > --- /dev/null > +++ b/arch/powerpc/include/asm/mem_encrypt.h > @@ -0,0 +1,19 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > +/* > + * SVM helper functions > + * > + * Copyright 2019 IBM Corporation > + */ > + > +#ifndef _ASM_POWERPC_MEM_ENCRYPT_H > +#define _ASM_POWERPC_MEM_ENCRYPT_H > + > +#define sme_me_mask 0ULL > + > +static inline bool sme_active(void) { return false; } > +static inline bool sev_active(void) { return false; } > + > +int set_memory_encrypted(unsigned long addr, int numpages); > +int set_memory_decrypted(unsigned long addr, int numpages); > + > +#endif /* _ASM_POWERPC_MEM_ENCRYPT_H */ S/390 seems to be adding a stub header just like this. Can you please clean up the Kconfig and generic headers bits for memory encryption so that we don't need all this boilerplate code? > config PPC_SVM > bool "Secure virtual machine (SVM) support for POWER" > depends on PPC_PSERIES > + select SWIOTLB > + select ARCH_HAS_MEM_ENCRYPT > default n n is the default default, no need to explictly specify it.