Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp893453imm; Fri, 14 Sep 2018 07:56:29 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda/xhL4a8wjMsN3Th1koQGeINiNVcptP5g911YzqLmdo3QoVOoZkSIislNQq8fpVDXbJVnK X-Received: by 2002:a17:902:b947:: with SMTP id h7-v6mr12829399pls.157.1536936989375; Fri, 14 Sep 2018 07:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536936989; cv=none; d=google.com; s=arc-20160816; b=naUcY2h8eQimybfPXIWWYhdmdJMgGVVdADJQ/RypGjIwgSXFTo5ih6bOSvwfrC69Ol O2uWpQSd7NnBTuf3ugCAMHwDBFzEGI/j6oJ4hMJh+kQBpgKkbZvii/4qunQLBA+ZqakU 0uwWAAtRT7hf2NttiRzqXMvdqLW1E44bH9qNpTG01EoZpcfOjeKPW7VchURXDt1XPTIV uQB/XuxG75JkQE7iSv1SuWbjiD7vuenq1WYOTCRtMheahRgdhbh6TVvHxNAUWhLk0Ser m7UnCxpF2dcdbgptThxKKF2sfkhYzbZZvnBFCkCPzflgy8nPpyw79PTSlqhC6tnyAKrB OmCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=GKP4pZDZDvn0UZB9gHwJaa8sVhEBOuW9j8cZDERX+rI=; b=aCg0+sggxWNohqokxXbYZr/V2ggbAdRRGY+tb3eYCIE4nEMzcaxrENDAEBN/X7s1eU PrG47wwy5JiYPMtpKSZX8VyljYhf8BzU6H15DwpCVZn1VYopeg7/TYi5eXQp/0yhDgUP vp0ZZuh4/tFAh8ndw4lfKE7WGFBgo86qiuHgFTgvG0/DvfEhUlkEKZ7O2R9c6TrHT9bV Ju0eC1DVxtbd9JeUr4FB5aIWE1AkgWi/3u6whMDDKD0XzspNvZOvh5Kj5jzi/ysZRQUa Nync1MsQEATod/QiNmdC6xWAd4egdKNjV2tKf/A9i5mLr0sqyC6ip4+Db27Ndx7Qv6J8 8dcw== 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 e1-v6si7811262pgk.275.2018.09.14.07.56.12; Fri, 14 Sep 2018 07:56:29 -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 S1728239AbeINUKx (ORCPT + 99 others); Fri, 14 Sep 2018 16:10:53 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50292 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbeINUKx (ORCPT ); Fri, 14 Sep 2018 16:10:53 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g0pVf-000144-KM; Fri, 14 Sep 2018 16:55:51 +0200 Date: Fri, 14 Sep 2018 16:55:51 +0200 (CEST) From: Thomas Gleixner To: Tom Lendacky cc: Borislav Petkov , Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "H. Peter Anvin" , Paolo Bonzini , Sean Christopherson , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= Subject: Re: [PATCH v8 1/2] x86/mm: add .bss..decrypted section to hold shared variables In-Reply-To: <07c76a33-7883-f407-5b1c-b6de7dda37b1@amd.com> Message-ID: References: <1536875471-17391-1-git-send-email-brijesh.singh@amd.com> <1536875471-17391-2-git-send-email-brijesh.singh@amd.com> <20180914071056.GA4747@zn.tnic> <3517a0db-2f64-6d09-7100-dced40561d08@amd.com> <20180914141216.GA29898@zn.tnic> <07c76a33-7883-f407-5b1c-b6de7dda37b1@amd.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1449710060-1536936951=:10480" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1449710060-1536936951=:10480 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Fri, 14 Sep 2018, Tom Lendacky wrote: > On 09/14/2018 09:12 AM, Borislav Petkov wrote: > > On Fri, Sep 14, 2018 at 02:17:05PM +0200, Thomas Gleixner wrote: > >>> The sme_encrypt_kernel() does not have access to pmd (after pointer > >>> fixup is applied). You can extend the sme_encrypt_kernel() to pass an > >>> additional arguments but then we start getting in include hell. The pmd > >>> is defined as "pmdval_t". If we extend the sme_encrypt_kernel() thenĀ  > >>> asm/mem_encrypt.h need to include the header file which defines > >>> "pmdval_t". Adding the 'asm/pgtable_type.h' was causing all kind of > >>> compilation errors. I didn't spend much time on it. IMO, we really don't > >>> need to go in this path unless we see some value from doing this. > >> > >> Keep it here then. > > > > *For what is worth*, a simple forward declaration works. I've taken the > > 64-bit forward declaration of pmdval_t as SME is 64-bit only anyway. > > Just my 2 cents, but I'd prefer it to be in head64.c. This is where > the future pagetable entries are all updated to set the encryption > mask by applying sme_get_me_mask() to load_delta. So, to me, it makes > sense to keep the clearing of the encryption mask for the bss_decrypted > section here. Yes, at least for now, I just keep it there and we can sort that out after we fixed the problem at hand. Thanks, tglx --8323329-1449710060-1536936951=:10480--