Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751795AbdIUQQm (ORCPT ); Thu, 21 Sep 2017 12:16:42 -0400 Received: from ppsw-43.csi.cam.ac.uk ([131.111.8.143]:47954 "EHLO ppsw-43.csi.cam.ac.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbdIUQQl (ORCPT ); Thu, 21 Sep 2017 12:16:41 -0400 X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Subject: Re: [Xen-devel] [PATCH] xen: support 52 bit physical addresses in pv guests To: Boris Ostrovsky , Juergen Gross , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: kirill.shutemov@linux.intel.com References: <20170921080138.22917-1-jgross@suse.com> <287fb059-910e-4dc9-b21d-581c97a06323@oracle.com> From: Andrew Cooper Message-ID: <7fa7aa6d-6458-0d86-83a4-b3b6daebfa80@citrix.com> Date: Thu, 21 Sep 2017 17:16:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1154 Lines: 39 On 21/09/17 17:00, Boris Ostrovsky wrote: > >> >>> >>>> >>>> Signed-off-by: Juergen Gross >>>> --- >>>>    arch/x86/include/asm/xen/page.h | 11 ++++++++++- >>>>    arch/x86/xen/mmu_pv.c           |  4 ++-- >>>>    2 files changed, 12 insertions(+), 3 deletions(-) >>>> >>>> diff --git a/arch/x86/include/asm/xen/page.h >>>> b/arch/x86/include/asm/xen/page.h >>>> index 07b6531813c4..bcb8b193c8d1 100644 >>>> --- a/arch/x86/include/asm/xen/page.h >>>> +++ b/arch/x86/include/asm/xen/page.h >>>> @@ -26,6 +26,15 @@ typedef struct xpaddr { >>>>        phys_addr_t paddr; >>>>    } xpaddr_t; >>>>    +#ifdef CONFIG_X86_64 >>>> +#define XEN_PHYSICAL_MASK    ((1UL << 52) - 1) >>> >>> >>> SME is not supported for PV guests but for consistency (and in case sme >>> bit somehow gets set) >>> #define XEN_PHYSICAL_MASK    __sme_clr(((1UL << 52) - 1)) >> >> Hmm, really? Shouldn't we rather add something like >> >> BUG_ON(sme_active()); >> >> somewhere? > > We can do that too. Please don't do anything to cause Linux to crash if Xen is using SME itself, but leaving all of the PV guest unencrypted. ~Andrew