Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
"A small set of fixes:

- UAPI data type correction for hyperv

- correct the cpu cores field in /proc/cpuinfo on CPU hotplug

- return proper error code in the resctrl file system failure path to
avoid silent subsequent failures

- correct a subtle accounting issue in the new vector allocation code
which went unnoticed for a while and caused suspend/resume
failures"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/topology: Update the 'cpu cores' field in /proc/cpuinfo correctly across CPU hotplug operations
x86/topology: Fix function name in documentation
x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
x86/apic/vector: Handle vector release on CPU unplug correctly
genirq/matrix: Handle CPU offlining proper
x86/headers/UAPI: Use __u64 instead of u64 in <uapi/asm/hyperv.h>

+48 -22
+1 -1
Documentation/x86/topology.txt
··· 108 108 109 109 The number of online threads is also printed in /proc/cpuinfo "siblings." 110 110 111 - - topology_sibling_mask(): 111 + - topology_sibling_cpumask(): 112 112 113 113 The cpumask contains all online threads in the core to which a thread 114 114 belongs.
+9 -9
arch/x86/include/uapi/asm/hyperv.h
··· 241 241 #define HV_X64_MSR_REENLIGHTENMENT_CONTROL 0x40000106 242 242 243 243 struct hv_reenlightenment_control { 244 - u64 vector:8; 245 - u64 reserved1:8; 246 - u64 enabled:1; 247 - u64 reserved2:15; 248 - u64 target_vp:32; 244 + __u64 vector:8; 245 + __u64 reserved1:8; 246 + __u64 enabled:1; 247 + __u64 reserved2:15; 248 + __u64 target_vp:32; 249 249 }; 250 250 251 251 #define HV_X64_MSR_TSC_EMULATION_CONTROL 0x40000107 252 252 #define HV_X64_MSR_TSC_EMULATION_STATUS 0x40000108 253 253 254 254 struct hv_tsc_emulation_control { 255 - u64 enabled:1; 256 - u64 reserved:63; 255 + __u64 enabled:1; 256 + __u64 reserved:63; 257 257 }; 258 258 259 259 struct hv_tsc_emulation_status { 260 - u64 inprogress:1; 261 - u64 reserved:63; 260 + __u64 inprogress:1; 261 + __u64 reserved:63; 262 262 }; 263 263 264 264 #define HV_X64_MSR_HYPERCALL_ENABLE 0x00000001
+22 -3
arch/x86/kernel/apic/vector.c
··· 134 134 { 135 135 struct apic_chip_data *apicd = apic_chip_data(irqd); 136 136 struct irq_desc *desc = irq_data_to_desc(irqd); 137 + bool managed = irqd_affinity_is_managed(irqd); 137 138 138 139 lockdep_assert_held(&vector_lock); 139 140 140 141 trace_vector_update(irqd->irq, newvec, newcpu, apicd->vector, 141 142 apicd->cpu); 142 143 143 - /* Setup the vector move, if required */ 144 - if (apicd->vector && cpu_online(apicd->cpu)) { 144 + /* 145 + * If there is no vector associated or if the associated vector is 146 + * the shutdown vector, which is associated to make PCI/MSI 147 + * shutdown mode work, then there is nothing to release. Clear out 148 + * prev_vector for this and the offlined target case. 149 + */ 150 + apicd->prev_vector = 0; 151 + if (!apicd->vector || apicd->vector == MANAGED_IRQ_SHUTDOWN_VECTOR) 152 + goto setnew; 153 + /* 154 + * If the target CPU of the previous vector is online, then mark 155 + * the vector as move in progress and store it for cleanup when the 156 + * first interrupt on the new vector arrives. If the target CPU is 157 + * offline then the regular release mechanism via the cleanup 158 + * vector is not possible and the vector can be immediately freed 159 + * in the underlying matrix allocator. 160 + */ 161 + if (cpu_online(apicd->cpu)) { 145 162 apicd->move_in_progress = true; 146 163 apicd->prev_vector = apicd->vector; 147 164 apicd->prev_cpu = apicd->cpu; 148 165 } else { 149 - apicd->prev_vector = 0; 166 + irq_matrix_free(vector_matrix, apicd->cpu, apicd->vector, 167 + managed); 150 168 } 151 169 170 + setnew: 152 171 apicd->vector = newvec; 153 172 apicd->cpu = newcpu; 154 173 BUG_ON(!IS_ERR_OR_NULL(per_cpu(vector_irq, newcpu)[newvec]));
+1
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
··· 1804 1804 goto out_common_fail; 1805 1805 } 1806 1806 closid = ret; 1807 + ret = 0; 1807 1808 1808 1809 rdtgrp->closid = closid; 1809 1810 list_add(&rdtgrp->rdtgroup_list, &rdt_all_groups);
+1
arch/x86/kernel/smpboot.c
··· 1437 1437 cpumask_clear(topology_sibling_cpumask(cpu)); 1438 1438 cpumask_clear(topology_core_cpumask(cpu)); 1439 1439 c->cpu_core_id = 0; 1440 + c->booted_cores = 0; 1440 1441 cpumask_clear_cpu(cpu, cpu_sibling_setup_mask); 1441 1442 recompute_smt_state(); 1442 1443 }
+14 -9
kernel/irq/matrix.c
··· 16 16 unsigned int available; 17 17 unsigned int allocated; 18 18 unsigned int managed; 19 + bool initialized; 19 20 bool online; 20 21 unsigned long alloc_map[IRQ_MATRIX_SIZE]; 21 22 unsigned long managed_map[IRQ_MATRIX_SIZE]; ··· 82 81 83 82 BUG_ON(cm->online); 84 83 85 - bitmap_zero(cm->alloc_map, m->matrix_bits); 86 - cm->available = m->alloc_size - (cm->managed + m->systembits_inalloc); 87 - cm->allocated = 0; 84 + if (!cm->initialized) { 85 + cm->available = m->alloc_size; 86 + cm->available -= cm->managed + m->systembits_inalloc; 87 + cm->initialized = true; 88 + } 88 89 m->global_available += cm->available; 89 90 cm->online = true; 90 91 m->online_maps++; ··· 373 370 if (WARN_ON_ONCE(bit < m->alloc_start || bit >= m->alloc_end)) 374 371 return; 375 372 376 - if (cm->online) { 377 - clear_bit(bit, cm->alloc_map); 378 - cm->allocated--; 373 + clear_bit(bit, cm->alloc_map); 374 + cm->allocated--; 375 + 376 + if (cm->online) 379 377 m->total_allocated--; 380 - if (!managed) { 381 - cm->available++; 378 + 379 + if (!managed) { 380 + cm->available++; 381 + if (cm->online) 382 382 m->global_available++; 383 - } 384 383 } 385 384 trace_irq_matrix_free(bit, cpu, m, cm); 386 385 }