|
@@ -1026,6 +1026,8 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
|
|
}
|
|
}
|
|
|
|
|
|
static DEFINE_PER_CPU(unsigned, xed_nesting_count);
|
|
static DEFINE_PER_CPU(unsigned, xed_nesting_count);
|
|
|
|
+static DEFINE_PER_CPU(unsigned int, last_word_idx) = { BITS_PER_LONG - 1 };
|
|
|
|
+static DEFINE_PER_CPU(unsigned int, last_bit_idx) = { BITS_PER_LONG - 1 };
|
|
|
|
|
|
/*
|
|
/*
|
|
* Mask out the i least significant bits of w
|
|
* Mask out the i least significant bits of w
|
|
@@ -1043,8 +1045,6 @@ static DEFINE_PER_CPU(unsigned, xed_nesting_count);
|
|
*/
|
|
*/
|
|
static void __xen_evtchn_do_upcall(void)
|
|
static void __xen_evtchn_do_upcall(void)
|
|
{
|
|
{
|
|
- static unsigned int last_word_idx = BITS_PER_LONG - 1;
|
|
|
|
- static unsigned int last_bit_idx = BITS_PER_LONG - 1;
|
|
|
|
int word_idx, bit_idx;
|
|
int word_idx, bit_idx;
|
|
int cpu = get_cpu();
|
|
int cpu = get_cpu();
|
|
struct shared_info *s = HYPERVISOR_shared_info;
|
|
struct shared_info *s = HYPERVISOR_shared_info;
|
|
@@ -1065,8 +1065,8 @@ static void __xen_evtchn_do_upcall(void)
|
|
#endif
|
|
#endif
|
|
pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0);
|
|
pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0);
|
|
|
|
|
|
- word_idx = last_word_idx;
|
|
|
|
- bit_idx = last_bit_idx;
|
|
|
|
|
|
+ word_idx = __this_cpu_read(last_word_idx);
|
|
|
|
+ bit_idx = __this_cpu_read(last_bit_idx);
|
|
|
|
|
|
while (pending_words != 0) {
|
|
while (pending_words != 0) {
|
|
unsigned long pending_bits;
|
|
unsigned long pending_bits;
|
|
@@ -1121,9 +1121,8 @@ static void __xen_evtchn_do_upcall(void)
|
|
* If this is the final port processed, we'll
|
|
* If this is the final port processed, we'll
|
|
* pick up here+1 next time.
|
|
* pick up here+1 next time.
|
|
*/
|
|
*/
|
|
- last_word_idx = word_idx;
|
|
|
|
- last_bit_idx = bit_idx;
|
|
|
|
-
|
|
|
|
|
|
+ __this_cpu_write(last_word_idx, word_idx);
|
|
|
|
+ __this_cpu_write(last_bit_idx, bit_idx);
|
|
} while (bit_idx != BITS_PER_LONG - 1);
|
|
} while (bit_idx != BITS_PER_LONG - 1);
|
|
|
|
|
|
pending_bits = active_evtchns(cpu, s, word_idx);
|
|
pending_bits = active_evtchns(cpu, s, word_idx);
|