Merge tag 'x86_urgent_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:
"I kinda knew while typing 'I hope this is the last batch of x86/urgent
updates' last week, Murphy was reading too and uttered 'Hold my
beer!'.

So here's more fixes... Thanks Murphy.

Anyway, three more x86/urgent fixes for 5.11 final. We should be
finally ready (famous last words). :-)

- An SGX use after free fix

- A fix for the fix to disable CET instrumentation generation for
kernel code. We forgot 32-bit, which we seem to do very often
nowadays

- A Xen PV fix to irqdomain init ordering"

* tag 'x86_urgent_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/pci: Create PCI/MSI irqdomain after x86_init.pci.arch_init()
x86/build: Disable CET instrumentation in the kernel for 32-bit too
x86/sgx: Maintain encl->refcount for each encl->mm_list entry

Changed files
+22 -7
arch
x86
kernel
cpu
pci
+3 -3
arch/x86/Makefile
··· 50 50 KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow 51 51 KBUILD_CFLAGS += $(call cc-option,-mno-avx,) 52 52 53 + # Intel CET isn't enabled in the kernel 54 + KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) 55 + 53 56 ifeq ($(CONFIG_X86_32),y) 54 57 BITS := 32 55 58 UTS_MACHINE := i386 ··· 123 120 124 121 KBUILD_CFLAGS += -mno-red-zone 125 122 KBUILD_CFLAGS += -mcmodel=kernel 126 - 127 - # Intel CET isn't enabled in the kernel 128 - KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) 129 123 endif 130 124 131 125 ifdef CONFIG_X86_X32
+3
arch/x86/kernel/cpu/sgx/driver.c
··· 72 72 synchronize_srcu(&encl->srcu); 73 73 mmu_notifier_unregister(&encl_mm->mmu_notifier, encl_mm->mm); 74 74 kfree(encl_mm); 75 + 76 + /* 'encl_mm' is gone, put encl_mm->encl reference: */ 77 + kref_put(&encl->refcount, sgx_encl_release); 75 78 } 76 79 77 80 kref_put(&encl->refcount, sgx_encl_release);
+5
arch/x86/kernel/cpu/sgx/encl.c
··· 481 481 { 482 482 struct sgx_encl_mm *encl_mm = container_of(mn, struct sgx_encl_mm, mmu_notifier); 483 483 484 + /* 'encl_mm' is going away, put encl_mm->encl reference: */ 485 + kref_put(&encl_mm->encl->refcount, sgx_encl_release); 486 + 484 487 kfree(encl_mm); 485 488 } 486 489 ··· 537 534 if (!encl_mm) 538 535 return -ENOMEM; 539 536 537 + /* Grab a refcount for the encl_mm->encl reference: */ 538 + kref_get(&encl->refcount); 540 539 encl_mm->encl = encl; 541 540 encl_mm->mm = mm; 542 541 encl_mm->mmu_notifier.ops = &sgx_mmu_notifier_ops;
+11 -4
arch/x86/pci/init.c
··· 9 9 in the right sequence from here. */ 10 10 static __init int pci_arch_init(void) 11 11 { 12 - int type; 13 - 14 - x86_create_pci_msi_domain(); 12 + int type, pcbios = 1; 15 13 16 14 type = pci_direct_probe(); 17 15 18 16 if (!(pci_probe & PCI_PROBE_NOEARLY)) 19 17 pci_mmcfg_early_init(); 20 18 21 - if (x86_init.pci.arch_init && !x86_init.pci.arch_init()) 19 + if (x86_init.pci.arch_init) 20 + pcbios = x86_init.pci.arch_init(); 21 + 22 + /* 23 + * Must happen after x86_init.pci.arch_init(). Xen sets up the 24 + * x86_init.irqs.create_pci_msi_domain there. 25 + */ 26 + x86_create_pci_msi_domain(); 27 + 28 + if (!pcbios) 22 29 return 0; 23 30 24 31 pci_pcbios_init();