Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-06-01 Thread Juergen Gross
On 01.06.23 16:33, Borislav Petkov wrote: On Thu, Jun 01, 2023 at 03:22:33PM +0200, Borislav Petkov wrote: Now lemme restart testing. This is from another box, with the latest changes incorporated: https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/log/?h=rc1-mtrr ---

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-06-01 Thread Borislav Petkov
On Thu, Jun 01, 2023 at 03:22:33PM +0200, Borislav Petkov wrote: > Now lemme restart testing. This is from another box, with the latest changes incorporated: https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/log/?h=rc1-mtrr --- proc-mtrr.before2011-03-04 01:03:35.243994733 +0100 +++

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-06-01 Thread Borislav Petkov
On Thu, Jun 01, 2023 at 10:19:01AM +0200, Juergen Gross wrote: > Patch 2 wants this diff on top: Obviously. :-) That fixes it, thx. Now lemme restart testing. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-06-01 Thread Juergen Gross
On 31.05.23 19:48, Borislav Petkov wrote: On Wed, May 31, 2023 at 04:20:08PM +0200, Juergen Gross wrote: One other note: why does mtrr_cleanup() think that using 8 instead of 6 variable MTRRs would be an "optimal setting"? Maybe the more extensive debug output below would help answer that...

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-06-01 Thread Juergen Gross
On 01.06.23 14:48, Borislav Petkov wrote: On Thu, Jun 01, 2023 at 08:39:17AM +0200, Juergen Gross wrote: Does this translate to: "we should remove that cleanup crap"? I'd be positive to that. :-) Why, what's wrong with that thing? Why do you need it if you don't think adding MTRRs

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-06-01 Thread Borislav Petkov
On Thu, Jun 01, 2023 at 08:39:17AM +0200, Juergen Gross wrote: > Does this translate to: "we should remove that cleanup crap"? I'd be > positive to that. :-) Why, what's wrong with that thing? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-06-01 Thread Juergen Gross
On 31.05.23 19:48, Borislav Petkov wrote: On Wed, May 31, 2023 at 04:20:08PM +0200, Juergen Gross wrote: One other note: why does mtrr_cleanup() think that using 8 instead of 6 variable MTRRs would be an "optimal setting"? Maybe the more extensive debug output below would help answer that...

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-06-01 Thread Juergen Gross
On 31.05.23 19:48, Borislav Petkov wrote: On Wed, May 31, 2023 at 04:20:08PM +0200, Juergen Gross wrote: One other note: why does mtrr_cleanup() think that using 8 instead of 6 variable MTRRs would be an "optimal setting"? Maybe the more extensive debug output below would help answer that...

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-31 Thread Juergen Gross
On 31.05.23 10:35, Borislav Petkov wrote: [0.018357] MTRR default type: uncachable [0.022347] MTRR fixed ranges enabled: [0.026085] 0-9 write-back [0.029650] A-B uncachable [0.033214] C-F write-protect [0.037039] MTRR variable ranges enabled:

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-31 Thread Borislav Petkov
On Wed, May 31, 2023 at 11:31:37AM +0200, Juergen Gross wrote: > What it did would have been printed if pr_debug() would have been > active. :-( Lemme turn those into pr_info(). pr_debug() is nuts. > Did you check whether CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT was the same in > both > kernels

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-31 Thread Juergen Gross
On 31.05.23 10:35, Borislav Petkov wrote: On Wed, May 31, 2023 at 09:28:57AM +0200, Juergen Gross wrote: Can you please boot the system with the MTRR patches and specify "mtrr=debug" on the command line? I'd be interested in the raw register values being read and the resulting memory type map.

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-31 Thread Borislav Petkov
On Wed, May 31, 2023 at 09:28:57AM +0200, Juergen Gross wrote: > Can you please boot the system with the MTRR patches and specify "mtrr=debug" > on the command line? I'd be interested in the raw register values being read > and the resulting memory type map. This is exactly why I wanted this

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-31 Thread Juergen Gross
On 30.05.23 17:28, Borislav Petkov wrote: On Mon, May 22, 2023 at 04:17:50PM +0200, Juergen Gross wrote: The attached diff is for patch 13. Merged and pushed out into same branch. Next issue. Diffing /proc/mtrr shows: --- proc-mtrr.6.3 2023-05-30 17:00:13.215999483 +0200 +++

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-30 Thread Borislav Petkov
On Mon, May 22, 2023 at 04:17:50PM +0200, Juergen Gross wrote: > The attached diff is for patch 13. Merged and pushed out into same branch. Next issue. Diffing /proc/mtrr shows: --- proc-mtrr.6.3 2023-05-30 17:00:13.215999483 +0200 +++ proc-mtrr.after 2023-05-30 16:01:38.281997816

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-22 Thread Juergen Gross
On 11.05.23 18:32, Borislav Petkov wrote: On Wed, May 10, 2023 at 05:53:15PM +0200, Juergen Gross wrote: Urgh, yes, there is something missing: diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index 031f7ea8e72b..9544e7d13bb3 100644 ---

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-11 Thread Borislav Petkov
On Wed, May 10, 2023 at 05:53:15PM +0200, Juergen Gross wrote: > Urgh, yes, there is something missing: > > diff --git a/arch/x86/kernel/cpu/mtrr/generic.c > b/arch/x86/kernel/cpu/mtrr/generic.c > index 031f7ea8e72b..9544e7d13bb3 100644 > --- a/arch/x86/kernel/cpu/mtrr/generic.c > +++

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-10 Thread Juergen Gross
On 10.05.23 15:30, Borislav Petkov wrote: On Wed, May 10, 2023 at 01:36:41AM +0200, Borislav Petkov wrote: More staring at this tomorrow, on a clear head. Yeah, I'm going to leave it as is. Tried doing a union with bitfields but doesn't get any prettier. Next crapola: The Intel box says

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-10 Thread Borislav Petkov
On Wed, May 10, 2023 at 03:30:24PM +0200, Borislav Petkov wrote: > So this map lookup thing is wrong in this case. Btw, current tree is: https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/log/?h=rc1-mtrr -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-10 Thread Borislav Petkov
On Wed, May 10, 2023 at 01:36:41AM +0200, Borislav Petkov wrote: > More staring at this tomorrow, on a clear head. Yeah, I'm going to leave it as is. Tried doing a union with bitfields but doesn't get any prettier. Next crapola: The Intel box says now: [8.138683] sgx: EPC section

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-09 Thread Borislav Petkov
On Tue, May 09, 2023 at 10:14:37PM +0200, Borislav Petkov wrote: > On Tue, May 02, 2023 at 02:09:15PM +0200, Juergen Gross wrote: > > This series tries to fix the rather special case of PAT being available > > without having MTRRs (either due to CONFIG_MTRR being not set, or > > because the

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-09 Thread Borislav Petkov
On Tue, May 02, 2023 at 02:09:15PM +0200, Juergen Gross wrote: > This series tries to fix the rather special case of PAT being available > without having MTRRs (either due to CONFIG_MTRR being not set, or > because the feature has been disabled e.g. by a hypervisor). More weird stuff. With the

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-03 Thread Borislav Petkov
On Wed, May 03, 2023 at 11:14:25AM -0700, Sohil Mehta wrote: > A Nit -> Documentation/process/maintainer-tip.rst suggests: > "The condensed patch description in the subject line should start with a > uppercase letter and ..." Yeah, good point. But my patch massaging script does that

Re: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-03 Thread Sohil Mehta
> Juergen Gross (16): > x86/mtrr: remove physical address size calculation > x86/mtrr: replace some constants with defines > x86/mtrr: support setting MTRR state for software defined MTRRs > x86/hyperv: set MTRR state when running as SEV-SNP Hyper-V guest > x86/xen: set MTRR state when

RE: [PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-02 Thread Michael Kelley (LINUX)
From: Juergen Gross Sent: Tuesday, May 2, 2023 5:09 AM > > This series tries to fix the rather special case of PAT being available > without having MTRRs (either due to CONFIG_MTRR being not set, or > because the feature has been disabled e.g. by a hypervisor). > > The main use cases are Xen PV

[PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-02 Thread Juergen Gross
This series tries to fix the rather special case of PAT being available without having MTRRs (either due to CONFIG_MTRR being not set, or because the feature has been disabled e.g. by a hypervisor). The main use cases are Xen PV guests and SEV-SNP guests running under Hyper-V. Instead of trying