diff options
-rw-r--r-- | arch/x86/xen/mmu.c | 12 | ||||
-rw-r--r-- | drivers/xen/events.c | 19 |
2 files changed, 23 insertions, 8 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 6afbb2ca9a0a..a4ea92477e01 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1748,14 +1748,18 @@ static void *m2v(phys_addr_t maddr) | |||
1748 | } | 1748 | } |
1749 | 1749 | ||
1750 | /* Set the page permissions on an identity-mapped pages */ | 1750 | /* Set the page permissions on an identity-mapped pages */ |
1751 | static void set_page_prot(void *addr, pgprot_t prot) | 1751 | static void set_page_prot_flags(void *addr, pgprot_t prot, unsigned long flags) |
1752 | { | 1752 | { |
1753 | unsigned long pfn = __pa(addr) >> PAGE_SHIFT; | 1753 | unsigned long pfn = __pa(addr) >> PAGE_SHIFT; |
1754 | pte_t pte = pfn_pte(pfn, prot); | 1754 | pte_t pte = pfn_pte(pfn, prot); |
1755 | 1755 | ||
1756 | if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, 0)) | 1756 | if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, flags)) |
1757 | BUG(); | 1757 | BUG(); |
1758 | } | 1758 | } |
1759 | static void set_page_prot(void *addr, pgprot_t prot) | ||
1760 | { | ||
1761 | return set_page_prot_flags(addr, prot, UVMF_NONE); | ||
1762 | } | ||
1759 | #ifdef CONFIG_X86_32 | 1763 | #ifdef CONFIG_X86_32 |
1760 | static void __init xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn) | 1764 | static void __init xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn) |
1761 | { | 1765 | { |
@@ -1839,12 +1843,12 @@ static void __init check_pt_base(unsigned long *pt_base, unsigned long *pt_end, | |||
1839 | unsigned long addr) | 1843 | unsigned long addr) |
1840 | { | 1844 | { |
1841 | if (*pt_base == PFN_DOWN(__pa(addr))) { | 1845 | if (*pt_base == PFN_DOWN(__pa(addr))) { |
1842 | set_page_prot((void *)addr, PAGE_KERNEL); | 1846 | set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG); |
1843 | clear_page((void *)addr); | 1847 | clear_page((void *)addr); |
1844 | (*pt_base)++; | 1848 | (*pt_base)++; |
1845 | } | 1849 | } |
1846 | if (*pt_end == PFN_DOWN(__pa(addr))) { | 1850 | if (*pt_end == PFN_DOWN(__pa(addr))) { |
1847 | set_page_prot((void *)addr, PAGE_KERNEL); | 1851 | set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG); |
1848 | clear_page((void *)addr); | 1852 | clear_page((void *)addr); |
1849 | (*pt_end)--; | 1853 | (*pt_end)--; |
1850 | } | 1854 | } |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index aa85881d17b2..2647ad8e1f19 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -1316,7 +1316,7 @@ static void __xen_evtchn_do_upcall(void) | |||
1316 | { | 1316 | { |
1317 | int start_word_idx, start_bit_idx; | 1317 | int start_word_idx, start_bit_idx; |
1318 | int word_idx, bit_idx; | 1318 | int word_idx, bit_idx; |
1319 | int i; | 1319 | int i, irq; |
1320 | int cpu = get_cpu(); | 1320 | int cpu = get_cpu(); |
1321 | struct shared_info *s = HYPERVISOR_shared_info; | 1321 | struct shared_info *s = HYPERVISOR_shared_info; |
1322 | struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); | 1322 | struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); |
@@ -1324,6 +1324,8 @@ static void __xen_evtchn_do_upcall(void) | |||
1324 | 1324 | ||
1325 | do { | 1325 | do { |
1326 | xen_ulong_t pending_words; | 1326 | xen_ulong_t pending_words; |
1327 | xen_ulong_t pending_bits; | ||
1328 | struct irq_desc *desc; | ||
1327 | 1329 | ||
1328 | vcpu_info->evtchn_upcall_pending = 0; | 1330 | vcpu_info->evtchn_upcall_pending = 0; |
1329 | 1331 | ||
@@ -1335,6 +1337,17 @@ static void __xen_evtchn_do_upcall(void) | |||
1335 | * selector flag. xchg_xen_ulong must contain an | 1337 | * selector flag. xchg_xen_ulong must contain an |
1336 | * appropriate barrier. | 1338 | * appropriate barrier. |
1337 | */ | 1339 | */ |
1340 | if ((irq = per_cpu(virq_to_irq, cpu)[VIRQ_TIMER]) != -1) { | ||
1341 | int evtchn = evtchn_from_irq(irq); | ||
1342 | word_idx = evtchn / BITS_PER_LONG; | ||
1343 | pending_bits = evtchn % BITS_PER_LONG; | ||
1344 | if (active_evtchns(cpu, s, word_idx) & (1ULL << pending_bits)) { | ||
1345 | desc = irq_to_desc(irq); | ||
1346 | if (desc) | ||
1347 | generic_handle_irq_desc(irq, desc); | ||
1348 | } | ||
1349 | } | ||
1350 | |||
1338 | pending_words = xchg_xen_ulong(&vcpu_info->evtchn_pending_sel, 0); | 1351 | pending_words = xchg_xen_ulong(&vcpu_info->evtchn_pending_sel, 0); |
1339 | 1352 | ||
1340 | start_word_idx = __this_cpu_read(current_word_idx); | 1353 | start_word_idx = __this_cpu_read(current_word_idx); |
@@ -1343,7 +1356,6 @@ static void __xen_evtchn_do_upcall(void) | |||
1343 | word_idx = start_word_idx; | 1356 | word_idx = start_word_idx; |
1344 | 1357 | ||
1345 | for (i = 0; pending_words != 0; i++) { | 1358 | for (i = 0; pending_words != 0; i++) { |
1346 | xen_ulong_t pending_bits; | ||
1347 | xen_ulong_t words; | 1359 | xen_ulong_t words; |
1348 | 1360 | ||
1349 | words = MASK_LSBS(pending_words, word_idx); | 1361 | words = MASK_LSBS(pending_words, word_idx); |
@@ -1372,8 +1384,7 @@ static void __xen_evtchn_do_upcall(void) | |||
1372 | 1384 | ||
1373 | do { | 1385 | do { |
1374 | xen_ulong_t bits; | 1386 | xen_ulong_t bits; |
1375 | int port, irq; | 1387 | int port; |
1376 | struct irq_desc *desc; | ||
1377 | 1388 | ||
1378 | bits = MASK_LSBS(pending_bits, bit_idx); | 1389 | bits = MASK_LSBS(pending_bits, bit_idx); |
1379 | 1390 | ||