From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbdG1G2Q (ORCPT ); Fri, 28 Jul 2017 02:28:16 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:38371 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660AbdG1G2L (ORCPT ); Fri, 28 Jul 2017 02:28:11 -0400 Date: Fri, 28 Jul 2017 08:28:07 +0200 From: Ingo Molnar To: Tom Lendacky Cc: Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Andy Lutomirski , "H. Peter Anvin" , Thomas Gleixner , Dave Young , Brijesh Singh Subject: Re: [PATCH v1 2/2] acpi, x86: Remove encryption mask from ACPI page protection type Message-ID: <20170728062807.k7bzg3qgxsxlllly@gmail.com> References: <45cc8e44980cbc1372c63420ebafc8c8466e958f.1501092102.git.thomas.lendacky@amd.com> <20170727144159.GD28548@nazgul.tnic> <5d7f9a32-89d1-e2f2-4dea-98527ac3492e@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d7f9a32-89d1-e2f2-4dea-98527ac3492e@amd.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tom Lendacky wrote: > > > + * in memory in an encrypted state so return a protection attribute > > > + * that does not have the encryption bit set. > > > */ > > > - return PAGE_KERNEL; > > > + return sme_active() ? PAGE_KERNEL_IO : PAGE_KERNEL; > > > > Why isn't there a PAGE_KERNEL_NOENC define which you can simply return > > instead of testing? > > Sounds like something I should add to pgtable_types.h (which has a > #define for PAGE_KERNEL_EXEC_NOENC, but not PAGE_KERNEL_NOENC). I'll > create that #define. > > As for the sme_active() check I was getting ahead of myself since > under SEV the encryption mask is needed. I'll change it to just > return PAGE_KERNEL_NOENC and then worry about the SEV change in > the SEV patches. Ok, that works for me too, as we at least don't sprinke the code with repeated sme_active() toggles. Thanks, Ingo