-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [Upstream] Update kernel base to 6.6.70-6.6.71 #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4dede80
8bbcc58
4d78dd3
341c678
24cae07
fc52f68
67687c7
51ca0b2
7f6f054
26d53c9
9610d3d
b192167
e37b087
236b206
8a43685
207eeb0
03c39c7
4dccf76
8dd91b5
151447f
8973879
4627697
2c5665d
fa4b382
582ab7b
8c1880a
57d6b24
e7e7be8
d2a6627
fb82350
af59782
46a9fdf
4d22302
f66b9a0
825b78f
fc88d93
017c556
117929d
f5679ff
d5d06ae
a9e3fa6
93128e2
e327e12
f81ac61
0144515
5b157ca
de48024
dcdfcfe
3e9d04f
a92aeaa
54a76f3
d5fe081
762557a
77ea018
9f2030a
39682d0
6d5a681
4d611cd
0a4b686
2c4ceff
f346b65
1b31d1e
396442e
4f3c0a5
ddf9d03
b2d42d5
40b86e2
1d1cebc
c5a2b54
370a10f
baabc30
bc49cd0
612d000
e7cd6a7
06822db
e1499b0
53c855d
6e05c65
6c87039
c075cc6
7cf17d7
90a0b6d
d6185a3
026198e
0dcadf0
425fdad
8302306
283acd8
0a1f270
7d27e44
ca5d088
1223c49
31fd301
7db3a33
cee9194
9626436
52cfbb1
e42cbb2
94de43c
83ecbb6
17f5a12
aa10dbe
bc83b89
9638a5c
4237a8c
016378e
15a6697
9f94c5f
4751489
ca7943a
c750196
1b9bdb2
ed6a820
5ca858b
f0827dc
84f007b
dba98df
856c30f
2191adf
8df35e0
3e3aff5
da864b9
0406239
20ca2e3
d8dc6f0
f54f0cb
4b5ca9d
e1b9ca9
d23f64b
24de9b2
1f6abe3
9de5f25
6dd3c66
ce941be
18eb723
5a4d75d
02c5772
2565b37
52814a1
32d3f0d
3afc0c0
6e91263
97414d4
ebd1563
ee5fc76
2eca73a
b6aa53b
bcb3065
df1ca84
978e301
befba0b
525a7a2
af18297
78dab1c
e3cfc39
5489d4c
9f14459
2fdc6c5
d693dd3
671e939
b221194
194d970
25b088a
131d85f
6e788f7
d3ce92d
86439bf
f1c0842
e531c57
481bb15
766a133
0373990
77f6af1
4df8393
1ae666c
f88e2bf
d478a2c
8764979
369fbe2
c3814eb
026e403
2776461
22716e5
75aec18
d1b0970
d1bd1ec
2c8a900
fca65c0
6eeab1a
2739775
6957fe6
ecd1de3
b8f60a8
d88d619
e3e2a0c
4b01aed
22d0ca8
d4f7ee7
0ef492a
6c28d11
ea7b9f5
39e87de
f43f558
c632b03
495e52d
5bf1041
eed31cf
c1a2ec5
c76a041
4d0d94f
cf92b2f
2d99986
b5ea062
4c94b87
91cc2a7
277827d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ | |
| KBUILD_DEFCONFIG := haps_hs_smp_defconfig | ||
|
|
||
| ifeq ($(CROSS_COMPILE),) | ||
| CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux-) | ||
| CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux- arc-linux-gnu-) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ERROR: trailing whitespace |
||
| endif | ||
|
|
||
| cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,32 +228,6 @@ static void __init node_mem_init(unsigned int node) | |
|
|
||
| #ifdef CONFIG_ACPI_NUMA | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?) |
||
| /* | ||
| * Sanity check to catch more bad NUMA configurations (they are amazingly | ||
| * common). Make sure the nodes cover all memory. | ||
| */ | ||
| static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi) | ||
| { | ||
| int i; | ||
| u64 numaram, biosram; | ||
|
|
||
| numaram = 0; | ||
| for (i = 0; i < mi->nr_blks; i++) { | ||
| u64 s = mi->blk[i].start >> PAGE_SHIFT; | ||
| u64 e = mi->blk[i].end >> PAGE_SHIFT; | ||
|
|
||
| numaram += e - s; | ||
| numaram -= __absent_pages_in_range(mi->blk[i].nid, s, e); | ||
| if ((s64)numaram < 0) | ||
| numaram = 0; | ||
| } | ||
| max_pfn = max_low_pfn; | ||
| biosram = max_pfn - absent_pages_in_range(0, max_pfn); | ||
|
|
||
| BUG_ON((s64)(biosram - numaram) >= (1 << (20 - PAGE_SHIFT))); | ||
| return true; | ||
| } | ||
|
|
||
| static void __init add_node_intersection(u32 node, u64 start, u64 size, u32 type) | ||
| { | ||
| static unsigned long num_physpages; | ||
|
|
@@ -399,7 +373,7 @@ int __init init_numa_memory(void) | |
|
|
||
| init_node_memblock(); | ||
| bpi_init_node_memblock(add_numamem_region); | ||
| if (numa_meminfo_cover_memory(&numa_meminfo) == false) | ||
| if (!memblock_validate_numa_coverage(SZ_1M)) | ||
| return -EINVAL; | ||
|
|
||
| for_each_node_mask(node, node_possible_map) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,18 +56,64 @@ struct pt_regs { | |
|
|
||
| #else /* __i386__ */ | ||
|
|
||
| struct fred_cs { | ||
| /* CS selector */ | ||
| u64 cs : 16, | ||
| /* Stack level at event time */ | ||
| sl : 2, | ||
| /* IBT in WAIT_FOR_ENDBRANCH state */ | ||
| wfe : 1, | ||
| : 45; | ||
| }; | ||
|
|
||
| struct fred_ss { | ||
| /* SS selector */ | ||
| u64 ss : 16, | ||
| /* STI state */ | ||
| sti : 1, | ||
| /* Set if syscall, sysenter or INT n */ | ||
| swevent : 1, | ||
| /* Event is NMI type */ | ||
| nmi : 1, | ||
| : 13, | ||
| /* Event vector */ | ||
| vector : 8, | ||
| : 8, | ||
| /* Event type */ | ||
| type : 4, | ||
| : 4, | ||
| /* Event was incident to enclave execution */ | ||
| enclave : 1, | ||
| /* CPU was in long mode */ | ||
| lm : 1, | ||
| /* | ||
| * Nested exception during FRED delivery, not set | ||
| * for #DF. | ||
| */ | ||
| nested : 1, | ||
| : 1, | ||
| /* | ||
| * The length of the instruction causing the event. | ||
| * Only set for INTO, INT1, INT3, INT n, SYSCALL | ||
| * and SYSENTER. 0 otherwise. | ||
| */ | ||
| insnlen : 4; | ||
| }; | ||
|
|
||
| struct pt_regs { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?) |
||
| /* | ||
| * C ABI says these regs are callee-preserved. They aren't saved on kernel entry | ||
| * unless syscall needs a complete, fully filled "struct pt_regs". | ||
| */ | ||
| /* | ||
| * C ABI says these regs are callee-preserved. They aren't saved on | ||
| * kernel entry unless syscall needs a complete, fully filled | ||
| * "struct pt_regs". | ||
| */ | ||
| unsigned long r15; | ||
| unsigned long r14; | ||
| unsigned long r13; | ||
| unsigned long r12; | ||
| unsigned long bp; | ||
| unsigned long bx; | ||
| /* These regs are callee-clobbered. Always saved on kernel entry. */ | ||
|
|
||
| /* These regs are callee-clobbered. Always saved on kernel entry. */ | ||
| unsigned long r11; | ||
| unsigned long r10; | ||
| unsigned long r9; | ||
|
|
@@ -77,18 +123,50 @@ struct pt_regs { | |
| unsigned long dx; | ||
| unsigned long si; | ||
| unsigned long di; | ||
| /* | ||
| * On syscall entry, this is syscall#. On CPU exception, this is error code. | ||
| * On hw interrupt, it's IRQ number: | ||
| */ | ||
|
|
||
| /* | ||
| * orig_ax is used on entry for: | ||
| * - the syscall number (syscall, sysenter, int80) | ||
| * - error_code stored by the CPU on traps and exceptions | ||
| * - the interrupt number for device interrupts | ||
| * | ||
| * A FRED stack frame starts here: | ||
| * 1) It _always_ includes an error code; | ||
| * | ||
| * 2) The return frame for ERET[US] starts here, but | ||
| * the content of orig_ax is ignored. | ||
| */ | ||
| unsigned long orig_ax; | ||
| /* Return frame for iretq */ | ||
|
|
||
| /* The IRETQ return frame starts here */ | ||
| unsigned long ip; | ||
| unsigned long cs; | ||
|
|
||
| union { | ||
| /* CS selector */ | ||
| u16 cs; | ||
| /* The extended 64-bit data slot containing CS */ | ||
| u64 csx; | ||
| /* The FRED CS extension */ | ||
| struct fred_cs fred_cs; | ||
| }; | ||
|
|
||
| unsigned long flags; | ||
| unsigned long sp; | ||
| unsigned long ss; | ||
| /* top of stack page */ | ||
|
|
||
| union { | ||
| /* SS selector */ | ||
| u16 ss; | ||
| /* The extended 64-bit data slot containing SS */ | ||
| u64 ssx; | ||
| /* The FRED SS extension */ | ||
| struct fred_ss fred_ss; | ||
| }; | ||
|
|
||
| /* | ||
| * Top of stack on IDT systems, while FRED systems have extra fields | ||
| * defined above for storing exception related information, e.g. CR2 or | ||
| * DR6. | ||
| */ | ||
| }; | ||
|
|
||
| #endif /* !__i386__ */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,34 @@ static void do_user_cp_fault(struct pt_regs *regs, unsigned long error_code) | |
|
|
||
| static __ro_after_init bool ibt_fatal = true; | ||
|
|
||
| /* | ||
| * By definition, all missing-ENDBRANCH #CPs are a result of WFE && !ENDBR. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?) |
||
| * | ||
| * For the kernel IBT no ENDBR selftest where #CPs are deliberately triggered, | ||
| * the WFE state of the interrupted context needs to be cleared to let execution | ||
| * continue. Otherwise when the CPU resumes from the instruction that just | ||
| * caused the previous #CP, another missing-ENDBRANCH #CP is raised and the CPU | ||
| * enters a dead loop. | ||
| * | ||
| * This is not a problem with IDT because it doesn't preserve WFE and IRET doesn't | ||
| * set WFE. But FRED provides space on the entry stack (in an expanded CS area) | ||
| * to save and restore the WFE state, thus the WFE state is no longer clobbered, | ||
| * so software must clear it. | ||
| */ | ||
| static void ibt_clear_fred_wfe(struct pt_regs *regs) | ||
| { | ||
| /* | ||
| * No need to do any FRED checks. | ||
| * | ||
| * For IDT event delivery, the high-order 48 bits of CS are pushed | ||
| * as 0s into the stack, and later IRET ignores these bits. | ||
| * | ||
| * For FRED, a test to check if fred_cs.wfe is set would be dropped | ||
| * by compilers. | ||
| */ | ||
| regs->fred_cs.wfe = 0; | ||
| } | ||
|
|
||
| static void do_kernel_cp_fault(struct pt_regs *regs, unsigned long error_code) | ||
| { | ||
| if ((error_code & CP_EC) != CP_ENDBR) { | ||
|
|
@@ -90,13 +118,15 @@ static void do_kernel_cp_fault(struct pt_regs *regs, unsigned long error_code) | |
|
|
||
| if (unlikely(regs->ip == (unsigned long)&ibt_selftest_noendbr)) { | ||
| regs->ax = 0; | ||
| ibt_clear_fred_wfe(regs); | ||
| return; | ||
| } | ||
|
|
||
| pr_err("Missing ENDBR: %pS\n", (void *)instruction_pointer(regs)); | ||
| if (!ibt_fatal) { | ||
| printk(KERN_DEFAULT CUT_HERE); | ||
| __warn(__FILE__, __LINE__, (void *)regs->ip, TAINT_WARN, regs, NULL); | ||
| ibt_clear_fred_wfe(regs); | ||
| return; | ||
| } | ||
| BUG(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -222,6 +222,63 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs) | |
| hyperv_cleanup(); | ||
| } | ||
| #endif /* CONFIG_KEXEC_CORE */ | ||
|
|
||
| static u64 hv_ref_counter_at_suspend; | ||
| static void (*old_save_sched_clock_state)(void); | ||
| static void (*old_restore_sched_clock_state)(void); | ||
|
|
||
| /* | ||
| * Hyper-V clock counter resets during hibernation. Save and restore clock | ||
| * offset during suspend/resume, while also considering the time passed | ||
| * before suspend. This is to make sure that sched_clock using hv tsc page | ||
| * based clocksource, proceeds from where it left off during suspend and | ||
| * it shows correct time for the timestamps of kernel messages after resume. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?) |
||
| */ | ||
| static void save_hv_clock_tsc_state(void) | ||
| { | ||
| hv_ref_counter_at_suspend = hv_read_reference_counter(); | ||
| } | ||
|
|
||
| static void restore_hv_clock_tsc_state(void) | ||
| { | ||
| /* | ||
| * Adjust the offsets used by hv tsc clocksource to | ||
| * account for the time spent before hibernation. | ||
| * adjusted value = reference counter (time) at suspend | ||
| * - reference counter (time) now. | ||
| */ | ||
| hv_adj_sched_clock_offset(hv_ref_counter_at_suspend - hv_read_reference_counter()); | ||
| } | ||
|
|
||
| /* | ||
| * Functions to override save_sched_clock_state and restore_sched_clock_state | ||
| * functions of x86_platform. The Hyper-V clock counter is reset during | ||
| * suspend-resume and the offset used to measure time needs to be | ||
| * corrected, post resume. | ||
| */ | ||
| static void hv_save_sched_clock_state(void) | ||
| { | ||
| old_save_sched_clock_state(); | ||
| save_hv_clock_tsc_state(); | ||
| } | ||
|
|
||
| static void hv_restore_sched_clock_state(void) | ||
| { | ||
| restore_hv_clock_tsc_state(); | ||
| old_restore_sched_clock_state(); | ||
| } | ||
|
|
||
| static void __init x86_setup_ops_for_tsc_pg_clock(void) | ||
| { | ||
| if (!(ms_hyperv.features & HV_MSR_REFERENCE_TSC_AVAILABLE)) | ||
| return; | ||
|
|
||
| old_save_sched_clock_state = x86_platform.save_sched_clock_state; | ||
| x86_platform.save_sched_clock_state = hv_save_sched_clock_state; | ||
|
|
||
| old_restore_sched_clock_state = x86_platform.restore_sched_clock_state; | ||
| x86_platform.restore_sched_clock_state = hv_restore_sched_clock_state; | ||
| } | ||
| #endif /* CONFIG_HYPERV */ | ||
|
|
||
| static uint32_t __init ms_hyperv_platform(void) | ||
|
|
@@ -572,6 +629,7 @@ static void __init ms_hyperv_init_platform(void) | |
|
|
||
| /* Register Hyper-V specific clocksource */ | ||
| hv_init_clocksource(); | ||
| x86_setup_ops_for_tsc_pg_clock(); | ||
| hv_vtl_init_platform(); | ||
| #endif | ||
| /* | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)