From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4730AC4332D for ; Sat, 21 Mar 2020 15:40:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1931820757 for ; Sat, 21 Mar 2020 15:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727495AbgCUPkg (ORCPT ); Sat, 21 Mar 2020 11:40:36 -0400 Received: from 8bytes.org ([81.169.241.247]:54940 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726607AbgCUPkf (ORCPT ); Sat, 21 Mar 2020 11:40:35 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id B99B33D3; Sat, 21 Mar 2020 16:40:33 +0100 (CET) Date: Sat, 21 Mar 2020 16:40:31 +0100 From: Joerg Roedel To: Dave Hansen Cc: David Rientjes , x86@kernel.org, hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Joerg Roedel Subject: Re: [PATCH 21/70] x86/boot/compressed/64: Add function to map a page unencrypted Message-ID: <20200321154031.GN5122@8bytes.org> References: <20200319091407.1481-1-joro@8bytes.org> <20200319091407.1481-22-joro@8bytes.org> <8a50c19f-aaf8-90bd-a415-0e3b71e5a010@intel.com> <20200320221213.GK5122@8bytes.org> <9b69d49f-969c-5720-5723-f89ff0e000c0@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9b69d49f-969c-5720-5723-f89ff0e000c0@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 20, 2020 at 03:26:09PM -0700, Dave Hansen wrote: > In any case, I thought this all came through initialize_identity_maps(), > which does, for instance: > > mapping_info.page_flag = __PAGE_KERNEL_LARGE_EXEC | sme_me_mask; > > Where: > > #define __PAGE_KERNEL_LARGE_EXEC (__PP|__RW| 0|___A| 0|___D|_PSE|___G) > > That looks like it has the Global bit set. Does that not apply here > somehow? No, as the value of %cr4 at boot is 0x00000020, so PGE is not set and global pages are not enabled. It wouldn't make sense anyhow, as global pages only make sense when there are more than one address space, which is not the case that early in boot. Regards, Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 21/70] x86/boot/compressed/64: Add function to map a page unencrypted Date: Sat, 21 Mar 2020 16:40:31 +0100 Message-ID: <20200321154031.GN5122@8bytes.org> References: <20200319091407.1481-1-joro@8bytes.org> <20200319091407.1481-22-joro@8bytes.org> <8a50c19f-aaf8-90bd-a415-0e3b71e5a010@intel.com> <20200320221213.GK5122@8bytes.org> <9b69d49f-969c-5720-5723-f89ff0e000c0@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <9b69d49f-969c-5720-5723-f89ff0e000c0@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" To: Dave Hansen Cc: Juergen Gross , Tom Lendacky , Thomas Hellstrom , x86@kernel.org, Kees Cook , kvm@vger.kernel.org, Peter Zijlstra , Dave Hansen , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Joerg Roedel , Andy Lutomirski , hpa@zytor.com, David Rientjes , Dan Williams , Jiri Slaby List-Id: virtualization@lists.linuxfoundation.org On Fri, Mar 20, 2020 at 03:26:09PM -0700, Dave Hansen wrote: > In any case, I thought this all came through initialize_identity_maps(), > which does, for instance: > > mapping_info.page_flag = __PAGE_KERNEL_LARGE_EXEC | sme_me_mask; > > Where: > > #define __PAGE_KERNEL_LARGE_EXEC (__PP|__RW| 0|___A| 0|___D|_PSE|___G) > > That looks like it has the Global bit set. Does that not apply here > somehow? No, as the value of %cr4 at boot is 0x00000020, so PGE is not set and global pages are not enabled. It wouldn't make sense anyhow, as global pages only make sense when there are more than one address space, which is not the case that early in boot. Regards, Joerg