linux-stable/arch
Jan Beulich a210408b90 x86/PAT: Have pat_enabled() properly reflect state when running on Xen
commit 72cbc8f04f upstream.

After commit ID in the Fixes: tag, pat_enabled() returns false (because
of PAT initialization being suppressed in the absence of MTRRs being
announced to be available).

This has become a problem: the i915 driver now fails to initialize when
running PV on Xen (i915_gem_object_pin_map() is where I located the
induced failure), and its error handling is flaky enough to (at least
sometimes) result in a hung system.

Yet even beyond that problem the keying of the use of WC mappings to
pat_enabled() (see arch_can_pci_mmap_wc()) means that in particular
graphics frame buffer accesses would have been quite a bit less optimal
than possible.

Arrange for the function to return true in such environments, without
undermining the rest of PAT MSR management logic considering PAT to be
disabled: specifically, no writes to the PAT MSR should occur.

For the new boolean to live in .init.data, init_cache_modes() also needs
moving to .init.text (where it could/should have lived already before).

  [ bp: This is the "small fix" variant for stable. It'll get replaced
    with a proper PAT and MTRR detection split upstream but that is too
    involved for a stable backport.
    - additional touchups to commit msg. Use cpu_feature_enabled(). ]

Fixes: bdd8b6c982 ("drm/i915: replace X86_FEATURE_PAT with pat_enabled()")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: <stable@vger.kernel.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/9385fa60-fa5d-f559-a137-6608408f88b0@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-31 17:18:14 +02:00
..
alpha Cleanups (and one fix) around struct mount handling. 2022-06-04 19:00:05 -07:00
arc This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
arm ARM: Marvell: Update PCIe fixup 2022-08-17 15:16:09 +02:00
arm64 KVM: arm64: Reject 32bit user PSTATE on asymmetric systems 2022-08-25 11:45:38 +02:00
csky csky/kprobe: reclaim insn_slot on kprobe unregistration 2022-08-25 11:45:46 +02:00
hexagon
ia64 ia64, processor: fix -Wincompatible-pointer-types in ia64_get_irr() 2022-08-17 15:13:56 +02:00
loongarch LoongArch: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-08-17 15:13:46 +02:00
m68k m68k: coldfire/device.c: protect FLEXCAN blocks 2022-08-25 11:45:15 +02:00
microblaze This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
mips MIPS: tlbex: Explicitly compare _PAGE_NO_EXEC against 0 2022-08-25 11:45:53 +02:00
nios2 nios2: add force_successful_syscall_return() 2022-08-25 11:45:27 +02:00
openrisc openrisc: io: Define iounmap argument as volatile 2022-08-25 11:45:46 +02:00
parisc parisc: Fix exception handler for fldw and fstw instructions 2022-08-31 17:17:59 +02:00
powerpc powerpc/64: Init jump labels before parse_early_param() 2022-08-25 11:45:53 +02:00
riscv RISC-V: Add fast call path of crash_kexec() 2022-08-25 11:45:50 +02:00
s390 Revert "s390/smp: enforce lowcore protection on CPU restart" 2022-08-17 15:16:20 +02:00
sh sh: convert nommu io{re,un}map() to static inline functions 2022-07-03 15:42:32 -07:00
sparc mmu_gather: Remove per arch tlb_{start,end}_vma() 2022-07-21 10:50:13 -07:00
um um: add "noreboot" command line option for PANIC_TIMEOUT=-1 setups 2022-08-25 11:45:45 +02:00
x86 x86/PAT: Have pat_enabled() properly reflect state when running on Xen 2022-08-31 17:18:14 +02:00
xtensa xtensa: iss: fix handling error cases in iss_net_configure() 2022-08-17 15:15:32 +02:00
.gitignore
Kconfig arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-08-17 15:13:59 +02:00