Skip to content

Commit 6eb1acd

Browse files
committed
Merge tag 'for-linus-6.7a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen updates from Juergen Gross: - A fix in the Xen events driver avoiding the use of RCU after the call to rcu_report_dead() when taking a cpu down - A fix for running as Xen dom0 to line up ACPI's idea of power management capabilities with the one of Xen - A cleanup eliminating several kernel-doc warnings in Xen related code - A cleanup series of the Xen events driver * tag 'for-linus-6.7a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/events: remove some info_for_irq() calls in pirq handling xen/events: modify internal [un]bind interfaces xen/events: drop xen_allocate_irqs_dynamic() xen/events: remove some simple helpers from events_base.c xen/events: reduce externally visible helper functions xen/events: remove unused functions xen/events: fix delayed eoi list handling xen/shbuf: eliminate 17 kernel-doc warnings acpi/processor: sanitize _OSC/_PDC capabilities for Xen dom0 xen/events: avoid using info_for_irq() in xen_send_IPI_one()
2 parents 372bed5 + cee9642 commit 6eb1acd

File tree

8 files changed

+347
-325
lines changed

8 files changed

+347
-325
lines changed

arch/x86/include/asm/acpi.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#include <asm/x86_init.h>
1717
#include <asm/cpufeature.h>
1818
#include <asm/irq_vectors.h>
19+
#include <asm/xen/hypervisor.h>
20+
21+
#include <xen/xen.h>
1922

2023
#ifdef CONFIG_ACPI_APEI
2124
# include <asm/pgtable_types.h>
@@ -127,6 +130,17 @@ static inline void arch_acpi_set_proc_cap_bits(u32 *cap)
127130
if (!cpu_has(c, X86_FEATURE_MWAIT) ||
128131
boot_option_idle_override == IDLE_NOMWAIT)
129132
*cap &= ~(ACPI_PROC_CAP_C_C1_FFH | ACPI_PROC_CAP_C_C2C3_FFH);
133+
134+
if (xen_initial_domain()) {
135+
/*
136+
* When Linux is running as Xen dom0, the hypervisor is the
137+
* entity in charge of the processor power management, and so
138+
* Xen needs to check the OS capabilities reported in the
139+
* processor capabilities buffer matches what the hypervisor
140+
* driver supports.
141+
*/
142+
xen_sanitize_proc_cap_bits(cap);
143+
}
130144
}
131145

132146
static inline bool acpi_has_cpu_in_madt(void)

arch/x86/include/asm/xen/hypervisor.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,13 @@ static inline void leave_lazy(enum xen_lazy_mode mode)
100100

101101
enum xen_lazy_mode xen_get_lazy_mode(void);
102102

103+
#if defined(CONFIG_XEN_DOM0) && defined(CONFIG_ACPI)
104+
void xen_sanitize_proc_cap_bits(uint32_t *buf);
105+
#else
106+
static inline void xen_sanitize_proc_cap_bits(uint32_t *buf)
107+
{
108+
BUG();
109+
}
110+
#endif
111+
103112
#endif /* _ASM_X86_XEN_HYPERVISOR_H */

drivers/xen/events/events_2l.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ static void evtchn_2l_handle_events(unsigned cpu, struct evtchn_loop_ctrl *ctrl)
171171
int i;
172172
struct shared_info *s = HYPERVISOR_shared_info;
173173
struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);
174+
evtchn_port_t evtchn;
174175

175176
/* Timer interrupt has highest priority. */
176-
irq = irq_from_virq(cpu, VIRQ_TIMER);
177+
irq = irq_evtchn_from_virq(cpu, VIRQ_TIMER, &evtchn);
177178
if (irq != -1) {
178-
evtchn_port_t evtchn = evtchn_from_irq(irq);
179179
word_idx = evtchn / BITS_PER_LONG;
180180
bit_idx = evtchn % BITS_PER_LONG;
181181
if (active_evtchns(cpu, s, word_idx) & (1ULL << bit_idx))
@@ -328,9 +328,9 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
328328
for (i = 0; i < EVTCHN_2L_NR_CHANNELS; i++) {
329329
if (sync_test_bit(i, BM(sh->evtchn_pending))) {
330330
int word_idx = i / BITS_PER_EVTCHN_WORD;
331-
printk(" %d: event %d -> irq %d%s%s%s\n",
331+
printk(" %d: event %d -> irq %u%s%s%s\n",
332332
cpu_from_evtchn(i), i,
333-
get_evtchn_to_irq(i),
333+
irq_from_evtchn(i),
334334
sync_test_bit(word_idx, BM(&v->evtchn_pending_sel))
335335
? "" : " l2-clear",
336336
!sync_test_bit(i, BM(sh->evtchn_mask))

0 commit comments

Comments
 (0)