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 tag 'stable/for-linus-3.14-rc8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull Xen bugfixes from David Vrabel:
"Fix two bugs that cause x86 PV guest crashes.

1. Ballooning a 32-bit guest would eventually crash it.

2. Revert a broken fix for a regression with NUMA_BALACING. The bad
fix caused PV guests to crash after migration. This is not ideal
but unpicking the madness that is _PAGE_NUMA == _PAGE_PROTNONE will
take a while longer"

* tag 'stable/for-linus-3.14-rc8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
Revert "xen: properly account for _PAGE_NUMA during xen pte translations"
xen/balloon: flush persistent kmaps in correct position

+23 -21
+2 -12
arch/x86/include/asm/pgtable.h
··· 445 445 return a.pte == b.pte; 446 446 } 447 447 448 - static inline int pteval_present(pteval_t pteval) 449 - { 450 - /* 451 - * Yes Linus, _PAGE_PROTNONE == _PAGE_NUMA. Expressing it this 452 - * way clearly states that the intent is that protnone and numa 453 - * hinting ptes are considered present for the purposes of 454 - * pagetable operations like zapping, protection changes, gup etc. 455 - */ 456 - return pteval & (_PAGE_PRESENT | _PAGE_PROTNONE | _PAGE_NUMA); 457 - } 458 - 459 448 static inline int pte_present(pte_t a) 460 449 { 461 - return pteval_present(pte_flags(a)); 450 + return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE | 451 + _PAGE_NUMA); 462 452 } 463 453 464 454 #define pte_accessible pte_accessible
+2 -2
arch/x86/xen/mmu.c
··· 365 365 /* Assume pteval_t is equivalent to all the other *val_t types. */ 366 366 static pteval_t pte_mfn_to_pfn(pteval_t val) 367 367 { 368 - if (pteval_present(val)) { 368 + if (val & _PAGE_PRESENT) { 369 369 unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; 370 370 unsigned long pfn = mfn_to_pfn(mfn); 371 371 ··· 381 381 382 382 static pteval_t pte_pfn_to_mfn(pteval_t val) 383 383 { 384 - if (pteval_present(val)) { 384 + if (val & _PAGE_PRESENT) { 385 385 unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; 386 386 pteval_t flags = val & PTE_FLAGS_MASK; 387 387 unsigned long mfn;
+19 -7
drivers/xen/balloon.c
··· 399 399 state = BP_EAGAIN; 400 400 break; 401 401 } 402 - 403 - pfn = page_to_pfn(page); 404 - frame_list[i] = pfn_to_mfn(pfn); 405 - 406 402 scrub_page(page); 403 + 404 + frame_list[i] = page_to_pfn(page); 405 + } 406 + 407 + /* 408 + * Ensure that ballooned highmem pages don't have kmaps. 409 + * 410 + * Do this before changing the p2m as kmap_flush_unused() 411 + * reads PTEs to obtain pages (and hence needs the original 412 + * p2m entry). 413 + */ 414 + kmap_flush_unused(); 415 + 416 + /* Update direct mapping, invalidate P2M, and add to balloon. */ 417 + for (i = 0; i < nr_pages; i++) { 418 + pfn = frame_list[i]; 419 + frame_list[i] = pfn_to_mfn(pfn); 420 + page = pfn_to_page(pfn); 407 421 408 422 #ifdef CONFIG_XEN_HAVE_PVMMU 409 423 /* ··· 443 429 } 444 430 #endif 445 431 446 - balloon_append(pfn_to_page(pfn)); 432 + balloon_append(page); 447 433 } 448 434 449 - /* Ensure that ballooned highmem pages don't have kmaps. */ 450 - kmap_flush_unused(); 451 435 flush_tlb_all(); 452 436 453 437 set_xen_guest_handle(reservation.extent_start, frame_list);