From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Lendacky Subject: Re: [RFC PATCH v3 02/20] x86: Set the write-protect cache mode for full PAT support Date: Mon, 14 Nov 2016 10:51:27 -0600 Message-ID: <01f705f1-484b-4407-7b7a-e8e69966581f@amd.com> References: <20161110003426.3280.2999.stgit@tlendack-t1.amdoffice.net> <20161110003448.3280.27573.stgit@tlendack-t1.amdoffice.net> <20161110131400.bmeoojsrin2zi2w2@pd.tnic> <1478827480.20881.142.camel@hpe.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1478827480.20881.142.camel-ZPxbGqLxI0U@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Kani, Toshimitsu" , "bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org" Cc: "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "rkrcmar-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org" , "linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org" , "glider-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org" , "hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org" , "lwoodman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "corbet-T1hC0tSOHrs@public.gmane.org" , "x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "kasan-dev-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org" , "mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "aryabinin-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org" , "riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "arnd-r2nGTMty4D4@public.gmane.org" , "luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org" , "dvyukov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org" List-Id: linux-arch.vger.kernel.org On 11/10/2016 07:26 PM, Kani, Toshimitsu wrote: > On Thu, 2016-11-10 at 14:14 +0100, Borislav Petkov wrote: >> + Toshi. >> >> On Wed, Nov 09, 2016 at 06:34:48PM -0600, Tom Lendacky wrote: >>> >>> For processors that support PAT, set the write-protect cache mode >>> (_PAGE_CACHE_MODE_WP) entry to the actual write-protect value >>> (x05). > > Using slot 6 may be more cautious (for the same reason slot 7 was used > for WT), but I do not have a strong opinion for it. > > set_page_memtype() cannot track the use of WP type since there is no > extra-bit available for WP, but WP is only supported by > early_memremap_xx() interfaces in this series. So, I think we should > just document that WP is only intended for temporary mappings at boot- > time until this issue is resolved. Also, we need to make sure that > this early_memremap for WP is only called after pat_init() is done. Sounds good, I'll add documentation to cover these points. > > A nit - please add WP to the function header comment below. > "This function initializes PAT MSR and PAT table with an OS-defined > value to enable additional cache attributes, WC and WT." Will do. Thanks, Tom > > Thanks, > -Toshi > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-dm3nam03on0063.outbound.protection.outlook.com ([104.47.41.63]:11232 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752781AbcKNR0B (ORCPT ); Mon, 14 Nov 2016 12:26:01 -0500 Subject: Re: [RFC PATCH v3 02/20] x86: Set the write-protect cache mode for full PAT support References: <20161110003426.3280.2999.stgit@tlendack-t1.amdoffice.net> <20161110003448.3280.27573.stgit@tlendack-t1.amdoffice.net> <20161110131400.bmeoojsrin2zi2w2@pd.tnic> <1478827480.20881.142.camel@hpe.com> From: Tom Lendacky Message-ID: <01f705f1-484b-4407-7b7a-e8e69966581f@amd.com> Date: Mon, 14 Nov 2016 10:51:27 -0600 MIME-Version: 1.0 In-Reply-To: <1478827480.20881.142.camel@hpe.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: "Kani, Toshimitsu" , "bp@alien8.de" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "dvyukov@google.com" , "corbet@lwn.net" , "arnd@arndb.de" , "matt@codeblueprint.co.uk" , "linux-mm@kvack.org" , "aryabinin@virtuozzo.com" , "tglx@linutronix.de" , "konrad.wilk@oracle.com" , "kasan-dev@googlegroups.com" , "x86@kernel.org" , "iommu@lists.linux-foundation.org" , "riel@redhat.com" , "lwoodman@redhat.com" , "mingo@redhat.com" , "joro@8bytes.org" , "linux-efi@vger.kernel.org" , "pbonzini@redhat.com" , "hpa@zytor.com" , "luto@kernel.org" , "glider@google.com" , "linux-arch@vger.kernel.org" , "linux-doc@vger.kernel.org" , "rkrcmar@redhat.com" Message-ID: <20161114165127.HVvj19pUV61RBPm6TAceI_Ty0IBc6GGmXoc_umr_xGw@z> On 11/10/2016 07:26 PM, Kani, Toshimitsu wrote: > On Thu, 2016-11-10 at 14:14 +0100, Borislav Petkov wrote: >> + Toshi. >> >> On Wed, Nov 09, 2016 at 06:34:48PM -0600, Tom Lendacky wrote: >>> >>> For processors that support PAT, set the write-protect cache mode >>> (_PAGE_CACHE_MODE_WP) entry to the actual write-protect value >>> (x05). > > Using slot 6 may be more cautious (for the same reason slot 7 was used > for WT), but I do not have a strong opinion for it. > > set_page_memtype() cannot track the use of WP type since there is no > extra-bit available for WP, but WP is only supported by > early_memremap_xx() interfaces in this series. So, I think we should > just document that WP is only intended for temporary mappings at boot- > time until this issue is resolved. Also, we need to make sure that > this early_memremap for WP is only called after pat_init() is done. Sounds good, I'll add documentation to cover these points. > > A nit - please add WP to the function header comment below. > "This function initializes PAT MSR and PAT table with an OS-defined > value to enable additional cache attributes, WC and WT." Will do. Thanks, Tom > > Thanks, > -Toshi >