Received: by 10.223.185.116 with SMTP id b49csp467649wrg; Wed, 14 Feb 2018 01:47:25 -0800 (PST) X-Google-Smtp-Source: AH8x2262gDh61mqQQ8Nfg76NEWi+wTZbXoURuySOXB2yNh8UB9HVZ/JG/7LXnuVNfx59Z4lUf6Pk X-Received: by 2002:a17:902:a607:: with SMTP id u7-v6mr3918648plq.71.1518601645006; Wed, 14 Feb 2018 01:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518601644; cv=none; d=google.com; s=arc-20160816; b=oeQj6XOOVArVEW6JDIbrBMehQg5vnZYAjHCTgNu+Z1YCvCpmMh/23PlLFZEHoDC8Qj 6l8dCe0SBh3ECBeHwQyigOWiXf87mEyn3YNbijfulkVZ09oJwZ5YVxG/sfcCLYzNp2MH vO1xql41HbPMFvt6f7JxuDa23IDBRnLfAYoVHdwXtWZbKg8CXEr2YZH1txgam+ooRiXo bQaLOj67qRl6RbH8/aVdB0mu/dT8A9A0+b29rqHffcJL6//WQxJmRaG8vdTUZV0FiPtj Uu/rJKLB0154+CQfB7TZn3LEPqEvfaakH6dgC5eewlD80XVyB6BTOm6YyJm5AbDl5qL9 mdSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=t/CB3WnIXo2Zhy73EmST8kiSi9tKFmudDYKZhv33N5A=; b=D+2dN0R2kJQSW6B96smgl1F1S7tFddHOHoBFlKNgOw+iGHnzIV4mF2PJdUR82Ezo1Z bcitGK4AwoQoqGD7A49Ifa27kcX2z6SkuYvSFGAq/TAlV+0vWz2p2MSuzyUGvRoOcF0l JZxFILX20h9KuK1z0ZP+fPj+321dymGQU1nMXYsbO8dtUTsnwQLyEbfwa5siSvsX6l8r sPPsZa2ii/Aq0s7kFK/WE6ZRDonf8sKHE+wc1VFV6DWG8qDTQhvs11Fg8Fc7YuBK2okn Uzy3J+i8oDzZGRDKmgVdZYXzUUyCbqKZwpygQ/7+Fr4eUdEmr8/Kst0PVIKIJ9cMNyNW a6GQ== 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 1-v6si982830plz.756.2018.02.14.01.47.10; Wed, 14 Feb 2018 01:47:24 -0800 (PST) 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 S966998AbeBNJqC (ORCPT + 99 others); Wed, 14 Feb 2018 04:46:02 -0500 Received: from mx2.suse.de ([195.135.220.15]:54747 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966503AbeBNJqB (ORCPT ); Wed, 14 Feb 2018 04:46:01 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4B5B5AE57; Wed, 14 Feb 2018 09:45:59 +0000 (UTC) Subject: Re: [PATCH 19/31] x86/mm/pae: Populate valid user PGD entries To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , jroedel@suse.de References: <1518168340-9392-1-git-send-email-joro@8bytes.org> <1518168340-9392-20-git-send-email-joro@8bytes.org> From: Juergen Gross Message-ID: <3913f255-7309-58c5-b6c3-39cf0e29a844@suse.com> Date: Wed, 14 Feb 2018 10:45:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1518168340-9392-20-git-send-email-joro@8bytes.org> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/02/18 10:25, Joerg Roedel wrote: > From: Joerg Roedel > > Generic page-table code populates all non-leaf entries with > _KERNPG_TABLE bits set. This is fine for all paging modes > except PAE. > > In PAE mode only a subset of the bits is allowed to be set. > Make sure we only set allowed bits by masking out the > reserved bits. > > Signed-off-by: Joerg Roedel > --- > arch/x86/include/asm/pgtable_types.h | 26 ++++++++++++++++++++++++-- > 1 file changed, 24 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h > index 3696398..5027470 100644 > --- a/arch/x86/include/asm/pgtable_types.h > +++ b/arch/x86/include/asm/pgtable_types.h > @@ -50,6 +50,7 @@ > #define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL) > #define _PAGE_SOFTW1 (_AT(pteval_t, 1) << _PAGE_BIT_SOFTW1) > #define _PAGE_SOFTW2 (_AT(pteval_t, 1) << _PAGE_BIT_SOFTW2) > +#define _PAGE_SOFTW3 (_AT(pteval_t, 1) << _PAGE_BIT_SOFTW3) > #define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT) > #define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) > #define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) > @@ -267,14 +268,35 @@ typedef struct pgprot { pgprotval_t pgprot; } pgprot_t; > > typedef struct { pgdval_t pgd; } pgd_t; > > +#ifdef CONFIG_X86_PAE > + > +/* > + * PHYSICAL_PAGE_MASK might be non-constant when SME is compiled in, so we can't > + * use it here. > + */ > +#define PGD_PAE_PHYS_MASK (((1ULL << __PHYSICAL_MASK_SHIFT)-1) & PAGE_MASK) I think PAGE_MASK is a 32 bit value here, so you are chopping off the high physical address bits. With that corrected the kernel is coming up as Xen PV guest. Juergen