Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-19 Thread Chuck Zmudzinski
On 7/14/2022 6:45 PM, Chuck Zmudzinski wrote: > On 7/14/2022 6:33 PM, Chuck Zmudzinski wrote: > > On 7/14/2022 1:17 PM, Chuck Zmudzinski wrote: > > > On 7/5/22 6:57 AM, Thorsten Leemhuis wrote: > > > > [CCing tglx, mingo, Boris and Juergen] > > > > > > > > On 04.07.22 14:26, Jan Beulich wrote: > >

Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-14 Thread Chuck Zmudzinski
On 7/14/2022 6:33 PM, Chuck Zmudzinski wrote: > On 7/14/2022 1:17 PM, Chuck Zmudzinski wrote: > > On 7/5/22 6:57 AM, Thorsten Leemhuis wrote: > > > [CCing tglx, mingo, Boris and Juergen] > > > > > > On 04.07.22 14:26, Jan Beulich wrote: > > > > On 04.07.2022 13:58, Thorsten Leemhuis wrote: > > > >>

Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-14 Thread Chuck Zmudzinski
On 7/14/2022 1:17 PM, Chuck Zmudzinski wrote: > On 7/5/22 6:57 AM, Thorsten Leemhuis wrote: > > [CCing tglx, mingo, Boris and Juergen] > > > > On 04.07.22 14:26, Jan Beulich wrote: > > > On 04.07.2022 13:58, Thorsten Leemhuis wrote: > > >> On 25.05.22 10:55, Jan Beulich wrote: > > >>> On 28.04.2022

Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-14 Thread Chuck Zmudzinski
On 7/5/22 6:57 AM, Thorsten Leemhuis wrote: > [CCing tglx, mingo, Boris and Juergen] > > On 04.07.22 14:26, Jan Beulich wrote: > > On 04.07.2022 13:58, Thorsten Leemhuis wrote: > >> On 25.05.22 10:55, Jan Beulich wrote: > >>> On 28.04.2022 16:50, Jan Beulich wrote: > The latest with commit bdd

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-12 Thread Chuck Zmudzinski
On 7/12/22 11:30 AM, Juergen Gross wrote: > On 12.07.22 17:09, Chuck Zmudzinski wrote: > > On 7/12/2022 9:32 AM, Juergen Gross wrote: > >> On 12.07.22 15:22, Chuck Zmudzinski wrote: > >>> On 7/12/2022 2:04 AM, Jan Beulich wrote: > On 11.07.2022 19:41, Chuck Zmudzinski wrote: > > Moreove

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-12 Thread Juergen Gross
On 12.07.22 17:09, Chuck Zmudzinski wrote: On 7/12/2022 9:32 AM, Juergen Gross wrote: On 12.07.22 15:22, Chuck Zmudzinski wrote: On 7/12/2022 2:04 AM, Jan Beulich wrote: On 11.07.2022 19:41, Chuck Zmudzinski wrote: Moreover... (please move to the bottom of the code snippet for more informatio

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-12 Thread Chuck Zmudzinski
On 7/12/2022 9:32 AM, Juergen Gross wrote: > On 12.07.22 15:22, Chuck Zmudzinski wrote: > > On 7/12/2022 2:04 AM, Jan Beulich wrote: > >> On 11.07.2022 19:41, Chuck Zmudzinski wrote: > >>> Moreover... (please move to the bottom of the code snippet > >>> for more information about my tests in the Xe

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-12 Thread Juergen Gross
On 12.07.22 15:22, Chuck Zmudzinski wrote: On 7/12/2022 2:04 AM, Jan Beulich wrote: On 11.07.2022 19:41, Chuck Zmudzinski wrote: Moreover... (please move to the bottom of the code snippet for more information about my tests in the Xen PV environment...) void init_cache_modes(void) {     u64 p

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-12 Thread Chuck Zmudzinski
On 7/12/2022 2:04 AM, Jan Beulich wrote: > On 11.07.2022 19:41, Chuck Zmudzinski wrote: > > Moreover... (please move to the bottom of the code snippet > > for more information about my tests in the Xen PV environment...) > > > > void init_cache_modes(void) > > { > >     u64 pat = 0; > > > >     i

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-11 Thread Jan Beulich
On 11.07.2022 19:41, Chuck Zmudzinski wrote: > Moreover... (please move to the bottom of the code snippet > for more information about my tests in the Xen PV environment...) > > void init_cache_modes(void) > { >     u64 pat = 0; > >     if (pat_cm_initialized) >    return; > >     if (boot_

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-11 Thread Juergen Gross
On 11.07.22 19:41, Chuck Zmudzinski wrote: On 7/11/2022 10:31 AM, Juergen Gross wrote: On 11.07.22 16:18, Chuck Zmudzinski wrote: On 7/5/22 12:14 PM, Borislav Petkov wrote: On Tue, Jul 05, 2022 at 05:56:36PM +0200, Jan Beulich wrote: Re-using pat_disabled like you do in your suggestion below

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-11 Thread Chuck Zmudzinski
On 7/11/2022 10:31 AM, Juergen Gross wrote: > On 11.07.22 16:18, Chuck Zmudzinski wrote: > > On 7/5/22 12:14 PM, Borislav Petkov wrote: > >> On Tue, Jul 05, 2022 at 05:56:36PM +0200, Jan Beulich wrote: > >>> Re-using pat_disabled like you do in your suggestion below won't > >>> work, because mtrr_b

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-11 Thread Juergen Gross
On 11.07.22 16:18, Chuck Zmudzinski wrote: On 7/5/22 12:14 PM, Borislav Petkov wrote: On Tue, Jul 05, 2022 at 05:56:36PM +0200, Jan Beulich wrote: Re-using pat_disabled like you do in your suggestion below won't work, because mtrr_bp_init() calls pat_disable() when MTRRs appear to be disabled (

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-11 Thread Chuck Zmudzinski
On 7/5/22 12:14 PM, Borislav Petkov wrote: > On Tue, Jul 05, 2022 at 05:56:36PM +0200, Jan Beulich wrote: > > Re-using pat_disabled like you do in your suggestion below won't > > work, because mtrr_bp_init() calls pat_disable() when MTRRs > > appear to be disabled (from the kernel's view). The goal

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen, with corrected patch

2022-07-11 Thread Chuck Zmudzinski
On 7/5/22 12:14 PM, Borislav Petkov wrote: > On Tue, Jul 05, 2022 at 05:56:36PM +0200, Jan Beulich wrote: > > Re-using pat_disabled like you do in your suggestion below won't > > work, because mtrr_bp_init() calls pat_disable() when MTRRs > > appear to be disabled (from the kernel's view). The goal

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-11 Thread Chuck Zmudzinski
On 7/5/22 12:14 PM, Borislav Petkov wrote: > On Tue, Jul 05, 2022 at 05:56:36PM +0200, Jan Beulich wrote: > > Re-using pat_disabled like you do in your suggestion below won't > > work, because mtrr_bp_init() calls pat_disable() when MTRRs > > appear to be disabled (from the kernel's view). The goal

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-11 Thread Borislav Petkov
On Thu, Jul 07, 2022 at 08:38:44AM +0200, Jan Beulich wrote: > Well, right now the pvops hook for Xen swallows #GP anyway (wrongly > so imo, but any of my earlier pointing out of that has been left > unheard, despite even the code comments there saying "It may be worth > changing that"). Oh great.

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-06 Thread Jan Beulich
On 06.07.2022 19:01, Borislav Petkov wrote: > On Wed, Jul 06, 2022 at 08:17:41AM +0200, Jan Beulich wrote: >> Sure, but that alone won't help. > > Well, the MTRR code looks at X86_FEATURE_MTRR. If Xen doesn't expose the > MTRRs, then that bit should be clear in the CPUID the guest sees. > > So in

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-05 Thread Jan Beulich
On 05.07.2022 18:14, Borislav Petkov wrote: > On Tue, Jul 05, 2022 at 05:56:36PM +0200, Jan Beulich wrote: >> Re-using pat_disabled like you do in your suggestion below won't >> work, because mtrr_bp_init() calls pat_disable() when MTRRs >> appear to be disabled (from the kernel's view). The goal i

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-05 Thread Borislav Petkov
On Tue, Jul 05, 2022 at 05:56:36PM +0200, Jan Beulich wrote: > Re-using pat_disabled like you do in your suggestion below won't > work, because mtrr_bp_init() calls pat_disable() when MTRRs > appear to be disabled (from the kernel's view). The goal is to > honor "nopat" without honoring any other c

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-05 Thread Jan Beulich
On 05.07.2022 17:04, Borislav Petkov wrote: > On Thu, Apr 28, 2022 at 04:50:29PM +0200, Jan Beulich wrote: >> --- a/arch/x86/mm/pat/memtype.c >> +++ b/arch/x86/mm/pat/memtype.c >> @@ -62,6 +62,7 @@ >> >> static bool __read_mostly pat_bp_initialized; >> static bool __read_mostly pat_disabled = !

Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-05 Thread Juergen Gross
On 05.07.22 15:36, Borislav Petkov wrote: On Tue, Jul 05, 2022 at 12:57:18PM +0200, Thorsten Leemhuis wrote: Side note: Juergen Gross recently posted related patches in this code area to fix some other problems (regressions?), but his efforts look stalled, too: https://lore.kernel.org/all/ddb0cc

Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-05 Thread Jan Beulich
On 05.07.2022 12:57, Thorsten Leemhuis wrote: > [CCing tglx, mingo, Boris and Juergen] > > On 04.07.22 14:26, Jan Beulich wrote: >> On 04.07.2022 13:58, Thorsten Leemhuis wrote: >>> On 25.05.22 10:55, Jan Beulich wrote: On 28.04.2022 16:50, Jan Beulich wrote: > The latest with commit bdd8

Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-05 Thread Thorsten Leemhuis
[CCing tglx, mingo, Boris and Juergen] On 04.07.22 14:26, Jan Beulich wrote: > On 04.07.2022 13:58, Thorsten Leemhuis wrote: >> On 25.05.22 10:55, Jan Beulich wrote: >>> On 28.04.2022 16:50, Jan Beulich wrote: The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT with p

Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-04 Thread Jan Beulich
On 04.07.2022 13:58, Thorsten Leemhuis wrote: > On 25.05.22 10:55, Jan Beulich wrote: >> On 28.04.2022 16:50, Jan Beulich wrote: >>> The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT >>> with pat_enabled()") pat_enabled() returning false (because of PAT >>> initialization bein

Re: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-07-04 Thread Thorsten Leemhuis
On 25.05.22 10:55, Jan Beulich wrote: > On 28.04.2022 16:50, Jan Beulich wrote: >> The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT >> with pat_enabled()") pat_enabled() returning false (because of PAT >> initialization being suppressed in the absence of MTRRs being announced

Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-05-25 Thread Jan Beulich
On 28.04.2022 16:50, Jan Beulich wrote: > The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT > with pat_enabled()") pat_enabled() returning false (because of PAT > initialization being suppressed in the absence of MTRRs being announced > to be available) has become a problem: T

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-05-21 Thread Chuck Zmudzinski
On 4/28/22 10:50 AM, Jan Beulich wrote: The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT with pat_enabled()") pat_enabled() returning false (because of PAT initialization being suppressed in the absence of MTRRs being announced to be available) has become a problem: The i91

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-05-11 Thread Juergen Gross
On 03.05.22 14:54, Juergen Gross wrote: On 28.04.22 16:50, Jan Beulich wrote: The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT with pat_enabled()") pat_enabled() returning false (because of PAT initialization being suppressed in the absence of MTRRs being announced to be a

Re: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-05-03 Thread Juergen Gross
On 28.04.22 16:50, Jan Beulich wrote: The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT with pat_enabled()") pat_enabled() returning false (because of PAT initialization being suppressed in the absence of MTRRs being announced to be available) has become a problem: The i915

[PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen

2022-04-28 Thread Jan Beulich
The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT with pat_enabled()") pat_enabled() returning false (because of PAT initialization being suppressed in the absence of MTRRs being announced to be available) has become a problem: The i915 driver now fails to initialize when runn