mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
Misc fixes:
- Fix 32-bit kernel boot crash if passed physical memory with more than 32 address bits - Fix Xen PV crash - Work around build bug in certain limited build environments - Fix CTEST instruction decoding in insn_decoder_test Signed-off-by: Ingo Molnar <mingo@kernel.org> -----BEGIN PGP SIGNATURE----- iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmgMn5IRHG1pbmdvQGtl cm5lbC5vcmcACgkQEnMQ0APhK1i8RxAArWZugF69H0bvVToCLaJhZJdQooyKO0Tu 438ctAKCQqblr4dw34KiaWLE4KyGPMHtNaEQPQIJNJjXVShjbazui/K/M1/0SWt/ KKpZ+P86Jlm9Ws8C8wht3q7db1sdWvsl+H0yUhMdFCQBKsxXiYLTwqIp2vQaSJt2 N3VWupzrYEV/XRp1qgeA8WlOa/p1+30MfnLRnXsYUoHyRNxPzvnrUM8ALMbHSP2P iifB+h33awGwAYR3Tqt601YcaTw2hR3xqZzAETrJQRNmF9w2GVE3omiw99a1MSgH uxtvhnp49haTIhRapabwGJ2FB2TaZapaTw/r/U2HEGmtuEuPHdm5stba9AJo8kDD J9yoneJBeRNzxK2TVi3pS3w9hcuzYDdgyZ5m3U8th5UTMa/widE0c8BtD6BSn23i qI52Zvfb/CX/seIDP1ib/Yb7iUTllB315tD7TRIrEtwPzs1YFyW1/tphIXnqfdsZ OHgoR6rg2PfomMo7Uh+u8E/SzpJkTkS4yRt8IMQCm0b2aMCILgpvhMp03VQURbXU KAQomfCECWvaoqAq4+pOZIoJ8s2J7+aw1VmaYMu3q0ctpRD+uObprCZlZ5AHqejg 57/fcVs1MgQhnGymM16hYAukd4cc0G/DV0xN2fD0ryRZmpjKBcRB1Ac2iylSHvh8 9+3EI8dit7E= =DbEx -----END PGP SIGNATURE----- Merge tag 'x86-urgent-2025-04-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 fixes from Ingo Molnar: - Fix 32-bit kernel boot crash if passed physical memory with more than 32 address bits - Fix Xen PV crash - Work around build bug in certain limited build environments - Fix CTEST instruction decoding in insn_decoder_test * tag 'x86-urgent-2025-04-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/insn: Fix CTEST instruction decoding x86/boot: Work around broken busybox 'truncate' tool x86/mm: Fix _pgd_alloc() for Xen PV mode x86/e820: Discard high memory that can't be addressed by 32-bit systems
This commit is contained in:
commit
06b31bdbf8
|
@ -59,7 +59,7 @@ KBUILD_CFLAGS += $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
|
|||
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
|
||||
|
||||
quiet_cmd_image = BUILD $@
|
||||
cmd_image = cp $< $@; truncate -s %4K $@; cat $(obj)/vmlinux.bin >>$@
|
||||
cmd_image = (dd if=$< bs=4k conv=sync status=none; cat $(filter-out $<,$(real-prereqs))) >$@
|
||||
|
||||
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,image)
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include <linux/mm.h> /* for struct page */
|
||||
#include <linux/pagemap.h>
|
||||
|
||||
#include <asm/cpufeature.h>
|
||||
|
||||
#define __HAVE_ARCH_PTE_ALLOC_ONE
|
||||
#define __HAVE_ARCH_PGD_FREE
|
||||
#include <asm-generic/pgalloc.h>
|
||||
|
@ -29,16 +31,17 @@ static inline void paravirt_release_pud(unsigned long pfn) {}
|
|||
static inline void paravirt_release_p4d(unsigned long pfn) {}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MITIGATION_PAGE_TABLE_ISOLATION
|
||||
/*
|
||||
* Instead of one PGD, we acquire two PGDs. Being order-1, it is
|
||||
* both 8k in size and 8k-aligned. That lets us just flip bit 12
|
||||
* in a pointer to swap between the two 4k halves.
|
||||
* In case of Page Table Isolation active, we acquire two PGDs instead of one.
|
||||
* Being order-1, it is both 8k in size and 8k-aligned. That lets us just
|
||||
* flip bit 12 in a pointer to swap between the two 4k halves.
|
||||
*/
|
||||
#define PGD_ALLOCATION_ORDER 1
|
||||
#else
|
||||
#define PGD_ALLOCATION_ORDER 0
|
||||
#endif
|
||||
static inline unsigned int pgd_allocation_order(void)
|
||||
{
|
||||
if (cpu_feature_enabled(X86_FEATURE_PTI))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate and free page tables.
|
||||
|
|
|
@ -1299,6 +1299,14 @@ void __init e820__memblock_setup(void)
|
|||
memblock_add(entry->addr, entry->size);
|
||||
}
|
||||
|
||||
/*
|
||||
* 32-bit systems are limited to 4BG of memory even with HIGHMEM and
|
||||
* to even less without it.
|
||||
* Discard memory after max_pfn - the actual limit detected at runtime.
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_X86_32))
|
||||
memblock_remove(PFN_PHYS(max_pfn), -1);
|
||||
|
||||
/* Throw away partial pages: */
|
||||
memblock_trim_memory(PAGE_SIZE);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ static void load_segments(void)
|
|||
|
||||
static void machine_kexec_free_page_tables(struct kimage *image)
|
||||
{
|
||||
free_pages((unsigned long)image->arch.pgd, PGD_ALLOCATION_ORDER);
|
||||
free_pages((unsigned long)image->arch.pgd, pgd_allocation_order());
|
||||
image->arch.pgd = NULL;
|
||||
#ifdef CONFIG_X86_PAE
|
||||
free_page((unsigned long)image->arch.pmd0);
|
||||
|
@ -59,7 +59,7 @@ static void machine_kexec_free_page_tables(struct kimage *image)
|
|||
static int machine_kexec_alloc_page_tables(struct kimage *image)
|
||||
{
|
||||
image->arch.pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
|
||||
PGD_ALLOCATION_ORDER);
|
||||
pgd_allocation_order());
|
||||
#ifdef CONFIG_X86_PAE
|
||||
image->arch.pmd0 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
|
||||
image->arch.pmd1 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
|
||||
|
|
|
@ -996,8 +996,8 @@ AVXcode: 4
|
|||
83: Grp1 Ev,Ib (1A),(es)
|
||||
# CTESTSCC instructions are: CTESTB, CTESTBE, CTESTF, CTESTL, CTESTLE, CTESTNB, CTESTNBE, CTESTNL,
|
||||
# CTESTNLE, CTESTNO, CTESTNS, CTESTNZ, CTESTO, CTESTS, CTESTT, CTESTZ
|
||||
84: CTESTSCC (ev)
|
||||
85: CTESTSCC (es) | CTESTSCC (66),(es)
|
||||
84: CTESTSCC Eb,Gb (ev)
|
||||
85: CTESTSCC Ev,Gv (es) | CTESTSCC Ev,Gv (66),(es)
|
||||
88: POPCNT Gv,Ev (es) | POPCNT Gv,Ev (66),(es)
|
||||
8f: POP2 Bq,Rq (000),(11B),(ev)
|
||||
a5: SHLD Ev,Gv,CL (es) | SHLD Ev,Gv,CL (66),(es)
|
||||
|
|
|
@ -360,7 +360,7 @@ static inline pgd_t *_pgd_alloc(struct mm_struct *mm)
|
|||
* We allocate one page for pgd.
|
||||
*/
|
||||
if (!SHARED_KERNEL_PMD)
|
||||
return __pgd_alloc(mm, PGD_ALLOCATION_ORDER);
|
||||
return __pgd_alloc(mm, pgd_allocation_order());
|
||||
|
||||
/*
|
||||
* Now PAE kernel is not running as a Xen domain. We can allocate
|
||||
|
@ -380,7 +380,7 @@ static inline void _pgd_free(struct mm_struct *mm, pgd_t *pgd)
|
|||
|
||||
static inline pgd_t *_pgd_alloc(struct mm_struct *mm)
|
||||
{
|
||||
return __pgd_alloc(mm, PGD_ALLOCATION_ORDER);
|
||||
return __pgd_alloc(mm, pgd_allocation_order());
|
||||
}
|
||||
|
||||
static inline void _pgd_free(struct mm_struct *mm, pgd_t *pgd)
|
||||
|
|
|
@ -73,7 +73,7 @@ int __init efi_alloc_page_tables(void)
|
|||
gfp_t gfp_mask;
|
||||
|
||||
gfp_mask = GFP_KERNEL | __GFP_ZERO;
|
||||
efi_pgd = (pgd_t *)__get_free_pages(gfp_mask, PGD_ALLOCATION_ORDER);
|
||||
efi_pgd = (pgd_t *)__get_free_pages(gfp_mask, pgd_allocation_order());
|
||||
if (!efi_pgd)
|
||||
goto fail;
|
||||
|
||||
|
@ -96,7 +96,7 @@ free_p4d:
|
|||
if (pgtable_l5_enabled())
|
||||
free_page((unsigned long)pgd_page_vaddr(*pgd));
|
||||
free_pgd:
|
||||
free_pages((unsigned long)efi_pgd, PGD_ALLOCATION_ORDER);
|
||||
free_pages((unsigned long)efi_pgd, pgd_allocation_order());
|
||||
fail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
@ -996,8 +996,8 @@ AVXcode: 4
|
|||
83: Grp1 Ev,Ib (1A),(es)
|
||||
# CTESTSCC instructions are: CTESTB, CTESTBE, CTESTF, CTESTL, CTESTLE, CTESTNB, CTESTNBE, CTESTNL,
|
||||
# CTESTNLE, CTESTNO, CTESTNS, CTESTNZ, CTESTO, CTESTS, CTESTT, CTESTZ
|
||||
84: CTESTSCC (ev)
|
||||
85: CTESTSCC (es) | CTESTSCC (66),(es)
|
||||
84: CTESTSCC Eb,Gb (ev)
|
||||
85: CTESTSCC Ev,Gv (es) | CTESTSCC Ev,Gv (66),(es)
|
||||
88: POPCNT Gv,Ev (es) | POPCNT Gv,Ev (66),(es)
|
||||
8f: POP2 Bq,Rq (000),(11B),(ev)
|
||||
a5: SHLD Ev,Gv,CL (es) | SHLD Ev,Gv,CL (66),(es)
|
||||
|
|
Loading…
Reference in New Issue
Block a user