diff --git a/22998-x86-get_page_from_l1e-retcode.patch b/22998-x86-get_page_from_l1e-retcode.patch index 077e167..b5a797c 100644 --- a/22998-x86-get_page_from_l1e-retcode.patch +++ b/22998-x86-get_page_from_l1e-retcode.patch @@ -19,10 +19,25 @@ could be introduced. Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/shadow/multi.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c +# HG changeset patch +# User Jan Beulich +# Date 1340271059 -7200 +# Node ID baa85434d0ec16629ca30b7c07deaa9beb3ea9c5 +# Parent d4cdcf4d541cc4ce72c48df2e26c2b506c5b04bd +x86/mm: fix mod_l1_entry() return value when encountering r/o MMIO page + +While putting together the workaround announced in +http://lists.xen.org/archives/html/xen-devel/2012-06/msg00709.html, I +found that mod_l1_entry(), upon encountering a set bit in +mmio_ro_ranges, would return 1 instead of 0 (the removal of the write +permission is supposed to be entirely transparent to the caller, even +more so to the calling guest). + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/mm/shadow/multi.c ++++ b/xen/arch/x86/mm/shadow/multi.c @@ -872,7 +872,7 @@ shadow_get_page_from_l1e(shadow_l1e_t sl // If a privileged domain is attempting to install a map of a page it does // not own, we let it succeed anyway. @@ -74,11 +89,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d); break; } -Index: xen-4.1.2-testing/xen/arch/x86/mm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -799,12 +799,12 @@ get_page_from_l1e( +--- a/xen/arch/x86/mm.c ++++ b/xen/arch/x86/mm.c +@@ -800,12 +800,12 @@ get_page_from_l1e( bool_t write; if ( !(l1f & _PAGE_PRESENT) ) @@ -93,7 +106,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } if ( !mfn_valid(mfn) || -@@ -821,18 +821,21 @@ get_page_from_l1e( +@@ -822,18 +822,21 @@ get_page_from_l1e( if ( !iomem_access_permitted(pg_owner, mfn, mfn) ) { if ( mfn != (PADDR_MASK >> PAGE_SHIFT) ) /* INVALID_MFN? */ @@ -118,7 +131,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } if ( unlikely(real_pg_owner != pg_owner) ) -@@ -863,6 +866,7 @@ get_page_from_l1e( +@@ -864,6 +867,7 @@ get_page_from_l1e( { unsigned long x, nx, y = page->count_info; unsigned long cacheattr = pte_flags_to_cacheattr(l1f); @@ -126,7 +139,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c if ( is_xen_heap_page(page) ) { -@@ -870,7 +874,7 @@ get_page_from_l1e( +@@ -871,7 +875,7 @@ get_page_from_l1e( put_page_type(page); put_page(page); MEM_LOG("Attempt to change cache attributes of Xen heap page"); @@ -135,7 +148,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } do { -@@ -878,7 +882,8 @@ get_page_from_l1e( +@@ -879,7 +883,8 @@ get_page_from_l1e( nx = (x & ~PGC_cacheattr_mask) | (cacheattr << PGC_cacheattr_base); } while ( (y = cmpxchg(&page->count_info, x, nx)) != x ); @@ -145,7 +158,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c { cacheattr = y & PGC_cacheattr_mask; do { -@@ -894,11 +899,11 @@ get_page_from_l1e( +@@ -895,11 +900,11 @@ get_page_from_l1e( " from L1 entry %" PRIpte ") for %d", mfn, get_gpfn_from_mfn(mfn), l1e_get_intpte(l1e), l1e_owner->domain_id); @@ -159,7 +172,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c could_not_pin: MEM_LOG("Error getting mfn %lx (pfn %lx) from L1 entry %" PRIpte -@@ -907,7 +912,7 @@ get_page_from_l1e( +@@ -908,7 +913,7 @@ get_page_from_l1e( l1e_get_intpte(l1e), l1e_owner->domain_id, pg_owner->domain_id); if ( real_pg_owner != NULL ) put_page(page); @@ -168,7 +181,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } -@@ -1197,17 +1202,20 @@ static int alloc_l1_table(struct page_in +@@ -1198,17 +1203,20 @@ static int alloc_l1_table(struct page_in unsigned long pfn = page_to_mfn(page); l1_pgentry_t *pl1e; unsigned int i; @@ -192,7 +205,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c l1e_remove_flags(pl1e[i], _PAGE_RW); break; } -@@ -1225,7 +1233,7 @@ static int alloc_l1_table(struct page_in +@@ -1226,7 +1234,7 @@ static int alloc_l1_table(struct page_in put_page_from_l1e(pl1e[i], d); unmap_domain_page(pl1e); @@ -201,7 +214,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } static int create_pae_xen_mappings(struct domain *d, l3_pgentry_t *pl3e) -@@ -1794,11 +1802,13 @@ static int mod_l1_entry(l1_pgentry_t *pl +@@ -1795,12 +1803,15 @@ static int mod_l1_entry(l1_pgentry_t *pl return rc; } @@ -216,9 +229,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c + break; + case 1: l1e_remove_flags(nl1e, _PAGE_RW); ++ rc = 0; break; } -@@ -4948,7 +4958,7 @@ static int ptwr_emulated_update( + +@@ -4976,7 +4987,7 @@ static int ptwr_emulated_update( nl1e = l1e_from_intpte(val); switch ( get_page_from_l1e(nl1e, d, d) ) { @@ -227,7 +242,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c if ( is_pv_32bit_domain(d) && (bytes == 4) && (unaligned_addr & 4) && !do_cmpxchg && (l1e_get_flags(nl1e) & _PAGE_PRESENT) ) { -@@ -4968,7 +4978,9 @@ static int ptwr_emulated_update( +@@ -4996,7 +5007,9 @@ static int ptwr_emulated_update( return X86EMUL_UNHANDLEABLE; } break; diff --git a/22999-x86-mod_l1_entry-retcode.patch b/22999-x86-mod_l1_entry-retcode.patch index 684fa96..a15cb99 100644 --- a/22999-x86-mod_l1_entry-retcode.patch +++ b/22999-x86-mod_l1_entry-retcode.patch @@ -12,11 +12,9 @@ x86: make mod_l1_entry() return a proper error code Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/x86/mm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -1765,15 +1765,16 @@ static int mod_l1_entry(l1_pgentry_t *pl +--- a/xen/arch/x86/mm.c ++++ b/xen/arch/x86/mm.c +@@ -1766,15 +1766,16 @@ static int mod_l1_entry(l1_pgentry_t *pl struct domain *pt_dom = pt_vcpu->domain; unsigned long mfn; p2m_type_t p2mt; @@ -37,7 +35,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } if ( l1e_get_flags(nl1e) & _PAGE_PRESENT ) -@@ -1782,7 +1783,7 @@ static int mod_l1_entry(l1_pgentry_t *pl +@@ -1783,7 +1784,7 @@ static int mod_l1_entry(l1_pgentry_t *pl mfn = mfn_x(gfn_to_mfn(p2m_get_hostp2m(pg_dom), l1e_get_pfn(nl1e), &p2mt)); if ( !p2m_is_ram(p2mt) || unlikely(mfn == INVALID_MFN) ) @@ -46,7 +44,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c ASSERT((mfn & ~(PADDR_MASK >> PAGE_SHIFT)) == 0); nl1e = l1e_from_pfn(mfn, l1e_get_flags(nl1e)); -@@ -1790,22 +1791,23 @@ static int mod_l1_entry(l1_pgentry_t *pl +@@ -1791,22 +1792,23 @@ static int mod_l1_entry(l1_pgentry_t *pl { MEM_LOG("Bad L1 flags %x", l1e_get_flags(nl1e) & l1_disallow_mask(pt_dom)); @@ -75,7 +73,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c case 0: break; case 1: -@@ -1818,13 +1820,13 @@ static int mod_l1_entry(l1_pgentry_t *pl +@@ -1820,13 +1822,13 @@ static int mod_l1_entry(l1_pgentry_t *pl preserve_ad)) ) { ol1e = nl1e; @@ -91,7 +89,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } put_page_from_l1e(ol1e, pt_dom); -@@ -3516,9 +3518,10 @@ int do_mmu_update( +@@ -3518,9 +3520,10 @@ int do_mmu_update( } #endif @@ -105,7 +103,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } break; case PGT_l2_page_table: -@@ -4300,7 +4303,7 @@ static int __do_update_va_mapping( +@@ -4302,7 +4305,7 @@ static int __do_update_va_mapping( goto out; } diff --git a/23000-x86-mod_l2_entry-retcode.patch b/23000-x86-mod_l2_entry-retcode.patch index 4382348..2ab61bb 100644 --- a/23000-x86-mod_l2_entry-retcode.patch +++ b/23000-x86-mod_l2_entry-retcode.patch @@ -11,11 +11,9 @@ track both an okay status and an error code). Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/x86/mm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -1845,16 +1845,16 @@ static int mod_l2_entry(l2_pgentry_t *pl +--- a/xen/arch/x86/mm.c ++++ b/xen/arch/x86/mm.c +@@ -1847,16 +1847,16 @@ static int mod_l2_entry(l2_pgentry_t *pl struct domain *d = vcpu->domain; struct page_info *l2pg = mfn_to_page(pfn); unsigned long type = l2pg->u.inuse.type_info; @@ -35,7 +33,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c if ( l2e_get_flags(nl2e) & _PAGE_PRESENT ) { -@@ -1862,32 +1862,33 @@ static int mod_l2_entry(l2_pgentry_t *pl +@@ -1864,32 +1864,33 @@ static int mod_l2_entry(l2_pgentry_t *pl { MEM_LOG("Bad L2 flags %x", l2e_get_flags(nl2e) & L2_DISALLOW_MASK); @@ -76,7 +74,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } put_page_from_l2e(ol2e, pfn); -@@ -3367,7 +3368,7 @@ int do_mmu_update( +@@ -3369,7 +3370,7 @@ int do_mmu_update( void *va; unsigned long gpfn, gmfn, mfn; struct page_info *page; @@ -85,7 +83,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c unsigned int cmd, done = 0, pt_dom; struct vcpu *v = current; struct domain *d = v->domain, *pt_owner = d, *pg_owner; -@@ -3434,7 +3435,6 @@ int do_mmu_update( +@@ -3436,7 +3437,6 @@ int do_mmu_update( } cmd = req.ptr & (sizeof(l1_pgentry_t)-1); @@ -93,7 +91,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c switch ( cmd ) { -@@ -3451,6 +3451,7 @@ int do_mmu_update( +@@ -3453,6 +3453,7 @@ int do_mmu_update( rc = xsm_mmu_normal_update(d, pg_owner, req.val); if ( rc ) break; @@ -101,7 +99,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c req.ptr -= cmd; gmfn = req.ptr >> PAGE_SHIFT; -@@ -3521,7 +3522,6 @@ int do_mmu_update( +@@ -3523,7 +3524,6 @@ int do_mmu_update( rc = mod_l1_entry(va, l1e, mfn, cmd == MMU_PT_UPDATE_PRESERVE_AD, v, pg_owner); @@ -109,7 +107,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } break; case PGT_l2_page_table: -@@ -3545,13 +3545,12 @@ int do_mmu_update( +@@ -3547,13 +3547,12 @@ int do_mmu_update( else if ( p2m_ram_shared == l2e_p2mt ) { MEM_LOG("Unexpected attempt to map shared page.\n"); @@ -125,7 +123,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } break; case PGT_l3_page_table: -@@ -3575,13 +3574,11 @@ int do_mmu_update( +@@ -3577,13 +3576,11 @@ int do_mmu_update( else if ( p2m_ram_shared == l3e_p2mt ) { MEM_LOG("Unexpected attempt to map shared page.\n"); @@ -139,7 +137,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c } break; #if CONFIG_PAGING_LEVELS >= 4 -@@ -3607,20 +3604,18 @@ int do_mmu_update( +@@ -3609,20 +3606,18 @@ int do_mmu_update( else if ( p2m_ram_shared == l4e_p2mt ) { MEM_LOG("Unexpected attempt to map shared page.\n"); @@ -162,7 +160,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c break; } page_unlock(page); -@@ -3630,8 +3625,8 @@ int do_mmu_update( +@@ -3632,8 +3627,8 @@ int do_mmu_update( else if ( get_page_type(page, PGT_writable_page) ) { perfc_incr(writable_mmu_updates); @@ -173,7 +171,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c put_page_type(page); } -@@ -3652,17 +3647,18 @@ int do_mmu_update( +@@ -3654,17 +3649,18 @@ int do_mmu_update( if ( unlikely(!get_page_from_pagenr(mfn, pg_owner)) ) { MEM_LOG("Could not get page for mach->phys update"); @@ -193,7 +191,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c paging_mark_dirty(pg_owner, mfn); -@@ -3672,15 +3668,11 @@ int do_mmu_update( +@@ -3674,15 +3670,11 @@ int do_mmu_update( default: MEM_LOG("Invalid page update command %x", cmd); rc = -ENOSYS; diff --git a/23074-pfn.h.patch b/23074-pfn.h.patch index e47aa5e..46ca8b0 100644 --- a/23074-pfn.h.patch +++ b/23074-pfn.h.patch @@ -9,10 +9,10 @@ Define new header for PFN_{DOWN,UP} macros. Signed-off-by: Keir Fraser -Index: xen-4.1.2-testing/xen/arch/x86/domain_build.c +Index: xen-4.1.3-testing/xen/arch/x86/domain_build.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/domain_build.c -+++ xen-4.1.2-testing/xen/arch/x86/domain_build.c +--- xen-4.1.3-testing.orig/xen/arch/x86/domain_build.c ++++ xen-4.1.3-testing/xen/arch/x86/domain_build.c @@ -21,6 +21,7 @@ #include #include @@ -21,10 +21,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/domain_build.c #include #include #include -Index: xen-4.1.2-testing/xen/arch/x86/e820.c +Index: xen-4.1.3-testing/xen/arch/x86/e820.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/e820.c -+++ xen-4.1.2-testing/xen/arch/x86/e820.c +--- xen-4.1.3-testing.orig/xen/arch/x86/e820.c ++++ xen-4.1.3-testing/xen/arch/x86/e820.c @@ -4,6 +4,7 @@ #include #include @@ -33,22 +33,22 @@ Index: xen-4.1.2-testing/xen/arch/x86/e820.c #include #include #include -Index: xen-4.1.2-testing/xen/arch/x86/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -99,6 +99,7 @@ - #include +--- xen-4.1.3-testing.orig/xen/arch/x86/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/mm.c +@@ -100,6 +100,7 @@ #include #include + #include +#include #include #include #include -Index: xen-4.1.2-testing/xen/arch/x86/msi.c +Index: xen-4.1.3-testing/xen/arch/x86/msi.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/msi.c -+++ xen-4.1.2-testing/xen/arch/x86/msi.c +--- xen-4.1.3-testing.orig/xen/arch/x86/msi.c ++++ xen-4.1.3-testing/xen/arch/x86/msi.c @@ -18,6 +18,7 @@ #include #include @@ -57,10 +57,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/msi.c #include #include #include -Index: xen-4.1.2-testing/xen/arch/x86/numa.c +Index: xen-4.1.3-testing/xen/arch/x86/numa.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/numa.c -+++ xen-4.1.2-testing/xen/arch/x86/numa.c +--- xen-4.1.3-testing.orig/xen/arch/x86/numa.c ++++ xen-4.1.3-testing/xen/arch/x86/numa.c @@ -13,6 +13,7 @@ #include #include @@ -69,10 +69,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/numa.c #include #include -Index: xen-4.1.2-testing/xen/arch/x86/setup.c +Index: xen-4.1.3-testing/xen/arch/x86/setup.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/setup.c -+++ xen-4.1.2-testing/xen/arch/x86/setup.c +--- xen-4.1.3-testing.orig/xen/arch/x86/setup.c ++++ xen-4.1.3-testing/xen/arch/x86/setup.c @@ -21,6 +21,7 @@ #include #include @@ -81,10 +81,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c #include #include #ifdef CONFIG_COMPAT -Index: xen-4.1.2-testing/xen/arch/x86/srat.c +Index: xen-4.1.3-testing/xen/arch/x86/srat.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/srat.c -+++ xen-4.1.2-testing/xen/arch/x86/srat.c +--- xen-4.1.3-testing.orig/xen/arch/x86/srat.c ++++ xen-4.1.3-testing/xen/arch/x86/srat.c @@ -17,6 +17,7 @@ #include #include @@ -93,10 +93,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/srat.c #include #include -Index: xen-4.1.2-testing/xen/arch/x86/tboot.c +Index: xen-4.1.3-testing/xen/arch/x86/tboot.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/tboot.c -+++ xen-4.1.2-testing/xen/arch/x86/tboot.c +--- xen-4.1.3-testing.orig/xen/arch/x86/tboot.c ++++ xen-4.1.3-testing/xen/arch/x86/tboot.c @@ -6,6 +6,7 @@ #include #include @@ -105,10 +105,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/tboot.c #include #include #include -Index: xen-4.1.2-testing/xen/include/asm-x86/page.h +Index: xen-4.1.3-testing/xen/include/asm-x86/page.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/page.h -+++ xen-4.1.2-testing/xen/include/asm-x86/page.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/page.h ++++ xen-4.1.3-testing/xen/include/asm-x86/page.h @@ -396,8 +396,6 @@ static inline uint32_t cacheattr_to_pte_ #endif /* !__ASSEMBLY__ */ @@ -118,10 +118,22 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/page.h #define PAGE_ALIGN(x) (((x) + PAGE_SIZE - 1) & PAGE_MASK) #endif /* __X86_PAGE_H__ */ -Index: xen-4.1.2-testing/xen/include/xen/pfn.h +Index: xen-4.1.3-testing/xen/include/xen/pci.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/xen/pci.h ++++ xen-4.1.3-testing/xen/include/xen/pci.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + /* + * The PCI interface treats multi-function devices as independent +Index: xen-4.1.3-testing/xen/include/xen/pfn.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/xen/pfn.h ++++ xen-4.1.3-testing/xen/include/xen/pfn.h @@ -0,0 +1,9 @@ +#ifndef __XEN_PFN_H__ +#define __XEN_PFN_H__ diff --git a/23103-x86-pirq-guest-eoi-check.patch b/23103-x86-pirq-guest-eoi-check.patch index 4443a03..4f144f3 100644 --- a/23103-x86-pirq-guest-eoi-check.patch +++ b/23103-x86-pirq-guest-eoi-check.patch @@ -8,11 +8,11 @@ guest-bound irq before accessing desc->action. Signed-off-by: Keir Fraser -Index: xen-4.1.2-testing/xen/arch/x86/irq.c +Index: xen-4.1.3-testing/xen/arch/x86/irq.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/irq.c -+++ xen-4.1.2-testing/xen/arch/x86/irq.c -@@ -1033,6 +1033,12 @@ static void __pirq_guest_eoi(struct doma +--- xen-4.1.3-testing.orig/xen/arch/x86/irq.c ++++ xen-4.1.3-testing/xen/arch/x86/irq.c +@@ -1143,6 +1143,12 @@ static void __pirq_guest_eoi(struct doma return; } diff --git a/23127-vtd-bios-settings.patch b/23127-vtd-bios-settings.patch index 97f29b9..c9c09dd 100644 --- a/23127-vtd-bios-settings.patch +++ b/23127-vtd-bios-settings.patch @@ -27,11 +27,11 @@ Signed-off-by: Allen Kay Signed-off-by: Allen Kay -Index: xen-4.1.2-testing/xen/arch/x86/apic.c +Index: xen-4.1.3-testing/xen/arch/x86/apic.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/apic.c -+++ xen-4.1.2-testing/xen/arch/x86/apic.c -@@ -566,7 +566,7 @@ static void resume_x2apic(void) +--- xen-4.1.3-testing.orig/xen/arch/x86/apic.c ++++ xen-4.1.3-testing/xen/arch/x86/apic.c +@@ -572,7 +572,7 @@ static void resume_x2apic(void) mask_8259A(); mask_IO_APIC_setup(ioapic_entries); @@ -40,7 +40,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/apic.c __enable_x2apic(); restore_IO_APIC_setup(ioapic_entries); -@@ -783,7 +783,7 @@ int lapic_suspend(void) +@@ -789,7 +789,7 @@ int lapic_suspend(void) local_irq_save(flags); disable_local_APIC(); @@ -49,7 +49,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/apic.c local_irq_restore(flags); return 0; } -@@ -1029,7 +1029,7 @@ void __init x2apic_bsp_setup(void) +@@ -1035,7 +1035,7 @@ void __init x2apic_bsp_setup(void) mask_8259A(); mask_IO_APIC_setup(ioapic_entries); @@ -58,10 +58,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/apic.c { if ( x2apic_enabled ) panic("Interrupt remapping could not be enabled while " -Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/dmar.c +Index: xen-4.1.3-testing/xen/drivers/passthrough/vtd/dmar.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/dmar.c -+++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/dmar.c +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/vtd/dmar.c ++++ xen-4.1.3-testing/xen/drivers/passthrough/vtd/dmar.c @@ -46,6 +46,7 @@ LIST_HEAD(acpi_rmrr_units); LIST_HEAD(acpi_atsr_units); LIST_HEAD(acpi_rhsa_units); @@ -101,10 +101,10 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/dmar.c + flags = DMAR_INTR_REMAP | DMAR_X2APIC_OPT_OUT; + return ((dmar_flags & flags) == DMAR_INTR_REMAP); +} -Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/extern.h +Index: xen-4.1.3-testing/xen/drivers/passthrough/vtd/extern.h =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/extern.h -+++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/extern.h +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/vtd/extern.h ++++ xen-4.1.3-testing/xen/drivers/passthrough/vtd/extern.h @@ -87,5 +87,7 @@ void vtd_ops_preamble_quirk(struct iommu void vtd_ops_postamble_quirk(struct iommu* iommu); void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map); @@ -113,10 +113,10 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/extern.h +int platform_supports_x2apic(void); #endif // _VTD_EXTERN_H_ -Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c +Index: xen-4.1.3-testing/xen/drivers/passthrough/vtd/intremap.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/intremap.c -+++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/vtd/intremap.c ++++ xen-4.1.3-testing/xen/drivers/passthrough/vtd/intremap.c @@ -741,6 +741,13 @@ int enable_intremap(struct iommu *iommu, ASSERT(ecap_intr_remap(iommu->ecap) && iommu_intremap); @@ -163,11 +163,11 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c { struct acpi_drhd_unit *drhd; -Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.c +Index: xen-4.1.3-testing/xen/drivers/passthrough/vtd/iommu.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/iommu.c -+++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.c -@@ -2006,7 +2006,7 @@ static int init_vtd_hw(void) +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/vtd/iommu.c ++++ xen-4.1.3-testing/xen/drivers/passthrough/vtd/iommu.c +@@ -2091,7 +2091,7 @@ static int init_vtd_hw(void) { iommu_intremap = 0; dprintk(XENLOG_WARNING VTDPREFIX, @@ -176,10 +176,10 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.c break; } } -Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.h +Index: xen-4.1.3-testing/xen/drivers/passthrough/vtd/iommu.h =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/iommu.h -+++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.h +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/vtd/iommu.h ++++ xen-4.1.3-testing/xen/drivers/passthrough/vtd/iommu.h @@ -22,6 +22,10 @@ #include @@ -191,10 +191,10 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.h /* * Intel IOMMU register specification per version 1.0 public spec. */ -Index: xen-4.1.2-testing/xen/include/xen/iommu.h +Index: xen-4.1.3-testing/xen/include/xen/iommu.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/iommu.h -+++ xen-4.1.2-testing/xen/include/xen/iommu.h +--- xen-4.1.3-testing.orig/xen/include/xen/iommu.h ++++ xen-4.1.3-testing/xen/include/xen/iommu.h @@ -66,8 +66,8 @@ struct iommu { int iommu_setup(void); diff --git a/23233-hvm-cr-access.patch b/23233-hvm-cr-access.patch deleted file mode 100644 index 9c4cfa2..0000000 --- a/23233-hvm-cr-access.patch +++ /dev/null @@ -1,435 +0,0 @@ -References: FATE#309900 - -# HG changeset patch -# User Keir Fraser -# Date 1303116432 -3600 -# Node ID 1276926e3795b11ef6ac2f59df900d8e0ba9f54b -# Parent 07d832ad23021445bc56fafaeb2843c94d868005 -vmx/hvm: move mov-cr handling functions to generic HVM code - -Currently the handling of CR accesses intercepts is done much -differently in SVM and VMX. For future usage move the VMX part -into the generic HVM path and use the exported functions. - -Signed-off-by: Andre Przywara -Signed-off-by: Keir Fraser - -Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -@@ -1298,6 +1298,86 @@ static void hvm_set_uc_mode(struct vcpu - return hvm_funcs.set_uc_mode(v); - } - -+int hvm_mov_to_cr(unsigned int cr, unsigned int gpr) -+{ -+ struct vcpu *curr = current; -+ unsigned long val, *reg; -+ -+ if ( (reg = get_x86_gpr(guest_cpu_user_regs(), gpr)) == NULL ) -+ { -+ gdprintk(XENLOG_ERR, "invalid gpr: %u\n", gpr); -+ goto exit_and_crash; -+ } -+ -+ val = *reg; -+ HVMTRACE_LONG_2D(CR_WRITE, cr, TRC_PAR_LONG(val)); -+ HVM_DBG_LOG(DBG_LEVEL_1, "CR%u, value = %lx", cr, val); -+ -+ switch ( cr ) -+ { -+ case 0: -+ return hvm_set_cr0(val); -+ -+ case 3: -+ return hvm_set_cr3(val); -+ -+ case 4: -+ return hvm_set_cr4(val); -+ -+ case 8: -+ vlapic_set_reg(vcpu_vlapic(curr), APIC_TASKPRI, ((val & 0x0f) << 4)); -+ break; -+ -+ default: -+ gdprintk(XENLOG_ERR, "invalid cr: %d\n", cr); -+ goto exit_and_crash; -+ } -+ -+ return X86EMUL_OKAY; -+ -+ exit_and_crash: -+ domain_crash(curr->domain); -+ return X86EMUL_UNHANDLEABLE; -+} -+ -+int hvm_mov_from_cr(unsigned int cr, unsigned int gpr) -+{ -+ struct vcpu *curr = current; -+ unsigned long val = 0, *reg; -+ -+ if ( (reg = get_x86_gpr(guest_cpu_user_regs(), gpr)) == NULL ) -+ { -+ gdprintk(XENLOG_ERR, "invalid gpr: %u\n", gpr); -+ goto exit_and_crash; -+ } -+ -+ switch ( cr ) -+ { -+ case 0: -+ case 2: -+ case 3: -+ case 4: -+ val = curr->arch.hvm_vcpu.guest_cr[cr]; -+ break; -+ case 8: -+ val = (vlapic_get_reg(vcpu_vlapic(curr), APIC_TASKPRI) & 0xf0) >> 4; -+ break; -+ default: -+ gdprintk(XENLOG_ERR, "invalid cr: %u\n", cr); -+ goto exit_and_crash; -+ } -+ -+ *reg = val; -+ HVMTRACE_LONG_2D(CR_READ, cr, TRC_PAR_LONG(val)); -+ HVM_DBG_LOG(DBG_LEVEL_VMMU, "CR%u, value = %lx", cr, val); -+ -+ return X86EMUL_OKAY; -+ -+ exit_and_crash: -+ domain_crash(curr->domain); -+ return X86EMUL_UNHANDLEABLE; -+} -+ - int hvm_set_cr0(unsigned long value) - { - struct vcpu *v = current; -Index: xen-4.1.2-testing/xen/arch/x86/hvm/vmx/vmx.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/vmx/vmx.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/vmx/vmx.c -@@ -1545,182 +1545,42 @@ static void vmx_invlpg_intercept(unsigne - vpid_sync_vcpu_gva(curr, vaddr); - } - --#define CASE_SET_REG(REG, reg) \ -- case VMX_CONTROL_REG_ACCESS_GPR_ ## REG: regs->reg = value; break --#define CASE_GET_REG(REG, reg) \ -- case VMX_CONTROL_REG_ACCESS_GPR_ ## REG: value = regs->reg; break -- --#define CASE_EXTEND_SET_REG \ -- CASE_EXTEND_REG(S) --#define CASE_EXTEND_GET_REG \ -- CASE_EXTEND_REG(G) -- --#ifdef __i386__ --#define CASE_EXTEND_REG(T) --#else --#define CASE_EXTEND_REG(T) \ -- CASE_ ## T ## ET_REG(R8, r8); \ -- CASE_ ## T ## ET_REG(R9, r9); \ -- CASE_ ## T ## ET_REG(R10, r10); \ -- CASE_ ## T ## ET_REG(R11, r11); \ -- CASE_ ## T ## ET_REG(R12, r12); \ -- CASE_ ## T ## ET_REG(R13, r13); \ -- CASE_ ## T ## ET_REG(R14, r14); \ -- CASE_ ## T ## ET_REG(R15, r15) --#endif -- --static int mov_to_cr(int gp, int cr, struct cpu_user_regs *regs) --{ -- unsigned long value; -- struct vcpu *v = current; -- struct vlapic *vlapic = vcpu_vlapic(v); -- int rc = 0; -- unsigned long old; -- -- switch ( gp ) -- { -- CASE_GET_REG(EAX, eax); -- CASE_GET_REG(ECX, ecx); -- CASE_GET_REG(EDX, edx); -- CASE_GET_REG(EBX, ebx); -- CASE_GET_REG(EBP, ebp); -- CASE_GET_REG(ESI, esi); -- CASE_GET_REG(EDI, edi); -- CASE_GET_REG(ESP, esp); -- CASE_EXTEND_GET_REG; -- default: -- gdprintk(XENLOG_ERR, "invalid gp: %d\n", gp); -- goto exit_and_crash; -- } -- -- HVMTRACE_LONG_2D(CR_WRITE, cr, TRC_PAR_LONG(value)); -- -- HVM_DBG_LOG(DBG_LEVEL_1, "CR%d, value = %lx", cr, value); -- -- switch ( cr ) -- { -- case 0: -- old = v->arch.hvm_vcpu.guest_cr[0]; -- rc = !hvm_set_cr0(value); -- if (rc) -- hvm_memory_event_cr0(value, old); -- return rc; -- -- case 3: -- old = v->arch.hvm_vcpu.guest_cr[3]; -- rc = !hvm_set_cr3(value); -- if (rc) -- hvm_memory_event_cr3(value, old); -- return rc; -- -- case 4: -- old = v->arch.hvm_vcpu.guest_cr[4]; -- rc = !hvm_set_cr4(value); -- if (rc) -- hvm_memory_event_cr4(value, old); -- return rc; -- -- case 8: -- vlapic_set_reg(vlapic, APIC_TASKPRI, ((value & 0x0F) << 4)); -- break; -- -- default: -- gdprintk(XENLOG_ERR, "invalid cr: %d\n", cr); -- goto exit_and_crash; -- } -- -- return 1; -- -- exit_and_crash: -- domain_crash(v->domain); -- return 0; --} -- --/* -- * Read from control registers. CR0 and CR4 are read from the shadow. -- */ --static void mov_from_cr(int cr, int gp, struct cpu_user_regs *regs) -+static int vmx_cr_access(unsigned long exit_qualification) - { -- unsigned long value = 0; -- struct vcpu *v = current; -- struct vlapic *vlapic = vcpu_vlapic(v); -- -- switch ( cr ) -- { -- case 3: -- value = (unsigned long)v->arch.hvm_vcpu.guest_cr[3]; -- break; -- case 8: -- value = (unsigned long)vlapic_get_reg(vlapic, APIC_TASKPRI); -- value = (value & 0xF0) >> 4; -- break; -- default: -- gdprintk(XENLOG_ERR, "invalid cr: %d\n", cr); -- domain_crash(v->domain); -- break; -- } -- -- switch ( gp ) { -- CASE_SET_REG(EAX, eax); -- CASE_SET_REG(ECX, ecx); -- CASE_SET_REG(EDX, edx); -- CASE_SET_REG(EBX, ebx); -- CASE_SET_REG(EBP, ebp); -- CASE_SET_REG(ESI, esi); -- CASE_SET_REG(EDI, edi); -- CASE_SET_REG(ESP, esp); -- CASE_EXTEND_SET_REG; -- default: -- printk("invalid gp: %d\n", gp); -- domain_crash(v->domain); -- break; -- } -- -- HVMTRACE_LONG_2D(CR_READ, cr, TRC_PAR_LONG(value)); -- -- HVM_DBG_LOG(DBG_LEVEL_VMMU, "CR%d, value = %lx", cr, value); --} -- --static int vmx_cr_access(unsigned long exit_qualification, -- struct cpu_user_regs *regs) --{ -- unsigned int gp, cr; -- unsigned long value; -- struct vcpu *v = current; -+ struct vcpu *curr = current; - -- switch ( exit_qualification & VMX_CONTROL_REG_ACCESS_TYPE ) -+ switch ( VMX_CONTROL_REG_ACCESS_TYPE(exit_qualification) ) - { -- case VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR: -- gp = exit_qualification & VMX_CONTROL_REG_ACCESS_GPR; -- cr = exit_qualification & VMX_CONTROL_REG_ACCESS_NUM; -- return mov_to_cr(gp, cr, regs); -- case VMX_CONTROL_REG_ACCESS_TYPE_MOV_FROM_CR: -- gp = exit_qualification & VMX_CONTROL_REG_ACCESS_GPR; -- cr = exit_qualification & VMX_CONTROL_REG_ACCESS_NUM; -- mov_from_cr(cr, gp, regs); -- break; -- case VMX_CONTROL_REG_ACCESS_TYPE_CLTS: -- { -- unsigned long old = v->arch.hvm_vcpu.guest_cr[0]; -- v->arch.hvm_vcpu.guest_cr[0] &= ~X86_CR0_TS; -- vmx_update_guest_cr(v, 0); -- -- hvm_memory_event_cr0(v->arch.hvm_vcpu.guest_cr[0], old); -- -+ case VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR: { -+ unsigned long gp = VMX_CONTROL_REG_ACCESS_GPR(exit_qualification); -+ unsigned long cr = VMX_CONTROL_REG_ACCESS_NUM(exit_qualification); -+ return hvm_mov_to_cr(cr, gp); -+ } -+ case VMX_CONTROL_REG_ACCESS_TYPE_MOV_FROM_CR: { -+ unsigned long gp = VMX_CONTROL_REG_ACCESS_GPR(exit_qualification); -+ unsigned long cr = VMX_CONTROL_REG_ACCESS_NUM(exit_qualification); -+ return hvm_mov_from_cr(cr, gp); -+ } -+ case VMX_CONTROL_REG_ACCESS_TYPE_CLTS: { -+ unsigned long old = curr->arch.hvm_vcpu.guest_cr[0]; -+ curr->arch.hvm_vcpu.guest_cr[0] &= ~X86_CR0_TS; -+ vmx_update_guest_cr(curr, 0); -+ hvm_memory_event_cr0(curr->arch.hvm_vcpu.guest_cr[0], old); - HVMTRACE_0D(CLTS); - break; - } -- case VMX_CONTROL_REG_ACCESS_TYPE_LMSW: -- value = v->arch.hvm_vcpu.guest_cr[0]; -+ case VMX_CONTROL_REG_ACCESS_TYPE_LMSW: { -+ unsigned long value = curr->arch.hvm_vcpu.guest_cr[0]; - /* LMSW can: (1) set bits 0-3; (2) clear bits 1-3. */ - value = (value & ~0xe) | ((exit_qualification >> 16) & 0xf); - HVMTRACE_LONG_1D(LMSW, value); -- return !hvm_set_cr0(value); -+ return hvm_set_cr0(value); -+ } - default: - BUG(); - } - -- return 1; -+ return X86EMUL_OKAY; - } - - static const struct lbr_info { -@@ -2525,7 +2385,7 @@ asmlinkage void vmx_vmexit_handler(struc - case EXIT_REASON_CR_ACCESS: - { - exit_qualification = __vmread(EXIT_QUALIFICATION); -- if ( vmx_cr_access(exit_qualification, regs) ) -+ if ( vmx_cr_access(exit_qualification) == X86EMUL_OKAY ) - update_guest_eip(); /* Safe: MOV Cn, LMSW, CLTS */ - break; - } -Index: xen-4.1.2-testing/xen/arch/x86/traps.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/traps.c -+++ xen-4.1.2-testing/xen/arch/x86/traps.c -@@ -368,6 +368,36 @@ void vcpu_show_execution_state(struct vc - vcpu_unpause(v); - } - -+unsigned long *get_x86_gpr(struct cpu_user_regs *regs, unsigned int modrm_reg) -+{ -+ void *p; -+ -+ switch ( modrm_reg ) -+ { -+ case 0: p = ®s->eax; break; -+ case 1: p = ®s->ecx; break; -+ case 2: p = ®s->edx; break; -+ case 3: p = ®s->ebx; break; -+ case 4: p = ®s->esp; break; -+ case 5: p = ®s->ebp; break; -+ case 6: p = ®s->esi; break; -+ case 7: p = ®s->edi; break; -+#if defined(__x86_64__) -+ case 8: p = ®s->r8; break; -+ case 9: p = ®s->r9; break; -+ case 10: p = ®s->r10; break; -+ case 11: p = ®s->r11; break; -+ case 12: p = ®s->r12; break; -+ case 13: p = ®s->r13; break; -+ case 14: p = ®s->r14; break; -+ case 15: p = ®s->r15; break; -+#endif -+ default: p = NULL; break; -+ } -+ -+ return p; -+} -+ - static char *trapstr(int trapnr) - { - static char *strings[] = { -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/support.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/support.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/support.h -@@ -137,5 +137,7 @@ int hvm_set_cr3(unsigned long value); - int hvm_set_cr4(unsigned long value); - int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content); - int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content); -+int hvm_mov_to_cr(unsigned int cr, unsigned int gpr); -+int hvm_mov_from_cr(unsigned int cr, unsigned int gpr); - - #endif /* __ASM_X86_HVM_SUPPORT_H__ */ -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/vmx/vmx.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/vmx/vmx.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/vmx/vmx.h -@@ -144,31 +144,15 @@ void vmx_update_cpu_exec_control(struct - * Exit Qualifications for MOV for Control Register Access - */ - /* 3:0 - control register number (CRn) */ --#define VMX_CONTROL_REG_ACCESS_NUM 0xf -+#define VMX_CONTROL_REG_ACCESS_NUM(eq) ((eq) & 0xf) - /* 5:4 - access type (CR write, CR read, CLTS, LMSW) */ --#define VMX_CONTROL_REG_ACCESS_TYPE 0x30 -+#define VMX_CONTROL_REG_ACCESS_TYPE(eq) (((eq) >> 4) & 0x3) -+# define VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR 0 -+# define VMX_CONTROL_REG_ACCESS_TYPE_MOV_FROM_CR 1 -+# define VMX_CONTROL_REG_ACCESS_TYPE_CLTS 2 -+# define VMX_CONTROL_REG_ACCESS_TYPE_LMSW 3 - /* 10:8 - general purpose register operand */ --#define VMX_CONTROL_REG_ACCESS_GPR 0xf00 --#define VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR (0 << 4) --#define VMX_CONTROL_REG_ACCESS_TYPE_MOV_FROM_CR (1 << 4) --#define VMX_CONTROL_REG_ACCESS_TYPE_CLTS (2 << 4) --#define VMX_CONTROL_REG_ACCESS_TYPE_LMSW (3 << 4) --#define VMX_CONTROL_REG_ACCESS_GPR_EAX (0 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_ECX (1 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_EDX (2 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_EBX (3 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_ESP (4 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_EBP (5 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_ESI (6 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_EDI (7 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_R8 (8 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_R9 (9 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_R10 (10 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_R11 (11 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_R12 (12 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_R13 (13 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_R14 (14 << 8) --#define VMX_CONTROL_REG_ACCESS_GPR_R15 (15 << 8) -+#define VMX_CONTROL_REG_ACCESS_GPR(eq) (((eq) >> 8) & 0xf) - - /* - * Access Rights -Index: xen-4.1.2-testing/xen/include/asm-x86/processor.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/processor.h -+++ xen-4.1.2-testing/xen/include/asm-x86/processor.h -@@ -592,6 +592,8 @@ int wrmsr_hypervisor_regs(uint32_t idx, - int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len); - int microcode_resume_cpu(int cpu); - -+unsigned long *get_x86_gpr(struct cpu_user_regs *regs, unsigned int modrm_reg); -+ - #endif /* !__ASSEMBLY__ */ - - #endif /* __ASM_X86_PROCESSOR_H */ diff --git a/23234-svm-decode-assist-base.patch b/23234-svm-decode-assist-base.patch deleted file mode 100644 index f6dc7bd..0000000 --- a/23234-svm-decode-assist-base.patch +++ /dev/null @@ -1,75 +0,0 @@ -References: FATE#309900 - -# HG changeset patch -# User Andre Przywara -# Date 1303116553 -3600 -# Node ID bf7afd48339a18cd86d89337f3c055045fb78d3b -# Parent 1276926e3795b11ef6ac2f59df900d8e0ba9f54b -svm: add bit definitions for SVM DecodeAssist - -Chapter 15.33 of recent APM Vol.2 manuals describe some additions -to SVM called DecodeAssist. Add the newly added fields to the VMCB -structure and name the associated CPUID bit. - -Signed-off-by: Andre Przywara - -# HG changeset patch -# User Keir Fraser -# Date 1303117802 -3600 -# Node ID 381ab77db71a4739b8a4f4fdad4ef3504999f998 -# Parent e324c4d1dd6eeb9417fec513640ca795bd0f5dd4 -svm: decode-assists feature must depend on nextrip feature. - -...since the decode-assist fast paths assume nextrip vmcb field is -valid. - -Signed-off-by: Keir Fraser - -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/svm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -@@ -928,11 +928,16 @@ struct hvm_function_table * __init start - - printk("SVM: Supported advanced features:\n"); - -+ /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */ -+ if ( !cpu_has_svm_nrips ) -+ clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags); -+ - #define P(p,s) if ( p ) { printk(" - %s\n", s); printed = 1; } - P(cpu_has_svm_npt, "Nested Page Tables (NPT)"); - P(cpu_has_svm_lbrv, "Last Branch Record (LBR) Virtualisation"); - P(cpu_has_svm_nrips, "Next-RIP Saved on #VMEXIT"); - P(cpu_has_svm_cleanbits, "VMCB Clean Bits"); -+ P(cpu_has_svm_decode, "DecodeAssists"); - P(cpu_has_pause_filter, "Pause-Intercept Filter"); - #undef P - -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/svm.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/svm.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/svm.h -@@ -80,6 +80,7 @@ extern u32 svm_feature_flags; - #define cpu_has_svm_svml cpu_has_svm_feature(SVM_FEATURE_SVML) - #define cpu_has_svm_nrips cpu_has_svm_feature(SVM_FEATURE_NRIPS) - #define cpu_has_svm_cleanbits cpu_has_svm_feature(SVM_FEATURE_VMCBCLEAN) -+#define cpu_has_svm_decode cpu_has_svm_feature(SVM_FEATURE_DECODEASSISTS) - #define cpu_has_pause_filter cpu_has_svm_feature(SVM_FEATURE_PAUSEFILTER) - - #endif /* __ASM_X86_HVM_SVM_H__ */ -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/vmcb.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/vmcb.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/vmcb.h -@@ -432,7 +432,9 @@ struct vmcb_struct { - vmcbcleanbits_t cleanbits; /* offset 0xC0 */ - u32 res09; /* offset 0xC4 */ - u64 nextrip; /* offset 0xC8 */ -- u64 res10a[102]; /* offset 0xD0 pad to save area */ -+ u8 guest_ins_len; /* offset 0xD0 */ -+ u8 guest_ins[15]; /* offset 0xD1 */ -+ u64 res10a[100]; /* offset 0xE0 pad to save area */ - - svm_segment_register_t es; /* offset 1024 - cleanbit 8 */ - svm_segment_register_t cs; /* cleanbit 8 */ diff --git a/23235-svm-decode-assist-crs.patch b/23235-svm-decode-assist-crs.patch deleted file mode 100644 index f3126a0..0000000 --- a/23235-svm-decode-assist-crs.patch +++ /dev/null @@ -1,66 +0,0 @@ -References: FATE#309900 - -# HG changeset patch -# User Andre Przywara -# Date 1303117266 -3600 -# Node ID 2c8ad607ece18b4740b9fc4ffe267a0e0893c141 -# Parent bf7afd48339a18cd86d89337f3c055045fb78d3b -svm: implement CR access part of DecodeAssist - -Newer SVM implementations (Bulldozer) now give the used general -purpose register on a MOV-CR intercept explictly. This avoids -fetching and decoding the instruction from guest's memory and speeds -up some Windows guest, which exercise CR8 quite often. - -Signed-off-by: Andre Przywara -Signed-off-by: Keir Fraser - -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/svm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -@@ -1039,6 +1039,22 @@ static void svm_vmexit_do_cpuid(struct c - __update_guest_eip(regs, inst_len); - } - -+static void svm_vmexit_do_cr_access( -+ struct vmcb_struct *vmcb, struct cpu_user_regs *regs) -+{ -+ int gp, cr, dir, rc; -+ -+ cr = vmcb->exitcode - VMEXIT_CR0_READ; -+ dir = (cr > 15); -+ cr &= 0xf; -+ gp = vmcb->exitinfo1 & 0xf; -+ -+ rc = dir ? hvm_mov_to_cr(cr, gp) : hvm_mov_from_cr(cr, gp); -+ -+ if ( rc == X86EMUL_OKAY ) -+ __update_guest_eip(regs, vmcb->nextrip - vmcb->rip); -+} -+ - static void svm_dr_access(struct vcpu *v, struct cpu_user_regs *regs) - { - HVMTRACE_0D(DR_WRITE); -@@ -1620,11 +1636,19 @@ asmlinkage void svm_vmexit_handler(struc - int dir = (vmcb->exitinfo1 & 1) ? IOREQ_READ : IOREQ_WRITE; - if ( handle_pio(port, bytes, dir) ) - __update_guest_eip(regs, vmcb->exitinfo2 - vmcb->rip); -- break; - } -- /* fallthrough to emulation if a string instruction */ -+ else if ( !handle_mmio() ) -+ hvm_inject_exception(TRAP_gp_fault, 0, 0); -+ break; -+ - case VMEXIT_CR0_READ ... VMEXIT_CR15_READ: - case VMEXIT_CR0_WRITE ... VMEXIT_CR15_WRITE: -+ if ( cpu_has_svm_decode && (vmcb->exitinfo1 & (1ULL << 63)) ) -+ svm_vmexit_do_cr_access(vmcb, regs); -+ else if ( !handle_mmio() ) -+ hvm_inject_exception(TRAP_gp_fault, 0, 0); -+ break; -+ - case VMEXIT_INVLPG: - case VMEXIT_INVLPGA: - if ( !handle_mmio() ) diff --git a/23236-svm-decode-assist-invlpg.patch b/23236-svm-decode-assist-invlpg.patch index c9c9a4f..0cdfbf2 100644 --- a/23236-svm-decode-assist-invlpg.patch +++ b/23236-svm-decode-assist-invlpg.patch @@ -34,10 +34,10 @@ Fixes endless loop. Signed-off-by: Christoph Egger -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/emulate.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/svm/emulate.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/emulate.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/emulate.c +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/svm/emulate.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/svm/emulate.c @@ -102,6 +102,7 @@ MAKE_INSTR(INT3, 1, 0xcc); MAKE_INSTR(RDTSC, 2, 0x0f, 0x31); MAKE_INSTR(PAUSE, 1, 0x90); @@ -54,39 +54,27 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/emulate.c }; static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len) -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/svm/svm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/svm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -@@ -1650,11 +1650,22 @@ asmlinkage void svm_vmexit_handler(struc +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/svm/svm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/svm/svm.c +@@ -1748,8 +1748,10 @@ asmlinkage void svm_vmexit_handler(struc break; - case VMEXIT_INVLPG: -- case VMEXIT_INVLPGA: + case VMEXIT_INVLPGA: - if ( !handle_mmio() ) -+ if ( cpu_has_svm_decode ) -+ { -+ svm_invlpg_intercept(vmcb->exitinfo1); -+ __update_guest_eip(regs, vmcb->nextrip - vmcb->rip); -+ } -+ else if ( !handle_mmio() ) - hvm_inject_exception(TRAP_gp_fault, 0, 0); - break; - -+ case VMEXIT_INVLPGA: +- hvm_inject_exception(TRAP_gp_fault, 0, 0); + if ( (inst_len = __get_instruction_length(v, INSTR_INVLPGA)) == 0 ) + break; + svm_invlpga(regs->eax, v->arch.hvm_vcpu.asid); + __update_guest_eip(regs, inst_len); -+ break; -+ + break; + case VMEXIT_VMMCALL: - if ( (inst_len = __get_instruction_length(v, INSTR_VMCALL)) == 0 ) - break; -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/asid.h +Index: xen-4.1.3-testing/xen/include/asm-x86/hvm/svm/asid.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/asid.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/asid.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/hvm/svm/asid.h ++++ xen-4.1.3-testing/xen/include/asm-x86/hvm/svm/asid.h @@ -34,10 +34,7 @@ static inline void svm_asid_g_invlpg(str { #if 0 @@ -99,10 +87,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/asid.h #endif /* Safe fallback. Take a new ASID. */ -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/emulate.h +Index: xen-4.1.3-testing/xen/include/asm-x86/hvm/svm/emulate.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/emulate.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/emulate.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/hvm/svm/emulate.h ++++ xen-4.1.3-testing/xen/include/asm-x86/hvm/svm/emulate.h @@ -33,6 +33,7 @@ enum instruction_index { INSTR_RDTSC, INSTR_PAUSE, @@ -111,10 +99,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/emulate.h INSTR_MAX_COUNT /* Must be last - Number of instructions supported */ }; -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/svm.h +Index: xen-4.1.3-testing/xen/include/asm-x86/hvm/svm/svm.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/svm.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/svm.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/hvm/svm/svm.h ++++ xen-4.1.3-testing/xen/include/asm-x86/hvm/svm/svm.h @@ -62,6 +62,15 @@ static inline void svm_vmsave(void *vmcb : : "a" (__pa(vmcb)) : "memory" ); } diff --git a/23238-svm-decode-assist-insn-fetch.patch b/23238-svm-decode-assist-insn-fetch.patch deleted file mode 100644 index 3c29681..0000000 --- a/23238-svm-decode-assist-insn-fetch.patch +++ /dev/null @@ -1,135 +0,0 @@ -References: FATE#309900 - -# HG changeset patch -# User Keir Fraser -# Date 1303130170 -3600 -# Node ID 60f5df2afcbbe1e8d8438c2b7b8223d9d2102e06 -# Parent 381ab77db71a4739b8a4f4fdad4ef3504999f998 -svm: implement instruction fetch part of DecodeAssist (on #PF/#NPF) - -Newer SVM implementations (Bulldozer) copy up to 15 bytes from the -instruction stream into the VMCB when a #PF or #NPF exception is -intercepted. This patch makes use of this information if available. -This saves us from a) traversing the guest's page tables, b) mapping -the guest's memory and c) copy the instructions from there into the -hypervisor's address space. -This speeds up #NPF intercepts quite a lot and avoids cache and TLB -trashing. - -Signed-off-by: Andre Przywara -Signed-off-by: Keir Fraser - -Index: xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/emulate.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c -@@ -996,6 +996,8 @@ int hvm_emulate_one( - - hvmemul_ctxt->insn_buf_eip = regs->eip; - hvmemul_ctxt->insn_buf_bytes = -+ hvm_get_insn_bytes(curr, hvmemul_ctxt->insn_buf) -+ ? : - (hvm_virtual_to_linear_addr( - x86_seg_cs, &hvmemul_ctxt->seg_reg[x86_seg_cs], - regs->eip, sizeof(hvmemul_ctxt->insn_buf), -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/svm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -@@ -603,6 +603,21 @@ static void svm_set_rdtsc_exiting(struct - vmcb_set_general1_intercepts(vmcb, general1_intercepts); - } - -+static unsigned int svm_get_insn_bytes(struct vcpu *v, uint8_t *buf) -+{ -+ struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb; -+ unsigned int len = v->arch.hvm_svm.cached_insn_len; -+ -+ if ( len != 0 ) -+ { -+ /* Latch and clear the cached instruction. */ -+ memcpy(buf, vmcb->guest_ins, 15); -+ v->arch.hvm_svm.cached_insn_len = 0; -+ } -+ -+ return len; -+} -+ - static void svm_init_hypercall_page(struct domain *d, void *hypercall_page) - { - char *p; -@@ -1448,7 +1463,8 @@ static struct hvm_function_table __read_ - .msr_read_intercept = svm_msr_read_intercept, - .msr_write_intercept = svm_msr_write_intercept, - .invlpg_intercept = svm_invlpg_intercept, -- .set_rdtsc_exiting = svm_set_rdtsc_exiting -+ .set_rdtsc_exiting = svm_set_rdtsc_exiting, -+ .get_insn_bytes = svm_get_insn_bytes - }; - - asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs) -@@ -1554,7 +1570,12 @@ asmlinkage void svm_vmexit_handler(struc - (unsigned long)regs->ecx, (unsigned long)regs->edx, - (unsigned long)regs->esi, (unsigned long)regs->edi); - -- if ( paging_fault(va, regs) ) -+ if ( cpu_has_svm_decode ) -+ v->arch.hvm_svm.cached_insn_len = vmcb->guest_ins_len & 0xf; -+ rc = paging_fault(va, regs); -+ v->arch.hvm_svm.cached_insn_len = 0; -+ -+ if ( rc ) - { - if ( trace_will_trace_event(TRC_SHADOW) ) - break; -@@ -1720,7 +1741,10 @@ asmlinkage void svm_vmexit_handler(struc - case VMEXIT_NPF: - perfc_incra(svmexits, VMEXIT_NPF_PERFC); - regs->error_code = vmcb->exitinfo1; -+ if ( cpu_has_svm_decode ) -+ v->arch.hvm_svm.cached_insn_len = vmcb->guest_ins_len & 0xf; - svm_do_nested_pgfault(vmcb->exitinfo2); -+ v->arch.hvm_svm.cached_insn_len = 0; - break; - - case VMEXIT_IRET: { -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/hvm.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/hvm.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/hvm.h -@@ -132,6 +132,9 @@ struct hvm_function_table { - int (*cpu_up)(void); - void (*cpu_down)(void); - -+ /* Copy up to 15 bytes from cached instruction bytes at current rIP. */ -+ unsigned int (*get_insn_bytes)(struct vcpu *v, uint8_t *buf); -+ - /* Instruction intercepts: non-void return values are X86EMUL codes. */ - void (*cpuid_intercept)( - unsigned int *eax, unsigned int *ebx, -@@ -328,6 +331,11 @@ static inline void hvm_cpu_down(void) - hvm_funcs.cpu_down(); - } - -+static inline unsigned int hvm_get_insn_bytes(struct vcpu *v, uint8_t *buf) -+{ -+ return (hvm_funcs.get_insn_bytes ? hvm_funcs.get_insn_bytes(v, buf) : 0); -+} -+ - enum hvm_task_switch_reason { TSW_jmp, TSW_iret, TSW_call_or_int }; - void hvm_task_switch( - uint16_t tss_sel, enum hvm_task_switch_reason taskswitch_reason, -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/vmcb.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/vmcb.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/vmcb.h -@@ -498,6 +498,9 @@ struct arch_svm_struct { - int launch_core; - bool_t vmcb_in_sync; /* VMCB sync'ed with VMSAVE? */ - -+ /* VMCB has a cached instruction from #PF/#NPF Decode Assist? */ -+ uint8_t cached_insn_len; /* Zero if no cached instruction. */ -+ - /* Upper four bytes are undefined in the VMCB, therefore we can't - * use the fields in the VMCB. Write a 64bit value and then read a 64bit - * value is fine unless there's a VMRUN/VMEXIT in between which clears diff --git a/23246-x86-xsave-enable.patch b/23246-x86-xsave-enable.patch index 7df4145..4eae486 100644 --- a/23246-x86-xsave-enable.patch +++ b/23246-x86-xsave-enable.patch @@ -9,8 +9,10 @@ xen/x86: re-enable xsave by default now that it supports live migration. Signed-off-by: Tim Deegan ---- a/xen/arch/x86/cpu/common.c -+++ b/xen/arch/x86/cpu/common.c +Index: xen-4.1.3-testing/xen/arch/x86/cpu/common.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/cpu/common.c ++++ xen-4.1.3-testing/xen/arch/x86/cpu/common.c @@ -25,7 +25,7 @@ boolean_param("nofxsr", disable_x86_fxsr static bool_t __cpuinitdata disable_x86_serial_nr; boolean_param("noserialnumber", disable_x86_serial_nr); @@ -18,5 +20,5 @@ Signed-off-by: Tim Deegan -static bool_t __cpuinitdata use_xsave; +static bool_t __cpuinitdata use_xsave = 1; boolean_param("xsave", use_xsave); + unsigned int __devinitdata opt_cpuid_mask_ecx = ~0u; - integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx); diff --git a/23304-amd-oprofile-strings.patch b/23304-amd-oprofile-strings.patch deleted file mode 100644 index c92baf4..0000000 --- a/23304-amd-oprofile-strings.patch +++ /dev/null @@ -1,42 +0,0 @@ -References: FATE#309893, FATE#309902, FATE#309903, FATE#309906 - -# HG changeset patch -# User Jacob Shin -# Date 1304930954 -3600 -# Node ID 8981b582be3e2f6647ef5ff3d93e167436ed357a -# Parent 82180954eda9cfe279e7ecf8c9ed4ffa29796bfb -xenoprof: Update cpu_type to sync with upstream oprofile - -Update xenoprof's cpu_type to match upstream oprofile. Currently AMD -Family 11h ~ Family 15h are broken due to string mismatches. - -Signed-off-by: Jacob Shin - -Index: xen-4.1.2-testing/xen/arch/x86/oprofile/nmi_int.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/oprofile/nmi_int.c -+++ xen-4.1.2-testing/xen/arch/x86/oprofile/nmi_int.c -@@ -435,19 +435,19 @@ static int __init nmi_init(void) - break; - case 0x11: - model = &op_athlon_spec; -- cpu_type = "x86-64/family11"; -+ cpu_type = "x86-64/family11h"; - break; - case 0x12: - model = &op_athlon_spec; -- cpu_type = "x86-64/family12"; -+ cpu_type = "x86-64/family12h"; - break; - case 0x14: - model = &op_athlon_spec; -- cpu_type = "x86-64/family14"; -+ cpu_type = "x86-64/family14h"; - break; - case 0x15: - model = &op_athlon_spec; -- cpu_type = "x86-64/family15"; -+ cpu_type = "x86-64/family15h"; - break; - } - break; diff --git a/23305-amd-fam15-xenoprof.patch b/23305-amd-fam15-xenoprof.patch deleted file mode 100644 index c400872..0000000 --- a/23305-amd-fam15-xenoprof.patch +++ /dev/null @@ -1,223 +0,0 @@ -References: FATE#309893, FATE#309906 - -# HG changeset patch -# User Jacob Shin -# Date 1304931187 -3600 -# Node ID 014ee4e09644bd3ae55919d267f742c1d60c337a -# Parent 8981b582be3e2f6647ef5ff3d93e167436ed357a -xenoprof: Add support for AMD Family 15h processors - -AMD Family 15h CPU mirrors legacy K7 performance monitor counters to -a new location, and adds 2 new counters. This patch updates xenoprof -to take advantage of the new counters. - -Signed-off-by: Jacob Shin - -Rename fam15h -> amd_fam15h in a few places, as suggested by Jan -Beulich. - -Signed-off-by: Keir Fraser - -Index: xen-4.1.2-testing/xen/arch/x86/oprofile/nmi_int.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/oprofile/nmi_int.c -+++ xen-4.1.2-testing/xen/arch/x86/oprofile/nmi_int.c -@@ -30,7 +30,7 @@ - struct op_counter_config counter_config[OP_MAX_COUNTER]; - struct op_ibs_config ibs_config; - --static struct op_x86_model_spec const *__read_mostly model; -+struct op_x86_model_spec const *__read_mostly model; - static struct op_msrs cpu_msrs[NR_CPUS]; - static unsigned long saved_lvtpc[NR_CPUS]; - -@@ -446,7 +446,7 @@ static int __init nmi_init(void) - cpu_type = "x86-64/family14h"; - break; - case 0x15: -- model = &op_athlon_spec; -+ model = &op_amd_fam15h_spec; - cpu_type = "x86-64/family15h"; - break; - } -Index: xen-4.1.2-testing/xen/arch/x86/oprofile/op_model_athlon.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/oprofile/op_model_athlon.c -+++ xen-4.1.2-testing/xen/arch/x86/oprofile/op_model_athlon.c -@@ -24,8 +24,13 @@ - #include "op_x86_model.h" - #include "op_counter.h" - --#define NUM_COUNTERS 4 --#define NUM_CONTROLS 4 -+#define K7_NUM_COUNTERS 4 -+#define K7_NUM_CONTROLS 4 -+ -+#define FAM15H_NUM_COUNTERS 6 -+#define FAM15H_NUM_CONTROLS 6 -+ -+#define MAX_COUNTERS FAM15H_NUM_COUNTERS - - #define CTR_READ(msr_content,msrs,c) do {rdmsrl(msrs->counters[(c)].addr, (msr_content));} while (0) - #define CTR_WRITE(l,msrs,c) do {wrmsr(msrs->counters[(c)].addr, -(unsigned int)(l), -1);} while (0) -@@ -44,9 +49,10 @@ - #define CTRL_SET_HOST_ONLY(val, h) (val |= ((h & 0x1ULL) << 41)) - #define CTRL_SET_GUEST_ONLY(val, h) (val |= ((h & 0x1ULL) << 40)) - --static unsigned long reset_value[NUM_COUNTERS]; -+static unsigned long reset_value[MAX_COUNTERS]; - - extern char svm_stgi_label[]; -+extern struct op_x86_model_spec const *__read_mostly model; - - #ifdef CONFIG_X86_64 - u32 ibs_caps = 0; -@@ -175,26 +181,44 @@ static void athlon_fill_in_addresses(str - msrs->controls[3].addr = MSR_K7_EVNTSEL3; - } - -- -+static void fam15h_fill_in_addresses(struct op_msrs * const msrs) -+{ -+ msrs->counters[0].addr = MSR_AMD_FAM15H_PERFCTR0; -+ msrs->counters[1].addr = MSR_AMD_FAM15H_PERFCTR1; -+ msrs->counters[2].addr = MSR_AMD_FAM15H_PERFCTR2; -+ msrs->counters[3].addr = MSR_AMD_FAM15H_PERFCTR3; -+ msrs->counters[4].addr = MSR_AMD_FAM15H_PERFCTR4; -+ msrs->counters[5].addr = MSR_AMD_FAM15H_PERFCTR5; -+ -+ msrs->controls[0].addr = MSR_AMD_FAM15H_EVNTSEL0; -+ msrs->controls[1].addr = MSR_AMD_FAM15H_EVNTSEL1; -+ msrs->controls[2].addr = MSR_AMD_FAM15H_EVNTSEL2; -+ msrs->controls[3].addr = MSR_AMD_FAM15H_EVNTSEL3; -+ msrs->controls[4].addr = MSR_AMD_FAM15H_EVNTSEL4; -+ msrs->controls[5].addr = MSR_AMD_FAM15H_EVNTSEL5; -+} -+ - static void athlon_setup_ctrs(struct op_msrs const * const msrs) - { - uint64_t msr_content; - int i; -+ unsigned int const nr_ctrs = model->num_counters; -+ unsigned int const nr_ctrls = model->num_controls; - - /* clear all counters */ -- for (i = 0 ; i < NUM_CONTROLS; ++i) { -+ for (i = 0 ; i < nr_ctrls; ++i) { - CTRL_READ(msr_content, msrs, i); - CTRL_CLEAR(msr_content); - CTRL_WRITE(msr_content, msrs, i); - } - - /* avoid a false detection of ctr overflows in NMI handler */ -- for (i = 0; i < NUM_COUNTERS; ++i) { -+ for (i = 0; i < nr_ctrs; ++i) { - CTR_WRITE(1, msrs, i); - } - - /* enable active counters */ -- for (i = 0; i < NUM_COUNTERS; ++i) { -+ for (i = 0; i < nr_ctrs; ++i) { - if (counter_config[i].enabled) { - reset_value[i] = counter_config[i].count; - -@@ -300,6 +324,7 @@ static int athlon_check_ctrs(unsigned in - int mode = 0; - struct vcpu *v = current; - struct cpu_user_regs *guest_regs = guest_cpu_user_regs(); -+ unsigned int const nr_ctrs = model->num_counters; - - if (!guest_mode(regs) && - (regs->eip == (unsigned long)svm_stgi_label)) { -@@ -312,7 +337,7 @@ static int athlon_check_ctrs(unsigned in - mode = xenoprofile_get_mode(v, regs); - } - -- for (i = 0 ; i < NUM_COUNTERS; ++i) { -+ for (i = 0 ; i < nr_ctrs; ++i) { - CTR_READ(msr_content, msrs, i); - if (CTR_OVERFLOWED(msr_content)) { - xenoprof_log_event(current, regs, eip, mode, i); -@@ -373,7 +398,8 @@ static void athlon_start(struct op_msrs - { - uint64_t msr_content; - int i; -- for (i = 0 ; i < NUM_COUNTERS ; ++i) { -+ unsigned int const nr_ctrs = model->num_counters; -+ for (i = 0 ; i < nr_ctrs ; ++i) { - if (reset_value[i]) { - CTRL_READ(msr_content, msrs, i); - CTRL_SET_ACTIVE(msr_content); -@@ -401,10 +427,11 @@ static void athlon_stop(struct op_msrs c - { - uint64_t msr_content; - int i; -+ unsigned int const nr_ctrs = model->num_counters; - - /* Subtle: stop on all counters to avoid race with - * setting our pm callback */ -- for (i = 0 ; i < NUM_COUNTERS ; ++i) { -+ for (i = 0 ; i < nr_ctrs ; ++i) { - CTRL_READ(msr_content, msrs, i); - CTRL_SET_INACTIVE(msr_content); - CTRL_WRITE(msr_content, msrs, i); -@@ -512,11 +539,21 @@ void __init ibs_init(void) - #endif /* CONFIG_X86_64 */ - - struct op_x86_model_spec const op_athlon_spec = { -- .num_counters = NUM_COUNTERS, -- .num_controls = NUM_CONTROLS, -+ .num_counters = K7_NUM_COUNTERS, -+ .num_controls = K7_NUM_CONTROLS, - .fill_in_addresses = &athlon_fill_in_addresses, - .setup_ctrs = &athlon_setup_ctrs, - .check_ctrs = &athlon_check_ctrs, - .start = &athlon_start, -+ .stop = &athlon_stop -+}; -+ -+struct op_x86_model_spec const op_amd_fam15h_spec = { -+ .num_counters = FAM15H_NUM_COUNTERS, -+ .num_controls = FAM15H_NUM_CONTROLS, -+ .fill_in_addresses = &fam15h_fill_in_addresses, -+ .setup_ctrs = &athlon_setup_ctrs, -+ .check_ctrs = &athlon_check_ctrs, -+ .start = &athlon_start, - .stop = &athlon_stop - }; -Index: xen-4.1.2-testing/xen/arch/x86/oprofile/op_x86_model.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/oprofile/op_x86_model.h -+++ xen-4.1.2-testing/xen/arch/x86/oprofile/op_x86_model.h -@@ -48,6 +48,7 @@ extern struct op_x86_model_spec op_arch_ - extern struct op_x86_model_spec const op_p4_spec; - extern struct op_x86_model_spec const op_p4_ht2_spec; - extern struct op_x86_model_spec const op_athlon_spec; -+extern struct op_x86_model_spec const op_amd_fam15h_spec; - - void arch_perfmon_setup_counters(void); - #endif /* OP_X86_MODEL_H */ -Index: xen-4.1.2-testing/xen/include/asm-x86/msr-index.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/msr-index.h -+++ xen-4.1.2-testing/xen/include/asm-x86/msr-index.h -@@ -219,6 +219,19 @@ - #define MSR_K8_VM_CR 0xc0010114 - #define MSR_K8_VM_HSAVE_PA 0xc0010117 - -+#define MSR_AMD_FAM15H_EVNTSEL0 0xc0010200 -+#define MSR_AMD_FAM15H_PERFCTR0 0xc0010201 -+#define MSR_AMD_FAM15H_EVNTSEL1 0xc0010202 -+#define MSR_AMD_FAM15H_PERFCTR1 0xc0010203 -+#define MSR_AMD_FAM15H_EVNTSEL2 0xc0010204 -+#define MSR_AMD_FAM15H_PERFCTR2 0xc0010205 -+#define MSR_AMD_FAM15H_EVNTSEL3 0xc0010206 -+#define MSR_AMD_FAM15H_PERFCTR3 0xc0010207 -+#define MSR_AMD_FAM15H_EVNTSEL4 0xc0010208 -+#define MSR_AMD_FAM15H_PERFCTR4 0xc0010209 -+#define MSR_AMD_FAM15H_EVNTSEL5 0xc001020a -+#define MSR_AMD_FAM15H_PERFCTR5 0xc001020b -+ - #define MSR_K8_FEATURE_MASK 0xc0011004 - #define MSR_K8_EXT_FEATURE_MASK 0xc0011005 - diff --git a/23306-amd-fam15-vpmu.patch b/23306-amd-fam15-vpmu.patch deleted file mode 100644 index 5e4af23..0000000 --- a/23306-amd-fam15-vpmu.patch +++ /dev/null @@ -1,261 +0,0 @@ -References: FATE#309893, FATE#309906 - -# HG changeset patch -# User Jacob Shin -# Date 1304931286 -3600 -# Node ID e787d4f2e5acdba48728a9390710de800315a540 -# Parent 014ee4e09644bd3ae55919d267f742c1d60c337a -hvm: vpmu: Add support for AMD Family 15h processors - -AMD Family 15h CPU mirrors legacy K7 performance monitor counters to -a new location, and adds 2 new counters. This patch updates HVM VPMU -to take advantage of the new counters. - -Signed-off-by: Jacob Shin - -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/svm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -@@ -1142,6 +1142,18 @@ static int svm_msr_read_intercept(unsign - case MSR_K7_EVNTSEL1: - case MSR_K7_EVNTSEL2: - case MSR_K7_EVNTSEL3: -+ case MSR_AMD_FAM15H_PERFCTR0: -+ case MSR_AMD_FAM15H_PERFCTR1: -+ case MSR_AMD_FAM15H_PERFCTR2: -+ case MSR_AMD_FAM15H_PERFCTR3: -+ case MSR_AMD_FAM15H_PERFCTR4: -+ case MSR_AMD_FAM15H_PERFCTR5: -+ case MSR_AMD_FAM15H_EVNTSEL0: -+ case MSR_AMD_FAM15H_EVNTSEL1: -+ case MSR_AMD_FAM15H_EVNTSEL2: -+ case MSR_AMD_FAM15H_EVNTSEL3: -+ case MSR_AMD_FAM15H_EVNTSEL4: -+ case MSR_AMD_FAM15H_EVNTSEL5: - vpmu_do_rdmsr(msr, msr_content); - break; - -@@ -1237,6 +1249,18 @@ static int svm_msr_write_intercept(unsig - case MSR_K7_EVNTSEL1: - case MSR_K7_EVNTSEL2: - case MSR_K7_EVNTSEL3: -+ case MSR_AMD_FAM15H_PERFCTR0: -+ case MSR_AMD_FAM15H_PERFCTR1: -+ case MSR_AMD_FAM15H_PERFCTR2: -+ case MSR_AMD_FAM15H_PERFCTR3: -+ case MSR_AMD_FAM15H_PERFCTR4: -+ case MSR_AMD_FAM15H_PERFCTR5: -+ case MSR_AMD_FAM15H_EVNTSEL0: -+ case MSR_AMD_FAM15H_EVNTSEL1: -+ case MSR_AMD_FAM15H_EVNTSEL2: -+ case MSR_AMD_FAM15H_EVNTSEL3: -+ case MSR_AMD_FAM15H_EVNTSEL4: -+ case MSR_AMD_FAM15H_EVNTSEL5: - vpmu_do_wrmsr(msr, msr_content); - break; - -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/vpmu.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/vpmu.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/vpmu.c -@@ -36,7 +36,9 @@ - #include - #include - --#define NUM_COUNTERS 4 -+#define F10H_NUM_COUNTERS 4 -+#define F15H_NUM_COUNTERS 6 -+#define MAX_NUM_COUNTERS F15H_NUM_COUNTERS - - #define MSR_F10H_EVNTSEL_GO_SHIFT 40 - #define MSR_F10H_EVNTSEL_EN_SHIFT 22 -@@ -47,6 +49,11 @@ - #define set_guest_mode(msr) (msr |= (1ULL << MSR_F10H_EVNTSEL_GO_SHIFT)) - #define is_overflowed(msr) (!((msr) & (1ULL << (MSR_F10H_COUNTER_LENGTH-1)))) - -+static int __read_mostly num_counters = 0; -+static u32 __read_mostly *counters = NULL; -+static u32 __read_mostly *ctrls = NULL; -+static bool_t __read_mostly k7_counters_mirrored = 0; -+ - /* PMU Counter MSRs. */ - u32 AMD_F10H_COUNTERS[] = { - MSR_K7_PERFCTR0, -@@ -63,10 +70,28 @@ u32 AMD_F10H_CTRLS[] = { - MSR_K7_EVNTSEL3 - }; - -+u32 AMD_F15H_COUNTERS[] = { -+ MSR_AMD_FAM15H_PERFCTR0, -+ MSR_AMD_FAM15H_PERFCTR1, -+ MSR_AMD_FAM15H_PERFCTR2, -+ MSR_AMD_FAM15H_PERFCTR3, -+ MSR_AMD_FAM15H_PERFCTR4, -+ MSR_AMD_FAM15H_PERFCTR5 -+}; -+ -+u32 AMD_F15H_CTRLS[] = { -+ MSR_AMD_FAM15H_EVNTSEL0, -+ MSR_AMD_FAM15H_EVNTSEL1, -+ MSR_AMD_FAM15H_EVNTSEL2, -+ MSR_AMD_FAM15H_EVNTSEL3, -+ MSR_AMD_FAM15H_EVNTSEL4, -+ MSR_AMD_FAM15H_EVNTSEL5 -+}; -+ - /* storage for context switching */ - struct amd_vpmu_context { -- u64 counters[NUM_COUNTERS]; -- u64 ctrls[NUM_COUNTERS]; -+ u64 counters[MAX_NUM_COUNTERS]; -+ u64 ctrls[MAX_NUM_COUNTERS]; - u32 hw_lapic_lvtpc; - }; - -@@ -78,10 +103,45 @@ static inline int get_pmu_reg_type(u32 a - if ( (addr >= MSR_K7_PERFCTR0) && (addr <= MSR_K7_PERFCTR3) ) - return MSR_TYPE_COUNTER; - -+ if ( (addr >= MSR_AMD_FAM15H_EVNTSEL0) && -+ (addr <= MSR_AMD_FAM15H_PERFCTR5 ) ) -+ { -+ if (addr & 1) -+ return MSR_TYPE_COUNTER; -+ else -+ return MSR_TYPE_CTRL; -+ } -+ - /* unsupported registers */ - return -1; - } - -+static inline u32 get_fam15h_addr(u32 addr) -+{ -+ switch ( addr ) -+ { -+ case MSR_K7_PERFCTR0: -+ return MSR_AMD_FAM15H_PERFCTR0; -+ case MSR_K7_PERFCTR1: -+ return MSR_AMD_FAM15H_PERFCTR1; -+ case MSR_K7_PERFCTR2: -+ return MSR_AMD_FAM15H_PERFCTR2; -+ case MSR_K7_PERFCTR3: -+ return MSR_AMD_FAM15H_PERFCTR3; -+ case MSR_K7_EVNTSEL0: -+ return MSR_AMD_FAM15H_EVNTSEL0; -+ case MSR_K7_EVNTSEL1: -+ return MSR_AMD_FAM15H_EVNTSEL1; -+ case MSR_K7_EVNTSEL2: -+ return MSR_AMD_FAM15H_EVNTSEL2; -+ case MSR_K7_EVNTSEL3: -+ return MSR_AMD_FAM15H_EVNTSEL3; -+ default: -+ break; -+ } -+ -+ return addr; -+} - - static int amd_vpmu_do_interrupt(struct cpu_user_regs *regs) - { -@@ -110,12 +170,12 @@ static inline void context_restore(struc - struct vpmu_struct *vpmu = vcpu_vpmu(v); - struct amd_vpmu_context *ctxt = vpmu->context; - -- for ( i = 0; i < NUM_COUNTERS; i++ ) -- wrmsrl(AMD_F10H_CTRLS[i], ctxt->ctrls[i]); -+ for ( i = 0; i < num_counters; i++ ) -+ wrmsrl(ctrls[i], ctxt->ctrls[i]); - -- for ( i = 0; i < NUM_COUNTERS; i++ ) -+ for ( i = 0; i < num_counters; i++ ) - { -- wrmsrl(AMD_F10H_COUNTERS[i], ctxt->counters[i]); -+ wrmsrl(counters[i], ctxt->counters[i]); - - /* Force an interrupt to allow guest reset the counter, - if the value is positive */ -@@ -147,11 +207,11 @@ static inline void context_save(struct v - struct vpmu_struct *vpmu = vcpu_vpmu(v); - struct amd_vpmu_context *ctxt = vpmu->context; - -- for ( i = 0; i < NUM_COUNTERS; i++ ) -- rdmsrl(AMD_F10H_COUNTERS[i], ctxt->counters[i]); -+ for ( i = 0; i < num_counters; i++ ) -+ rdmsrl(counters[i], ctxt->counters[i]); - -- for ( i = 0; i < NUM_COUNTERS; i++ ) -- rdmsrl(AMD_F10H_CTRLS[i], ctxt->ctrls[i]); -+ for ( i = 0; i < num_counters; i++ ) -+ rdmsrl(ctrls[i], ctxt->ctrls[i]); - } - - static void amd_vpmu_save(struct vcpu *v) -@@ -175,12 +235,18 @@ static void context_update(unsigned int - struct vpmu_struct *vpmu = vcpu_vpmu(v); - struct amd_vpmu_context *ctxt = vpmu->context; - -- for ( i = 0; i < NUM_COUNTERS; i++ ) -- if ( msr == AMD_F10H_COUNTERS[i] ) -+ if ( k7_counters_mirrored && -+ ((msr >= MSR_K7_EVNTSEL0) && (msr <= MSR_K7_PERFCTR3)) ) -+ { -+ msr = get_fam15h_addr(msr); -+ } -+ -+ for ( i = 0; i < num_counters; i++ ) -+ if ( msr == counters[i] ) - ctxt->counters[i] = msr_content; - -- for ( i = 0; i < NUM_COUNTERS; i++ ) -- if ( msr == AMD_F10H_CTRLS[i] ) -+ for ( i = 0; i < num_counters; i++ ) -+ if ( msr == ctrls[i] ) - ctxt->ctrls[i] = msr_content; - - ctxt->hw_lapic_lvtpc = apic_read(APIC_LVTPC); -@@ -235,10 +301,31 @@ static void amd_vpmu_initialise(struct v - { - struct amd_vpmu_context *ctxt = NULL; - struct vpmu_struct *vpmu = vcpu_vpmu(v); -+ __u8 family = current_cpu_data.x86; - - if ( vpmu->flags & VPMU_CONTEXT_ALLOCATED ) - return; - -+ if ( counters == NULL ) -+ { -+ switch ( family ) -+ { -+ case 0x15: -+ num_counters = F15H_NUM_COUNTERS; -+ counters = AMD_F15H_COUNTERS; -+ ctrls = AMD_F15H_CTRLS; -+ k7_counters_mirrored = 1; -+ break; -+ case 0x10: -+ default: -+ num_counters = F10H_NUM_COUNTERS; -+ counters = AMD_F10H_COUNTERS; -+ ctrls = AMD_F10H_CTRLS; -+ k7_counters_mirrored = 0; -+ break; -+ } -+ } -+ - ctxt = xmalloc_bytes(sizeof(struct amd_vpmu_context)); - - if ( !ctxt ) -Index: xen-4.1.2-testing/xen/arch/x86/hvm/vpmu.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/vpmu.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/vpmu.c -@@ -101,6 +101,7 @@ void vpmu_initialise(struct vcpu *v) - switch ( family ) - { - case 0x10: -+ case 0x15: - vpmu->arch_vpmu_ops = &amd_vpmu_ops; - break; - default: diff --git a/23383-libxc-rm-static-vars.patch b/23383-libxc-rm-static-vars.patch index e51d70e..0334afb 100644 --- a/23383-libxc-rm-static-vars.patch +++ b/23383-libxc-rm-static-vars.patch @@ -17,11 +17,11 @@ Acked-by: Ian Jackson Committed-by: Ian Jackson Acked-by: Vincent Hanquez -Index: xen-4.1.2-testing/tools/libxc/xc_domain_restore.c +Index: xen-4.1.3-testing/tools/libxc/xc_domain_restore.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_domain_restore.c -+++ xen-4.1.2-testing/tools/libxc/xc_domain_restore.c -@@ -1134,23 +1134,19 @@ int xc_domain_restore(xc_interface *xch, +--- xen-4.1.3-testing.orig/tools/libxc/xc_domain_restore.c ++++ xen-4.1.3-testing/tools/libxc/xc_domain_restore.c +@@ -1145,23 +1145,19 @@ int xc_domain_restore(xc_interface *xch, int orig_io_fd_flags; @@ -49,10 +49,10 @@ Index: xen-4.1.2-testing/tools/libxc/xc_domain_restore.c ctxt = xc_hypercall_buffer_alloc(xch, ctxt, sizeof(*ctxt)); if ( ctxt == NULL ) -Index: xen-4.1.2-testing/tools/libxc/xc_domain_save.c +Index: xen-4.1.3-testing/tools/libxc/xc_domain_save.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_domain_save.c -+++ xen-4.1.2-testing/tools/libxc/xc_domain_save.c +--- xen-4.1.3-testing.orig/tools/libxc/xc_domain_save.c ++++ xen-4.1.3-testing/tools/libxc/xc_domain_save.c @@ -958,11 +958,8 @@ int xc_domain_save(xc_interface *xch, in unsigned long mfn; diff --git a/23437-amd-fam15-TSC-scaling.patch b/23437-amd-fam15-TSC-scaling.patch deleted file mode 100644 index 0ae7f49..0000000 --- a/23437-amd-fam15-TSC-scaling.patch +++ /dev/null @@ -1,133 +0,0 @@ -References: FATE#309901 - -# HG changeset patch -# User Wei Huang -# Date 1306569488 -3600 -# Node ID d7c755c25bb9d6ed77d64cb6736b6c4f339db1bf -# Parent f6ce871e568949f5817470f6c7bab6ed1f8f6c13 -HVM/SVM: enable tsc scaling ratio for SVM - -Future AMD CPUs support TSC scaling. It allows guests to have a -different TSC frequency from host system using this formula: guest_tsc -= host_tsc * tsc_ratio + vmcb_offset. The tsc_ratio is a 64bit MSR -contains a fixed-point number in 8.32 format (8 bits for integer part -and 32bits for fractional part). For instance 0x00000003_80000000 -means tsc_ratio=3.5. - -This patch enables TSC scaling ratio for SVM. With it, guest VMs don't -need take #VMEXIT to calculate a translated TSC value when it is -running under TSC emulation mode. This can substancially reduce the -rdtsc overhead. - -Signed-off-by: Wei Huang - -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/svm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c -@@ -588,6 +588,22 @@ static void svm_set_segment_register(str - static void svm_set_tsc_offset(struct vcpu *v, u64 offset) - { - struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb; -+ struct domain *d = v->domain; -+ -+ /* Re-adjust the offset value when TSC_RATIO is available */ -+ if ( cpu_has_tsc_ratio && d->arch.vtsc ) -+ { -+ uint64_t host_tsc, guest_tsc; -+ -+ rdtscll(host_tsc); -+ guest_tsc = hvm_get_guest_tsc(v); -+ -+ /* calculate hi,lo parts in 64bits to prevent overflow */ -+ offset = (((host_tsc >> 32) * d->arch.tsc_khz / cpu_khz) << 32) + -+ (host_tsc & 0xffffffffULL) * d->arch.tsc_khz / cpu_khz; -+ offset = guest_tsc - offset; -+ } -+ - vmcb_set_tsc_offset(vmcb, offset); - } - -@@ -638,6 +654,19 @@ static void svm_init_hypercall_page(stru - *(u16 *)(hypercall_page + (__HYPERVISOR_iret * 32)) = 0x0b0f; /* ud2 */ - } - -+static inline void svm_tsc_ratio_save(struct vcpu *v) -+{ -+ /* Other vcpus might not have vtsc enabled. So disable TSC_RATIO here. */ -+ if ( cpu_has_tsc_ratio && v->domain->arch.vtsc ) -+ wrmsrl(MSR_AMD64_TSC_RATIO, DEFAULT_TSC_RATIO); -+} -+ -+static inline void svm_tsc_ratio_load(struct vcpu *v) -+{ -+ if ( cpu_has_tsc_ratio && v->domain->arch.vtsc ) -+ wrmsrl(MSR_AMD64_TSC_RATIO, vcpu_tsc_ratio(v)); -+} -+ - static void svm_ctxt_switch_from(struct vcpu *v) - { - int cpu = smp_processor_id(); -@@ -646,6 +675,7 @@ static void svm_ctxt_switch_from(struct - - svm_save_dr(v); - vpmu_save(v); -+ svm_tsc_ratio_save(v); - - svm_sync_vmcb(v); - svm_vmload(per_cpu(root_vmcb, cpu)); -@@ -689,6 +719,7 @@ static void svm_ctxt_switch_to(struct vc - svm_vmload(vmcb); - vmcb->cleanbits.bytes = 0; - vpmu_load(v); -+ svm_tsc_ratio_load(v); - - if ( cpu_has_rdtscp ) - wrmsrl(MSR_TSC_AUX, hvm_msr_tsc_aux(v)); -Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/vmcb.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/vmcb.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/vmcb.c -@@ -165,7 +165,9 @@ static int construct_vmcb(struct vcpu *v - - /* TSC. */ - vmcb->_tsc_offset = 0; -- if ( v->domain->arch.vtsc ) -+ -+ /* Don't need to intercept RDTSC if CPU supports TSC rate scaling */ -+ if ( v->domain->arch.vtsc && !cpu_has_tsc_ratio ) - { - vmcb->_general1_intercepts |= GENERAL1_INTERCEPT_RDTSC; - vmcb->_general2_intercepts |= GENERAL2_INTERCEPT_RDTSCP; -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/svm.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/svm.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/svm.h -@@ -91,5 +91,13 @@ extern u32 svm_feature_flags; - #define cpu_has_svm_cleanbits cpu_has_svm_feature(SVM_FEATURE_VMCBCLEAN) - #define cpu_has_svm_decode cpu_has_svm_feature(SVM_FEATURE_DECODEASSISTS) - #define cpu_has_pause_filter cpu_has_svm_feature(SVM_FEATURE_PAUSEFILTER) -+#define cpu_has_tsc_ratio cpu_has_svm_feature(SVM_FEATURE_TSCRATEMSR) -+ -+/* TSC rate */ -+#define DEFAULT_TSC_RATIO 0x0000000100000000ULL -+#define TSC_RATIO_RSVD_BITS 0xffffff0000000000ULL -+#define TSC_RATIO(g_khz, h_khz) ( (((u64)(g_khz)<<32)/(u64)(h_khz)) & \ -+ ~TSC_RATIO_RSVD_BITS ) -+#define vcpu_tsc_ratio(v) TSC_RATIO((v)->domain->arch.tsc_khz, cpu_khz) - - #endif /* __ASM_X86_HVM_SVM_H__ */ -Index: xen-4.1.2-testing/xen/include/asm-x86/msr-index.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/msr-index.h -+++ xen-4.1.2-testing/xen/include/asm-x86/msr-index.h -@@ -261,6 +261,9 @@ - #define MSR_AMD_PATCHLEVEL 0x0000008b - #define MSR_AMD_PATCHLOADER 0xc0010020 - -+/* AMD TSC RATE MSR */ -+#define MSR_AMD64_TSC_RATIO 0xc0000104 -+ - /* AMD OS Visible Workaround MSRs */ - #define MSR_AMD_OSVW_ID_LENGTH 0xc0010140 - #define MSR_AMD_OSVW_STATUS 0xc0010141 diff --git a/23508-vmx-proc-based-ctls-probe.patch b/23508-vmx-proc-based-ctls-probe.patch index 8882453..4a9a680 100644 --- a/23508-vmx-proc-based-ctls-probe.patch +++ b/23508-vmx-proc-based-ctls-probe.patch @@ -12,11 +12,11 @@ is of use to nestedvmx, and every 64-bit cpu should support it. Signed-off-by: Eddie Dong Signed-off-by: Keir Fraser -Index: xen-4.1.2-testing/xen/arch/x86/hvm/vmx/vmcs.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/vmx/vmcs.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/vmx/vmcs.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/vmx/vmcs.c -@@ -148,6 +148,11 @@ static int vmx_init_vmcs_config(void) +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/vmx/vmcs.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/vmx/vmcs.c +@@ -143,6 +143,11 @@ static int vmx_init_vmcs_config(void) MSR_IA32_VMX_PINBASED_CTLS, &mismatch); min = (CPU_BASED_HLT_EXITING | @@ -28,7 +28,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/vmx/vmcs.c CPU_BASED_INVLPG_EXITING | CPU_BASED_CR3_LOAD_EXITING | CPU_BASED_CR3_STORE_EXITING | -@@ -166,13 +171,9 @@ static int vmx_init_vmcs_config(void) +@@ -161,13 +166,9 @@ static int vmx_init_vmcs_config(void) MSR_IA32_VMX_PROCBASED_CTLS, &mismatch); _vmx_cpu_based_exec_control &= ~CPU_BASED_RDTSC_EXITING; #ifdef __x86_64__ diff --git a/23511-amd-fam15-no-flush-for-C3.patch b/23511-amd-fam15-no-flush-for-C3.patch deleted file mode 100644 index 684a2c2..0000000 --- a/23511-amd-fam15-no-flush-for-C3.patch +++ /dev/null @@ -1,30 +0,0 @@ -References: FATE#309893 - -# HG changeset patch -# User Mark Langsdorf -# Date 1308051989 -3600 -# Node ID 450f1d198e1e299b69489d513f591f0301cc5166 -# Parent 864a3dd1d9b4664f1ece44c9eaf390969253b7a8 -x86/amd: Eliminate cache flushing when entering C3 on select AMD processors - -AMD Fam15h processors have a shared cache. It does not need -to be be flushed when entering C3 and doing so causes reduces -performance. Modify acpi_processor_power_init_bm_check to -prevent these processors from flushing when entering C3. - -Signed-off-by: Mark Langsdorf - -Index: xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/acpi/cpu_idle.c -+++ xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c -@@ -710,7 +710,8 @@ static void acpi_processor_power_init_bm - flags->bm_check = 0; - if ( num_online_cpus() == 1 ) - flags->bm_check = 1; -- else if ( c->x86_vendor == X86_VENDOR_INTEL ) -+ else if ( (c->x86_vendor == X86_VENDOR_INTEL) || -+ ((c->x86_vendor == X86_VENDOR_AMD) && (c->x86 == 0x15)) ) - { - /* - * Today all MP CPUs that support C3 share cache. diff --git a/23571-vtd-fault-verbosity.patch b/23571-vtd-fault-verbosity.patch index 0ac5a60..93b3e26 100644 --- a/23571-vtd-fault-verbosity.patch +++ b/23571-vtd-fault-verbosity.patch @@ -10,10 +10,10 @@ iommu=debug is set xen boot parameter. Signed-off-by: Allen Kay -Index: xen-4.1.2-testing/xen/drivers/passthrough/amd/iommu_acpi.c +Index: xen-4.1.3-testing/xen/drivers/passthrough/amd/iommu_acpi.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/amd/iommu_acpi.c -+++ xen-4.1.2-testing/xen/drivers/passthrough/amd/iommu_acpi.c +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/amd/iommu_acpi.c ++++ xen-4.1.3-testing/xen/drivers/passthrough/amd/iommu_acpi.c @@ -822,7 +822,7 @@ static int __init parse_ivrs_table(struc BUG_ON(!table); @@ -23,10 +23,10 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/amd/iommu_acpi.c dump_acpi_table_header(table); /* parse IVRS blocks */ -Index: xen-4.1.2-testing/xen/drivers/passthrough/iommu.c +Index: xen-4.1.3-testing/xen/drivers/passthrough/iommu.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/iommu.c -+++ xen-4.1.2-testing/xen/drivers/passthrough/iommu.c +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/iommu.c ++++ xen-4.1.3-testing/xen/drivers/passthrough/iommu.c @@ -48,7 +48,7 @@ bool_t __read_mostly iommu_snoop = 1; bool_t __read_mostly iommu_qinval = 1; bool_t __read_mostly iommu_intremap = 1; @@ -47,11 +47,11 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/iommu.c else if ( !strcmp(s, "amd-iommu-perdev-intremap") ) amd_iommu_perdev_intremap = 1; else if ( !strcmp(s, "dom0-passthrough") ) -Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.c +Index: xen-4.1.3-testing/xen/drivers/passthrough/vtd/iommu.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/iommu.c -+++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.c -@@ -821,7 +821,7 @@ static int iommu_page_fault_do_one(struc +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/vtd/iommu.c ++++ xen-4.1.3-testing/xen/drivers/passthrough/vtd/iommu.c +@@ -844,7 +844,7 @@ static int iommu_page_fault_do_one(struc if ( fault_type == DMA_REMAP ) { @@ -60,7 +60,7 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.c "DMAR:[%s] Request device [%02x:%02x.%d] " "fault addr %"PRIx64", iommu reg = %p\n" "DMAR:[fault reason %02xh] %s\n", -@@ -830,12 +830,13 @@ static int iommu_page_fault_do_one(struc +@@ -853,12 +853,13 @@ static int iommu_page_fault_do_one(struc PCI_FUNC(source_id & 0xFF), addr, iommu->reg, fault_reason, reason); #ifndef __i386__ /* map_domain_page() cannot be used in this context */ @@ -76,7 +76,7 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.c "INTR-REMAP: Request device [%02x:%02x.%d] " "fault index %"PRIx64", iommu reg = %p\n" "INTR-REMAP:[fault reason %02xh] %s\n", -@@ -849,26 +850,19 @@ static int iommu_page_fault_do_one(struc +@@ -872,26 +873,19 @@ static int iommu_page_fault_do_one(struc static void iommu_fault_status(u32 fault_status) { if ( fault_status & DMA_FSTS_PFO ) @@ -110,10 +110,10 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.c } #define PRIMARY_FAULT_REG_LEN (16) -Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.h +Index: xen-4.1.3-testing/xen/drivers/passthrough/vtd/iommu.h =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/iommu.h -+++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.h +--- xen-4.1.3-testing.orig/xen/drivers/passthrough/vtd/iommu.h ++++ xen-4.1.3-testing/xen/drivers/passthrough/vtd/iommu.h @@ -512,4 +512,11 @@ struct intel_iommu { struct acpi_drhd_unit *drhd; }; @@ -126,10 +126,10 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/iommu.h + } while(0) + #endif -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h +Index: xen-4.1.3-testing/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h ++++ xen-4.1.3-testing/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h @@ -34,7 +34,7 @@ #define AMD_IOMMU_DEBUG(fmt, args...) \ do \ @@ -139,10 +139,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h printk(XENLOG_INFO "AMD-Vi: " fmt, ## args); \ } while(0) -Index: xen-4.1.2-testing/xen/include/xen/iommu.h +Index: xen-4.1.3-testing/xen/include/xen/iommu.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/iommu.h -+++ xen-4.1.2-testing/xen/include/xen/iommu.h +--- xen-4.1.3-testing.orig/xen/include/xen/iommu.h ++++ xen-4.1.3-testing/xen/include/xen/iommu.h @@ -31,7 +31,7 @@ extern bool_t force_iommu, iommu_verbose extern bool_t iommu_workaround_bios_bug, iommu_passthrough; extern bool_t iommu_snoop, iommu_qinval, iommu_intremap; diff --git a/23575-x86-DMI.patch b/23575-x86-DMI.patch index 1f9db41..d089bc5 100644 --- a/23575-x86-DMI.patch +++ b/23575-x86-DMI.patch @@ -12,13 +12,13 @@ another prerequisite for native EFI booting support. Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/x86/dmi_scan.c +Index: xen-4.1.3-testing/xen/arch/x86/dmi_scan.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/dmi_scan.c -+++ xen-4.1.2-testing/xen/arch/x86/dmi_scan.c -@@ -10,11 +10,31 @@ - #include - #include +--- xen-4.1.3-testing.orig/xen/arch/x86/dmi_scan.c ++++ xen-4.1.3-testing/xen/arch/x86/dmi_scan.c +@@ -12,11 +12,31 @@ + #include + #include -#define bt_ioremap(b,l) ((u8 *)__acpi_map_table(b,l)) +#define bt_ioremap(b,l) ((void *)__acpi_map_table(b,l)) @@ -49,7 +49,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/dmi_scan.c struct dmi_header { u8 type; -@@ -90,62 +110,70 @@ static int __init dmi_table(u32 base, in +@@ -92,62 +112,70 @@ static int __init dmi_table(u32 base, in } diff --git a/23576-x86_show_page_walk_also_for_early_page_faults.patch b/23576-x86_show_page_walk_also_for_early_page_faults.patch index d5c2466..7a47875 100644 --- a/23576-x86_show_page_walk_also_for_early_page_faults.patch +++ b/23576-x86_show_page_walk_also_for_early_page_faults.patch @@ -20,11 +20,11 @@ Signed-off-by: Jan Beulich xen/arch/x86/x86_64/traps.c | 12 ++++++++---- 6 files changed, 17 insertions(+), 11 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -151,6 +151,8 @@ unsigned long __read_mostly pdx_group_va +--- xen-4.1.3-testing.orig/xen/arch/x86/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/mm.c +@@ -152,6 +152,8 @@ unsigned long __read_mostly pdx_group_va (FRAMETABLE_SIZE / sizeof(*frame_table) + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT)] = { [0] = 1 }; @@ -33,11 +33,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c #define PAGE_CACHE_ATTRS (_PAGE_PAT|_PAGE_PCD|_PAGE_PWT) bool_t __read_mostly opt_allow_superpage; -Index: xen-4.1.2-testing/xen/arch/x86/traps.c +Index: xen-4.1.3-testing/xen/arch/x86/traps.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/traps.c -+++ xen-4.1.2-testing/xen/arch/x86/traps.c -@@ -1428,6 +1428,7 @@ asmlinkage void __init do_early_page_fau +--- xen-4.1.3-testing.orig/xen/arch/x86/traps.c ++++ xen-4.1.3-testing/xen/arch/x86/traps.c +@@ -1454,6 +1454,7 @@ asmlinkage void __init do_early_page_fau unsigned long *stk = (unsigned long *)regs; printk("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n", regs->cs, _p(regs->eip), _p(cr2), regs->error_code); @@ -45,10 +45,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c printk("Stack dump: "); while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 ) printk("%p ", _p(*stk++)); -Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_32/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_32/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_32/mm.c @@ -39,8 +39,6 @@ extern l1_pgentry_t l1_identmap[L1_PAGET unsigned int __read_mostly PAGE_HYPERVISOR = __PAGE_HYPERVISOR; unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE; @@ -58,10 +58,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c static unsigned long __read_mostly mpt_size; void *alloc_xen_pagetable(void) -Index: xen-4.1.2-testing/xen/arch/x86/x86_32/traps.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_32/traps.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/traps.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_32/traps.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_32/traps.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_32/traps.c @@ -164,7 +164,8 @@ void show_page_walk(unsigned long addr) l3t += (cr3 & 0xFE0UL) >> 3; l3e = l3t[l3_table_offset(addr)]; @@ -92,10 +92,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_32/traps.c printk(" L1[0x%03lx] = %"PRIpte" %08lx\n", l1_table_offset(addr), l1e_get_intpte(l1e), pfn); unmap_domain_page(l1t); -Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/mm.c @@ -47,8 +47,6 @@ unsigned int __read_mostly pfn_pdx_hole_ unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START; @@ -105,10 +105,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c /* Top-level master (and idle-domain) page directory. */ l4_pgentry_t __attribute__ ((__section__ (".bss.page_aligned"))) idle_pg_table[L4_PAGETABLE_ENTRIES]; -Index: xen-4.1.2-testing/xen/arch/x86/x86_64/traps.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/traps.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/traps.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_64/traps.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/traps.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/traps.c @@ -176,7 +176,8 @@ void show_page_walk(unsigned long addr) l4t = mfn_to_virt(mfn); l4e = l4t[l4_table_offset(addr)]; diff --git a/23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch b/23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch index 8863e7b..f67311c 100644 --- a/23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch +++ b/23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch @@ -44,10 +44,10 @@ Committed-by: Ian Jackson tools/xenpaging/xenpaging.h | 1 12 files changed, 91 insertions(+), 618 deletions(-) -Index: xen-4.1.2-testing/tools/blktap2/drivers/block-log.c +Index: xen-4.1.3-testing/tools/blktap2/drivers/block-log.c =================================================================== ---- xen-4.1.2-testing.orig/tools/blktap2/drivers/block-log.c -+++ xen-4.1.2-testing/tools/blktap2/drivers/block-log.c +--- xen-4.1.3-testing.orig/tools/blktap2/drivers/block-log.c ++++ xen-4.1.3-testing/tools/blktap2/drivers/block-log.c @@ -47,6 +47,7 @@ #include #include @@ -98,10 +98,10 @@ Index: xen-4.1.2-testing/tools/blktap2/drivers/block-log.c BWPRINTF("could not allocate dirty bitmap of size %"PRIu64, bmsize); return -1; } -Index: xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_linux_restore.c +Index: xen-4.1.3-testing/tools/libxc/ia64/xc_ia64_linux_restore.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/ia64/xc_ia64_linux_restore.c -+++ xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_linux_restore.c +--- xen-4.1.3-testing.orig/tools/libxc/ia64/xc_ia64_linux_restore.c ++++ xen-4.1.3-testing/tools/libxc/ia64/xc_ia64_linux_restore.c @@ -218,14 +218,12 @@ xc_ia64_recv_vcpumap(xc_interface *xch, max_virt_cpus, info->max_vcpu_id); return -1; @@ -139,10 +139,10 @@ Index: xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_linux_restore.c continue; if (xc_ia64_recv_vcpu_context(xch, io_fd, dom, i, &ctxt_any)) -Index: xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_linux_save.c +Index: xen-4.1.3-testing/tools/libxc/ia64/xc_ia64_linux_save.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/ia64/xc_ia64_linux_save.c -+++ xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_linux_save.c +--- xen-4.1.3-testing.orig/tools/libxc/ia64/xc_ia64_linux_save.c ++++ xen-4.1.3-testing/tools/libxc/ia64/xc_ia64_linux_save.c @@ -32,6 +32,7 @@ #include @@ -214,10 +214,10 @@ Index: xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_linux_save.c continue; if (xc_ia64_send_vcpu_context(xch, io_fd, dom, i, &ctxt_any)) -Index: xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_save_restore.h +Index: xen-4.1.3-testing/tools/libxc/ia64/xc_ia64_save_restore.h =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/ia64/xc_ia64_save_restore.h -+++ xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_save_restore.h +--- xen-4.1.3-testing.orig/tools/libxc/ia64/xc_ia64_save_restore.h ++++ xen-4.1.3-testing/tools/libxc/ia64/xc_ia64_save_restore.h @@ -33,26 +33,6 @@ #define XC_IA64_SR_FORMAT_VER_CURRENT XC_IA64_SR_FORMAT_VER_THREE @@ -245,10 +245,10 @@ Index: xen-4.1.2-testing/tools/libxc/ia64/xc_ia64_save_restore.h #endif /* XC_IA64_SAVE_RESTORE_H */ -Index: xen-4.1.2-testing/tools/libxc/xc_bitops.h +Index: xen-4.1.3-testing/tools/libxc/xc_bitops.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/tools/libxc/xc_bitops.h ++++ xen-4.1.3-testing/tools/libxc/xc_bitops.h @@ -0,0 +1,57 @@ +#ifndef XC_BITOPS_H +#define XC_BITOPS_H 1 @@ -307,10 +307,10 @@ Index: xen-4.1.2-testing/tools/libxc/xc_bitops.h +} + +#endif /* XC_BITOPS_H */ -Index: xen-4.1.2-testing/tools/libxc/xc_domain_save.c +Index: xen-4.1.3-testing/tools/libxc/xc_domain_save.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_domain_save.c -+++ xen-4.1.2-testing/tools/libxc/xc_domain_save.c +--- xen-4.1.3-testing.orig/tools/libxc/xc_domain_save.c ++++ xen-4.1.3-testing/tools/libxc/xc_domain_save.c @@ -27,6 +27,7 @@ #include @@ -408,7 +408,7 @@ Index: xen-4.1.2-testing/tools/libxc/xc_domain_save.c debug = 0; DPRINTF("Entering debug resend-all mode\n"); -@@ -1959,8 +1909,8 @@ int xc_domain_save(xc_interface *xch, in +@@ -1971,8 +1921,8 @@ int xc_domain_save(xc_interface *xch, in if ( ctx->live_m2p ) munmap(ctx->live_m2p, M2P_SIZE(ctx->max_mfn)); @@ -419,9 +419,9 @@ Index: xen-4.1.2-testing/tools/libxc/xc_domain_save.c free(pfn_type); free(pfn_batch); -Index: xen-4.1.2-testing/tools/xenpaging/bitops.h +Index: xen-4.1.3-testing/tools/xenpaging/bitops.h =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/bitops.h +--- xen-4.1.3-testing.orig/tools/xenpaging/bitops.h +++ /dev/null @@ -1,448 +0,0 @@ -#ifndef _X86_BITOPS_H @@ -872,10 +872,10 @@ Index: xen-4.1.2-testing/tools/xenpaging/bitops.h -#define hweight8(x) generic_hweight8(x) - -#endif /* _X86_BITOPS_H */ -Index: xen-4.1.2-testing/tools/xenpaging/policy_default.c +Index: xen-4.1.3-testing/tools/xenpaging/policy_default.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/policy_default.c -+++ xen-4.1.2-testing/tools/xenpaging/policy_default.c +--- xen-4.1.3-testing.orig/tools/xenpaging/policy_default.c ++++ xen-4.1.3-testing/tools/xenpaging/policy_default.c @@ -21,8 +21,7 @@ */ @@ -937,10 +937,10 @@ Index: xen-4.1.2-testing/tools/xenpaging/policy_default.c out: return rc; } -Index: xen-4.1.2-testing/tools/xenpaging/xc.c +Index: xen-4.1.3-testing/tools/xenpaging/xc.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xc.c -+++ xen-4.1.2-testing/tools/xenpaging/xc.c +--- xen-4.1.3-testing.orig/tools/xenpaging/xc.c ++++ xen-4.1.3-testing/tools/xenpaging/xc.c @@ -31,20 +31,6 @@ #include "xc.h" @@ -962,10 +962,10 @@ Index: xen-4.1.2-testing/tools/xenpaging/xc.c int xc_mem_paging_flush_ioemu_cache(domid_t domain_id) { -Index: xen-4.1.2-testing/tools/xenpaging/xc.h +Index: xen-4.1.3-testing/tools/xenpaging/xc.h =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xc.h -+++ xen-4.1.2-testing/tools/xenpaging/xc.h +--- xen-4.1.3-testing.orig/tools/xenpaging/xc.h ++++ xen-4.1.3-testing/tools/xenpaging/xc.h @@ -39,7 +39,6 @@ #endif @@ -982,10 +982,10 @@ Index: xen-4.1.2-testing/tools/xenpaging/xc.h int xc_mem_paging_flush_ioemu_cache(domid_t domain_id); int xc_wait_for_event(xc_interface *xch, xc_evtchn *xce); -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.c ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.c @@ -31,7 +31,7 @@ #include @@ -1009,10 +1009,10 @@ Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c { ERROR("Error allocating bitmap"); goto err; -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.h =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.h ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.h @@ -40,7 +40,6 @@ typedef struct xenpaging { xc_platform_info_t *platform_info; xc_domaininfo_t *domain_info; diff --git a/23610-x86-topology-info.patch b/23610-x86-topology-info.patch deleted file mode 100644 index 39a6224..0000000 --- a/23610-x86-topology-info.patch +++ /dev/null @@ -1,222 +0,0 @@ -References: fate#309894 - -# HG changeset patch -# User Wei Huang -# Date 1309248811 -3600 -# Node ID 87c2013c2aa2d4874f892507e6cc7b52219a3acf -# Parent 819c315a919daec434f80ffb6e790ac492cbd2a7 -x86: consolidate cpu_core_id and phys_proc_id into cpuinfo_x86 struct - -This patch moves cpu_core_id and phys_proc_id into cpuinfo_x86 -structure. This is similar to upstream Linux kernel's approach. - -Signed-off-by: Wei Huang - -Index: xen-4.1.2-testing/xen/arch/x86/cpu/amd.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/amd.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/amd.c -@@ -579,11 +579,11 @@ static void __devinit init_amd(struct cp - while ((1 << bits) < c->x86_max_cores) - bits++; - } -- cpu_core_id[cpu] = phys_proc_id[cpu] & ((1<>= bits; -+ c->cpu_core_id = c->phys_proc_id & ((1<phys_proc_id >>= bits; - if (opt_cpu_info) - printk("CPU %d(%d) -> Core %d\n", -- cpu, c->x86_max_cores, cpu_core_id[cpu]); -+ cpu, c->x86_max_cores, c->cpu_core_id); - } - #endif - -Index: xen-4.1.2-testing/xen/arch/x86/cpu/common.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/common.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/common.c -@@ -326,7 +326,7 @@ void __cpuinit generic_identify(struct c - early_intel_workaround(c); - - #ifdef CONFIG_X86_HT -- phys_proc_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff; -+ c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff; - #endif - } - -@@ -362,6 +362,8 @@ void __cpuinit identify_cpu(struct cpuin - c->x86_max_cores = 1; - c->x86_num_siblings = 1; - c->x86_clflush_size = 0; -+ c->phys_proc_id = BAD_APICID; -+ c->cpu_core_id = BAD_APICID; - memset(&c->x86_capability, 0, sizeof c->x86_capability); - - if (!have_cpuid_p()) { -@@ -510,7 +512,6 @@ void __cpuinit detect_extended_topology( - unsigned int ht_mask_width, core_plus_mask_width; - unsigned int core_select_mask, core_level_siblings; - unsigned int initial_apicid; -- int cpu = smp_processor_id(); - - if ( c->cpuid_level < 0xb ) - return; -@@ -545,9 +546,9 @@ void __cpuinit detect_extended_topology( - - core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width; - -- cpu_core_id[cpu] = phys_pkg_id(initial_apicid, ht_mask_width) -+ c->cpu_core_id = phys_pkg_id(initial_apicid, ht_mask_width) - & core_select_mask; -- phys_proc_id[cpu] = phys_pkg_id(initial_apicid, core_plus_mask_width); -+ c->phys_proc_id = phys_pkg_id(initial_apicid, core_plus_mask_width); - - c->apicid = phys_pkg_id(initial_apicid, 0); - c->x86_max_cores = (core_level_siblings / c->x86_num_siblings); -@@ -555,10 +556,10 @@ void __cpuinit detect_extended_topology( - if ( opt_cpu_info ) - { - printk("CPU: Physical Processor ID: %d\n", -- phys_proc_id[cpu]); -+ c->phys_proc_id); - if ( c->x86_max_cores > 1 ) - printk("CPU: Processor Core ID: %d\n", -- cpu_core_id[cpu]); -+ c->cpu_core_id); - } - } - -@@ -567,7 +568,6 @@ void __cpuinit detect_ht(struct cpuinfo_ - { - u32 eax, ebx, ecx, edx; - int index_msb, core_bits; -- int cpu = smp_processor_id(); - - cpuid(1, &eax, &ebx, &ecx, &edx); - -@@ -590,11 +590,11 @@ void __cpuinit detect_ht(struct cpuinfo_ - } - - index_msb = get_count_order(c->x86_num_siblings); -- phys_proc_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb); -+ c->phys_proc_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb); - - if (opt_cpu_info) - printk("CPU: Physical Processor ID: %d\n", -- phys_proc_id[cpu]); -+ c->phys_proc_id); - - c->x86_num_siblings = c->x86_num_siblings / c->x86_max_cores; - -@@ -602,12 +602,12 @@ void __cpuinit detect_ht(struct cpuinfo_ - - core_bits = get_count_order(c->x86_max_cores); - -- cpu_core_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) & -+ c->cpu_core_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) & - ((1 << core_bits) - 1); - - if (opt_cpu_info && c->x86_max_cores > 1) - printk("CPU: Processor Core ID: %d\n", -- cpu_core_id[cpu]); -+ c->cpu_core_id); - } - } - #endif -Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/mce.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c -@@ -1041,9 +1041,9 @@ void x86_mc_get_cpu_info(unsigned cpu, u - if (nthreads != NULL) - *nthreads = 1; - } else { -- *chipid = phys_proc_id[cpu]; -+ *chipid = c->phys_proc_id; - if (c->x86_max_cores > 1) -- *coreid = cpu_core_id[cpu]; -+ *coreid = c->cpu_core_id; - else - *coreid = 0; - *threadid = c->apicid & ((1 << (c->x86_num_siblings - 1)) - 1); -Index: xen-4.1.2-testing/xen/arch/x86/smpboot.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/smpboot.c -+++ xen-4.1.2-testing/xen/arch/x86/smpboot.c -@@ -51,12 +51,6 @@ - /* Set if we find a B stepping CPU */ - static int smp_b_stepping; - --/* Package ID of each logical CPU */ --int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; -- --/* Core ID of each logical CPU */ --int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; -- - /* representing HT siblings of each logical CPU */ - DEFINE_PER_CPU_READ_MOSTLY(cpumask_t, cpu_sibling_map); - /* representing HT and core siblings of each logical CPU */ -@@ -257,8 +251,8 @@ static void set_cpu_sibling_map(int cpu) - { - for_each_cpu_mask ( i, cpu_sibling_setup_map ) - { -- if ( (phys_proc_id[cpu] == phys_proc_id[i]) && -- (cpu_core_id[cpu] == cpu_core_id[i]) ) -+ if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) && -+ (c[cpu].cpu_core_id == c[i].cpu_core_id) ) - { - cpu_set(i, per_cpu(cpu_sibling_map, cpu)); - cpu_set(cpu, per_cpu(cpu_sibling_map, i)); -@@ -281,7 +275,7 @@ static void set_cpu_sibling_map(int cpu) - - for_each_cpu_mask ( i, cpu_sibling_setup_map ) - { -- if ( phys_proc_id[cpu] == phys_proc_id[i] ) -+ if ( c[cpu].phys_proc_id == c[i].phys_proc_id ) - { - cpu_set(i, per_cpu(cpu_core_map, cpu)); - cpu_set(cpu, per_cpu(cpu_core_map, i)); -@@ -842,8 +836,8 @@ remove_siblinginfo(int cpu) - cpu_clear(cpu, per_cpu(cpu_sibling_map, sibling)); - cpus_clear(per_cpu(cpu_sibling_map, cpu)); - cpus_clear(per_cpu(cpu_core_map, cpu)); -- phys_proc_id[cpu] = BAD_APICID; -- cpu_core_id[cpu] = BAD_APICID; -+ c[cpu].phys_proc_id = BAD_APICID; -+ c[cpu].cpu_core_id = BAD_APICID; - cpu_clear(cpu, cpu_sibling_setup_map); - } - -Index: xen-4.1.2-testing/xen/include/asm-x86/processor.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/processor.h -+++ xen-4.1.2-testing/xen/include/asm-x86/processor.h -@@ -175,6 +175,8 @@ struct cpuinfo_x86 { - __u32 x86_max_cores; /* cpuid returned max cores value */ - __u32 booted_cores; /* number of cores as seen by OS */ - __u32 x86_num_siblings; /* cpuid logical cpus per chip value */ -+ int phys_proc_id; /* package ID of each logical CPU */ -+ int cpu_core_id; /* core ID of each logical CPU*/ - __u32 apicid; - unsigned short x86_clflush_size; - } __cacheline_aligned; -@@ -196,8 +198,6 @@ extern struct cpuinfo_x86 cpu_data[]; - extern void set_cpuid_faulting(bool_t enable); - - extern u64 host_pat; --extern int phys_proc_id[NR_CPUS]; --extern int cpu_core_id[NR_CPUS]; - extern bool_t opt_cpu_info; - - /* Maximum width of physical addresses supported by the hardware */ -@@ -217,8 +217,8 @@ extern void detect_ht(struct cpuinfo_x86 - static always_inline void detect_ht(struct cpuinfo_x86 *c) {} - #endif - --#define cpu_to_core(_cpu) (cpu_core_id[_cpu]) --#define cpu_to_socket(_cpu) (phys_proc_id[_cpu]) -+#define cpu_to_core(_cpu) (cpu_data[_cpu].cpu_core_id) -+#define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id) - - /* - * Generic CPUID function diff --git a/23611-amd-fam15-topology.patch b/23611-amd-fam15-topology.patch deleted file mode 100644 index d507127..0000000 --- a/23611-amd-fam15-topology.patch +++ /dev/null @@ -1,176 +0,0 @@ -References: fate#309894 - -# HG changeset patch -# User Wei Huang -# Date 1309248833 -3600 -# Node ID c2c12b2dafb5b1d3bfcc4c05a60ca4f9051c90e7 -# Parent 87c2013c2aa2d4874f892507e6cc7b52219a3acf -x86: AMD core-pair topology detection code - -This patch is to support core-pair topology introduced by AMD CPUs, -which introduces a new concept of [core, compute unit]. There is a new -feature bit for topology extension in CPUID:0x80000001. Also a new -CPUID 0x8000001E is introduced for CPU topology enumeration. This -patch collects the sibling information from the new CPUID and will be -stored in the sibling map in Xen hypervisor. - -Signed-off-by: Wei Huang - -Index: xen-4.1.2-testing/xen/arch/x86/cpu/amd.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/amd.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/amd.c -@@ -344,6 +344,49 @@ static void check_syscfg_dram_mod_en(voi - wrmsrl(MSR_K8_SYSCFG, syscfg); - } - -+static void __devinit amd_get_topology(struct cpuinfo_x86 *c) -+{ -+#ifdef CONFIG_X86_HT -+ int cpu; -+ unsigned bits; -+ -+ if (c->x86_max_cores <= 1) -+ return; -+ /* -+ * On a AMD multi core setup the lower bits of the APIC id -+ * distingush the cores. -+ */ -+ cpu = smp_processor_id(); -+ bits = (cpuid_ecx(0x80000008) >> 12) & 0xf; -+ -+ if (bits == 0) { -+ while ((1 << bits) < c->x86_max_cores) -+ bits++; -+ } -+ -+ /* Low order bits define the core id */ -+ c->cpu_core_id = c->phys_proc_id & ((1<phys_proc_id >>= bits; -+ /* Collect compute unit ID if available */ -+ if (cpu_has(c, X86_FEATURE_TOPOEXT)) { -+ u32 eax, ebx, ecx, edx; -+ -+ cpuid(0x8000001e, &eax, &ebx, &ecx, &edx); -+ c->compute_unit_id = ebx & 0xFF; -+ c->x86_num_siblings = ((ebx >> 8) & 0x3) + 1; -+ } -+ -+ if (opt_cpu_info) -+ printk("CPU %d(%d) -> Processor %d, %s %d\n", -+ cpu, c->x86_max_cores, c->phys_proc_id, -+ cpu_has(c, X86_FEATURE_TOPOEXT) ? "Compute Unit" : -+ "Core", -+ cpu_has(c, X86_FEATURE_TOPOEXT) ? c->compute_unit_id : -+ c->cpu_core_id); -+#endif -+} -+ - static void __devinit init_amd(struct cpuinfo_x86 *c) - { - u32 l, h; -@@ -566,26 +609,7 @@ static void __devinit init_amd(struct cp - } - } - --#ifdef CONFIG_X86_HT -- /* -- * On a AMD multi core setup the lower bits of the APIC id -- * distingush the cores. -- */ -- if (c->x86_max_cores > 1) { -- int cpu = smp_processor_id(); -- unsigned bits = (cpuid_ecx(0x80000008) >> 12) & 0xf; -- -- if (bits == 0) { -- while ((1 << bits) < c->x86_max_cores) -- bits++; -- } -- c->cpu_core_id = c->phys_proc_id & ((1<phys_proc_id >>= bits; -- if (opt_cpu_info) -- printk("CPU %d(%d) -> Core %d\n", -- cpu, c->x86_max_cores, c->cpu_core_id); -- } --#endif -+ amd_get_topology(c); - - /* Pointless to use MWAIT on Family10 as it does not deep sleep. */ - if (c->x86 >= 0x10 && !force_mwait) -Index: xen-4.1.2-testing/xen/arch/x86/cpu/common.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/common.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/common.c -@@ -364,6 +364,7 @@ void __cpuinit identify_cpu(struct cpuin - c->x86_clflush_size = 0; - c->phys_proc_id = BAD_APICID; - c->cpu_core_id = BAD_APICID; -+ c->compute_unit_id = BAD_APICID; - memset(&c->x86_capability, 0, sizeof c->x86_capability); - - if (!have_cpuid_p()) { -Index: xen-4.1.2-testing/xen/arch/x86/smpboot.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/smpboot.c -+++ xen-4.1.2-testing/xen/arch/x86/smpboot.c -@@ -240,6 +240,14 @@ static int booting_cpu; - /* CPUs for which sibling maps can be computed. */ - static cpumask_t cpu_sibling_setup_map; - -+static void link_thread_siblings(int cpu1, int cpu2) -+{ -+ cpu_set(cpu1, per_cpu(cpu_sibling_map, cpu2)); -+ cpu_set(cpu2, per_cpu(cpu_sibling_map, cpu1)); -+ cpu_set(cpu1, per_cpu(cpu_core_map, cpu2)); -+ cpu_set(cpu2, per_cpu(cpu_core_map, cpu1)); -+} -+ - static void set_cpu_sibling_map(int cpu) - { - int i; -@@ -251,13 +259,13 @@ static void set_cpu_sibling_map(int cpu) - { - for_each_cpu_mask ( i, cpu_sibling_setup_map ) - { -- if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) && -- (c[cpu].cpu_core_id == c[i].cpu_core_id) ) -- { -- cpu_set(i, per_cpu(cpu_sibling_map, cpu)); -- cpu_set(cpu, per_cpu(cpu_sibling_map, i)); -- cpu_set(i, per_cpu(cpu_core_map, cpu)); -- cpu_set(cpu, per_cpu(cpu_core_map, i)); -+ if ( cpu_has(c, X86_FEATURE_TOPOEXT) ) { -+ if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) && -+ (c[cpu].compute_unit_id == c[i].compute_unit_id) ) -+ link_thread_siblings(cpu, i); -+ } else if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) && -+ (c[cpu].cpu_core_id == c[i].cpu_core_id) ) { -+ link_thread_siblings(cpu, i); - } - } - } -@@ -838,6 +846,7 @@ remove_siblinginfo(int cpu) - cpus_clear(per_cpu(cpu_core_map, cpu)); - c[cpu].phys_proc_id = BAD_APICID; - c[cpu].cpu_core_id = BAD_APICID; -+ c[cpu].compute_unit_id = BAD_APICID; - cpu_clear(cpu, cpu_sibling_setup_map); - } - -Index: xen-4.1.2-testing/xen/include/asm-x86/processor.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/processor.h -+++ xen-4.1.2-testing/xen/include/asm-x86/processor.h -@@ -175,9 +175,10 @@ struct cpuinfo_x86 { - __u32 x86_max_cores; /* cpuid returned max cores value */ - __u32 booted_cores; /* number of cores as seen by OS */ - __u32 x86_num_siblings; /* cpuid logical cpus per chip value */ -+ __u32 apicid; - int phys_proc_id; /* package ID of each logical CPU */ - int cpu_core_id; /* core ID of each logical CPU*/ -- __u32 apicid; -+ int compute_unit_id; /* AMD compute unit ID of each logical CPU */ - unsigned short x86_clflush_size; - } __cacheline_aligned; - diff --git a/23613-EFI-headers.patch b/23613-EFI-headers.patch index c82ed9d..37f5694 100644 --- a/23613-EFI-headers.patch +++ b/23613-EFI-headers.patch @@ -11,10 +11,10 @@ Taken from gnu-efi-3.0k (slightly edited). Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/include/asm-x86/efibind.h +Index: xen-4.1.3-testing/xen/include/asm-x86/efibind.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/asm-x86/efibind.h ++++ xen-4.1.3-testing/xen/include/asm-x86/efibind.h @@ -0,0 +1,6 @@ +#include +#if defined(__i386__) @@ -22,10 +22,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/efibind.h +#elif defined(__x86_64__) +# include +#endif -Index: xen-4.1.2-testing/xen/include/asm-x86/x86_64/efibind.h +Index: xen-4.1.3-testing/xen/include/asm-x86/x86_64/efibind.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/asm-x86/x86_64/efibind.h ++++ xen-4.1.3-testing/xen/include/asm-x86/x86_64/efibind.h @@ -0,0 +1,276 @@ +/*++ + @@ -303,10 +303,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/x86_64/efibind.h +#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP +#endif + -Index: xen-4.1.2-testing/xen/include/efi/efiapi.h +Index: xen-4.1.3-testing/xen/include/efi/efiapi.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/efi/efiapi.h ++++ xen-4.1.3-testing/xen/include/efi/efiapi.h @@ -0,0 +1,718 @@ +#ifndef _EFI_API_H +#define _EFI_API_H @@ -1026,10 +1026,10 @@ Index: xen-4.1.2-testing/xen/include/efi/efiapi.h + +#endif + -Index: xen-4.1.2-testing/xen/include/efi/eficon.h +Index: xen-4.1.3-testing/xen/include/efi/eficon.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/efi/eficon.h ++++ xen-4.1.3-testing/xen/include/efi/eficon.h @@ -0,0 +1,302 @@ +#ifndef _EFI_CON_H +#define _EFI_CON_H @@ -1333,10 +1333,10 @@ Index: xen-4.1.2-testing/xen/include/efi/eficon.h + +#endif + -Index: xen-4.1.2-testing/xen/include/efi/efidef.h +Index: xen-4.1.3-testing/xen/include/efi/efidef.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/efi/efidef.h ++++ xen-4.1.3-testing/xen/include/efi/efidef.h @@ -0,0 +1,196 @@ +#ifndef _EFI_DEF_H +#define _EFI_DEF_H @@ -1400,11 +1400,11 @@ Index: xen-4.1.2-testing/xen/include/efi/efidef.h +// A GUID +// + -+typedef struct { ++typedef struct { + UINT32 Data1; + UINT16 Data2; + UINT16 Data3; -+ UINT8 Data4[8]; ++ UINT8 Data4[8]; +} EFI_GUID; + + @@ -1412,7 +1412,7 @@ Index: xen-4.1.2-testing/xen/include/efi/efidef.h +// Time +// + -+typedef struct { ++typedef struct { + UINT16 Year; // 1998 - 20XX + UINT8 Month; // 1 - 12 + UINT8 Day; // 1 - 31 @@ -1495,9 +1495,9 @@ Index: xen-4.1.2-testing/xen/include/efi/efidef.h +#define EFI_MEMORY_WC 0x0000000000000002 +#define EFI_MEMORY_WT 0x0000000000000004 +#define EFI_MEMORY_WB 0x0000000000000008 -+#define EFI_MEMORY_UCE 0x0000000000000010 ++#define EFI_MEMORY_UCE 0x0000000000000010 + -+// physical memory protection on range ++// physical memory protection on range +#define EFI_MEMORY_WP 0x0000000000001000 +#define EFI_MEMORY_RP 0x0000000000002000 +#define EFI_MEMORY_XP 0x0000000000004000 @@ -1534,10 +1534,10 @@ Index: xen-4.1.2-testing/xen/include/efi/efidef.h + ( ((a) >> EFI_PAGE_SHIFT) + ((a) & EFI_PAGE_MASK ? 1 : 0) ) + +#endif -Index: xen-4.1.2-testing/xen/include/efi/efidevp.h +Index: xen-4.1.3-testing/xen/include/efi/efidevp.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/efi/efidevp.h ++++ xen-4.1.3-testing/xen/include/efi/efidevp.h @@ -0,0 +1,402 @@ +#ifndef _DEVPATH_H +#define _DEVPATH_H @@ -1684,8 +1684,8 @@ Index: xen-4.1.2-testing/xen/include/efi/efidevp.h +// bits[31:16] - binary number +// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z' +// -+#define PNP_EISA_ID_CONST 0x41d0 -+#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16)) ++#define PNP_EISA_ID_CONST 0x41d0 ++#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16)) +#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) + +#define PNP_EISA_ID_MASK 0xffff @@ -1693,7 +1693,7 @@ Index: xen-4.1.2-testing/xen/include/efi/efidevp.h +/* + * + */ -+#define MESSAGING_DEVICE_PATH 0x03 ++#define MESSAGING_DEVICE_PATH 0x03 + +#define MSG_ATAPI_DP 0x01 +typedef struct _ATAPI_DEVICE_PATH { @@ -1707,7 +1707,7 @@ Index: xen-4.1.2-testing/xen/include/efi/efidevp.h +typedef struct _SCSI_DEVICE_PATH { + EFI_DEVICE_PATH Header; + UINT16 Pun; -+ UINT16 Lun; ++ UINT16 Lun; +} SCSI_DEVICE_PATH; + +#define MSG_FIBRECHANNEL_DP 0x03 @@ -1877,7 +1877,7 @@ Index: xen-4.1.2-testing/xen/include/efi/efidevp.h + PCCARD_DEVICE_PATH PcCard; + MEMMAP_DEVICE_PATH MemMap; + VENDOR_DEVICE_PATH Vendor; -+ UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor; ++ UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor; + CONTROLLER_DEVICE_PATH Controller; + ACPI_HID_DEVICE_PATH Acpi; + @@ -1911,7 +1911,7 @@ Index: xen-4.1.2-testing/xen/include/efi/efidevp.h + PCCARD_DEVICE_PATH *PcCard; + MEMMAP_DEVICE_PATH *MemMap; + VENDOR_DEVICE_PATH *Vendor; -+ UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor; ++ UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor; + CONTROLLER_DEVICE_PATH *Controller; + ACPI_HID_DEVICE_PATH *Acpi; + @@ -1941,10 +1941,10 @@ Index: xen-4.1.2-testing/xen/include/efi/efidevp.h + + +#endif -Index: xen-4.1.2-testing/xen/include/efi/efierr.h +Index: xen-4.1.3-testing/xen/include/efi/efierr.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/efi/efierr.h ++++ xen-4.1.3-testing/xen/include/efi/efierr.h @@ -0,0 +1,60 @@ +#ifndef _EFI_ERR_H +#define _EFI_ERR_H @@ -2006,10 +2006,10 @@ Index: xen-4.1.2-testing/xen/include/efi/efierr.h + +#endif + -Index: xen-4.1.2-testing/xen/include/efi/efiprot.h +Index: xen-4.1.3-testing/xen/include/efi/efiprot.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/efi/efiprot.h ++++ xen-4.1.3-testing/xen/include/efi/efiprot.h @@ -0,0 +1,728 @@ +#ifndef _EFI_PROT_H +#define _EFI_PROT_H @@ -2318,9 +2318,9 @@ Index: xen-4.1.2-testing/xen/include/efi/efiprot.h +// +// The FileName field of the EFI_FILE_INFO data structure is variable length. +// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to -+// be the size of the data structure without the FileName field. The following macro ++// be the size of the data structure without the FileName field. The following macro +// computes this size correctly no matter how big the FileName array is declared. -+// This is required to make the EFI_FILE_INFO data structure ANSI compilant. ++// This is required to make the EFI_FILE_INFO data structure ANSI compilant. +// + +#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName) @@ -2340,9 +2340,9 @@ Index: xen-4.1.2-testing/xen/include/efi/efiprot.h +// +// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length. +// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs -+// to be the size of the data structure without the VolumeLable field. The following macro ++// to be the size of the data structure without the VolumeLable field. The following macro +// computes this size correctly no matter how big the VolumeLable array is declared. -+// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant. ++// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant. +// + +#define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel) @@ -2423,7 +2423,7 @@ Index: xen-4.1.2-testing/xen/include/efi/efiprot.h + EFI_DEVICE_IO Write; +} EFI_IO_ACCESS; + -+typedef ++typedef +EFI_STATUS +(EFIAPI *EFI_PCI_DEVICE_PATH) ( + IN struct _EFI_DEVICE_IO_INTERFACE *This, @@ -2658,7 +2658,7 @@ Index: xen-4.1.2-testing/xen/include/efi/efiprot.h +typedef enum { + EfiBltVideoFill, + EfiBltVideoToBltBuffer, -+ EfiBltBufferToVideo, ++ EfiBltBufferToVideo, + EfiBltVideoToVideo, + EfiGraphicsOutputBltOperationMax +} EFI_GRAPHICS_OUTPUT_BLT_OPERATION; @@ -2666,28 +2666,28 @@ Index: xen-4.1.2-testing/xen/include/efi/efiprot.h +/** + The following table defines actions for BltOperations: + -+ EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) -+ directly to every pixel of the video display rectangle -+ (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). ++ EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) ++ directly to every pixel of the video display rectangle ++ (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). + Only one pixel will be used from the BltBuffer. Delta is NOT used. + -+ EfiBltVideoToBltBuffer - Read data from the video display rectangle -+ (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in -+ the BltBuffer rectangle (DestinationX, DestinationY ) -+ (DestinationX + Width, DestinationY + Height). If DestinationX or -+ DestinationY is not zero then Delta must be set to the length in bytes ++ EfiBltVideoToBltBuffer - Read data from the video display rectangle ++ (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in ++ the BltBuffer rectangle (DestinationX, DestinationY ) ++ (DestinationX + Width, DestinationY + Height). If DestinationX or ++ DestinationY is not zero then Delta must be set to the length in bytes + of a row in the BltBuffer. + -+ EfiBltBufferToVideo - Write data from the BltBuffer rectangle -+ (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the -+ video display rectangle (DestinationX, DestinationY) -+ (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is -+ not zero then Delta must be set to the length in bytes of a row in the ++ EfiBltBufferToVideo - Write data from the BltBuffer rectangle ++ (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the ++ video display rectangle (DestinationX, DestinationY) ++ (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is ++ not zero then Delta must be set to the length in bytes of a row in the + BltBuffer. + + EfiBltVideoToVideo - Copy from the video display rectangle (SourceX, SourceY) -+ (SourceX + Width, SourceY + Height) .to the video display rectangle -+ (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). ++ (SourceX + Width, SourceY + Height) .to the video display rectangle ++ (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). + The BltBuffer and Delta are not used in this mode. + + @param This Protocol instance pointer. diff --git a/23614-x86_64-EFI-boot.patch b/23614-x86_64-EFI-boot.patch index 43d4417..fc1447e 100644 --- a/23614-x86_64-EFI-boot.patch +++ b/23614-x86_64-EFI-boot.patch @@ -59,10 +59,10 @@ corrupt other data. Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/Makefile +Index: xen-4.1.3-testing/xen/Makefile =================================================================== ---- xen-4.1.2-testing.orig/xen/Makefile -+++ xen-4.1.2-testing/xen/Makefile +--- xen-4.1.3-testing.orig/xen/Makefile ++++ xen-4.1.3-testing/xen/Makefile @@ -12,6 +12,8 @@ export XEN_DOMAIN ?= $(shell ([ -x /bin/ export BASEDIR := $(CURDIR) export XEN_ROOT := $(BASEDIR)/.. @@ -91,10 +91,10 @@ Index: xen-4.1.2-testing/xen/Makefile .PHONY: _debug _debug: -Index: xen-4.1.2-testing/xen/arch/x86/Makefile +Index: xen-4.1.3-testing/xen/arch/x86/Makefile =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/Makefile -+++ xen-4.1.2-testing/xen/arch/x86/Makefile +--- xen-4.1.3-testing.orig/xen/arch/x86/Makefile ++++ xen-4.1.3-testing/xen/arch/x86/Makefile @@ -61,14 +61,21 @@ obj-$(crash_debug) += gdbstub.o x86_emulate.o: x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h @@ -182,10 +182,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/Makefile rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d + rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.o efi/mkreloc rm -f boot/reloc.S boot/reloc.lnk boot/reloc.bin -Index: xen-4.1.2-testing/xen/arch/x86/boot/trampoline.S +Index: xen-4.1.3-testing/xen/arch/x86/boot/trampoline.S =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/boot/trampoline.S -+++ xen-4.1.2-testing/xen/arch/x86/boot/trampoline.S +--- xen-4.1.3-testing.orig/xen/arch/x86/boot/trampoline.S ++++ xen-4.1.3-testing/xen/arch/x86/boot/trampoline.S @@ -38,6 +38,7 @@ trampoline_gdt: .long 0x0000ffff | ((BOOT_TRAMPOLINE & 0x00ffff) << 16) .long 0x00009200 | ((BOOT_TRAMPOLINE & 0xff0000) >> 16) @@ -194,10 +194,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/boot/trampoline.S cpuid_ext_features: .long 0 -Index: xen-4.1.2-testing/xen/arch/x86/boot/x86_64.S +Index: xen-4.1.3-testing/xen/arch/x86/boot/x86_64.S =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/boot/x86_64.S -+++ xen-4.1.2-testing/xen/arch/x86/boot/x86_64.S +--- xen-4.1.3-testing.orig/xen/arch/x86/boot/x86_64.S ++++ xen-4.1.3-testing/xen/arch/x86/boot/x86_64.S @@ -84,11 +84,13 @@ multiboot_ptr: .long 0 @@ -212,19 +212,19 @@ Index: xen-4.1.2-testing/xen/arch/x86/boot/x86_64.S idt_descr: .word 256*16-1 .quad idt_table -Index: xen-4.1.2-testing/xen/arch/x86/dmi_scan.c +Index: xen-4.1.3-testing/xen/arch/x86/dmi_scan.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/dmi_scan.c -+++ xen-4.1.2-testing/xen/arch/x86/dmi_scan.c -@@ -9,6 +9,7 @@ - #include - #include +--- xen-4.1.3-testing.orig/xen/arch/x86/dmi_scan.c ++++ xen-4.1.3-testing/xen/arch/x86/dmi_scan.c +@@ -11,6 +11,7 @@ #include + #include + #include +#include #define bt_ioremap(b,l) ((void *)__acpi_map_table(b,l)) #define bt_iounmap(b,l) ((void)0) -@@ -122,11 +123,39 @@ static inline bool_t __init dmi_checksum +@@ -124,11 +125,39 @@ static inline bool_t __init dmi_checksum return sum == 0; } @@ -264,7 +264,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/dmi_scan.c p = maddr_to_virt(0xF0000); for (q = p; q < p + 0x10000; q += 16) { memcpy_fromio(&eps, q, 15); -@@ -178,6 +207,39 @@ static int __init dmi_iterate(void (*dec +@@ -180,6 +209,39 @@ static int __init dmi_iterate(void (*dec return -1; } @@ -304,7 +304,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/dmi_scan.c static char *dmi_ident[DMI_STRING_MAX]; /* -@@ -468,8 +530,8 @@ static void __init dmi_decode(struct dmi +@@ -504,8 +566,8 @@ static void __init dmi_decode(struct dmi void __init dmi_scan_machine(void) { @@ -315,10 +315,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/dmi_scan.c dmi_check_system(dmi_blacklist); else printk(KERN_INFO "DMI not present.\n"); -Index: xen-4.1.2-testing/xen/arch/x86/efi/Makefile +Index: xen-4.1.3-testing/xen/arch/x86/efi/Makefile =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/Makefile ++++ xen-4.1.3-testing/xen/arch/x86/efi/Makefile @@ -0,0 +1,17 @@ +CFLAGS += -fshort-wchar -mno-sse + @@ -337,10 +337,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/Makefile + +clean:: + rm -f disabled *.efi -Index: xen-4.1.2-testing/xen/arch/x86/efi/boot.c +Index: xen-4.1.3-testing/xen/arch/x86/efi/boot.c =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/boot.c ++++ xen-4.1.3-testing/xen/arch/x86/efi/boot.c @@ -0,0 +1,1221 @@ +#include "efi.h" +#include @@ -1563,19 +1563,19 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/boot.c + mdesc_ver, efi_memmap); +#endif +} -Index: xen-4.1.2-testing/xen/arch/x86/efi/check.c +Index: xen-4.1.3-testing/xen/arch/x86/efi/check.c =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/check.c ++++ xen-4.1.3-testing/xen/arch/x86/efi/check.c @@ -0,0 +1,4 @@ +int __attribute__((__ms_abi__)) test(int i) +{ + return i; +} -Index: xen-4.1.2-testing/xen/arch/x86/efi/compat.c +Index: xen-4.1.3-testing/xen/arch/x86/efi/compat.c =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/compat.c ++++ xen-4.1.3-testing/xen/arch/x86/efi/compat.c @@ -0,0 +1,16 @@ +#include +#include @@ -1593,10 +1593,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/compat.c +#undef __copy_to_guest_offset +#define __copy_to_guest_offset __copy_to_compat_offset +#include "runtime.c" -Index: xen-4.1.2-testing/xen/arch/x86/efi/efi.h +Index: xen-4.1.3-testing/xen/arch/x86/efi/efi.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/efi.h ++++ xen-4.1.3-testing/xen/arch/x86/efi/efi.h @@ -0,0 +1,18 @@ +#include +#include @@ -1616,10 +1616,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/efi.h + +extern UINTN efi_memmap_size, efi_mdesc_size; +extern void *efi_memmap; -Index: xen-4.1.2-testing/xen/arch/x86/efi/mkreloc.c +Index: xen-4.1.3-testing/xen/arch/x86/efi/mkreloc.c =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/mkreloc.c ++++ xen-4.1.3-testing/xen/arch/x86/efi/mkreloc.c @@ -0,0 +1,377 @@ +#include +#include @@ -1998,10 +1998,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/mkreloc.c + + return 0; +} -Index: xen-4.1.2-testing/xen/arch/x86/efi/relocs-dummy.S +Index: xen-4.1.3-testing/xen/arch/x86/efi/relocs-dummy.S =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/relocs-dummy.S ++++ xen-4.1.3-testing/xen/arch/x86/efi/relocs-dummy.S @@ -0,0 +1,13 @@ +#include + @@ -2016,10 +2016,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/relocs-dummy.S + .globl VIRT_START, ALT_START + .equ VIRT_START, XEN_VIRT_START + .equ ALT_START, XEN_VIRT_END -Index: xen-4.1.2-testing/xen/arch/x86/efi/runtime.c +Index: xen-4.1.3-testing/xen/arch/x86/efi/runtime.c =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/runtime.c ++++ xen-4.1.3-testing/xen/arch/x86/efi/runtime.c @@ -0,0 +1,88 @@ +#include "efi.h" +#include @@ -2109,10 +2109,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/runtime.c + + return 0; +} -Index: xen-4.1.2-testing/xen/arch/x86/efi/stub.c +Index: xen-4.1.3-testing/xen/arch/x86/efi/stub.c =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/arch/x86/efi/stub.c ++++ xen-4.1.3-testing/xen/arch/x86/efi/stub.c @@ -0,0 +1,17 @@ +#include +#include @@ -2131,19 +2131,19 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/stub.c + +int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *) + __attribute__((__alias__("efi_get_info"))); -Index: xen-4.1.2-testing/xen/arch/x86/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -100,6 +100,7 @@ - #include +--- xen-4.1.3-testing.orig/xen/arch/x86/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/mm.c +@@ -101,6 +101,7 @@ #include + #include #include +#include #include #include #include -@@ -355,6 +356,8 @@ void __init arch_init_memory(void) +@@ -356,6 +357,8 @@ void __init arch_init_memory(void) subarch_init_memory(); @@ -2152,10 +2152,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c mem_sharing_init(); } -Index: xen-4.1.2-testing/xen/arch/x86/platform_hypercall.c +Index: xen-4.1.3-testing/xen/arch/x86/platform_hypercall.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/platform_hypercall.c -+++ xen-4.1.2-testing/xen/arch/x86/platform_hypercall.c +--- xen-4.1.3-testing.orig/xen/arch/x86/platform_hypercall.c ++++ xen-4.1.3-testing/xen/arch/x86/platform_hypercall.c @@ -19,6 +19,7 @@ #include #include @@ -2179,10 +2179,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/platform_hypercall.c default: ret = -EINVAL; break; -Index: xen-4.1.2-testing/xen/arch/x86/setup.c +Index: xen-4.1.3-testing/xen/arch/x86/setup.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/setup.c -+++ xen-4.1.2-testing/xen/arch/x86/setup.c +--- xen-4.1.3-testing.orig/xen/arch/x86/setup.c ++++ xen-4.1.3-testing/xen/arch/x86/setup.c @@ -7,6 +7,7 @@ #include #include @@ -2191,7 +2191,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c #include #include #include -@@ -448,6 +449,10 @@ static void __init parse_video_info(void +@@ -446,6 +447,10 @@ static void __init parse_video_info(void { struct boot_video_info *bvi = &bootsym(boot_vid_info); @@ -2202,7 +2202,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c if ( (bvi->orig_video_isVGA == 1) && (bvi->orig_video_mode == 3) ) { vga_console_info.video_type = XEN_VGATYPE_TEXT_MODE_3; -@@ -619,6 +624,7 @@ void __init __start_xen(unsigned long mb +@@ -617,6 +622,7 @@ void __init __start_xen(unsigned long mb vga_console_info.u.text_mode_3.font_height); break; case XEN_VGATYPE_VESA_LFB: @@ -2210,7 +2210,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c printk(" VGA is graphics mode %dx%d, %d bpp\n", vga_console_info.u.vesa_lfb.width, vga_console_info.u.vesa_lfb.height, -@@ -664,7 +670,24 @@ void __init __start_xen(unsigned long mb +@@ -662,7 +668,24 @@ void __init __start_xen(unsigned long mb if ( ((unsigned long)cpu0_stack & (STACK_SIZE-1)) != 0 ) EARLY_FAIL("Misaligned CPU0 stack.\n"); @@ -2236,7 +2236,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c { memmap_type = "Xen-e820"; } -@@ -762,7 +785,7 @@ void __init __start_xen(unsigned long mb +@@ -760,7 +783,7 @@ void __init __start_xen(unsigned long mb * we can relocate the dom0 kernel and other multiboot modules. Also, on * x86/64, we relocate Xen to higher memory. */ @@ -2245,7 +2245,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c { if ( mod[i].mod_start & (PAGE_SIZE - 1) ) EARLY_FAIL("Bootloader didn't honor module alignment request.\n"); -@@ -811,7 +834,6 @@ void __init __start_xen(unsigned long mb +@@ -809,7 +832,6 @@ void __init __start_xen(unsigned long mb end = 0; if ( end > s ) { @@ -2253,7 +2253,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c l4_pgentry_t *pl4e; l3_pgentry_t *pl3e; l2_pgentry_t *pl2e; -@@ -951,7 +973,8 @@ void __init __start_xen(unsigned long mb +@@ -949,7 +971,8 @@ void __init __start_xen(unsigned long mb #else if ( !xen_phys_start ) EARLY_FAIL("Not enough memory to relocate Xen.\n"); @@ -2263,10 +2263,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c #endif /* Late kexec reservation (dynamic start address). */ -Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_32/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_32/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_32/mm.c @@ -34,8 +34,6 @@ l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned"))) idle_pg_table_l2[4 * L2_PAGETABLE_ENTRIES]; @@ -2276,10 +2276,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c unsigned int __read_mostly PAGE_HYPERVISOR = __PAGE_HYPERVISOR; unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE; -Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/mm.c @@ -21,6 +21,7 @@ #include #include @@ -2298,10 +2298,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c } void *compat_arg_xlat_virt_base(void) -Index: xen-4.1.2-testing/xen/arch/x86/x86_64/platform_hypercall.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/platform_hypercall.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/platform_hypercall.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_64/platform_hypercall.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/platform_hypercall.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/platform_hypercall.c @@ -11,6 +11,8 @@ DEFINE_XEN_GUEST_HANDLE(compat_platform_ #define xen_platform_op_t compat_platform_op_t #define do_platform_op(x) compat_platform_op(_##x) @@ -2311,10 +2311,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_64/platform_hypercall.c #define xen_processor_px compat_processor_px #define xen_processor_px_t compat_processor_px_t #define xen_processor_performance compat_processor_performance -Index: xen-4.1.2-testing/xen/arch/x86/xen.lds.S +Index: xen-4.1.3-testing/xen/arch/x86/xen.lds.S =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/xen.lds.S -+++ xen-4.1.2-testing/xen/arch/x86/xen.lds.S +--- xen-4.1.3-testing.orig/xen/arch/x86/xen.lds.S ++++ xen-4.1.3-testing/xen/arch/x86/xen.lds.S @@ -8,15 +8,34 @@ #undef ENTRY #undef ALIGN @@ -2384,10 +2384,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/xen.lds.S } /* Stabs debugging sections. */ -Index: xen-4.1.2-testing/xen/drivers/acpi/osl.c +Index: xen-4.1.3-testing/xen/drivers/acpi/osl.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/acpi/osl.c -+++ xen-4.1.2-testing/xen/drivers/acpi/osl.c +--- xen-4.1.3-testing.orig/xen/drivers/acpi/osl.c ++++ xen-4.1.3-testing/xen/drivers/acpi/osl.c @@ -37,9 +37,7 @@ #include #include @@ -2418,10 +2418,10 @@ Index: xen-4.1.2-testing/xen/drivers/acpi/osl.c acpi_physical_address pa = 0; acpi_find_root_pointer(&pa); -Index: xen-4.1.2-testing/xen/drivers/video/vga.c +Index: xen-4.1.3-testing/xen/drivers/video/vga.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/video/vga.c -+++ xen-4.1.2-testing/xen/drivers/video/vga.c +--- xen-4.1.3-testing.orig/xen/drivers/video/vga.c ++++ xen-4.1.3-testing/xen/drivers/video/vga.c @@ -89,6 +89,7 @@ void __init vga_init(void) vga_puts = vga_text_puts; break; @@ -2438,10 +2438,10 @@ Index: xen-4.1.2-testing/xen/drivers/video/vga.c vesa_endboot(vgacon_keep); break; default: -Index: xen-4.1.2-testing/xen/include/asm-x86/page.h +Index: xen-4.1.3-testing/xen/include/asm-x86/page.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/page.h -+++ xen-4.1.2-testing/xen/include/asm-x86/page.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/page.h ++++ xen-4.1.3-testing/xen/include/asm-x86/page.h @@ -301,8 +301,14 @@ extern l2_pgentry_t idle_pg_table_l2[ #elif CONFIG_PAGING_LEVELS == 4 extern l2_pgentry_t *compat_idle_pg_table_l2; @@ -2457,10 +2457,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/page.h void paging_init(void); void setup_idle_pagetable(void); #endif /* !defined(__ASSEMBLY__) */ -Index: xen-4.1.2-testing/xen/include/public/platform.h +Index: xen-4.1.3-testing/xen/include/public/platform.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/platform.h -+++ xen-4.1.2-testing/xen/include/public/platform.h +--- xen-4.1.3-testing.orig/xen/include/public/platform.h ++++ xen-4.1.3-testing/xen/include/public/platform.h @@ -118,6 +118,11 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_platform_q #define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */ #define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */ @@ -2498,10 +2498,10 @@ Index: xen-4.1.2-testing/xen/include/public/platform.h } u; }; typedef struct xenpf_firmware_info xenpf_firmware_info_t; -Index: xen-4.1.2-testing/xen/include/public/xen.h +Index: xen-4.1.3-testing/xen/include/public/xen.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/xen.h -+++ xen-4.1.2-testing/xen/include/public/xen.h +--- xen-4.1.3-testing.orig/xen/include/public/xen.h ++++ xen-4.1.3-testing/xen/include/public/xen.h @@ -638,6 +638,7 @@ typedef struct dom0_vga_console_info { uint8_t video_type; /* DOM0_VGA_CONSOLE_??? */ #define XEN_VGATYPE_TEXT_MODE_3 0x03 @@ -2510,10 +2510,10 @@ Index: xen-4.1.2-testing/xen/include/public/xen.h union { struct { -Index: xen-4.1.2-testing/xen/include/xen/compat.h +Index: xen-4.1.3-testing/xen/include/xen/compat.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/compat.h -+++ xen-4.1.2-testing/xen/include/xen/compat.h +--- xen-4.1.3-testing.orig/xen/include/xen/compat.h ++++ xen-4.1.3-testing/xen/include/xen/compat.h @@ -34,7 +34,7 @@ /* Cast a compat handle to the specified type of handle. */ #define compat_handle_cast(chnd, type) ({ \ @@ -2523,10 +2523,10 @@ Index: xen-4.1.2-testing/xen/include/xen/compat.h }) #define guest_from_compat_handle(ghnd, chnd) \ -Index: xen-4.1.2-testing/xen/include/xen/dmi.h +Index: xen-4.1.3-testing/xen/include/xen/dmi.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/dmi.h -+++ xen-4.1.2-testing/xen/include/xen/dmi.h +--- xen-4.1.3-testing.orig/xen/include/xen/dmi.h ++++ xen-4.1.3-testing/xen/include/xen/dmi.h @@ -36,5 +36,6 @@ extern int dmi_check_system(struct dmi_s extern char * dmi_get_system_info(int field); extern void dmi_scan_machine(void); @@ -2534,10 +2534,10 @@ Index: xen-4.1.2-testing/xen/include/xen/dmi.h +extern void dmi_efi_get_table(void *); #endif /* __DMI_H__ */ -Index: xen-4.1.2-testing/xen/include/xen/efi.h +Index: xen-4.1.3-testing/xen/include/xen/efi.h =================================================================== --- /dev/null -+++ xen-4.1.2-testing/xen/include/xen/efi.h ++++ xen-4.1.3-testing/xen/include/xen/efi.h @@ -0,0 +1,38 @@ +#ifndef __XEN_EFI_H__ +#define __XEN_EFI_H__ diff --git a/23676-x86_64-image-map-bounds.patch b/23676-x86_64-image-map-bounds.patch index 892ca63..12c3114 100644 --- a/23676-x86_64-image-map-bounds.patch +++ b/23676-x86_64-image-map-bounds.patch @@ -14,11 +14,11 @@ other pages beyond _end when checking for aliases. Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/x86/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -778,7 +778,7 @@ static int update_xen_mappings(unsigned +--- xen-4.1.3-testing.orig/xen/arch/x86/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/mm.c +@@ -779,7 +779,7 @@ static int update_xen_mappings(unsigned int err = 0; #ifdef __x86_64__ bool_t alias = mfn >= PFN_DOWN(xen_phys_start) && @@ -27,11 +27,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c unsigned long xen_va = XEN_VIRT_START + ((mfn - PFN_DOWN(xen_phys_start)) << PAGE_SHIFT); -Index: xen-4.1.2-testing/xen/arch/x86/setup.c +Index: xen-4.1.3-testing/xen/arch/x86/setup.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/setup.c -+++ xen-4.1.2-testing/xen/arch/x86/setup.c -@@ -99,6 +99,8 @@ unsigned long __read_mostly xen_phys_sta +--- xen-4.1.3-testing.orig/xen/arch/x86/setup.c ++++ xen-4.1.3-testing/xen/arch/x86/setup.c +@@ -97,6 +97,8 @@ unsigned long __read_mostly xen_phys_sta /* Limits of Xen heap, used to initialise the allocator. */ unsigned long __initdata xenheap_initial_phys_start; unsigned long __read_mostly xenheap_phys_end; @@ -40,7 +40,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c #endif DEFINE_PER_CPU(struct tss_struct, init_tss); -@@ -1098,6 +1100,9 @@ void __init __start_xen(unsigned long mb +@@ -1096,6 +1098,9 @@ void __init __start_xen(unsigned long mb map_pages_to_xen((unsigned long)__va(kexec_crash_area.start), kexec_crash_area.start >> PAGE_SHIFT, PFN_UP(kexec_crash_area.size), PAGE_HYPERVISOR); @@ -50,10 +50,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/setup.c #endif memguard_init(); -Index: xen-4.1.2-testing/xen/include/asm-x86/x86_64/page.h +Index: xen-4.1.3-testing/xen/include/asm-x86/x86_64/page.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/x86_64/page.h -+++ xen-4.1.2-testing/xen/include/asm-x86/x86_64/page.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/x86_64/page.h ++++ xen-4.1.3-testing/xen/include/asm-x86/x86_64/page.h @@ -34,6 +34,8 @@ #include #include diff --git a/23686-pygrub-solaris.patch b/23686-pygrub-solaris.patch deleted file mode 100644 index 68cd836..0000000 --- a/23686-pygrub-solaris.patch +++ /dev/null @@ -1,43 +0,0 @@ -# HG changeset patch -# User tools/pygrub: fix solaris kernel sniff -# Date 1310663398 -3600 -# Node ID 7c39a2c0d870f9a374f181b581bcf82a2a7ff364 -# Parent 5239811f92e1ffb185a50172fdcf47372e71ba7e -tools/pygrub: fix solaris kernel sniff - -Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the -64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists. - -This patch fixes the detection. - -Signed-off-by: Zhigang Wang -Signed-off-by: Kurt Hackel -Signed-off-by: Frank Che -Committed-by: Ian Jackson - -diff -r 5239811f92e1 -r 7c39a2c0d870 tools/pygrub/src/pygrub ---- a/tools/pygrub/src/pygrub Thu Jul 14 15:49:49 2011 +0100 -+++ b/tools/pygrub/src/pygrub Thu Jul 14 18:09:58 2011 +0100 -@@ -594,7 +594,8 @@ - # If nothing has been specified, look for a Solaris domU. If found, perform the - # necessary tweaks. - def sniff_solaris(fs, cfg): -- if not fs.file_exists("/platform/i86xpv/kernel/unix"): -+ if not fs.file_exists("/platform/i86xpv/kernel/unix") and \ -+ not fs.file_exists("/platform/i86xpv/kernel/amd64/unix"): - return cfg - - if not cfg["kernel"]: -@@ -602,9 +603,11 @@ - fs.file_exists("/platform/i86xpv/kernel/amd64/unix"): - cfg["kernel"] = "/platform/i86xpv/kernel/amd64/unix" - cfg["ramdisk"] = "/platform/i86pc/amd64/boot_archive" -- else: -+ elif fs.file_exists("/platform/i86xpv/kernel/unix"): - cfg["kernel"] = "/platform/i86xpv/kernel/unix" - cfg["ramdisk"] = "/platform/i86pc/boot_archive" -+ else: -+ return cfg - - # Unpleasant. Typically we'll have 'root=foo -k' or 'root=foo /kernel -k', - # and we need to maintain Xen properties (root= and ip=) and the kernel diff --git a/23697-pygrub-grub2.patch b/23697-pygrub-grub2.patch index 741df98..d40c9ac 100644 --- a/23697-pygrub-grub2.patch +++ b/23697-pygrub-grub2.patch @@ -11,10 +11,11 @@ Signed-off-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson -diff -r c1d7fa123dae -r 5e1032229546 tools/pygrub/src/pygrub ---- a/tools/pygrub/src/pygrub Fri Jul 15 18:09:49 2011 +0100 -+++ b/tools/pygrub/src/pygrub Fri Jul 15 18:12:55 2011 +0100 -@@ -385,14 +385,14 @@ +Index: xen-4.1.3-testing/tools/pygrub/src/pygrub +=================================================================== +--- xen-4.1.3-testing.orig/tools/pygrub/src/pygrub ++++ xen-4.1.3-testing/tools/pygrub/src/pygrub +@@ -394,15 +394,14 @@ class Grub: # fallbacks ["/efi/boot/elilo.conf", "/elilo.conf",]) else: @@ -22,8 +23,10 @@ diff -r c1d7fa123dae -r 5e1032229546 tools/pygrub/src/pygrub - ["/boot/grub/menu.lst", "/boot/grub/grub.conf", - "/grub/menu.lst", "/grub/grub.conf"]) + \ - map(lambda x: (x,grub.GrubConf.Grub2ConfigFile), +- ["/boot/grub/grub.cfg", "/grub/grub.cfg", +- "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]) + \ + cfg_list = map(lambda x: (x,grub.GrubConf.Grub2ConfigFile), - ["/boot/grub/grub.cfg", "/grub/grub.cfg"]) + \ ++ ["/boot/grub/grub.cfg", "/grub/grub.cfg"]) + \ map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile), ["/boot/isolinux/isolinux.cfg", - "/boot/extlinux.conf"]) diff --git a/23723-x86-CMOS-lock.patch b/23723-x86-CMOS-lock.patch index bcdf55e..232410a 100644 --- a/23723-x86-CMOS-lock.patch +++ b/23723-x86-CMOS-lock.patch @@ -18,10 +18,10 @@ for PCI config space method 1 accesses. Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/x86/efi/runtime.c +Index: xen-4.1.3-testing/xen/arch/x86/efi/runtime.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/efi/runtime.c -+++ xen-4.1.2-testing/xen/arch/x86/efi/runtime.c +--- xen-4.1.3-testing.orig/xen/arch/x86/efi/runtime.c ++++ xen-4.1.3-testing/xen/arch/x86/efi/runtime.c @@ -3,6 +3,7 @@ #include #include @@ -98,10 +98,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/runtime.c efi_rs_leave(cr3); op->misc = 0; -Index: xen-4.1.2-testing/xen/arch/x86/hpet.c +Index: xen-4.1.3-testing/xen/arch/x86/hpet.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hpet.c -+++ xen-4.1.2-testing/xen/arch/x86/hpet.c +--- xen-4.1.3-testing.orig/xen/arch/x86/hpet.c ++++ xen-4.1.3-testing/xen/arch/x86/hpet.c @@ -525,18 +525,10 @@ static void hpet_detach_channel(int cpu, #include @@ -123,10 +123,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/hpet.c if ( index != RTC_REG_B ) return; -Index: xen-4.1.2-testing/xen/arch/x86/traps.c +Index: xen-4.1.3-testing/xen/arch/x86/traps.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/traps.c -+++ xen-4.1.2-testing/xen/arch/x86/traps.c +--- xen-4.1.3-testing.orig/xen/arch/x86/traps.c ++++ xen-4.1.3-testing/xen/arch/x86/traps.c @@ -67,6 +67,8 @@ #include #include @@ -136,7 +136,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c #include /* -@@ -1630,6 +1632,10 @@ static int admin_io_okay( +@@ -1656,6 +1658,10 @@ static int admin_io_okay( if ( (port == 0xcf8) && (bytes == 4) ) return 0; @@ -147,7 +147,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c return ioports_access_permitted(v->domain, port, port + bytes - 1); } -@@ -1659,6 +1665,21 @@ static uint32_t guest_io_read( +@@ -1685,6 +1691,21 @@ static uint32_t guest_io_read( { sub_data = pv_pit_handler(port, 0, 0); } @@ -169,7 +169,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c else if ( (port == 0xcf8) && (bytes == 4) ) { size = 4; -@@ -1684,8 +1705,6 @@ static uint32_t guest_io_read( +@@ -1710,8 +1731,6 @@ static uint32_t guest_io_read( return data; } @@ -178,7 +178,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c static void guest_io_write( unsigned int port, unsigned int bytes, uint32_t data, struct vcpu *v, struct cpu_user_regs *regs) -@@ -1694,8 +1713,6 @@ static void guest_io_write( +@@ -1720,8 +1739,6 @@ static void guest_io_write( { switch ( bytes ) { case 1: @@ -187,7 +187,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c outb((uint8_t)data, port); if ( pv_post_outb_hook ) pv_post_outb_hook(port, (uint8_t)data); -@@ -1718,6 +1735,23 @@ static void guest_io_write( +@@ -1744,6 +1761,23 @@ static void guest_io_write( { pv_pit_handler(port, (uint8_t)data, 1); } @@ -211,7 +211,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c else if ( (port == 0xcf8) && (bytes == 4) ) { size = 4; -@@ -2083,10 +2117,6 @@ static int emulate_privileged_op(struct +@@ -2109,10 +2143,6 @@ static int emulate_privileged_op(struct goto fail; if ( admin_io_okay(port, op_bytes, v, regs) ) { @@ -222,10 +222,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c io_emul(regs); if ( (op_bytes == 1) && pv_post_outb_hook ) pv_post_outb_hook(port, regs->eax); -Index: xen-4.1.2-testing/xen/include/asm-x86/domain.h +Index: xen-4.1.3-testing/xen/include/asm-x86/domain.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/domain.h -+++ xen-4.1.2-testing/xen/include/asm-x86/domain.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/domain.h ++++ xen-4.1.3-testing/xen/include/asm-x86/domain.h @@ -251,6 +251,7 @@ struct arch_domain /* I/O-port admin-specified access capabilities. */ struct rangeset *ioport_caps; @@ -234,10 +234,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/domain.h struct list_head pdev_list; struct hvm_domain hvm_domain; -Index: xen-4.1.2-testing/xen/include/asm-x86/hpet.h +Index: xen-4.1.3-testing/xen/include/asm-x86/hpet.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hpet.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hpet.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/hpet.h ++++ xen-4.1.3-testing/xen/include/asm-x86/hpet.h @@ -52,6 +52,7 @@ #define HPET_TN_FSB_CAP 0x8000 #define HPET_TN_ROUTE_SHIFT 9 @@ -246,10 +246,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/hpet.h #define hpet_read32(x) \ (*(volatile u32 *)(fix_to_virt(FIX_HPET_BASE) + (x))) -Index: xen-4.1.2-testing/xen/include/asm-x86/mach-default/smpboot_hooks.h +Index: xen-4.1.3-testing/xen/include/asm-x86/mach-default/smpboot_hooks.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/mach-default/smpboot_hooks.h -+++ xen-4.1.2-testing/xen/include/asm-x86/mach-default/smpboot_hooks.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/mach-default/smpboot_hooks.h ++++ xen-4.1.3-testing/xen/include/asm-x86/mach-default/smpboot_hooks.h @@ -3,7 +3,11 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) diff --git a/23724-x86-smpboot-x2apic.patch b/23724-x86-smpboot-x2apic.patch deleted file mode 100644 index c490ec6..0000000 --- a/23724-x86-smpboot-x2apic.patch +++ /dev/null @@ -1,107 +0,0 @@ -# HG changeset patch -# User Tim Deegan -# Date 1311081181 -3600 -# Node ID b3434f24b0827c5ef34e4b4a72893288e2ffbe40 -# Parent 18653a163b1e8e10b4353272bcb9e8302bfd2e19 -x86: Remove timeouts from INIT-SIPI-SIPI sequence when using x2apic. - -Some of the timeouts are pointless since they're waiting for the ICR -to ack the IPI delivery and that doesn't happen on x2apic. -The others should be benign (and are suggested in the SDM) but -removing them makes AP bringup much more reliable on some test boxes. - -Signed-off-by: Tim Deegan - -Index: xen-4.1.2-testing/xen/arch/x86/smpboot.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/smpboot.c -+++ xen-4.1.2-testing/xen/arch/x86/smpboot.c -@@ -447,29 +447,30 @@ static int wakeup_secondary_cpu(int phys - apic_icr_write(APIC_INT_LEVELTRIG | APIC_INT_ASSERT | APIC_DM_INIT, - phys_apicid); - -- Dprintk("Waiting for send to finish...\n"); -- timeout = 0; -- do { -- Dprintk("+"); -- udelay(100); -- if ( !x2apic_enabled ) -+ if ( !x2apic_enabled ) -+ { -+ Dprintk("Waiting for send to finish...\n"); -+ timeout = 0; -+ do { -+ Dprintk("+"); -+ udelay(100); - send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY; -- } while ( send_status && (timeout++ < 1000) ); -+ } while ( send_status && (timeout++ < 1000) ); - -- mdelay(10); -+ mdelay(10); - -- Dprintk("Deasserting INIT.\n"); -+ Dprintk("Deasserting INIT.\n"); - -- apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid); -+ apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid); - -- Dprintk("Waiting for send to finish...\n"); -- timeout = 0; -- do { -- Dprintk("+"); -- udelay(100); -- if ( !x2apic_enabled ) -+ Dprintk("Waiting for send to finish...\n"); -+ timeout = 0; -+ do { -+ Dprintk("+"); -+ udelay(100); - send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY; -- } while ( send_status && (timeout++ < 1000) ); -+ } while ( send_status && (timeout++ < 1000) ); -+ } - - /* - * Should we send STARTUP IPIs ? -@@ -498,22 +499,24 @@ static int wakeup_secondary_cpu(int phys - */ - apic_icr_write(APIC_DM_STARTUP | (start_eip >> 12), phys_apicid); - -- /* Give the other CPU some time to accept the IPI. */ -- udelay(300); -- -- Dprintk("Startup point 1.\n"); -- -- Dprintk("Waiting for send to finish...\n"); -- timeout = 0; -- do { -- Dprintk("+"); -- udelay(100); -- if ( !x2apic_enabled ) -- send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY; -- } while ( send_status && (timeout++ < 1000) ); -- -- /* Give the other CPU some time to accept the IPI. */ -- udelay(200); -+ if ( !x2apic_enabled ) -+ { -+ /* Give the other CPU some time to accept the IPI. */ -+ udelay(300); -+ -+ Dprintk("Startup point 1.\n"); -+ -+ Dprintk("Waiting for send to finish...\n"); -+ timeout = 0; -+ do { -+ Dprintk("+"); -+ udelay(100); -+ send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY; -+ } while ( send_status && (timeout++ < 1000) ); -+ -+ /* Give the other CPU some time to accept the IPI. */ -+ udelay(200); -+ } - - /* Due to the Pentium erratum 3AP. */ - if ( maxlvt > 3 ) diff --git a/23726-x86-intel-flexmigration-v2.patch b/23726-x86-intel-flexmigration-v2.patch deleted file mode 100644 index 87a84b8..0000000 --- a/23726-x86-intel-flexmigration-v2.patch +++ /dev/null @@ -1,127 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1311081291 -3600 -# Node ID fd97ca086df6808bffc6ecf3f79cebca64c60bc3 -# Parent 4dc6a9ba90d60fdf0cc0898fc9a8fe84ae9030fc -x86: update Intel CPUID masking code to latest spec - -..., which adds masking of the xsave feature leaf. - -Also fix the printing (to actually make it do what it was supposed to -do from the beginning) of what specific masking couldn't be done in -case the user requested something the hardware doesn't support. - -Signed-off-by: Jan Beulich - -# HG changeset patch -# User Jan Beulich -# Date 1311255291 -3600 -# Node ID 48f72b389b04cfa8d44924577a69ed59e48fbe77 -# Parent dd5eecf739d152fb16bd44897875ea878d4c9d59 -x86: add change missing in c/s 23726:fd97ca086df6 - -The early "do we need to do anything" check needs adjustment, too. -Thanks to Haitao Shan for pointing this out. - -Signed-off-by: Jan Beulich - ---- a/xen/arch/x86/cpu/common.c -+++ b/xen/arch/x86/cpu/common.c -@@ -27,10 +27,15 @@ boolean_param("noserialnumber", disable_ - - static bool_t __cpuinitdata use_xsave = 1; - boolean_param("xsave", use_xsave); -+ - unsigned int __devinitdata opt_cpuid_mask_ecx = ~0u; - integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx); - unsigned int __devinitdata opt_cpuid_mask_edx = ~0u; - integer_param("cpuid_mask_edx", opt_cpuid_mask_edx); -+ -+unsigned int __devinitdata opt_cpuid_mask_xsave_eax = ~0u; -+integer_param("cpuid_mask_xsave_eax", opt_cpuid_mask_xsave_eax); -+ - unsigned int __devinitdata opt_cpuid_mask_ext_ecx = ~0u; - integer_param("cpuid_mask_ext_ecx", opt_cpuid_mask_ext_ecx); - unsigned int __devinitdata opt_cpuid_mask_ext_edx = ~0u; ---- a/xen/arch/x86/cpu/cpu.h -+++ b/xen/arch/x86/cpu/cpu.h -@@ -22,6 +22,7 @@ struct cpu_dev { - extern struct cpu_dev * cpu_devs [X86_VENDOR_NUM]; - - extern unsigned int opt_cpuid_mask_ecx, opt_cpuid_mask_edx; -+extern unsigned int opt_cpuid_mask_xsave_eax; - extern unsigned int opt_cpuid_mask_ext_ecx, opt_cpuid_mask_ext_edx; - - extern int get_model_name(struct cpuinfo_x86 *c); ---- a/xen/arch/x86/cpu/intel.c -+++ b/xen/arch/x86/cpu/intel.c -@@ -59,10 +59,12 @@ void set_cpuid_faulting(bool_t enable) - */ - static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c) - { -+ u32 eax, edx; - const char *extra = ""; - - if (!~(opt_cpuid_mask_ecx & opt_cpuid_mask_edx & -- opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx)) -+ opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx & -+ opt_cpuid_mask_xsave_eax)) - return; - - /* Only family 6 supports this feature */ -@@ -75,9 +77,12 @@ static void __devinit set_cpuidmask(cons - wrmsr(MSR_INTEL_CPUID_FEATURE_MASK, - opt_cpuid_mask_ecx, - opt_cpuid_mask_edx); -- if (!~(opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx)) -+ if (~(opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx)) -+ extra = "extended "; -+ else if (~opt_cpuid_mask_xsave_eax) -+ extra = "xsave "; -+ else - return; -- extra = "extended "; - break; - /* - * CPU supports this feature if the processor signature meets the following: -@@ -97,11 +102,25 @@ static void __devinit set_cpuidmask(cons - wrmsr(MSR_INTEL_CPUID80000001_FEATURE_MASK, - opt_cpuid_mask_ext_ecx, - opt_cpuid_mask_ext_edx); -+ if (!~opt_cpuid_mask_xsave_eax) -+ return; -+ extra = "xsave "; -+ break; -+ case 0x2a: -+ wrmsr(MSR_INTEL_CPUID1_FEATURE_MASK_V2, -+ opt_cpuid_mask_ecx, -+ opt_cpuid_mask_edx); -+ rdmsr(MSR_INTEL_CPUIDD_01_FEATURE_MASK, eax, edx); -+ wrmsr(MSR_INTEL_CPUIDD_01_FEATURE_MASK, -+ opt_cpuid_mask_xsave_eax, edx); -+ wrmsr(MSR_INTEL_CPUID80000001_FEATURE_MASK_V2, -+ opt_cpuid_mask_ext_ecx, -+ opt_cpuid_mask_ext_edx); - return; - } - -- printk(XENLOG_ERR "Cannot set CPU feature mask on CPU#%d\n", -- smp_processor_id()); -+ printk(XENLOG_ERR "Cannot set CPU %sfeature mask on CPU#%d\n", -+ extra, smp_processor_id()); - } - - void __devinit early_intel_workaround(struct cpuinfo_x86 *c) ---- a/xen/include/asm-x86/msr-index.h -+++ b/xen/include/asm-x86/msr-index.h -@@ -488,6 +488,10 @@ - #define MSR_INTEL_CPUID1_FEATURE_MASK 0x00000130 - #define MSR_INTEL_CPUID80000001_FEATURE_MASK 0x00000131 - -+#define MSR_INTEL_CPUID1_FEATURE_MASK_V2 0x00000132 -+#define MSR_INTEL_CPUID80000001_FEATURE_MASK_V2 0x00000133 -+#define MSR_INTEL_CPUIDD_01_FEATURE_MASK 0x00000134 -+ - /* Intel cpuid faulting MSRs */ - #define MSR_INTEL_PLATFORM_INFO 0x000000ce - #define MSR_INTEL_MISC_FEATURES_ENABLES 0x00000140 diff --git a/23735-guest-dom0-cap.patch b/23735-guest-dom0-cap.patch index cdb0b36..7cd0d13 100644 --- a/23735-guest-dom0-cap.patch +++ b/23735-guest-dom0-cap.patch @@ -42,10 +42,10 @@ tests... Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/tools/libxc/xc_dom_elfloader.c +Index: xen-4.1.3-testing/tools/libxc/xc_dom_elfloader.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_dom_elfloader.c -+++ xen-4.1.2-testing/tools/libxc/xc_dom_elfloader.c +--- xen-4.1.3-testing.orig/tools/libxc/xc_dom_elfloader.c ++++ xen-4.1.3-testing/tools/libxc/xc_dom_elfloader.c @@ -286,6 +286,13 @@ static int xc_dom_parse_elf_kernel(struc if ( (rc = elf_xen_parse(elf, &dom->parms)) != 0 ) return rc; @@ -60,11 +60,11 @@ Index: xen-4.1.2-testing/tools/libxc/xc_dom_elfloader.c /* find kernel segment */ dom->kernel_seg.vstart = dom->parms.virt_kstart; dom->kernel_seg.vend = dom->parms.virt_kend; -Index: xen-4.1.2-testing/xen/arch/ia64/xen/domain.c +Index: xen-4.1.3-testing/xen/arch/ia64/xen/domain.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/ia64/xen/domain.c -+++ xen-4.1.2-testing/xen/arch/ia64/xen/domain.c -@@ -2164,6 +2164,13 @@ int __init construct_dom0(struct domain +--- xen-4.1.3-testing.orig/xen/arch/ia64/xen/domain.c ++++ xen-4.1.3-testing/xen/arch/ia64/xen/domain.c +@@ -2165,6 +2165,13 @@ int __init construct_dom0(struct domain return -1; } @@ -78,10 +78,10 @@ Index: xen-4.1.2-testing/xen/arch/ia64/xen/domain.c p_start = parms.virt_base; pkern_start = parms.virt_kstart; pkern_end = parms.virt_kend; -Index: xen-4.1.2-testing/xen/arch/x86/domain_build.c +Index: xen-4.1.3-testing/xen/arch/x86/domain_build.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/domain_build.c -+++ xen-4.1.2-testing/xen/arch/x86/domain_build.c +--- xen-4.1.3-testing.orig/xen/arch/x86/domain_build.c ++++ xen-4.1.3-testing/xen/arch/x86/domain_build.c @@ -417,6 +417,13 @@ int __init construct_dom0( return -EINVAL; } @@ -96,11 +96,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/domain_build.c #if defined(__x86_64__) if ( compat32 ) { -Index: xen-4.1.2-testing/xen/common/kernel.c +Index: xen-4.1.3-testing/xen/common/kernel.c =================================================================== ---- xen-4.1.2-testing.orig/xen/common/kernel.c -+++ xen-4.1.2-testing/xen/common/kernel.c -@@ -287,6 +287,8 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL +--- xen-4.1.3-testing.orig/xen/common/kernel.c ++++ xen-4.1.3-testing/xen/common/kernel.c +@@ -289,6 +289,8 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL (1U << XENFEAT_auto_translated_physmap); if ( supervisor_mode_kernel ) fi.submap |= 1U << XENFEAT_supervisor_mode_kernel; @@ -109,10 +109,10 @@ Index: xen-4.1.2-testing/xen/common/kernel.c #ifdef CONFIG_X86 if ( !is_hvm_vcpu(current) ) fi.submap |= (1U << XENFEAT_mmu_pt_update_preserve_ad) | -Index: xen-4.1.2-testing/xen/common/libelf/libelf-dominfo.c +Index: xen-4.1.3-testing/xen/common/libelf/libelf-dominfo.c =================================================================== ---- xen-4.1.2-testing.orig/xen/common/libelf/libelf-dominfo.c -+++ xen-4.1.2-testing/xen/common/libelf/libelf-dominfo.c +--- xen-4.1.3-testing.orig/xen/common/libelf/libelf-dominfo.c ++++ xen-4.1.3-testing/xen/common/libelf/libelf-dominfo.c @@ -26,7 +26,8 @@ static const char *const elf_xen_feature [XENFEAT_writable_descriptor_tables] = "writable_descriptor_tables", [XENFEAT_auto_translated_physmap] = "auto_translated_physmap", @@ -161,10 +161,10 @@ Index: xen-4.1.2-testing/xen/common/libelf/libelf-dominfo.c } return 0; } -Index: xen-4.1.2-testing/xen/common/libelf/libelf-tools.c +Index: xen-4.1.3-testing/xen/common/libelf/libelf-tools.c =================================================================== ---- xen-4.1.2-testing.orig/xen/common/libelf/libelf-tools.c -+++ xen-4.1.2-testing/xen/common/libelf/libelf-tools.c +--- xen-4.1.3-testing.orig/xen/common/libelf/libelf-tools.c ++++ xen-4.1.3-testing/xen/common/libelf/libelf-tools.c @@ -227,6 +227,27 @@ uint64_t elf_note_numeric(struct elf_bin return 0; } @@ -193,10 +193,10 @@ Index: xen-4.1.2-testing/xen/common/libelf/libelf-tools.c const elf_note *elf_note_next(struct elf_binary *elf, const elf_note * note) { int namesz = (elf_uval(elf, note, namesz) + 3) & ~3; -Index: xen-4.1.2-testing/xen/include/public/elfnote.h +Index: xen-4.1.3-testing/xen/include/public/elfnote.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/elfnote.h -+++ xen-4.1.2-testing/xen/include/public/elfnote.h +--- xen-4.1.3-testing.orig/xen/include/public/elfnote.h ++++ xen-4.1.3-testing/xen/include/public/elfnote.h @@ -179,9 +179,22 @@ #define XEN_ELFNOTE_MOD_START_PFN 16 @@ -221,10 +221,10 @@ Index: xen-4.1.2-testing/xen/include/public/elfnote.h /* * System information exported through crash notes. -Index: xen-4.1.2-testing/xen/include/public/features.h +Index: xen-4.1.3-testing/xen/include/public/features.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/features.h -+++ xen-4.1.2-testing/xen/include/public/features.h +--- xen-4.1.3-testing.orig/xen/include/public/features.h ++++ xen-4.1.3-testing/xen/include/public/features.h @@ -75,7 +75,10 @@ #define XENFEAT_hvm_safe_pvclock 9 @@ -237,10 +237,10 @@ Index: xen-4.1.2-testing/xen/include/public/features.h #define XENFEAT_NR_SUBMAPS 1 -Index: xen-4.1.2-testing/xen/include/xen/libelf.h +Index: xen-4.1.3-testing/xen/include/xen/libelf.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/libelf.h -+++ xen-4.1.2-testing/xen/include/xen/libelf.h +--- xen-4.1.3-testing.orig/xen/include/xen/libelf.h ++++ xen-4.1.3-testing/xen/include/xen/libelf.h @@ -179,6 +179,8 @@ const elf_sym *elf_sym_by_index(struct e const char *elf_note_name(struct elf_binary *elf, const elf_note * note); const void *elf_note_desc(struct elf_binary *elf, const elf_note * note); diff --git a/23749-mmcfg-reservation.patch b/23749-mmcfg-reservation.patch index e5ad5c3..b690d96 100644 --- a/23749-mmcfg-reservation.patch +++ b/23749-mmcfg-reservation.patch @@ -25,8 +25,10 @@ x86-64/mmcfg: remove __initdata annotation overlooked in 23749:e8d1c8f074ba Signed-off-by: Jan Beulich ---- a/xen/arch/x86/physdev.c -+++ b/xen/arch/x86/physdev.c +Index: xen-4.1.3-testing/xen/arch/x86/physdev.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/physdev.c ++++ xen-4.1.3-testing/xen/arch/x86/physdev.c @@ -16,6 +16,10 @@ #include #include @@ -38,7 +40,7 @@ Signed-off-by: Jan Beulich #ifndef COMPAT typedef long ret_t; #endif -@@ -512,6 +516,24 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H +@@ -540,6 +544,24 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H break; } @@ -63,8 +65,10 @@ Signed-off-by: Jan Beulich case PHYSDEVOP_restore_msi: { struct physdev_restore_msi restore_msi; struct pci_dev *pdev; ---- a/xen/arch/x86/x86_64/mmconfig.h -+++ b/xen/arch/x86/x86_64/mmconfig.h +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/mmconfig.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/mmconfig.h ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/mmconfig.h @@ -84,6 +84,11 @@ extern int pci_mmcfg_config_num; extern struct acpi_mcfg_allocation *pci_mmcfg_config; @@ -78,8 +82,10 @@ Signed-off-by: Jan Beulich -void pci_mmcfg_arch_free(void); +int pci_mmcfg_arch_enable(unsigned int); +void pci_mmcfg_arch_disable(unsigned int); ---- a/xen/arch/x86/x86_64/mmconfig-shared.c -+++ b/xen/arch/x86/x86_64/mmconfig-shared.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/mmconfig-shared.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/mmconfig-shared.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/mmconfig-shared.c @@ -22,10 +22,10 @@ #include #include @@ -185,12 +191,12 @@ Signed-off-by: Jan Beulich - /* for late to exit */ - if (known_bridge) - return; -- -- if (pci_mmcfg_check_hostbridge()) -- known_bridge = 1; + if (pci_mmcfg_check_hostbridge()) { + unsigned int i; +- if (pci_mmcfg_check_hostbridge()) +- known_bridge = 1; +- - if (!known_bridge) { + pci_mmcfg_arch_init(); + for (i = 0; i < pci_mmcfg_config_num; ++i) @@ -247,8 +253,10 @@ Signed-off-by: Jan Beulich } /** ---- a/xen/arch/x86/x86_64/mmconfig_64.c -+++ b/xen/arch/x86/x86_64/mmconfig_64.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/mmconfig_64.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/mmconfig_64.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/mmconfig_64.c @@ -23,7 +23,7 @@ struct mmcfg_virt { char __iomem *virt; }; @@ -360,8 +368,10 @@ Signed-off-by: Jan Beulich - xfree(pci_mmcfg_virt); - pci_mmcfg_virt = NULL; -} ---- a/xen/arch/x86/x86_64/physdev.c -+++ b/xen/arch/x86/x86_64/physdev.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/physdev.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/physdev.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/physdev.c @@ -54,6 +54,10 @@ #define physdev_get_free_pirq compat_physdev_get_free_pirq #define physdev_get_free_pirq_t physdev_get_free_pirq_compat_t @@ -373,9 +383,11 @@ Signed-off-by: Jan Beulich #define COMPAT #undef guest_handle_okay #define guest_handle_okay compat_handle_okay ---- a/xen/include/public/physdev.h -+++ b/xen/include/public/physdev.h -@@ -255,6 +255,19 @@ struct physdev_get_free_pirq { +Index: xen-4.1.3-testing/xen/include/public/physdev.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/public/physdev.h ++++ xen-4.1.3-testing/xen/include/public/physdev.h +@@ -263,6 +263,19 @@ struct physdev_get_free_pirq { typedef struct physdev_get_free_pirq physdev_get_free_pirq_t; DEFINE_XEN_GUEST_HANDLE(physdev_get_free_pirq_t); @@ -395,8 +407,10 @@ Signed-off-by: Jan Beulich /* * Notify that some PIRQ-bound event channels have been unmasked. * ** This command is obsolete since interface version 0x00030202 and is ** ---- a/xen/include/xlat.lst -+++ b/xen/include/xlat.lst +Index: xen-4.1.3-testing/xen/include/xlat.lst +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/xlat.lst ++++ xen-4.1.3-testing/xen/include/xlat.lst @@ -60,6 +60,7 @@ ! memory_map memory.h ! memory_reservation memory.h diff --git a/23752-x86-shared-IRQ-vector-maps.patch b/23752-x86-shared-IRQ-vector-maps.patch deleted file mode 100644 index 5841eee..0000000 --- a/23752-x86-shared-IRQ-vector-maps.patch +++ /dev/null @@ -1,147 +0,0 @@ -References: bnc#713503 - -# HG changeset patch -# User George Dunlap -# Date 1311701818 -3600 -# Node ID ef9ed3d2aa870a37ed5e611be9c524d526a2d604 -# Parent 590aadf7c46ae979da3552332f592f9492ce6d8b -xen: Infrastructure to allow irqs to share vector maps - -Laying the groundwork for per-device vector maps. This generic -code allows any irq to point to a vector map; all irqs sharing the -same vector map will avoid sharing vectors. - -Signed-off-by: George Dunlap - -# HG changeset patch -# User George Dunlap -# Date 1314026133 -3600 -# Node ID 3a05da2dc7c0a5fc0fcfc40c535d1fcb71203625 -# Parent d1cd78a73a79e0e648937322cdb8d92a7f86327a -x86: Fix up irq vector map logic - -We need to make sure that cfg->used_vector is only cleared once; -otherwise there may be a race condition that allows the same vector to -be assigned twice, defeating the whole purpose of the map. - -This makes two changes: -* __clear_irq_vector() only clears the vector if the irq is not being -moved -* smp_iqr_move_cleanup_interrupt() only clears used_vector if this -is the last place it's being used (move_cleanup_count==0 after -decrement). - -Also make use of asserts more consistent, to catch this kind of logic -bug in the future. - -Signed-off-by: George Dunlap - ---- a/xen/arch/x86/io_apic.c -+++ b/xen/arch/x86/io_apic.c -@@ -548,6 +548,13 @@ fastcall void smp_irq_move_cleanup_inter - } - __get_cpu_var(vector_irq)[vector] = -1; - cfg->move_cleanup_count--; -+ -+ if ( cfg->move_cleanup_count == 0 -+ && cfg->used_vectors ) -+ { -+ ASSERT(test_bit(vector, cfg->used_vectors)); -+ clear_bit(vector, cfg->used_vectors); -+ } - unlock: - spin_unlock(&desc->lock); - } ---- a/xen/arch/x86/irq.c -+++ b/xen/arch/x86/irq.c -@@ -94,6 +94,11 @@ static int __init __bind_irq_vector(int - per_cpu(vector_irq, cpu)[vector] = irq; - cfg->vector = vector; - cfg->cpu_mask = online_mask; -+ if ( cfg->used_vectors ) -+ { -+ ASSERT(!test_bit(vector, cfg->used_vectors)); -+ set_bit(vector, cfg->used_vectors); -+ } - irq_status[irq] = IRQ_USED; - if (IO_APIC_IRQ(irq)) - irq_vector[irq] = vector; -@@ -159,6 +164,7 @@ static void dynamic_irq_cleanup(unsigned - desc->depth = 1; - desc->msi_desc = NULL; - desc->handler = &no_irq_type; -+ desc->chip_data->used_vectors=NULL; - cpus_setall(desc->affinity); - spin_unlock_irqrestore(&desc->lock, flags); - -@@ -191,6 +197,7 @@ static void __clear_irq_vector(int irq) - - if (likely(!cfg->move_in_progress)) - return; -+ - cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map); - for_each_cpu_mask(cpu, tmp_mask) { - for (vector = FIRST_DYNAMIC_VECTOR; vector <= LAST_DYNAMIC_VECTOR; -@@ -202,6 +209,12 @@ static void __clear_irq_vector(int irq) - } - } - -+ if ( cfg->used_vectors ) -+ { -+ ASSERT(test_bit(vector, cfg->used_vectors)); -+ clear_bit(vector, cfg->used_vectors); -+ } -+ - cfg->move_in_progress = 0; - } - -@@ -261,6 +274,7 @@ static void init_one_irq_cfg(struct irq_ - cfg->vector = IRQ_VECTOR_UNASSIGNED; - cpus_clear(cfg->cpu_mask); - cpus_clear(cfg->old_cpu_mask); -+ cfg->used_vectors = NULL; - } - - int init_irq_data(void) -@@ -387,6 +401,10 @@ next: - if (test_bit(vector, used_vectors)) - goto next; - -+ if (cfg->used_vectors -+ && test_bit(vector, cfg->used_vectors) ) -+ goto next; -+ - for_each_cpu_mask(new_cpu, tmp_mask) - if (per_cpu(vector_irq, new_cpu)[vector] != -1) - goto next; -@@ -402,6 +420,11 @@ next: - per_cpu(vector_irq, new_cpu)[vector] = irq; - cfg->vector = vector; - cpus_copy(cfg->cpu_mask, tmp_mask); -+ if ( cfg->used_vectors ) -+ { -+ ASSERT(!test_bit(vector, cfg->used_vectors)); -+ set_bit(vector, cfg->used_vectors); -+ } - - irq_status[irq] = IRQ_USED; - if (IO_APIC_IRQ(irq)) ---- a/xen/include/asm-x86/irq.h -+++ b/xen/include/asm-x86/irq.h -@@ -23,11 +23,16 @@ - #define irq_to_desc(irq) (&irq_desc[irq]) - #define irq_cfg(irq) (&irq_cfg[irq]) - -+typedef struct { -+ DECLARE_BITMAP(_bits,NR_VECTORS); -+} vmask_t; -+ - struct irq_cfg { - int vector; - cpumask_t cpu_mask; - cpumask_t old_cpu_mask; - unsigned move_cleanup_count; -+ vmask_t *used_vectors; - u8 move_in_progress : 1; - }; - diff --git a/23754-AMD-perdev-vector-map.patch b/23754-AMD-perdev-vector-map.patch deleted file mode 100644 index 67c0a9e..0000000 --- a/23754-AMD-perdev-vector-map.patch +++ /dev/null @@ -1,361 +0,0 @@ -References: bnc#713503 - -# HG changeset patch -# User George Dunlap -# Date 1311701836 -3600 -# Node ID 2e0cf9428554da666616982cd0074024ff85b221 -# Parent ef9ed3d2aa870a37ed5e611be9c524d526a2d604 -xen: Option to allow per-device vector maps for MSI IRQs - -Add a vector-map to pci_dev, and add an option to point MSI-related -IRQs to the vector-map of the device. - -This prevents irqs from the same device from being assigned -the same vector on different pcpus. This is required for systems -using an AMD IOMMU, since the intremap tables on AMD only look at -vector, and not destination ID. - -Signed-off-by: George Dunlap - -# HG changeset patch -# User George Dunlap -# Date 1311701852 -3600 -# Node ID fa4e2ca9ecffbc432b451f495ad0a403644a6be8 -# Parent 2e0cf9428554da666616982cd0074024ff85b221 -xen: AMD IOMMU: Automatically enable per-device vector maps - -Automatically enable per-device vector maps when using IOMMU, -unless disabled specifically by an IOMMU parameter. - -Signed-off-by: George Dunlap - -# HG changeset patch -# User George Dunlap -# Date 1315231215 -3600 -# Node ID 32814ad7458dc842a7c588eee13e5c4ee11709a3 -# Parent f1349a968a5ac5577d67ad4a3f3490c580dbe264 -xen: Add global irq_vector_map option, set if using AMD global intremap tables - -As mentioned in previous changesets, AMD IOMMU interrupt -remapping tables only look at the vector, not the destination -id of an interrupt. This means that all IRQs going through -the same interrupt remapping table need to *not* share vectors. - -The irq "vector map" functionality was originally introduced -after a patch which disabled global AMD IOMMUs entirely. That -patch has since been reverted, meaning that AMD intremap tables -can either be per-device or global. - -This patch therefore introduces a global irq vector map option, -and enables it if we're using an AMD IOMMU with a global -interrupt remapping table. - -This patch removes the "irq-perdev-vector-map" boolean -command-line optino and replaces it with "irq_vector_map", -which can have one of three values: none, global, or per-device. - -Setting the irq_vector_map to any value will override the -default that the AMD code sets. - -Signed-off-by: George Dunlap - -# HG changeset patch -# User Jan Beulich -# Date 1317730316 -7200 -# Node ID a99d75671a911f9c0d5d11e0fe88a0a65863cb44 -# Parent 3d1664cc9e458809e399320204aca8536e401ee1 -AMD-IOMMU: remove dead variable references - -These got orphaned up by recent changes. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/docs/src/user.tex -+++ b/docs/src/user.tex -@@ -4197,6 +4197,10 @@ writing to the VGA console after domain - \item [ vcpu\_migration\_delay=$<$minimum\_time$>$] Set minimum time of - vcpu migration in microseconds (default 0). This parameter avoids agressive - vcpu migration. For example, the linux kernel uses 0.5ms by default. -+\item [ irq_vector_map=xxx ] Enable irq vector non-sharing maps. Setting 'global' -+ will ensure that no IRQs will share vectors. Setting 'per-device' will ensure -+ that no IRQs from the same device will share vectors. Setting to 'none' will -+ disable it entirely, overriding any defaults the IOMMU code may set. - \end{description} - - In addition, the following options may be specified on the Xen command ---- a/xen/arch/x86/irq.c -+++ b/xen/arch/x86/irq.c -@@ -24,6 +24,8 @@ - #include - #include - -+static void parse_irq_vector_map_param(char *s); -+ - /* opt_noirqbalance: If true, software IRQ balancing/affinity is disabled. */ - bool_t __read_mostly opt_noirqbalance = 0; - boolean_param("noirqbalance", opt_noirqbalance); -@@ -32,6 +34,12 @@ unsigned int __read_mostly nr_irqs_gsi = - unsigned int __read_mostly nr_irqs; - integer_param("nr_irqs", nr_irqs); - -+/* This default may be changed by the AMD IOMMU code */ -+int __read_mostly opt_irq_vector_map = OPT_IRQ_VECTOR_MAP_DEFAULT; -+custom_param("irq_vector_map", parse_irq_vector_map_param); -+ -+vmask_t global_used_vector_map; -+ - u8 __read_mostly *irq_vector; - struct irq_desc __read_mostly *irq_desc = NULL; - -@@ -60,6 +68,26 @@ static struct timer irq_ratelimit_timer; - static unsigned int __read_mostly irq_ratelimit_threshold = 10000; - integer_param("irq_ratelimit", irq_ratelimit_threshold); - -+static void __init parse_irq_vector_map_param(char *s) -+{ -+ char *ss; -+ -+ do { -+ ss = strchr(s, ','); -+ if ( ss ) -+ *ss = '\0'; -+ -+ if ( !strcmp(s, "none")) -+ opt_irq_vector_map=OPT_IRQ_VECTOR_MAP_NONE; -+ else if ( !strcmp(s, "global")) -+ opt_irq_vector_map=OPT_IRQ_VECTOR_MAP_GLOBAL; -+ else if ( !strcmp(s, "per-device")) -+ opt_irq_vector_map=OPT_IRQ_VECTOR_MAP_PERDEV; -+ -+ s = ss + 1; -+ } while ( ss ); -+} -+ - /* Must be called when irq disabled */ - void lock_vector_lock(void) - { -@@ -344,6 +372,41 @@ hw_irq_controller no_irq_type = { - end_none - }; - -+static vmask_t *irq_get_used_vector_mask(int irq) -+{ -+ vmask_t *ret = NULL; -+ -+ if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_GLOBAL ) -+ { -+ struct irq_desc *desc = irq_to_desc(irq); -+ -+ ret = &global_used_vector_map; -+ -+ if ( desc->chip_data->used_vectors ) -+ { -+ printk(XENLOG_INFO "%s: Strange, unassigned irq %d already has used_vectors!\n", -+ __func__, irq); -+ } -+ else -+ { -+ int vector; -+ -+ vector = irq_to_vector(irq); -+ if ( vector > 0 ) -+ { -+ printk(XENLOG_INFO "%s: Strange, irq %d already assigned vector %d!\n", -+ __func__, irq, vector); -+ -+ ASSERT(!test_bit(vector, ret)); -+ -+ set_bit(vector, ret); -+ } -+ } -+ } -+ -+ return ret; -+} -+ - int __assign_irq_vector(int irq, struct irq_cfg *cfg, const cpumask_t *mask) - { - /* -@@ -362,6 +425,7 @@ int __assign_irq_vector(int irq, struct - int cpu, err; - unsigned long flags; - cpumask_t tmp_mask; -+ vmask_t *irq_used_vectors = NULL; - - old_vector = irq_to_vector(irq); - if (old_vector) { -@@ -376,6 +440,17 @@ int __assign_irq_vector(int irq, struct - return -EAGAIN; - - err = -ENOSPC; -+ -+ /* This is the only place normal IRQs are ever marked -+ * as "in use". If they're not in use yet, check to see -+ * if we need to assign a global vector mask. */ -+ if ( irq_status[irq] == IRQ_USED ) -+ { -+ irq_used_vectors = cfg->used_vectors; -+ } -+ else -+ irq_used_vectors = irq_get_used_vector_mask(irq); -+ - for_each_cpu_mask(cpu, *mask) { - int new_cpu; - int vector, offset; -@@ -401,8 +476,8 @@ next: - if (test_bit(vector, used_vectors)) - goto next; - -- if (cfg->used_vectors -- && test_bit(vector, cfg->used_vectors) ) -+ if (irq_used_vectors -+ && test_bit(vector, irq_used_vectors) ) - goto next; - - for_each_cpu_mask(new_cpu, tmp_mask) -@@ -420,15 +495,22 @@ next: - per_cpu(vector_irq, new_cpu)[vector] = irq; - cfg->vector = vector; - cpus_copy(cfg->cpu_mask, tmp_mask); -+ -+ irq_status[irq] = IRQ_USED; -+ ASSERT((cfg->used_vectors == NULL) -+ || (cfg->used_vectors == irq_used_vectors)); -+ cfg->used_vectors = irq_used_vectors; -+ -+ if (IO_APIC_IRQ(irq)) -+ irq_vector[irq] = vector; -+ - if ( cfg->used_vectors ) - { - ASSERT(!test_bit(vector, cfg->used_vectors)); -+ - set_bit(vector, cfg->used_vectors); - } - -- irq_status[irq] = IRQ_USED; -- if (IO_APIC_IRQ(irq)) -- irq_vector[irq] = vector; - err = 0; - local_irq_restore(flags); - break; -@@ -1523,7 +1605,7 @@ int map_domain_pirq( - - if ( !IS_PRIV(current->domain) && - !(IS_PRIV_FOR(current->domain, d) && -- irq_access_permitted(current->domain, pirq))) -+ irq_access_permitted(current->domain, pirq))) - return -EPERM; - - if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs ) -@@ -1571,8 +1653,22 @@ int map_domain_pirq( - - if ( desc->handler != &no_irq_type ) - dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n", -- d->domain_id, irq); -+ d->domain_id, irq); - desc->handler = &pci_msi_type; -+ -+ if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV -+ && !desc->chip_data->used_vectors ) -+ { -+ desc->chip_data->used_vectors = &pdev->info.used_vectors; -+ if ( desc->chip_data->vector != IRQ_VECTOR_UNASSIGNED ) -+ { -+ int vector = desc->chip_data->vector; -+ ASSERT(!test_bit(vector, desc->chip_data->used_vectors)); -+ -+ set_bit(vector, desc->chip_data->used_vectors); -+ } -+ } -+ - d->arch.pirq_irq[pirq] = irq; - d->arch.irq_pirq[irq] = pirq; - setup_msi_irq(pdev, msi_desc, irq); -@@ -1583,9 +1679,12 @@ int map_domain_pirq( - d->arch.pirq_irq[pirq] = irq; - d->arch.irq_pirq[irq] = pirq; - spin_unlock_irqrestore(&desc->lock, flags); -+ -+ if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV ) -+ printk(XENLOG_INFO "Per-device vector maps for GSIs not implemented yet.\n"); - } - -- done: -+done: - return ret; - } - ---- a/xen/drivers/passthrough/amd/pci_amd_iommu.c -+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c -@@ -166,6 +166,35 @@ int __init amd_iov_detect(void) - return -ENODEV; - } - -+ /* -+ * AMD IOMMUs don't distinguish between vectors destined for -+ * different cpus when doing interrupt remapping. This means -+ * that interrupts going through the same intremap table -+ * can't share the same vector. -+ * -+ * If irq_vector_map isn't specified, choose a sensible default: -+ * - If we're using per-device interemap tables, per-device -+ * vector non-sharing maps -+ * - If we're using a global interemap table, global vector -+ * non-sharing map -+ */ -+ if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_DEFAULT ) -+ { -+ if ( amd_iommu_perdev_intremap ) -+ { -+ printk("AMD-Vi: Enabling per-device vector maps\n"); -+ opt_irq_vector_map = OPT_IRQ_VECTOR_MAP_PERDEV; -+ } -+ else -+ { -+ printk("AMD-Vi: Enabling global vector map\n"); -+ opt_irq_vector_map = OPT_IRQ_VECTOR_MAP_GLOBAL; -+ } -+ } -+ else -+ { -+ printk("AMD-Vi: Not overriding irq_vector_map setting\n"); -+ } - return scan_pci_devices(); - } - ---- a/xen/include/asm-x86/irq.h -+++ b/xen/include/asm-x86/irq.h -@@ -45,6 +45,13 @@ extern u8 *irq_vector; - - extern bool_t opt_noirqbalance; - -+#define OPT_IRQ_VECTOR_MAP_DEFAULT 0 /* Do the default thing */ -+#define OPT_IRQ_VECTOR_MAP_NONE 1 /* None */ -+#define OPT_IRQ_VECTOR_MAP_GLOBAL 2 /* One global vector map (no vector sharing) */ -+#define OPT_IRQ_VECTOR_MAP_PERDEV 3 /* Per-device vetor map (no vector sharing w/in a device) */ -+ -+extern int opt_irq_vector_map; -+ - /* - * Per-cpu current frame pointer - the location of the last exception frame on - * the stack ---- a/xen/include/xen/pci.h -+++ b/xen/include/xen/pci.h -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - - /* - * The PCI interface treats multi-function devices as independent -@@ -38,6 +39,7 @@ struct pci_dev_info { - u8 bus; - u8 devfn; - } physfn; -+ vmask_t used_vectors; - }; - - struct pci_dev { diff --git a/23771-x86-ioapic-clear-pin.patch b/23771-x86-ioapic-clear-pin.patch index 8086796..cfd9d94 100644 --- a/23771-x86-ioapic-clear-pin.patch +++ b/23771-x86-ioapic-clear-pin.patch @@ -19,11 +19,11 @@ in the "raw" pass, though I haven't observed this case in practice). Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/x86/io_apic.c +Index: xen-4.1.3-testing/xen/arch/x86/io_apic.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/io_apic.c -+++ xen-4.1.2-testing/xen/arch/x86/io_apic.c -@@ -471,14 +471,12 @@ static void eoi_IO_APIC_irq(unsigned int +--- xen-4.1.3-testing.orig/xen/arch/x86/io_apic.c ++++ xen-4.1.3-testing/xen/arch/x86/io_apic.c +@@ -458,14 +458,12 @@ static void eoi_IO_APIC_irq(unsigned int spin_unlock_irqrestore(&ioapic_lock, flags); } @@ -40,7 +40,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/io_apic.c if (entry.delivery_mode == dest_SMI) return; -@@ -487,7 +485,7 @@ static void __clear_IO_APIC_pin(unsigned +@@ -474,7 +472,7 @@ static void __clear_IO_APIC_pin(unsigned */ memset(&entry, 0, sizeof(entry)); entry.mask = 1; @@ -49,7 +49,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/io_apic.c } static void clear_IO_APIC (void) -@@ -495,10 +493,8 @@ static void clear_IO_APIC (void) +@@ -482,10 +480,8 @@ static void clear_IO_APIC (void) int apic, pin; for (apic = 0; apic < nr_ioapics; apic++) { diff --git a/23772-x86-trampoline.patch b/23772-x86-trampoline.patch index 6b3bc00..25f86b9 100644 --- a/23772-x86-trampoline.patch +++ b/23772-x86-trampoline.patch @@ -17,10 +17,10 @@ code. Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/x86/boot/Makefile +Index: xen-4.1.3-testing/xen/arch/x86/boot/Makefile =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/boot/Makefile -+++ xen-4.1.2-testing/xen/arch/x86/boot/Makefile +--- xen-4.1.3-testing.orig/xen/arch/x86/boot/Makefile ++++ xen-4.1.3-testing/xen/arch/x86/boot/Makefile @@ -2,8 +2,8 @@ obj-y += head.o head.o: reloc.S @@ -32,10 +32,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/boot/Makefile -reloc.S: $(BASEDIR)/include/asm-x86/config.h +reloc.S: head.S -Index: xen-4.1.2-testing/xen/arch/x86/boot/head.S +Index: xen-4.1.3-testing/xen/arch/x86/boot/head.S =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/boot/head.S -+++ xen-4.1.2-testing/xen/arch/x86/boot/head.S +--- xen-4.1.3-testing.orig/xen/arch/x86/boot/head.S ++++ xen-4.1.3-testing/xen/arch/x86/boot/head.S @@ -9,7 +9,7 @@ .text .code32 @@ -63,10 +63,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/boot/head.S /* Copy bootstrap trampoline to low memory, below 1MB. */ mov $sym_phys(trampoline_start),%esi mov $bootsym_phys(trampoline_start),%edi -Index: xen-4.1.2-testing/xen/arch/x86/boot/trampoline.S +Index: xen-4.1.3-testing/xen/arch/x86/boot/trampoline.S =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/boot/trampoline.S -+++ xen-4.1.2-testing/xen/arch/x86/boot/trampoline.S +--- xen-4.1.3-testing.orig/xen/arch/x86/boot/trampoline.S ++++ xen-4.1.3-testing/xen/arch/x86/boot/trampoline.S @@ -4,6 +4,13 @@ #undef bootsym #define bootsym(s) ((s)-trampoline_start) @@ -139,10 +139,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/boot/trampoline.S .code64 start64: -Index: xen-4.1.2-testing/xen/arch/x86/boot/wakeup.S +Index: xen-4.1.3-testing/xen/arch/x86/boot/wakeup.S =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/boot/wakeup.S -+++ xen-4.1.2-testing/xen/arch/x86/boot/wakeup.S +--- xen-4.1.3-testing.orig/xen/arch/x86/boot/wakeup.S ++++ xen-4.1.3-testing/xen/arch/x86/boot/wakeup.S @@ -42,15 +42,13 @@ ENTRY(wakeup_start) # boot trampoline is under 1M, and shift its start into @@ -210,10 +210,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/boot/wakeup.S .code64 wakeup_64: -Index: xen-4.1.2-testing/xen/arch/x86/efi/boot.c +Index: xen-4.1.3-testing/xen/arch/x86/efi/boot.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/efi/boot.c -+++ xen-4.1.2-testing/xen/arch/x86/efi/boot.c +--- xen-4.1.3-testing.orig/xen/arch/x86/efi/boot.c ++++ xen-4.1.3-testing/xen/arch/x86/efi/boot.c @@ -599,6 +599,9 @@ static void __init relocate_image(unsign } } @@ -291,11 +291,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/efi/boot.c /* Set system registers and transfer control. */ asm volatile("pushq $0\n\tpopfq"); -Index: xen-4.1.2-testing/xen/arch/x86/smpboot.c +Index: xen-4.1.3-testing/xen/arch/x86/smpboot.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/smpboot.c -+++ xen-4.1.2-testing/xen/arch/x86/smpboot.c -@@ -48,6 +48,8 @@ +--- xen-4.1.3-testing.orig/xen/arch/x86/smpboot.c ++++ xen-4.1.3-testing/xen/arch/x86/smpboot.c +@@ -49,6 +49,8 @@ #define setup_trampoline() (bootsym_phys(trampoline_realmode_entry)) @@ -304,10 +304,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/smpboot.c /* Set if we find a B stepping CPU */ static int smp_b_stepping; -Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_32/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_32/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_32/mm.c @@ -22,6 +22,7 @@ #include #include @@ -328,10 +328,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c } void __init subarch_init_memory(void) -Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_64/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_64/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_64/mm.c @@ -830,7 +830,7 @@ void __init zap_low_mappings(void) flush_local(FLUSH_TLB_GLOBAL); @@ -341,10 +341,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c PFN_UP(trampoline_end - trampoline_start), __PAGE_HYPERVISOR); } -Index: xen-4.1.2-testing/xen/arch/x86/xen.lds.S +Index: xen-4.1.3-testing/xen/arch/x86/xen.lds.S =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/xen.lds.S -+++ xen-4.1.2-testing/xen/arch/x86/xen.lds.S +--- xen-4.1.3-testing.orig/xen/arch/x86/xen.lds.S ++++ xen-4.1.3-testing/xen/arch/x86/xen.lds.S @@ -103,6 +103,13 @@ SECTIONS *(.init.data) *(.init.data.rel) @@ -359,10 +359,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/xen.lds.S } :text . = ALIGN(32); .init.setup : { -Index: xen-4.1.2-testing/xen/include/asm-x86/config.h +Index: xen-4.1.3-testing/xen/include/asm-x86/config.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/config.h -+++ xen-4.1.2-testing/xen/include/asm-x86/config.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/config.h ++++ xen-4.1.3-testing/xen/include/asm-x86/config.h @@ -95,13 +95,13 @@ /* Primary stack is restricted to 8kB by guard pages. */ #define PRIMARY_STACK_SIZE 8192 diff --git a/23781-pm-wide-ACPI-ids.patch b/23781-pm-wide-ACPI-ids.patch deleted file mode 100644 index c04fb94..0000000 --- a/23781-pm-wide-ACPI-ids.patch +++ /dev/null @@ -1,74 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1314004239 -3600 -# Node ID 0849b0e59e2418e8215616df147f955b01b07577 -# Parent 07f78b5bd03c02e32324eaa00487643d27b7ffa8 -pm: don't truncate processors' ACPI IDs to 8 bits - -This is just another adjustment to allow systems with very many CPUs -(or unusual ACPI IDs) to be properly power-managed. - -Signed-off-by: Jan Beulich - -Index: xen-4.1.2-testing/xen/arch/ia64/linux-xen/acpi.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/ia64/linux-xen/acpi.c -+++ xen-4.1.2-testing/xen/arch/ia64/linux-xen/acpi.c -@@ -223,11 +223,14 @@ static u16 ia64_acpiid_to_sapicid[ MAX_L - {[0 ... MAX_LOCAL_SAPIC - 1] = 0xffff }; - - /* acpi id to cpu id */ --int get_cpu_id(u8 acpi_id) -+int get_cpu_id(u32 acpi_id) - { - int i; - u16 apic_id; - -+ if ( acpi_id >= MAX_LOCAL_SAPIC ) -+ return -EINVAL; -+ - apic_id = ia64_acpiid_to_sapicid[acpi_id]; - if ( apic_id == 0xffff ) - return -EINVAL; -Index: xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/acpi/cpu_idle.c -+++ xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c -@@ -901,11 +901,14 @@ static void set_cx( - acpi_power->safe_state = cx; - } - --int get_cpu_id(u8 acpi_id) -+int get_cpu_id(u32 acpi_id) - { - int i; - u32 apic_id; - -+ if ( acpi_id >= MAX_MADT_ENTRIES ) -+ return -1; -+ - apic_id = x86_acpiid_to_apicid[acpi_id]; - if ( apic_id == BAD_APICID ) - return -1; -@@ -982,7 +985,7 @@ long set_cx_pminfo(uint32_t cpu, struct - print_cx_pminfo(cpu, power); - - /* map from acpi_id to cpu_id */ -- cpu_id = get_cpu_id((u8)cpu); -+ cpu_id = get_cpu_id(cpu); - if ( cpu_id == -1 ) - { - printk(XENLOG_ERR "no cpu_id for acpi_id %d\n", cpu); -Index: xen-4.1.2-testing/xen/include/acpi/cpufreq/processor_perf.h -=================================================================== ---- xen-4.1.2-testing.orig/xen/include/acpi/cpufreq/processor_perf.h -+++ xen-4.1.2-testing/xen/include/acpi/cpufreq/processor_perf.h -@@ -6,7 +6,7 @@ - - #define XEN_PX_INIT 0x80000000 - --int get_cpu_id(u8); -+int get_cpu_id(u32); - int powernow_cpufreq_init(void); - unsigned int powernow_register_driver(void); - unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); diff --git a/23782-x86-ioapic-clear-irr.patch b/23782-x86-ioapic-clear-irr.patch index f2c6f1f..1f1047e 100644 --- a/23782-x86-ioapic-clear-irr.patch +++ b/23782-x86-ioapic-clear-irr.patch @@ -20,9 +20,11 @@ Based on a Linux patch from suresh.b.siddha@intel.com. Signed-off-by: Jan Beulich ---- a/xen/arch/x86/io_apic.c -+++ b/xen/arch/x86/io_apic.c -@@ -481,11 +481,35 @@ static void clear_IO_APIC_pin(unsigned i +Index: xen-4.1.3-testing/xen/arch/x86/io_apic.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/io_apic.c ++++ xen-4.1.3-testing/xen/arch/x86/io_apic.c +@@ -468,11 +468,35 @@ static void clear_IO_APIC_pin(unsigned i return; /* diff --git a/23783-ACPI-set-_PDC-bits.patch b/23783-ACPI-set-_PDC-bits.patch index a4c5f1c..81b24c4 100644 --- a/23783-ACPI-set-_PDC-bits.patch +++ b/23783-ACPI-set-_PDC-bits.patch @@ -17,10 +17,10 @@ extension (which the Dom0 kernel should have no need to know about). Signed-off-by: Jan Beulich -Index: xen-4.1.2-testing/xen/arch/ia64/linux-xen/acpi.c +Index: xen-4.1.3-testing/xen/arch/ia64/linux-xen/acpi.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/ia64/linux-xen/acpi.c -+++ xen-4.1.2-testing/xen/arch/ia64/linux-xen/acpi.c +--- xen-4.1.3-testing.orig/xen/arch/ia64/linux-xen/acpi.c ++++ xen-4.1.3-testing/xen/arch/ia64/linux-xen/acpi.c @@ -243,6 +243,13 @@ int get_cpu_id(u32 acpi_id) return -1; @@ -35,11 +35,11 @@ Index: xen-4.1.2-testing/xen/arch/ia64/linux-xen/acpi.c #endif static int __init -Index: xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c +Index: xen-4.1.3-testing/xen/arch/x86/acpi/cpu_idle.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/acpi/cpu_idle.c -+++ xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c -@@ -649,12 +649,6 @@ static int cpuidle_init_cpu(int cpu) +--- xen-4.1.3-testing.orig/xen/arch/x86/acpi/cpu_idle.c ++++ xen-4.1.3-testing/xen/arch/x86/acpi/cpu_idle.c +@@ -644,12 +644,6 @@ static int cpuidle_init_cpu(int cpu) return 0; } @@ -52,10 +52,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c #define MWAIT_SUBSTATE_MASK (0xf) #define MWAIT_SUBSTATE_SIZE (4) -Index: xen-4.1.2-testing/xen/arch/x86/acpi/boot.c +Index: xen-4.1.3-testing/xen/arch/x86/acpi/boot.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/acpi/boot.c -+++ xen-4.1.2-testing/xen/arch/x86/acpi/boot.c +--- xen-4.1.3-testing.orig/xen/arch/x86/acpi/boot.c ++++ xen-4.1.3-testing/xen/arch/x86/acpi/boot.c @@ -1006,3 +1006,47 @@ unsigned int acpi_get_processor_id(unsig return INVALID_ACPIID; @@ -104,10 +104,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/acpi/boot.c + + return 0; +} -Index: xen-4.1.2-testing/xen/arch/x86/platform_hypercall.c +Index: xen-4.1.3-testing/xen/arch/x86/platform_hypercall.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/platform_hypercall.c -+++ xen-4.1.2-testing/xen/arch/x86/platform_hypercall.c +--- xen-4.1.3-testing.orig/xen/arch/x86/platform_hypercall.c ++++ xen-4.1.3-testing/xen/arch/x86/platform_hypercall.c @@ -419,6 +419,15 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe ret = -EINVAL; break; @@ -124,11 +124,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/platform_hypercall.c default: ret = -EINVAL; break; -Index: xen-4.1.2-testing/xen/drivers/acpi/pmstat.c +Index: xen-4.1.3-testing/xen/drivers/acpi/pmstat.c =================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/acpi/pmstat.c -+++ xen-4.1.2-testing/xen/drivers/acpi/pmstat.c -@@ -519,3 +519,34 @@ int do_pm_op(struct xen_sysctl_pm_op *op +--- xen-4.1.3-testing.orig/xen/drivers/acpi/pmstat.c ++++ xen-4.1.3-testing/xen/drivers/acpi/pmstat.c +@@ -521,3 +521,34 @@ int do_pm_op(struct xen_sysctl_pm_op *op return ret; } @@ -163,10 +163,10 @@ Index: xen-4.1.2-testing/xen/drivers/acpi/pmstat.c + + return ret; +} -Index: xen-4.1.2-testing/xen/include/acpi/cpufreq/processor_perf.h +Index: xen-4.1.3-testing/xen/include/acpi/cpufreq/processor_perf.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/acpi/cpufreq/processor_perf.h -+++ xen-4.1.2-testing/xen/include/acpi/cpufreq/processor_perf.h +--- xen-4.1.3-testing.orig/xen/include/acpi/cpufreq/processor_perf.h ++++ xen-4.1.3-testing/xen/include/acpi/cpufreq/processor_perf.h @@ -3,10 +3,10 @@ #include @@ -179,10 +179,10 @@ Index: xen-4.1.2-testing/xen/include/acpi/cpufreq/processor_perf.h int powernow_cpufreq_init(void); unsigned int powernow_register_driver(void); unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); -Index: xen-4.1.2-testing/xen/include/acpi/pdc_intel.h +Index: xen-4.1.3-testing/xen/include/acpi/pdc_intel.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/acpi/pdc_intel.h -+++ xen-4.1.2-testing/xen/include/acpi/pdc_intel.h +--- xen-4.1.3-testing.orig/xen/include/acpi/pdc_intel.h ++++ xen-4.1.3-testing/xen/include/acpi/pdc_intel.h @@ -4,6 +4,8 @@ #ifndef __PDC_INTEL_H__ #define __PDC_INTEL_H__ @@ -226,10 +226,10 @@ Index: xen-4.1.2-testing/xen/include/acpi/pdc_intel.h + ACPI_PDC_SMP_T_SWCOORD) + #endif /* __PDC_INTEL_H__ */ -Index: xen-4.1.2-testing/xen/include/asm-x86/cpufeature.h +Index: xen-4.1.3-testing/xen/include/asm-x86/cpufeature.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/cpufeature.h -+++ xen-4.1.2-testing/xen/include/asm-x86/cpufeature.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/cpufeature.h ++++ xen-4.1.3-testing/xen/include/asm-x86/cpufeature.h @@ -151,6 +151,10 @@ #define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability) #define cpufeat_mask(idx) (1u << ((idx) & 31)) @@ -241,10 +241,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/cpufeature.h #ifdef __i386__ #define cpu_has_vme boot_cpu_has(X86_FEATURE_VME) #define cpu_has_de boot_cpu_has(X86_FEATURE_DE) -Index: xen-4.1.2-testing/xen/include/public/platform.h +Index: xen-4.1.3-testing/xen/include/public/platform.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/platform.h -+++ xen-4.1.2-testing/xen/include/public/platform.h +--- xen-4.1.3-testing.orig/xen/include/public/platform.h ++++ xen-4.1.3-testing/xen/include/public/platform.h @@ -304,6 +304,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_getidletim #define XEN_PM_CX 0 #define XEN_PM_PX 1 @@ -261,10 +261,10 @@ Index: xen-4.1.2-testing/xen/include/public/platform.h } u; }; typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t; -Index: xen-4.1.2-testing/xen/include/xen/acpi.h +Index: xen-4.1.3-testing/xen/include/xen/acpi.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/acpi.h -+++ xen-4.1.2-testing/xen/include/xen/acpi.h +--- xen-4.1.3-testing.orig/xen/include/xen/acpi.h ++++ xen-4.1.3-testing/xen/include/xen/acpi.h @@ -334,6 +334,8 @@ static inline int acpi_boot_table_init(v #endif /*!CONFIG_ACPI_BOOT*/ diff --git a/23795-intel-ich10-quirk.patch b/23795-intel-ich10-quirk.patch deleted file mode 100644 index 7bff26e..0000000 --- a/23795-intel-ich10-quirk.patch +++ /dev/null @@ -1,82 +0,0 @@ -References: bnc#683580 - -# HG changeset patch -# User Jan Beulich -# Date 1314443678 -3600 -# Node ID e17f70940d1f57fe04dde3bf4e243f75c89f0d0e -# Parent 4705eca37c9fac9d13867a856bdcfa8b7bad56c6 -x86: work around certain Intel BIOSes causing (transient) hangs during boot - -They apparently leave the USB legacy emulation bits set in ICH10's -SMI Control and Enable register, but fail to handle the resulting SMIs -gracefully. The hangs can apparently extend indefinitely, but are -commonly observed to last between a few seconds and a minute. - -This assumes that only ICH10-based systems on Intel main boards with -Intel BIOS may be affected. Until Intel comes up with a more precise -identification of affected BIOSes, all Intel ones on Intel boards -will get this workaround applied. - -Signed-off-by: Jan Beulich - -Index: xen-4.1.2-testing/xen/arch/x86/dmi_scan.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/dmi_scan.c -+++ xen-4.1.2-testing/xen/arch/x86/dmi_scan.c -@@ -10,6 +10,8 @@ - #include - #include - #include -+#include -+#include - - #define bt_ioremap(b,l) ((void *)__acpi_map_table(b,l)) - #define bt_iounmap(b,l) ((void)0) -@@ -278,6 +280,28 @@ static __init int broken_toshiba_keyboar - return 0; - } - -+static int __init ich10_bios_quirk(struct dmi_system_id *d) -+{ -+ u32 port, smictl; -+ -+ if ( pci_conf_read16(0, 0x1f, 0, PCI_VENDOR_ID) != 0x8086 ) -+ return 0; -+ -+ switch ( pci_conf_read16(0, 0x1f, 0, PCI_DEVICE_ID) ) { -+ case 0x3a14: -+ case 0x3a16: -+ case 0x3a18: -+ case 0x3a1a: -+ port = (pci_conf_read16(0, 0x1f, 0, 0x40) & 0xff80) + 0x30; -+ smictl = inl(port); -+ /* turn off LEGACY_USB{,2}_EN if enabled */ -+ if ( smictl & 0x20008 ) -+ outl(smictl & ~0x20008, port); -+ break; -+ } -+ -+ return 0; -+} - - #ifdef CONFIG_ACPI_SLEEP - static __init int reset_videomode_after_s3(struct dmi_blacklist *d) -@@ -363,6 +387,18 @@ static __initdata struct dmi_blacklist d - } }, - #endif - -+ { ich10_bios_quirk, "Intel board & BIOS", -+ /* -+ * BIOS leaves legacy USB emulation enabled while -+ * SMM can't properly handle it. -+ */ -+ { -+ MATCH(DMI_BOARD_VENDOR, "Intel Corp"), -+ MATCH(DMI_BIOS_VENDOR, "Intel Corp"), -+ NO_MATCH, NO_MATCH -+ } -+ }, -+ - #ifdef CONFIG_ACPI_BOOT - /* - * If your system is blacklisted here, but you find that acpi=force diff --git a/23804-x86-IPI-counts.patch b/23804-x86-IPI-counts.patch index 436eb68..2ba983f 100644 --- a/23804-x86-IPI-counts.patch +++ b/23804-x86-IPI-counts.patch @@ -11,9 +11,11 @@ currently counted. Signed-off-by: Kevin Tian ---- a/xen/arch/x86/apic.c -+++ b/xen/arch/x86/apic.c -@@ -1372,6 +1372,7 @@ fastcall void smp_apic_timer_interrupt(s +Index: xen-4.1.3-testing/xen/arch/x86/apic.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/apic.c ++++ xen-4.1.3-testing/xen/arch/x86/apic.c +@@ -1378,6 +1378,7 @@ fastcall void smp_apic_timer_interrupt(s struct cpu_user_regs *old_regs = set_irq_regs(regs); ack_APIC_irq(); perfc_incr(apic_timer); @@ -21,7 +23,7 @@ Signed-off-by: Kevin Tian raise_softirq(TIMER_SOFTIRQ); set_irq_regs(old_regs); } -@@ -1393,6 +1394,7 @@ fastcall void smp_spurious_interrupt(str +@@ -1399,6 +1400,7 @@ fastcall void smp_spurious_interrupt(str unsigned long v; struct cpu_user_regs *old_regs = set_irq_regs(regs); @@ -29,7 +31,7 @@ Signed-off-by: Kevin Tian irq_enter(); /* -@@ -1428,6 +1430,7 @@ fastcall void smp_error_interrupt(struct +@@ -1434,6 +1436,7 @@ fastcall void smp_error_interrupt(struct unsigned long v, v1; struct cpu_user_regs *old_regs = set_irq_regs(regs); @@ -37,7 +39,7 @@ Signed-off-by: Kevin Tian irq_enter(); /* First tickle the hardware, only then report what went on. -- REW */ v = apic_read(APIC_ESR); -@@ -1459,6 +1462,7 @@ fastcall void smp_pmu_apic_interrupt(str +@@ -1465,6 +1468,7 @@ fastcall void smp_pmu_apic_interrupt(str { struct cpu_user_regs *old_regs = set_irq_regs(regs); ack_APIC_irq(); @@ -45,8 +47,10 @@ Signed-off-by: Kevin Tian hvm_do_pmu_interrupt(regs); set_irq_regs(old_regs); } ---- a/xen/arch/x86/cpu/mcheck/mce_intel.c -+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c +Index: xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/mce_intel.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/cpu/mcheck/mce_intel.c ++++ xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/mce_intel.c @@ -66,6 +66,7 @@ static void (*vendor_thermal_interrupt)( fastcall void smp_thermal_interrupt(struct cpu_user_regs *regs) { @@ -55,7 +59,7 @@ Signed-off-by: Kevin Tian irq_enter(); vendor_thermal_interrupt(regs); irq_exit(); -@@ -1094,6 +1095,7 @@ fastcall void smp_cmci_interrupt(struct +@@ -1094,6 +1095,7 @@ fastcall void smp_cmci_interrupt(struct struct cpu_user_regs *old_regs = set_irq_regs(regs); ack_APIC_irq(); @@ -63,9 +67,11 @@ Signed-off-by: Kevin Tian irq_enter(); mctc = mcheck_mca_logout( ---- a/xen/arch/x86/io_apic.c -+++ b/xen/arch/x86/io_apic.c -@@ -529,6 +529,7 @@ fastcall void smp_irq_move_cleanup_inter +Index: xen-4.1.3-testing/xen/arch/x86/io_apic.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/io_apic.c ++++ xen-4.1.3-testing/xen/arch/x86/io_apic.c +@@ -516,6 +516,7 @@ fastcall void smp_irq_move_cleanup_inter struct cpu_user_regs *old_regs = set_irq_regs(regs); ack_APIC_irq(); @@ -73,9 +79,11 @@ Signed-off-by: Kevin Tian irq_enter(); me = smp_processor_id(); ---- a/xen/arch/x86/smp.c -+++ b/xen/arch/x86/smp.c -@@ -221,6 +221,7 @@ fastcall void smp_invalidate_interrupt(v +Index: xen-4.1.3-testing/xen/arch/x86/smp.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/smp.c ++++ xen-4.1.3-testing/xen/arch/x86/smp.c +@@ -222,6 +222,7 @@ fastcall void smp_invalidate_interrupt(v { ack_APIC_irq(); perfc_incr(ipis); @@ -83,7 +91,7 @@ Signed-off-by: Kevin Tian irq_enter(); if ( !__sync_local_execstate() || (flush_flags & (FLUSH_TLB_GLOBAL | FLUSH_CACHE)) ) -@@ -385,6 +386,7 @@ fastcall void smp_event_check_interrupt( +@@ -387,6 +388,7 @@ fastcall void smp_event_check_interrupt( struct cpu_user_regs *old_regs = set_irq_regs(regs); ack_APIC_irq(); perfc_incr(ipis); @@ -91,7 +99,7 @@ Signed-off-by: Kevin Tian set_irq_regs(old_regs); } -@@ -421,6 +423,7 @@ fastcall void smp_call_function_interrup +@@ -423,6 +425,7 @@ fastcall void smp_call_function_interrup ack_APIC_irq(); perfc_incr(ipis); diff --git a/23817-mem_event_add_ref_counting_for_free_requestslots.patch b/23817-mem_event_add_ref_counting_for_free_requestslots.patch index 825624b..71145a2 100644 --- a/23817-mem_event_add_ref_counting_for_free_requestslots.patch +++ b/23817-mem_event_add_ref_counting_for_free_requestslots.patch @@ -37,10 +37,10 @@ Signed-off-by: Olaf Hering xen/include/xen/sched.h | 1 + 5 files changed, 15 insertions(+), 8 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_event.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c @@ -37,8 +37,6 @@ #define mem_event_ring_lock(_d) spin_lock(&(_d)->mem_event.ring_lock) #define mem_event_ring_unlock(_d) spin_unlock(&(_d)->mem_event.ring_lock) @@ -94,10 +94,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c if ( (curr->domain->domain_id == d->domain_id) && ring_full ) { -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_sharing.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c @@ -322,7 +322,6 @@ static struct page_info* mem_sharing_all req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED; } @@ -106,11 +106,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c if(mem_event_check_ring(d)) return page; req.gfn = gfn; -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2970,6 +2970,7 @@ void p2m_mem_paging_populate(struct p2m_ +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2976,6 +2976,7 @@ void p2m_mem_paging_populate(struct p2m_ else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged ) { /* gfn is already on its way back and vcpu is not paused */ @@ -118,10 +118,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return; } -Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h +Index: xen-4.1.3-testing/xen/include/asm-x86/mem_event.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/mem_event.h -+++ xen-4.1.2-testing/xen/include/asm-x86/mem_event.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/mem_event.h ++++ xen-4.1.3-testing/xen/include/asm-x86/mem_event.h @@ -27,6 +27,7 @@ /* Pauses VCPU while marking pause flag for mem event */ void mem_event_mark_and_pause(struct vcpu *v); @@ -130,10 +130,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h void mem_event_put_request(struct domain *d, mem_event_request_t *req); void mem_event_get_response(struct domain *d, mem_event_response_t *rsp); void mem_event_unpause_vcpus(struct domain *d); -Index: xen-4.1.2-testing/xen/include/xen/sched.h +Index: xen-4.1.3-testing/xen/include/xen/sched.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/sched.h -+++ xen-4.1.2-testing/xen/include/xen/sched.h +--- xen-4.1.3-testing.orig/xen/include/xen/sched.h ++++ xen-4.1.3-testing/xen/include/xen/sched.h @@ -190,6 +190,7 @@ struct mem_event_domain { /* ring lock */ diff --git a/23819-make-docs.patch b/23819-make-docs.patch deleted file mode 100644 index c0f1e89..0000000 --- a/23819-make-docs.patch +++ /dev/null @@ -1,22 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1315320580 -3600 -# Node ID 5fe770c8a8a35c58893816ee6335a90ed43f3bbd -# Parent 0268e73809532a4a3ca18a075efcee3c62caf458 -docs: Fix 'make docs' - -Signed-off-by: Keir Fraser - -Index: xen-4.1.2-testing/docs/src/user.tex -=================================================================== ---- xen-4.1.2-testing.orig/docs/src/user.tex -+++ xen-4.1.2-testing/docs/src/user.tex -@@ -4197,7 +4197,7 @@ writing to the VGA console after domain - \item [ vcpu\_migration\_delay=$<$minimum\_time$>$] Set minimum time of - vcpu migration in microseconds (default 0). This parameter avoids agressive - vcpu migration. For example, the linux kernel uses 0.5ms by default. --\item [ irq_vector_map=xxx ] Enable irq vector non-sharing maps. Setting 'global' -+\item [ irq\_vector\_map=xxx ] Enable irq vector non-sharing maps. Setting 'global' - will ensure that no IRQs will share vectors. Setting 'per-device' will ensure - that no IRQs from the same device will share vectors. Setting to 'none' will - disable it entirely, overriding any defaults the IOMMU code may set. diff --git a/23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch b/23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch index c50c213..55100b1 100644 --- a/23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch +++ b/23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch @@ -25,11 +25,11 @@ Committed-by: Tim Deegan xen/include/asm-x86/mem_event.h | 8 +-- 5 files changed, 66 insertions(+), 65 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -@@ -3909,7 +3909,7 @@ static int hvm_memory_event_traps(long p +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +@@ -3920,7 +3920,7 @@ static int hvm_memory_event_traps(long p if ( (p & HVMPME_onchangeonly) && (value == old) ) return 1; @@ -38,7 +38,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c if ( rc ) return rc; -@@ -3932,7 +3932,7 @@ static int hvm_memory_event_traps(long p +@@ -3943,7 +3943,7 @@ static int hvm_memory_event_traps(long p req.gla_valid = 1; } @@ -47,10 +47,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c return 1; } -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_event.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c @@ -33,21 +33,21 @@ #define xen_rmb() rmb() #define xen_wmb() wmb() @@ -271,10 +271,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c } break; -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_sharing.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c @@ -322,12 +322,12 @@ static struct page_info* mem_sharing_all req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED; } @@ -299,11 +299,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c /* Unpause domain/vcpu */ if( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2923,7 +2923,7 @@ void p2m_mem_paging_drop_page(struct p2m +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2929,7 +2929,7 @@ void p2m_mem_paging_drop_page(struct p2m struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ @@ -312,7 +312,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c { /* Send release notification to pager */ memset(&req, 0, sizeof(req)); -@@ -2931,7 +2931,7 @@ void p2m_mem_paging_drop_page(struct p2m +@@ -2937,7 +2937,7 @@ void p2m_mem_paging_drop_page(struct p2m req.gfn = gfn; req.vcpu_id = v->vcpu_id; @@ -321,7 +321,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } } -@@ -2943,7 +2943,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2949,7 +2949,7 @@ void p2m_mem_paging_populate(struct p2m_ struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ @@ -330,7 +330,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return; memset(&req, 0, sizeof(req)); -@@ -2970,7 +2970,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2976,7 +2976,7 @@ void p2m_mem_paging_populate(struct p2m_ else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged ) { /* gfn is already on its way back and vcpu is not paused */ @@ -339,7 +339,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return; } -@@ -2979,7 +2979,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2985,7 +2985,7 @@ void p2m_mem_paging_populate(struct p2m_ req.p2mt = p2mt; req.vcpu_id = v->vcpu_id; @@ -348,7 +348,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn) -@@ -3008,7 +3008,7 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3014,7 +3014,7 @@ void p2m_mem_paging_resume(struct p2m_do mfn_t mfn; /* Pull the response off the ring */ @@ -357,7 +357,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Fix p2m entry if the page was not dropped */ if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) ) -@@ -3055,7 +3055,7 @@ void p2m_mem_access_check(unsigned long +@@ -3061,7 +3061,7 @@ void p2m_mem_access_check(paddr_t gpa, b p2m_unlock(p2m); /* Otherwise, check if there is a memory event listener, and send the message along */ @@ -366,7 +366,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c if ( res < 0 ) { /* No listener */ -@@ -3099,7 +3099,7 @@ void p2m_mem_access_check(unsigned long +@@ -3105,7 +3105,7 @@ void p2m_mem_access_check(paddr_t gpa, b req.vcpu_id = v->vcpu_id; @@ -375,7 +375,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* VCPU paused, mem event request sent */ } -@@ -3109,7 +3109,7 @@ void p2m_mem_access_resume(struct p2m_do +@@ -3115,7 +3115,7 @@ void p2m_mem_access_resume(struct p2m_do struct domain *d = p2m->domain; mem_event_response_t rsp; @@ -384,10 +384,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Unpause domain */ if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) -Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h +Index: xen-4.1.3-testing/xen/include/asm-x86/mem_event.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/mem_event.h -+++ xen-4.1.2-testing/xen/include/asm-x86/mem_event.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/mem_event.h ++++ xen-4.1.3-testing/xen/include/asm-x86/mem_event.h @@ -26,10 +26,10 @@ /* Pauses VCPU while marking pause flag for mem event */ diff --git a/23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch b/23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch index 36a3a03..22bb845 100644 --- a/23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch +++ b/23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch @@ -45,10 +45,10 @@ Committed-by: Tim Deegan xen/include/xen/sched.h | 6 + 15 files changed, 206 insertions(+), 156 deletions(-) -Index: xen-4.1.2-testing/tools/libxc/Makefile +Index: xen-4.1.3-testing/tools/libxc/Makefile =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/Makefile -+++ xen-4.1.2-testing/tools/libxc/Makefile +--- xen-4.1.3-testing.orig/tools/libxc/Makefile ++++ xen-4.1.3-testing/tools/libxc/Makefile @@ -1,7 +1,7 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk @@ -58,10 +58,10 @@ Index: xen-4.1.2-testing/tools/libxc/Makefile MINOR = 0 CTRL_SRCS-y := -Index: xen-4.1.2-testing/tools/libxc/xc_mem_access.c +Index: xen-4.1.3-testing/tools/libxc/xc_mem_access.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_mem_access.c -+++ xen-4.1.2-testing/tools/libxc/xc_mem_access.c +--- xen-4.1.3-testing.orig/tools/libxc/xc_mem_access.c ++++ xen-4.1.3-testing/tools/libxc/xc_mem_access.c @@ -24,12 +24,29 @@ #include "xc_private.h" @@ -94,10 +94,10 @@ Index: xen-4.1.2-testing/tools/libxc/xc_mem_access.c } /* -Index: xen-4.1.2-testing/tools/libxc/xc_mem_event.c +Index: xen-4.1.3-testing/tools/libxc/xc_mem_event.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_mem_event.c -+++ xen-4.1.2-testing/tools/libxc/xc_mem_event.c +--- xen-4.1.3-testing.orig/tools/libxc/xc_mem_event.c ++++ xen-4.1.3-testing/tools/libxc/xc_mem_event.c @@ -42,18 +42,3 @@ int xc_mem_event_control(xc_interface *x return do_domctl(xch, &domctl); } @@ -117,10 +117,10 @@ Index: xen-4.1.2-testing/tools/libxc/xc_mem_event.c - NULL, NULL, INVALID_MFN); -} - -Index: xen-4.1.2-testing/tools/libxc/xc_mem_paging.c +Index: xen-4.1.3-testing/tools/libxc/xc_mem_paging.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_mem_paging.c -+++ xen-4.1.2-testing/tools/libxc/xc_mem_paging.c +--- xen-4.1.3-testing.orig/tools/libxc/xc_mem_paging.c ++++ xen-4.1.3-testing/tools/libxc/xc_mem_paging.c @@ -24,36 +24,53 @@ #include "xc_private.h" @@ -183,10 +183,10 @@ Index: xen-4.1.2-testing/tools/libxc/xc_mem_paging.c } -Index: xen-4.1.2-testing/tools/libxc/xc_memshr.c +Index: xen-4.1.3-testing/tools/libxc/xc_memshr.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_memshr.c -+++ xen-4.1.2-testing/tools/libxc/xc_memshr.c +--- xen-4.1.3-testing.orig/tools/libxc/xc_memshr.c ++++ xen-4.1.3-testing/tools/libxc/xc_memshr.c @@ -36,7 +36,7 @@ int xc_memshr_control(xc_interface *xch, domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION; domctl.domain = (domid_t)domid; @@ -259,10 +259,10 @@ Index: xen-4.1.2-testing/tools/libxc/xc_memshr.c op->u.debug.u.gref = gref; return do_domctl(xch, &domctl); -Index: xen-4.1.2-testing/tools/libxc/xenctrl.h +Index: xen-4.1.3-testing/tools/libxc/xenctrl.h =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xenctrl.h -+++ xen-4.1.2-testing/tools/libxc/xenctrl.h +--- xen-4.1.3-testing.orig/tools/libxc/xenctrl.h ++++ xen-4.1.3-testing/tools/libxc/xenctrl.h @@ -1734,16 +1734,19 @@ int xc_mem_event_control(xc_interface *x unsigned int mode, void *shared_page, void *ring_page, unsigned long gfn); @@ -286,10 +286,10 @@ Index: xen-4.1.2-testing/tools/libxc/xenctrl.h int xc_mem_access_resume(xc_interface *xch, domid_t domain_id, unsigned long gfn); -Index: xen-4.1.2-testing/tools/tests/xen-access/xen-access.c +Index: xen-4.1.3-testing/tools/tests/xen-access/xen-access.c =================================================================== ---- xen-4.1.2-testing.orig/tools/tests/xen-access/xen-access.c -+++ xen-4.1.2-testing/tools/tests/xen-access/xen-access.c +--- xen-4.1.3-testing.orig/tools/tests/xen-access/xen-access.c ++++ xen-4.1.3-testing/tools/tests/xen-access/xen-access.c @@ -241,7 +241,7 @@ xenaccess_t *xenaccess_init(xc_interface mem_event_ring_lock_init(&xenaccess->mem_event); @@ -308,10 +308,10 @@ Index: xen-4.1.2-testing/tools/tests/xen-access/xen-access.c if ( rc != 0 ) { ERROR("Error tearing down domain xenaccess in xen"); -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.c ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.c @@ -234,7 +234,7 @@ static xenpaging_t *xenpaging_init(domid PAGE_SIZE); @@ -330,10 +330,10 @@ Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c if ( rc != 0 ) { ERROR("Error tearing down domain paging in xen"); -Index: xen-4.1.2-testing/xen/arch/ia64/xen/dom0_ops.c +Index: xen-4.1.3-testing/xen/arch/ia64/xen/dom0_ops.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/ia64/xen/dom0_ops.c -+++ xen-4.1.2-testing/xen/arch/ia64/xen/dom0_ops.c +--- xen-4.1.3-testing.orig/xen/arch/ia64/xen/dom0_ops.c ++++ xen-4.1.3-testing/xen/arch/ia64/xen/dom0_ops.c @@ -688,7 +688,7 @@ long arch_do_domctl(xen_domctl_t *op, XE switch(mec->op) @@ -343,11 +343,11 @@ Index: xen-4.1.2-testing/xen/arch/ia64/xen/dom0_ops.c { if (mec->u.enable) { ret = -EINVAL; /* not implemented */ -Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -@@ -3909,7 +3909,7 @@ static int hvm_memory_event_traps(long p +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +@@ -3920,7 +3920,7 @@ static int hvm_memory_event_traps(long p if ( (p & HVMPME_onchangeonly) && (value == old) ) return 1; @@ -356,7 +356,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c if ( rc ) return rc; -@@ -3932,7 +3932,7 @@ static int hvm_memory_event_traps(long p +@@ -3943,7 +3943,7 @@ static int hvm_memory_event_traps(long p req.gla_valid = 1; } @@ -365,10 +365,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c return 1; } -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_event.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c @@ -37,24 +37,52 @@ #define mem_event_ring_lock(_med) spin_lock(&(_med)->ring_lock) #define mem_event_ring_unlock(_med) spin_unlock(&(_med)->ring_lock) @@ -588,10 +588,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c } return rc; -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_sharing.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c @@ -322,12 +322,12 @@ static struct page_info* mem_sharing_all req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED; } @@ -688,11 +688,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c { grant_ref_t gref = mec->u.debug.u.gref; rc = mem_sharing_debug_gref(d, gref); -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2923,7 +2923,7 @@ void p2m_mem_paging_drop_page(struct p2m +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2929,7 +2929,7 @@ void p2m_mem_paging_drop_page(struct p2m struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ @@ -701,7 +701,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c { /* Send release notification to pager */ memset(&req, 0, sizeof(req)); -@@ -2931,7 +2931,7 @@ void p2m_mem_paging_drop_page(struct p2m +@@ -2937,7 +2937,7 @@ void p2m_mem_paging_drop_page(struct p2m req.gfn = gfn; req.vcpu_id = v->vcpu_id; @@ -710,7 +710,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } } -@@ -2943,7 +2943,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2949,7 +2949,7 @@ void p2m_mem_paging_populate(struct p2m_ struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ @@ -719,7 +719,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return; memset(&req, 0, sizeof(req)); -@@ -2970,7 +2970,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2976,7 +2976,7 @@ void p2m_mem_paging_populate(struct p2m_ else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged ) { /* gfn is already on its way back and vcpu is not paused */ @@ -728,7 +728,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return; } -@@ -2979,7 +2979,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2985,7 +2985,7 @@ void p2m_mem_paging_populate(struct p2m_ req.p2mt = p2mt; req.vcpu_id = v->vcpu_id; @@ -737,7 +737,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn) -@@ -3008,7 +3008,7 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3014,7 +3014,7 @@ void p2m_mem_paging_resume(struct p2m_do mfn_t mfn; /* Pull the response off the ring */ @@ -746,7 +746,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Fix p2m entry if the page was not dropped */ if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) ) -@@ -3055,7 +3055,7 @@ void p2m_mem_access_check(unsigned long +@@ -3061,7 +3061,7 @@ void p2m_mem_access_check(paddr_t gpa, b p2m_unlock(p2m); /* Otherwise, check if there is a memory event listener, and send the message along */ @@ -755,7 +755,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c if ( res < 0 ) { /* No listener */ -@@ -3099,7 +3099,7 @@ void p2m_mem_access_check(unsigned long +@@ -3105,7 +3105,7 @@ void p2m_mem_access_check(paddr_t gpa, b req.vcpu_id = v->vcpu_id; @@ -764,7 +764,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* VCPU paused, mem event request sent */ } -@@ -3109,7 +3109,7 @@ void p2m_mem_access_resume(struct p2m_do +@@ -3115,7 +3115,7 @@ void p2m_mem_access_resume(struct p2m_do struct domain *d = p2m->domain; mem_event_response_t rsp; @@ -773,10 +773,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Unpause domain */ if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) -Index: xen-4.1.2-testing/xen/include/public/domctl.h +Index: xen-4.1.3-testing/xen/include/public/domctl.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/domctl.h -+++ xen-4.1.2-testing/xen/include/public/domctl.h +--- xen-4.1.3-testing.orig/xen/include/public/domctl.h ++++ xen-4.1.3-testing/xen/include/public/domctl.h @@ -707,20 +707,18 @@ struct xen_domctl_gdbsx_domstatus { /* XEN_DOMCTL_mem_event_op */ @@ -848,10 +848,10 @@ Index: xen-4.1.2-testing/xen/include/public/domctl.h #define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID (-10) #define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID (-9) -Index: xen-4.1.2-testing/xen/include/xen/sched.h +Index: xen-4.1.3-testing/xen/include/xen/sched.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/sched.h -+++ xen-4.1.2-testing/xen/include/xen/sched.h +--- xen-4.1.3-testing.orig/xen/include/xen/sched.h ++++ xen-4.1.3-testing/xen/include/xen/sched.h @@ -326,8 +326,12 @@ struct domain /* Non-migratable and non-restoreable? */ bool_t disable_migrate; diff --git a/23853-x86-pv-cpuid-xsave.patch b/23853-x86-pv-cpuid-xsave.patch deleted file mode 100644 index d905d43..0000000 --- a/23853-x86-pv-cpuid-xsave.patch +++ /dev/null @@ -1,61 +0,0 @@ -# HG changeset patch -# User Shan Haitao -# Date 1316300518 -3600 -# Node ID b78235de5c6407023759f9bbf723dd83887fedf0 -# Parent c944e82bb092925f31403a129087e9d40e0fa06a -Fix PV CPUID virtualization of XSave - -The patch will fix XSave CPUID virtualization for PV guests. The XSave -area size returned by CPUID leaf D is changed dynamically depending on -the XCR0. Tools/libxc only assigns a static value. The fix will adjust -xsave area size during runtime. - -Note: This fix is already in HVM cpuid virtualization. And Dom0 is not -affected, either. - -Signed-off-by: Shan Haitao - ---- a/xen/arch/x86/hvm/hvm.c -+++ b/xen/arch/x86/hvm/hvm.c -@@ -2310,7 +2310,7 @@ void hvm_cpuid(unsigned int input, unsig - { - /* reset EBX to default value first */ - *ebx = XSAVE_AREA_MIN_SIZE; -- for ( sub_leaf = 2; sub_leaf < 64; sub_leaf++ ) -+ for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ ) - { - if ( !(v->arch.xcr0 & (1ULL << sub_leaf)) ) - continue; ---- a/xen/arch/x86/traps.c -+++ b/xen/arch/x86/traps.c -@@ -768,6 +768,30 @@ static void pv_cpuid(struct cpu_user_reg - { - if ( !cpuid_hypervisor_leaves(a, c, &a, &b, &c, &d) ) - domain_cpuid(current->domain, a, c, &a, &b, &c, &d); -+ -+ switch ( a ) -+ { -+ case 0xd: -+ { -+ unsigned int sub_leaf, _eax, _ebx, _ecx, _edx; -+ /* EBX value of main leaf 0 depends on enabled xsave features */ -+ if ( c == 0 && current->arch.xcr0 ) -+ { -+ /* reset EBX to default value first */ -+ b = XSAVE_AREA_MIN_SIZE; -+ for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ ) -+ { -+ if ( !(current->arch.xcr0 & (1ULL << sub_leaf)) ) -+ continue; -+ domain_cpuid(current->domain, a, c, &_eax, &_ebx, &_ecx, -+ &_edx); -+ if ( (_eax + _ebx) > b ) -+ b = _eax + _ebx; -+ } -+ } -+ break; -+ } -+ } - goto out; - } - diff --git a/23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch b/23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch index 5a6a33b..3c860b6 100644 --- a/23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch +++ b/23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch @@ -28,10 +28,10 @@ Committed-by: Tim Deegan xen/include/xen/sched.h | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) -Index: xen-4.1.2-testing/tools/libxc/xc_domain.c +Index: xen-4.1.3-testing/tools/libxc/xc_domain.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_domain.c -+++ xen-4.1.2-testing/tools/libxc/xc_domain.c +--- xen-4.1.3-testing.orig/tools/libxc/xc_domain.c ++++ xen-4.1.3-testing/tools/libxc/xc_domain.c @@ -235,6 +235,7 @@ int xc_domain_getinfo(xc_interface *xch, info->ssidref = domctl.u.getdomaininfo.ssidref; info->nr_pages = domctl.u.getdomaininfo.tot_pages; @@ -40,10 +40,10 @@ Index: xen-4.1.2-testing/tools/libxc/xc_domain.c info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10); info->shared_info_frame = domctl.u.getdomaininfo.shared_info_frame; info->cpu_time = domctl.u.getdomaininfo.cpu_time; -Index: xen-4.1.2-testing/tools/libxc/xenctrl.h +Index: xen-4.1.3-testing/tools/libxc/xenctrl.h =================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xenctrl.h -+++ xen-4.1.2-testing/tools/libxc/xenctrl.h +--- xen-4.1.3-testing.orig/tools/libxc/xenctrl.h ++++ xen-4.1.3-testing/tools/libxc/xenctrl.h @@ -353,6 +353,7 @@ typedef struct xc_dominfo { unsigned int shutdown_reason; /* only meaningful if shutdown==1 */ unsigned long nr_pages; /* current number, not maximum */ @@ -52,11 +52,11 @@ Index: xen-4.1.2-testing/tools/libxc/xenctrl.h unsigned long shared_info_frame; uint64_t cpu_time; unsigned long max_memkb; -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2913,6 +2913,9 @@ int p2m_mem_paging_evict(struct p2m_doma +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2919,6 +2919,9 @@ int p2m_mem_paging_evict(struct p2m_doma /* Put the page back so it gets freed */ put_page(page); @@ -66,7 +66,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return 0; } -@@ -2997,6 +3000,8 @@ int p2m_mem_paging_prep(struct p2m_domai +@@ -3003,6 +3006,8 @@ int p2m_mem_paging_prep(struct p2m_domai audit_p2m(p2m, 1); p2m_unlock(p2m); @@ -75,10 +75,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return 0; } -Index: xen-4.1.2-testing/xen/common/domctl.c +Index: xen-4.1.3-testing/xen/common/domctl.c =================================================================== ---- xen-4.1.2-testing.orig/xen/common/domctl.c -+++ xen-4.1.2-testing/xen/common/domctl.c +--- xen-4.1.3-testing.orig/xen/common/domctl.c ++++ xen-4.1.3-testing/xen/common/domctl.c @@ -139,6 +139,7 @@ void getdomaininfo(struct domain *d, str info->tot_pages = d->tot_pages; info->max_pages = d->max_pages; @@ -87,10 +87,10 @@ Index: xen-4.1.2-testing/xen/common/domctl.c info->shared_info_frame = mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_SHIFT); BUG_ON(SHARED_M2P(info->shared_info_frame)); -Index: xen-4.1.2-testing/xen/include/public/domctl.h +Index: xen-4.1.3-testing/xen/include/public/domctl.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/domctl.h -+++ xen-4.1.2-testing/xen/include/public/domctl.h +--- xen-4.1.3-testing.orig/xen/include/public/domctl.h ++++ xen-4.1.3-testing/xen/include/public/domctl.h @@ -35,7 +35,7 @@ #include "xen.h" #include "grant_table.h" @@ -108,10 +108,10 @@ Index: xen-4.1.2-testing/xen/include/public/domctl.h uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */ uint64_aligned_t cpu_time; uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */ -Index: xen-4.1.2-testing/xen/include/xen/sched.h +Index: xen-4.1.3-testing/xen/include/xen/sched.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/sched.h -+++ xen-4.1.2-testing/xen/include/xen/sched.h +--- xen-4.1.3-testing.orig/xen/include/xen/sched.h ++++ xen-4.1.3-testing/xen/include/xen/sched.h @@ -215,6 +215,7 @@ struct domain unsigned int tot_pages; /* number of pages currently possesed */ unsigned int max_pages; /* maximum value for tot_pages */ diff --git a/23900-xzalloc.patch b/23900-xzalloc.patch deleted file mode 100644 index a035f59..0000000 --- a/23900-xzalloc.patch +++ /dev/null @@ -1,89 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1317730526 -7200 -# Node ID e09ebf7a31f55bb26c3cce7695a435ed20adf05b -# Parent a99d75671a911f9c0d5d11e0fe88a0a65863cb44 -introduce xzalloc() & Co - -Rather than having to match a call to one of the xmalloc() flavors with -a subsequent memset(), introduce a zeroing variant of each of those -flavors. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/common/xmalloc_tlsf.c -+++ b/xen/common/xmalloc_tlsf.c -@@ -585,6 +585,13 @@ void *_xmalloc(unsigned long size, unsig - return p; - } - -+void *_xzalloc(unsigned long size, unsigned long align) -+{ -+ void *p = _xmalloc(size, align); -+ -+ return p ? memset(p, 0, size) : p; -+} -+ - void xfree(void *p) - { - struct bhdr *b; ---- a/xen/include/acpi/platform/aclinux.h -+++ b/xen/include/acpi/platform/aclinux.h -@@ -77,10 +77,7 @@ - #define acpi_thread_id struct vcpu * - - #define ACPI_ALLOCATE(a) xmalloc_bytes(a) --#define ACPI_ALLOCATE_ZEROED(a) ({ \ -- void *p = xmalloc_bytes(a); \ -- if ( p ) memset(p, 0, a); \ -- p; }) -+#define ACPI_ALLOCATE_ZEROED(a) xzalloc_bytes(a) - #define ACPI_FREE(a) xfree(a) - - #endif /* __ACLINUX_H__ */ ---- a/xen/include/xen/xmalloc.h -+++ b/xen/include/xen/xmalloc.h -@@ -8,19 +8,25 @@ - - /* Allocate space for typed object. */ - #define xmalloc(_type) ((_type *)_xmalloc(sizeof(_type), __alignof__(_type))) -+#define xzalloc(_type) ((_type *)_xzalloc(sizeof(_type), __alignof__(_type))) - - /* Allocate space for array of typed objects. */ - #define xmalloc_array(_type, _num) \ - ((_type *)_xmalloc_array(sizeof(_type), __alignof__(_type), _num)) -+#define xzalloc_array(_type, _num) \ -+ ((_type *)_xzalloc_array(sizeof(_type), __alignof__(_type), _num)) - - /* Allocate untyped storage. */ --#define xmalloc_bytes(_bytes) (_xmalloc(_bytes, SMP_CACHE_BYTES)) -+#define xmalloc_bytes(_bytes) _xmalloc(_bytes, SMP_CACHE_BYTES) -+#define xzalloc_bytes(_bytes) _xzalloc(_bytes, SMP_CACHE_BYTES) - - /* Free any of the above. */ - extern void xfree(void *); - - /* Underlying functions */ - extern void *_xmalloc(unsigned long size, unsigned long align); -+extern void *_xzalloc(unsigned long size, unsigned long align); -+ - static inline void *_xmalloc_array( - unsigned long size, unsigned long align, unsigned long num) - { -@@ -30,6 +36,15 @@ static inline void *_xmalloc_array( - return _xmalloc(size * num, align); - } - -+static inline void *_xzalloc_array( -+ unsigned long size, unsigned long align, unsigned long num) -+{ -+ /* Check for overflow. */ -+ if (size && num > UINT_MAX / size) -+ return NULL; -+ return _xzalloc(size * num, align); -+} -+ - /* - * Pooled allocator interface. - */ diff --git a/23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch b/23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch index d67bdca..c7fdaf1 100644 --- a/23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch +++ b/23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch @@ -18,11 +18,11 @@ Committed-by: Tim Deegan xen/arch/x86/mm/p2m.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2839,10 +2839,11 @@ int p2m_mem_paging_nominate(struct p2m_d +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2845,10 +2845,11 @@ int p2m_mem_paging_nominate(struct p2m_d { struct page_info *page; p2m_type_t p2mt; @@ -35,7 +35,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Check if mfn is valid */ ret = -EINVAL; -@@ -2869,7 +2870,7 @@ int p2m_mem_paging_nominate(struct p2m_d +@@ -2875,7 +2876,7 @@ int p2m_mem_paging_nominate(struct p2m_d /* Fix p2m entry */ p2m_lock(p2m); @@ -44,7 +44,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c audit_p2m(p2m, 1); p2m_unlock(p2m); -@@ -2883,11 +2884,12 @@ int p2m_mem_paging_evict(struct p2m_doma +@@ -2889,11 +2890,12 @@ int p2m_mem_paging_evict(struct p2m_doma { struct page_info *page; p2m_type_t p2mt; @@ -58,7 +58,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c if ( unlikely(!mfn_valid(mfn)) ) return -EINVAL; -@@ -2906,7 +2908,7 @@ int p2m_mem_paging_evict(struct p2m_doma +@@ -2912,7 +2914,7 @@ int p2m_mem_paging_evict(struct p2m_doma /* Remove mapping from p2m table */ p2m_lock(p2m); @@ -67,7 +67,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c audit_p2m(p2m, 1); p2m_unlock(p2m); -@@ -2943,6 +2945,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2949,6 +2951,7 @@ void p2m_mem_paging_populate(struct p2m_ struct vcpu *v = current; mem_event_request_t req; p2m_type_t p2mt; @@ -75,7 +75,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ -@@ -2955,11 +2958,11 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2961,11 +2964,11 @@ void p2m_mem_paging_populate(struct p2m_ /* Fix p2m mapping */ /* XXX: It seems inefficient to have this here, as it's only needed * in one case (ept guest accessing paging out page) */ @@ -89,7 +89,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c audit_p2m(p2m, 1); p2m_unlock(p2m); } -@@ -2988,7 +2991,10 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2994,7 +2997,10 @@ void p2m_mem_paging_populate(struct p2m_ int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn) { struct page_info *page; @@ -100,7 +100,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Get a free page */ page = alloc_domheap_page(p2m->domain, 0); if ( unlikely(page == NULL) ) -@@ -2996,7 +3002,7 @@ int p2m_mem_paging_prep(struct p2m_domai +@@ -3002,7 +3008,7 @@ int p2m_mem_paging_prep(struct p2m_domai /* Fix p2m mapping */ p2m_lock(p2m); @@ -109,7 +109,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c audit_p2m(p2m, 1); p2m_unlock(p2m); -@@ -3010,6 +3016,7 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3016,6 +3022,7 @@ void p2m_mem_paging_resume(struct p2m_do struct domain *d = p2m->domain; mem_event_response_t rsp; p2m_type_t p2mt; @@ -117,7 +117,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c mfn_t mfn; /* Pull the response off the ring */ -@@ -3018,9 +3025,9 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3024,9 +3031,9 @@ void p2m_mem_paging_resume(struct p2m_do /* Fix p2m entry if the page was not dropped */ if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) ) { diff --git a/23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch b/23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch index a7464c4..566ce42 100644 --- a/23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch +++ b/23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch @@ -17,11 +17,11 @@ Committed-by: Tim Deegan xen/arch/x86/mm/p2m.c | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2843,6 +2843,8 @@ int p2m_mem_paging_nominate(struct p2m_d +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2849,6 +2849,8 @@ int p2m_mem_paging_nominate(struct p2m_d mfn_t mfn; int ret; @@ -30,7 +30,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query); /* Check if mfn is valid */ -@@ -2869,14 +2871,12 @@ int p2m_mem_paging_nominate(struct p2m_d +@@ -2875,14 +2877,12 @@ int p2m_mem_paging_nominate(struct p2m_d goto out; /* Fix p2m entry */ @@ -46,7 +46,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return ret; } -@@ -2887,30 +2887,31 @@ int p2m_mem_paging_evict(struct p2m_doma +@@ -2893,30 +2893,31 @@ int p2m_mem_paging_evict(struct p2m_doma p2m_access_t a; mfn_t mfn; struct domain *d = p2m->domain; @@ -83,7 +83,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Put the page back so it gets freed */ put_page(page); -@@ -2918,7 +2919,11 @@ int p2m_mem_paging_evict(struct p2m_doma +@@ -2924,7 +2925,11 @@ int p2m_mem_paging_evict(struct p2m_doma /* Track number of paged gfns */ atomic_inc(&p2m->domain->paged_pages); @@ -96,7 +96,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } void p2m_mem_paging_drop_page(struct p2m_domain *p2m, unsigned long gfn) -@@ -2958,14 +2963,14 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2964,14 +2969,14 @@ void p2m_mem_paging_populate(struct p2m_ /* Fix p2m mapping */ /* XXX: It seems inefficient to have this here, as it's only needed * in one case (ept guest accessing paging out page) */ @@ -113,7 +113,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Pause domain */ if ( v->domain->domain_id == d->domain_id ) -@@ -2993,22 +2998,27 @@ int p2m_mem_paging_prep(struct p2m_domai +@@ -2999,22 +3004,27 @@ int p2m_mem_paging_prep(struct p2m_domai struct page_info *page; p2m_type_t p2mt; p2m_access_t a; @@ -145,7 +145,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } void p2m_mem_paging_resume(struct p2m_domain *p2m) -@@ -3025,8 +3035,8 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3031,8 +3041,8 @@ void p2m_mem_paging_resume(struct p2m_do /* Fix p2m entry if the page was not dropped */ if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) ) { diff --git a/23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch b/23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch index 76a5482..47af775 100644 --- a/23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch +++ b/23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch @@ -20,11 +20,11 @@ Committed-by: Tim Deegan xen/arch/x86/mm/p2m.c | 2 -- 1 file changed, 2 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2961,8 +2961,6 @@ void p2m_mem_paging_populate(struct p2m_ +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2967,8 +2967,6 @@ void p2m_mem_paging_populate(struct p2m_ req.type = MEM_EVENT_TYPE_PAGING; /* Fix p2m mapping */ diff --git a/23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch b/23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch deleted file mode 100644 index 836524f..0000000 --- a/23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch +++ /dev/null @@ -1,85 +0,0 @@ -changeset: 23908:88b6e08b8aa8 -user: Olaf Hering -date: Thu Oct 06 14:15:43 2011 +0100 -files: xen/arch/x86/mm/p2m.c -description: -p2m: query/modify p2mt with p2m_lock held - -Query and update the p2mt in set_mmio_p2m_entry, clear_mmio_p2m_entry -and set_shared_p2m_entry with the p2m_lock held. - -Signed-off-by: Olaf Hering -Acked-by: Tim Deegan -Committed-by: Tim Deegan - - ---- - xen/arch/x86/mm/p2m.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2751,9 +2751,11 @@ set_mmio_p2m_entry(struct p2m_domain *p2 - if ( !paging_mode_translate(p2m->domain) ) - return 0; - -+ p2m_lock(p2m); - omfn = gfn_to_mfn_query(p2m, gfn, &ot); - if ( p2m_is_grant(ot) ) - { -+ p2m_unlock(p2m); - domain_crash(p2m->domain); - return 0; - } -@@ -2764,7 +2766,6 @@ set_mmio_p2m_entry(struct p2m_domain *p2 - } - - P2M_DEBUG("set mmio %lx %lx\n", gfn, mfn_x(mfn)); -- p2m_lock(p2m); - rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_mmio_direct, p2m->default_access); - audit_p2m(p2m, 1); - p2m_unlock(p2m); -@@ -2785,18 +2786,20 @@ clear_mmio_p2m_entry(struct p2m_domain * - if ( !paging_mode_translate(p2m->domain) ) - return 0; - -- mfn = gfn_to_mfn(p2m, gfn, &t); -+ p2m_lock(p2m); -+ mfn = gfn_to_mfn_query(p2m, gfn, &t); - - /* Do not use mfn_valid() here as it will usually fail for MMIO pages. */ - if ( (INVALID_MFN == mfn_x(mfn)) || (t != p2m_mmio_direct) ) - { - gdprintk(XENLOG_ERR, - "clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn); -- return 0; -+ goto out; - } -- p2m_lock(p2m); - rc = set_p2m_entry(p2m, gfn, _mfn(INVALID_MFN), 0, p2m_invalid, p2m->default_access); - audit_p2m(p2m, 1); -+ -+out: - p2m_unlock(p2m); - - return rc; -@@ -2813,6 +2816,8 @@ set_shared_p2m_entry(struct p2m_domain * - if ( !paging_mode_translate(p2m->domain) ) - return 0; - -+ if ( need_lock ) -+ p2m_lock(p2m); - omfn = gfn_to_mfn_query(p2m, gfn, &ot); - /* At the moment we only allow p2m change if gfn has already been made - * sharable first */ -@@ -2822,8 +2827,6 @@ set_shared_p2m_entry(struct p2m_domain * - set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY); - - P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn)); -- if ( need_lock ) -- p2m_lock(p2m); - rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_shared, p2m->default_access); - if ( need_lock ) - p2m_unlock(p2m); diff --git a/23925-x86-AMD-ARAT-Fam12.patch b/23925-x86-AMD-ARAT-Fam12.patch deleted file mode 100644 index 3853562..0000000 --- a/23925-x86-AMD-ARAT-Fam12.patch +++ /dev/null @@ -1,33 +0,0 @@ -# HG changeset patch -# User Boris Ostrovsky -# Date 1317976335 -7200 -# Node ID 08d6ba4e447d6c13c6dfac5c23e84b73961cb109 -# Parent 159be83e5fe9111bb30d8b1f83127f5724d44424 -x86/AMD: Do not enable ARAT feature on AMD processors below family 0x12 - -Determining whether an AMD processor is affected by erratum 400 may -have some corner cases and handling these cases is somewhat complicated. -In the interest of simplicity we won't claim ARAT support on processor -families below 0x12. - -Mirrors Linux commit e9cdd343a5e42c43bcda01e609fa23089e026470 - -Signed-off-by: Boris Ostrovsky -Committed-by: Jan Beulich - ---- a/xen/arch/x86/cpu/amd.c -+++ b/xen/arch/x86/cpu/amd.c -@@ -632,8 +632,11 @@ static void __devinit init_amd(struct cp - } - #endif - -- /* As a rule processors have APIC timer running in deep C states */ -- if (c->x86 > 0xf && !cpu_has_amd_erratum(c, AMD_ERRATUM_400)) -+ /* -+ * Family 0x12 and above processors have APIC timer -+ * running in deep C states. -+ */ -+ if (c->x86 > 0x11) - set_bit(X86_FEATURE_ARAT, c->x86_capability); - - /* Prevent TSC drift in non single-processor, single-core platforms. */ diff --git a/23943-xenpaging_clear_page_content_after_evict.patch b/23943-xenpaging_clear_page_content_after_evict.patch index 634939d..ebe6d3f 100644 --- a/23943-xenpaging_clear_page_content_after_evict.patch +++ b/23943-xenpaging_clear_page_content_after_evict.patch @@ -23,10 +23,10 @@ Committed-by: Tim Deegan xen/arch/x86/mm/p2m.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.c ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.c @@ -455,9 +455,6 @@ static int xenpaging_evict_page(xenpagin goto out; } @@ -37,11 +37,11 @@ Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c munmap(page, PAGE_SIZE); /* Tell Xen to evict page */ -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2916,6 +2916,9 @@ int p2m_mem_paging_evict(struct p2m_doma +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2919,6 +2919,9 @@ int p2m_mem_paging_evict(struct p2m_doma set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, a); audit_p2m(p2m, 1); diff --git a/23944-pygrub-debug.patch b/23944-pygrub-debug.patch index f709410..ebfe8bb 100644 --- a/23944-pygrub-debug.patch +++ b/23944-pygrub-debug.patch @@ -13,9 +13,10 @@ Signed-off-by: Guido Gunther Acked-by: Ian Campbell Committed-by: Ian Jackson -diff -r 1185ae04b5aa -r 4b0907c6a08c tools/pygrub/src/pygrub ---- a/tools/pygrub/src/pygrub Tue Oct 11 10:46:28 2011 +0100 -+++ b/tools/pygrub/src/pygrub Tue Oct 11 12:02:58 2011 +0100 +Index: xen-4.1.3-testing/tools/pygrub/src/pygrub +=================================================================== +--- xen-4.1.3-testing.orig/tools/pygrub/src/pygrub ++++ xen-4.1.3-testing/tools/pygrub/src/pygrub @@ -13,7 +13,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # @@ -25,7 +26,7 @@ diff -r 1185ae04b5aa -r 4b0907c6a08c tools/pygrub/src/pygrub import copy import logging import platform -@@ -665,7 +665,7 @@ +@@ -674,7 +674,7 @@ if __name__ == "__main__": ["quiet", "interactive", "not-really", "help", "output=", "output-format=", "output-directory=", "entry=", "kernel=", @@ -34,7 +35,7 @@ diff -r 1185ae04b5aa -r 4b0907c6a08c tools/pygrub/src/pygrub except getopt.GetoptError: usage() sys.exit(1) -@@ -679,6 +679,7 @@ +@@ -688,6 +688,7 @@ if __name__ == "__main__": entry = None interactive = True isconfig = False @@ -42,7 +43,7 @@ diff -r 1185ae04b5aa -r 4b0907c6a08c tools/pygrub/src/pygrub not_really = False output_format = "sxp" output_directory = "/var/run/xend/boot" -@@ -714,6 +715,8 @@ +@@ -723,6 +724,8 @@ if __name__ == "__main__": interactive = False elif o in ("--isconfig",): isconfig = True @@ -51,7 +52,7 @@ diff -r 1185ae04b5aa -r 4b0907c6a08c tools/pygrub/src/pygrub elif o in ("--output-format",): if a not in ["sxp", "simple", "simple0"]: print "unkonwn output format %s" % a -@@ -723,6 +726,9 @@ +@@ -732,6 +735,9 @@ if __name__ == "__main__": elif o in ("--output-directory",): output_directory = a @@ -61,7 +62,7 @@ diff -r 1185ae04b5aa -r 4b0907c6a08c tools/pygrub/src/pygrub if output is None or output == "-": fd = sys.stdout.fileno() else: -@@ -769,6 +775,8 @@ +@@ -778,6 +784,8 @@ if __name__ == "__main__": except: # IOErrors raised by fsimage.open # RuntimeErrors raised by run_grub if no menu.lst present diff --git a/23949-constify_vcpu_set_affinitys_second_parameter.patch b/23949-constify_vcpu_set_affinitys_second_parameter.patch index bab5f68..1e7eed6 100644 --- a/23949-constify_vcpu_set_affinitys_second_parameter.patch +++ b/23949-constify_vcpu_set_affinitys_second_parameter.patch @@ -22,10 +22,10 @@ Acked-by: Keir Fraser xen/include/xen/sched.h | 2 +- 4 files changed, 6 insertions(+), 17 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c +Index: xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/vmce.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/vmce.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c +--- xen-4.1.3-testing.orig/xen/arch/x86/cpu/mcheck/vmce.c ++++ xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/vmce.c @@ -304,7 +304,6 @@ int vmce_wrmsr(u32 msr, u64 val) int inject_vmce(struct domain *d) { @@ -47,11 +47,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c vcpu_kick(d->vcpu[0]); } else -Index: xen-4.1.2-testing/xen/arch/x86/traps.c +Index: xen-4.1.3-testing/xen/arch/x86/traps.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/traps.c -+++ xen-4.1.2-testing/xen/arch/x86/traps.c -@@ -3104,7 +3104,6 @@ static void nmi_mce_softirq(void) +--- xen-4.1.3-testing.orig/xen/arch/x86/traps.c ++++ xen-4.1.3-testing/xen/arch/x86/traps.c +@@ -3106,7 +3106,6 @@ static void nmi_mce_softirq(void) { int cpu = smp_processor_id(); struct softirq_trap *st = &per_cpu(softirq_trap, cpu); @@ -59,7 +59,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c BUG_ON(st == NULL); BUG_ON(st->vcpu == NULL); -@@ -3120,9 +3119,7 @@ static void nmi_mce_softirq(void) +@@ -3122,9 +3121,7 @@ static void nmi_mce_softirq(void) * Make sure to wakeup the vcpu on the * specified processor. */ @@ -70,7 +70,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c /* Affinity is restored in the iret hypercall. */ } -@@ -3192,14 +3189,11 @@ void async_exception_cleanup(struct vcpu +@@ -3199,14 +3196,11 @@ void async_exception_cleanup(struct vcpu !test_and_set_bool(curr->mce_pending) ) { int cpu = smp_processor_id(); @@ -86,11 +86,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/traps.c } } } -Index: xen-4.1.2-testing/xen/common/schedule.c +Index: xen-4.1.3-testing/xen/common/schedule.c =================================================================== ---- xen-4.1.2-testing.orig/xen/common/schedule.c -+++ xen-4.1.2-testing/xen/common/schedule.c -@@ -593,9 +593,9 @@ int cpu_disable_scheduler(unsigned int c +--- xen-4.1.3-testing.orig/xen/common/schedule.c ++++ xen-4.1.3-testing/xen/common/schedule.c +@@ -598,9 +598,9 @@ int cpu_disable_scheduler(unsigned int c return ret; } @@ -102,7 +102,7 @@ Index: xen-4.1.2-testing/xen/common/schedule.c cpumask_t *online; if ( v->domain->is_pinned ) -@@ -607,9 +607,7 @@ int vcpu_set_affinity(struct vcpu *v, cp +@@ -612,9 +612,7 @@ int vcpu_set_affinity(struct vcpu *v, cp vcpu_schedule_lock_irq(v); @@ -112,11 +112,11 @@ Index: xen-4.1.2-testing/xen/common/schedule.c if ( !cpu_isset(v->processor, v->cpu_affinity) ) set_bit(_VPF_migrating, &v->pause_flags); -Index: xen-4.1.2-testing/xen/include/xen/sched.h +Index: xen-4.1.3-testing/xen/include/xen/sched.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/sched.h -+++ xen-4.1.2-testing/xen/include/xen/sched.h -@@ -623,7 +623,7 @@ void scheduler_free(struct scheduler *sc +--- xen-4.1.3-testing.orig/xen/include/xen/sched.h ++++ xen-4.1.3-testing/xen/include/xen/sched.h +@@ -624,7 +624,7 @@ void scheduler_free(struct scheduler *sc int schedule_cpu_switch(unsigned int cpu, struct cpupool *c); void vcpu_force_reschedule(struct vcpu *v); int cpu_disable_scheduler(unsigned int cpu); diff --git a/23953-xenpaging_handle_evict_failures.patch b/23953-xenpaging_handle_evict_failures.patch index cae687f..a0e2148 100644 --- a/23953-xenpaging_handle_evict_failures.patch +++ b/23953-xenpaging_handle_evict_failures.patch @@ -35,10 +35,10 @@ Committed-by: Tim Deegan xen/include/public/mem_event.h | 1 4 files changed, 50 insertions(+), 24 deletions(-) -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.c ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.c @@ -734,10 +734,12 @@ int main(int argc, char *argv[]) } else @@ -56,11 +56,11 @@ Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c /* Tell Xen to resume the vcpu */ /* XXX: Maybe just check if the vcpu was paused? */ -Index: xen-4.1.2-testing/xen/arch/x86/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -3502,7 +3502,7 @@ int do_mmu_update( +--- xen-4.1.3-testing.orig/xen/arch/x86/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/mm.c +@@ -3504,7 +3504,7 @@ int do_mmu_update( rc = -ENOENT; break; } @@ -69,7 +69,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c { rc = -ENOENT; break; -@@ -3543,7 +3543,7 @@ int do_mmu_update( +@@ -3545,7 +3545,7 @@ int do_mmu_update( rc = -ENOENT; break; } @@ -78,7 +78,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c { rc = -ENOENT; break; -@@ -3572,7 +3572,7 @@ int do_mmu_update( +@@ -3574,7 +3574,7 @@ int do_mmu_update( rc = -ENOENT; break; } @@ -87,7 +87,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c { rc = -ENOENT; break; -@@ -3602,7 +3602,7 @@ int do_mmu_update( +@@ -3604,7 +3604,7 @@ int do_mmu_update( rc = -ENOENT; break; } @@ -96,11 +96,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c { rc = -ENOENT; break; -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2899,15 +2899,24 @@ int p2m_mem_paging_evict(struct p2m_doma +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2902,15 +2902,24 @@ int p2m_mem_paging_evict(struct p2m_doma if ( unlikely(!mfn_valid(mfn)) ) goto out; @@ -127,7 +127,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Decrement guest domain's ref count of the page */ if ( test_and_clear_bit(_PGC_allocated, &page->count_info) ) put_page(page); -@@ -2919,14 +2928,15 @@ int p2m_mem_paging_evict(struct p2m_doma +@@ -2922,14 +2931,15 @@ int p2m_mem_paging_evict(struct p2m_doma /* Clear content before returning the page to Xen */ scrub_one_page(page); @@ -146,7 +146,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c out: p2m_unlock(p2m); return ret; -@@ -2957,6 +2967,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2960,6 +2970,7 @@ void p2m_mem_paging_populate(struct p2m_ mem_event_request_t req; p2m_type_t p2mt; p2m_access_t a; @@ -154,7 +154,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ -@@ -2968,20 +2979,26 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -2971,20 +2982,26 @@ void p2m_mem_paging_populate(struct p2m_ /* Fix p2m mapping */ p2m_lock(p2m); @@ -186,7 +186,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged ) { /* gfn is already on its way back and vcpu is not paused */ -@@ -3002,19 +3019,25 @@ int p2m_mem_paging_prep(struct p2m_domai +@@ -3005,19 +3022,25 @@ int p2m_mem_paging_prep(struct p2m_domai struct page_info *page; p2m_type_t p2mt; p2m_access_t a; @@ -218,10 +218,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c audit_p2m(p2m, 1); atomic_dec(&p2m->domain->paged_pages); -Index: xen-4.1.2-testing/xen/include/public/mem_event.h +Index: xen-4.1.3-testing/xen/include/public/mem_event.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/mem_event.h -+++ xen-4.1.2-testing/xen/include/public/mem_event.h +--- xen-4.1.3-testing.orig/xen/include/public/mem_event.h ++++ xen-4.1.3-testing/xen/include/public/mem_event.h @@ -38,6 +38,7 @@ /* Memory event flags */ #define MEM_EVENT_FLAG_VCPU_PAUSED (1 << 0) diff --git a/23955-x86-pv-cpuid-xsave.patch b/23955-x86-pv-cpuid-xsave.patch deleted file mode 100644 index 7c04efb..0000000 --- a/23955-x86-pv-cpuid-xsave.patch +++ /dev/null @@ -1,45 +0,0 @@ -# HG changeset patch -# User Shan Haitao -# Date 1318517935 -3600 -# Node ID bbde1453cbd95d6d36febe9c552f9cfa26b5c49e -# Parent c1bd53fac3d5e5868352894d62dbacd6de0b0e7a -x86: Further fixes for xsave leaf in pv_cpuid(). - -Signed-off-by: Shan Haitao -Committed-by: Keir Fraser - ---- a/xen/arch/x86/traps.c -+++ b/xen/arch/x86/traps.c -@@ -766,16 +766,18 @@ static void pv_cpuid(struct cpu_user_reg - - if ( current->domain->domain_id != 0 ) - { -+ unsigned int cpuid_leaf = a, sub_leaf = c; -+ - if ( !cpuid_hypervisor_leaves(a, c, &a, &b, &c, &d) ) - domain_cpuid(current->domain, a, c, &a, &b, &c, &d); - -- switch ( a ) -+ switch ( cpuid_leaf ) - { - case 0xd: - { -- unsigned int sub_leaf, _eax, _ebx, _ecx, _edx; -+ unsigned int _eax, _ebx, _ecx, _edx; - /* EBX value of main leaf 0 depends on enabled xsave features */ -- if ( c == 0 && current->arch.xcr0 ) -+ if ( sub_leaf == 0 && current->arch.xcr0 ) - { - /* reset EBX to default value first */ - b = XSAVE_AREA_MIN_SIZE; -@@ -783,8 +785,8 @@ static void pv_cpuid(struct cpu_user_reg - { - if ( !(current->arch.xcr0 & (1ULL << sub_leaf)) ) - continue; -- domain_cpuid(current->domain, a, c, &_eax, &_ebx, &_ecx, -- &_edx); -+ domain_cpuid(current->domain, cpuid_leaf, sub_leaf, -+ &_eax, &_ebx, &_ecx, &_edx); - if ( (_eax + _ebx) > b ) - b = _eax + _ebx; - } diff --git a/23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch b/23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch index 5bdc0a0..6786dde 100644 --- a/23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch +++ b/23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch @@ -19,11 +19,11 @@ Committed-by: Tim Deegan xen/arch/x86/mm/p2m.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -3020,16 +3020,22 @@ int p2m_mem_paging_prep(struct p2m_domai +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -3023,16 +3023,22 @@ int p2m_mem_paging_prep(struct p2m_domai p2m_type_t p2mt; p2m_access_t a; mfn_t mfn; @@ -47,7 +47,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c page = alloc_domheap_page(p2m->domain, 0); if ( unlikely(page == NULL) ) goto out; -@@ -3064,9 +3070,15 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3067,9 +3073,15 @@ void p2m_mem_paging_resume(struct p2m_do { p2m_lock(p2m); mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query); diff --git a/23979-xenpaging_document_p2m_mem_paging_functions.patch b/23979-xenpaging_document_p2m_mem_paging_functions.patch index c978e26..3fbf333 100644 --- a/23979-xenpaging_document_p2m_mem_paging_functions.patch +++ b/23979-xenpaging_document_p2m_mem_paging_functions.patch @@ -17,11 +17,11 @@ Committed-by: Tim Deegan xen/arch/x86/mm/p2m.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2838,6 +2838,24 @@ set_shared_p2m_entry(struct p2m_domain * +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2841,6 +2841,24 @@ set_shared_p2m_entry(struct p2m_domain * } #ifdef __x86_64__ @@ -46,7 +46,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c int p2m_mem_paging_nominate(struct p2m_domain *p2m, unsigned long gfn) { struct page_info *page; -@@ -2883,6 +2901,25 @@ int p2m_mem_paging_nominate(struct p2m_d +@@ -2886,6 +2904,25 @@ int p2m_mem_paging_nominate(struct p2m_d return ret; } @@ -72,7 +72,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c int p2m_mem_paging_evict(struct p2m_domain *p2m, unsigned long gfn) { struct page_info *page; -@@ -2942,6 +2979,15 @@ int p2m_mem_paging_evict(struct p2m_doma +@@ -2945,6 +2982,15 @@ int p2m_mem_paging_evict(struct p2m_doma return ret; } @@ -88,7 +88,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c void p2m_mem_paging_drop_page(struct p2m_domain *p2m, unsigned long gfn) { struct vcpu *v = current; -@@ -2961,6 +3007,27 @@ void p2m_mem_paging_drop_page(struct p2m +@@ -2964,6 +3010,27 @@ void p2m_mem_paging_drop_page(struct p2m } } @@ -116,7 +116,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c void p2m_mem_paging_populate(struct p2m_domain *p2m, unsigned long gfn) { struct vcpu *v = current; -@@ -3014,6 +3081,17 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3017,6 +3084,17 @@ void p2m_mem_paging_populate(struct p2m_ mem_event_put_request(d, &d->mem_paging, &req); } @@ -134,7 +134,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn) { struct page_info *page; -@@ -3054,6 +3132,21 @@ int p2m_mem_paging_prep(struct p2m_domai +@@ -3057,6 +3135,21 @@ int p2m_mem_paging_prep(struct p2m_domai return ret; } diff --git a/23993-x86-microcode-amd-fix-23871.patch b/23993-x86-microcode-amd-fix-23871.patch index 5367621..e5fd7c7 100644 --- a/23993-x86-microcode-amd-fix-23871.patch +++ b/23993-x86-microcode-amd-fix-23871.patch @@ -24,11 +24,11 @@ there reverted). Signed-off-by: Jan Beulich Committed-by: Keir Fraser -Index: xen-4.1.2-testing/xen/arch/x86/microcode_amd.c +Index: xen-4.1.3-testing/xen/arch/x86/microcode_amd.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/microcode_amd.c -+++ xen-4.1.2-testing/xen/arch/x86/microcode_amd.c -@@ -76,14 +76,6 @@ static int microcode_fits(void *mc, int +--- xen-4.1.3-testing.orig/xen/arch/x86/microcode_amd.c ++++ xen-4.1.3-testing/xen/arch/x86/microcode_amd.c +@@ -76,14 +76,6 @@ static int microcode_fits(const struct m /* We should bind the task to the CPU */ BUG_ON(cpu != raw_smp_processor_id()); @@ -43,31 +43,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/microcode_amd.c current_cpu_id = cpuid_eax(0x00000001); for ( i = 0; equiv_cpu_table[i].installed_cpu != 0; i++ ) -@@ -96,7 +88,7 @@ static int microcode_fits(void *mc, int - } - - if ( !equiv_cpu_id ) -- return 0; -+ return 0; - - if ( (mc_header->processor_rev_id) != equiv_cpu_id ) - { -@@ -113,8 +105,7 @@ static int microcode_fits(void *mc, int +@@ -117,7 +109,6 @@ static int microcode_fits(const struct m "update with version 0x%x (current=0x%x)\n", cpu, mc_header->patch_id, uci->cpu_sig.rev); -out: -- return 0; -+ return 1; + return 1; } - static int apply_microcode(int cpu) -@@ -289,7 +280,7 @@ static int cpu_request_microcode(int cpu - while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0) - { - error = microcode_fits(mc, cpu); -- if (error != 0) -+ if (error <= 0) - continue; - - error = apply_microcode(cpu); diff --git a/23998-pygrub-GPT.patch b/23998-pygrub-GPT.patch deleted file mode 100644 index 4c2dd81..0000000 --- a/23998-pygrub-GPT.patch +++ /dev/null @@ -1,53 +0,0 @@ -# HG changeset patch -# User Michael Young -# Date 1319566554 -3600 -# Node ID 85d7b207fabcd1cbda8f93e3937c5990f42a2cf9 -# Parent f273bce1fc265b9f71879705639a0b14da03f6e1 -pygrub: check all GPT partitions - -On Fedora 16 the first GPT partition is a boot partition for grub2 with -the grub2 configuration in the second partition. -Check all GPT partitions for grub configuration, not just the first. - -[ Also remove now-inaccurate comment. -iwj ] - -Signed-off-by: Michael Young -Tested-by: Paolo Bonzini -Signed-off-by: Ian Jackson -Committed-by: Ian Jackson - -diff -r f273bce1fc26 -r 85d7b207fabc tools/pygrub/src/pygrub ---- a/tools/pygrub/src/pygrub Tue Oct 25 17:04:41 2011 +0100 -+++ b/tools/pygrub/src/pygrub Tue Oct 25 19:15:54 2011 +0100 -@@ -77,10 +77,17 @@ - - def get_fs_offset_gpt(file): - fd = os.open(file, os.O_RDONLY) -- # assume the first partition is an EFI system partition. -- os.lseek(fd, SECTOR_SIZE * 2, 0) -+ os.lseek(fd, SECTOR_SIZE, 0) - buf = os.read(fd, 512) -- return struct.unpack("0: -+ buf = os.read(fd, partsize) -+ offsets.append(struct.unpack(" -# Date 1319566759 -3600 -# Node ID 65679fee01778aec2dbe9988959da6b57c52d6c9 -# Parent 138f707fa598340749a70a79748b01dff850b8f2 -pygrub: Allow GPT partition references - -The grub2 configuration file in Fedora 16 can have GPT partition -references like (hd0,gpt2) so remove the "gpt" string where necessary - -Signed-off-by: Michael Young -Acked-by: Ian Campbell - -Index: xen-4.1.2-testing/tools/pygrub/src/GrubConf.py -=================================================================== ---- xen-4.1.2-testing.orig/tools/pygrub/src/GrubConf.py -+++ xen-4.1.2-testing/tools/pygrub/src/GrubConf.py -@@ -79,6 +79,8 @@ class GrubDiskPart(object): - val = val.replace("(", "").replace(")", "") - if val[:5] == "msdos": - val = val[5:] -+ if val[:3] == "gpt": -+ val = val[3:] - self._part = int(val) - part = property(get_part, set_part) - diff --git a/24001-pygrub-grub2.patch b/24001-pygrub-grub2.patch deleted file mode 100644 index 9fc2197..0000000 --- a/24001-pygrub-grub2.patch +++ /dev/null @@ -1,55 +0,0 @@ -# HG changeset patch -# User Michael Young -# Date 1319566806 -3600 -# Node ID 152049468175f29a3792b3b60e09a841f9cd2c21 -# Parent 65679fee01778aec2dbe9988959da6b57c52d6c9 -pygrub: cope with configurations with submenus - -The grub2 configuration file in Fedora 16 can have one or more -menuentrys in a submenu, with configuration of the form - submenu "Xen 4.1" { - menuentry ... { - ... - } - } -(this example occurs when the xen hypervisor is installed on the -guest) - -Ignore the submenu line and the corresponding } - -Signed-off-by: Michael Young -Acked-by: Ian Campbell - -Index: xen-4.1.2-testing/tools/pygrub/src/GrubConf.py -=================================================================== ---- xen-4.1.2-testing.orig/tools/pygrub/src/GrubConf.py -+++ xen-4.1.2-testing/tools/pygrub/src/GrubConf.py -@@ -370,6 +370,7 @@ class Grub2ConfigFile(_GrubConfigFile): - in_function = False - img = None - title = "" -+ menu_level=0 - for l in lines: - l = l.strip() - # skip blank lines -@@ -396,10 +397,18 @@ class Grub2ConfigFile(_GrubConfigFile): - img = [] - title = title_match.group(1) - continue -- -+ -+ if l.startswith("submenu"): -+ menu_level += 1 -+ continue -+ - if l.startswith("}"): - if img is None: -- raise RuntimeError, "syntax error: closing brace without menuentry" -+ if menu_level > 0: -+ menu_level -= 1 -+ continue -+ else: -+ raise RuntimeError, "syntax error: closing brace without menuentry" - - self.add_image(Grub2Image(title, img)) - img = None diff --git a/24002-pygrub-grub2.patch b/24002-pygrub-grub2.patch deleted file mode 100644 index c9bd2d4..0000000 --- a/24002-pygrub-grub2.patch +++ /dev/null @@ -1,28 +0,0 @@ -# HG changeset patch -# User Michael Young -# Date 1319566865 -3600 -# Node ID 979bc34d0ad0369e42c70f66a39952e4b6b9b613 -# Parent 152049468175f29a3792b3b60e09a841f9cd2c21 -pyrgrub: cope with configurations with set default="${saved_entry}" line - -Fedora 16 grub2 configuration file can have lines like - set default="${saved_entry}" -and a string containing an integer is expected - -Signed-off-by: Michael Young -Acked-by: Ian Campbell -Committed-by: Ian Jackson - -Index: xen-4.1.2-testing/tools/pygrub/src/GrubConf.py -=================================================================== ---- xen-4.1.2-testing.orig/tools/pygrub/src/GrubConf.py -+++ xen-4.1.2-testing/tools/pygrub/src/GrubConf.py -@@ -425,6 +425,8 @@ class Grub2ConfigFile(_GrubConfigFile): - - if self.commands.has_key(com): - if self.commands[com] is not None: -+ if arg.strip() == "${saved_entry}": -+ arg = "0" - setattr(self, self.commands[com], arg.strip()) - else: - logging.info("Ignored directive %s" %(com,)) diff --git a/24105-xenpaging_compare_domain_pointer_in_p2m_mem_paging_populate.patch b/24105-xenpaging_compare_domain_pointer_in_p2m_mem_paging_populate.patch index 3e7549c..ec43f2c 100644 --- a/24105-xenpaging_compare_domain_pointer_in_p2m_mem_paging_populate.patch +++ b/24105-xenpaging_compare_domain_pointer_in_p2m_mem_paging_populate.patch @@ -15,11 +15,11 @@ Committed-by: Keir Fraser xen/arch/x86/mm/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -3060,7 +3060,7 @@ void p2m_mem_paging_populate(struct p2m_ +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -3063,7 +3063,7 @@ void p2m_mem_paging_populate(struct p2m_ p2m_unlock(p2m); /* Pause domain if request came from guest and gfn has paging type */ diff --git a/24116-x86-continuation-cancel.patch b/24116-x86-continuation-cancel.patch deleted file mode 100644 index e8067f3..0000000 --- a/24116-x86-continuation-cancel.patch +++ /dev/null @@ -1,67 +0,0 @@ -# HG changeset patch -# User Jean Guyader -# Date 1321002862 -3600 -# Node ID a095cf28f2b6eeb8f5873c18eb18d4d7e5544e2c -# Parent 6534da595d695a4f2af12a64e46fb06219a0e4bc -Hypercall continuation cancelation in compat mode for XENMEM_get/set_pod_target - -If copy_to_guest failed in the compat code after a continuation as been -done in the native code we need to cancel it so we won't reexecute the -hypercall but return from the hypercall with the appropriate error. - -Signed-off-by: Jean Guyader -Acked-by: Jan Beulich -Acked-by: Keir Fraser -Committed-by: Jan Beulich - ---- a/xen/arch/x86/domain.c -+++ b/xen/arch/x86/domain.c -@@ -1585,6 +1585,24 @@ void sync_vcpu_execstate(struct vcpu *v) - __arg; \ - }) - -+void hypercall_cancel_continuation(void) -+{ -+ struct cpu_user_regs *regs = guest_cpu_user_regs(); -+ struct mc_state *mcs = ¤t->mc_state; -+ -+ if ( test_bit(_MCSF_in_multicall, &mcs->flags) ) -+ { -+ __clear_bit(_MCSF_call_preempted, &mcs->flags); -+ } -+ else -+ { -+ if ( !is_hvm_vcpu(current) ) -+ regs->eip += 2; /* skip re-execute 'syscall' / 'int $xx' */ -+ else -+ current->arch.hvm_vcpu.hcall_preempted = 0; -+ } -+} -+ - unsigned long hypercall_create_continuation( - unsigned int op, const char *format, ...) - { ---- a/xen/arch/x86/x86_64/compat/mm.c -+++ b/xen/arch/x86/x86_64/compat/mm.c -@@ -133,7 +133,11 @@ int compat_arch_memory_op(int op, XEN_GU - XLAT_pod_target(&cmp, nat); - - if ( copy_to_guest(arg, &cmp, 1) ) -+ { -+ if ( rc == __HYPERVISOR_memory_op ) -+ hypercall_cancel_continuation(); - rc = -EFAULT; -+ } - - break; - } ---- a/xen/include/xen/sched.h -+++ b/xen/include/xen/sched.h -@@ -560,6 +560,7 @@ void startup_cpu_idle_loop(void); - */ - unsigned long hypercall_create_continuation( - unsigned int op, const char *format, ...); -+void hypercall_cancel_continuation(void); - - #define hypercall_preempt_check() (unlikely( \ - softirq_pending(smp_processor_id()) | \ diff --git a/24123-x86-cpuidle-quiesce.patch b/24123-x86-cpuidle-quiesce.patch index eae9cd6..e9b219f 100644 --- a/24123-x86-cpuidle-quiesce.patch +++ b/24123-x86-cpuidle-quiesce.patch @@ -14,9 +14,11 @@ be revisited, but ideally without producing per-CPU messages again). Signed-off-by: Jan Beulich Acked-by: Keir Fraser ---- a/xen/arch/x86/acpi/cpu_idle.c -+++ b/xen/arch/x86/acpi/cpu_idle.c -@@ -659,6 +659,8 @@ static int acpi_processor_ffh_cstate_pro +Index: xen-4.1.3-testing/xen/arch/x86/acpi/cpu_idle.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/acpi/cpu_idle.c ++++ xen-4.1.3-testing/xen/arch/x86/acpi/cpu_idle.c +@@ -654,6 +654,8 @@ static int acpi_processor_ffh_cstate_pro unsigned int edx_part; unsigned int cstate_type; /* C-state type and not ACPI C-state type */ unsigned int num_cstate_subtype; @@ -25,7 +27,7 @@ Acked-by: Keir Fraser if ( c->cpuid_level < CPUID_MWAIT_LEAF ) { -@@ -667,8 +669,9 @@ static int acpi_processor_ffh_cstate_pro +@@ -662,8 +664,9 @@ static int acpi_processor_ffh_cstate_pro } cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx); @@ -37,7 +39,7 @@ Acked-by: Keir Fraser /* Check whether this particular cx_type (in CST) is supported or not */ cstate_type = (cx->reg.address >> MWAIT_SUBSTATE_SIZE) + 1; -@@ -676,15 +679,16 @@ static int acpi_processor_ffh_cstate_pro +@@ -671,15 +674,16 @@ static int acpi_processor_ffh_cstate_pro num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK; if ( num_cstate_subtype < (cx->reg.address & MWAIT_SUBSTATE_MASK) ) diff --git a/24124-x86-microcode-amd-quiesce.patch b/24124-x86-microcode-amd-quiesce.patch index 8d6ccc3..c338fef 100644 --- a/24124-x86-microcode-amd-quiesce.patch +++ b/24124-x86-microcode-amd-quiesce.patch @@ -12,8 +12,10 @@ Turn up the log level on various (mostly debug-only) messages. Signed-off-by: Jan Beulich Acked-by: Keir Fraser ---- a/xen/arch/x86/microcode_amd.c -+++ b/xen/arch/x86/microcode_amd.c +Index: xen-4.1.3-testing/xen/arch/x86/microcode_amd.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/microcode_amd.c ++++ xen-4.1.3-testing/xen/arch/x86/microcode_amd.c @@ -59,7 +59,7 @@ static int collect_cpu_info(int cpu, str rdmsrl(MSR_AMD_PATCHLEVEL, csig->rev); @@ -23,7 +25,7 @@ Acked-by: Keir Fraser csig->rev); return 0; -@@ -92,7 +92,7 @@ static int microcode_fits(void *mc, int +@@ -96,7 +96,7 @@ static int microcode_fits(const struct m if ( (mc_header->processor_rev_id) != equiv_cpu_id ) { @@ -32,31 +34,30 @@ Acked-by: Keir Fraser "(patch is %x, cpu base id is %x) \n", cpu, mc_header->processor_rev_id, equiv_cpu_id); return -EINVAL; -@@ -101,7 +101,7 @@ static int microcode_fits(void *mc, int +@@ -105,7 +105,7 @@ static int microcode_fits(const struct m if ( mc_header->patch_id <= uci->cpu_sig.rev ) - return -EINVAL; + return 0; - printk(KERN_INFO "microcode: CPU%d found a matching microcode " + printk(KERN_DEBUG "microcode: CPU%d found a matching microcode " "update with version 0x%x (current=0x%x)\n", cpu, mc_header->patch_id, uci->cpu_sig.rev); -@@ -139,8 +139,7 @@ static int apply_microcode(int cpu) +@@ -148,7 +148,7 @@ static int apply_microcode(int cpu) return -EIO; } - printk("microcode: CPU%d updated from revision " -- "0x%x to 0x%x \n", -+ printk(KERN_INFO "microcode: CPU%d updated from revision %#x to %#x\n", - cpu, uci->cpu_sig.rev, mc_amd->hdr.patch_id); ++ printk(KERN_INFO "microcode: CPU%d updated from revision " + "0x%x to 0x%x \n", + cpu, uci->cpu_sig.rev, hdr->patch_id); - uci->cpu_sig.rev = rev; -@@ -173,7 +172,7 @@ static int get_next_ucode_from_buffer_am +@@ -179,7 +179,7 @@ static int get_next_ucode_from_buffer_am + return -EINVAL; + } - total_size = (unsigned long) (bufp[off+4] + (bufp[off+5] << 8)); +- printk(KERN_INFO "microcode: size %lu, total_size %u, offset %ld\n", ++ printk(KERN_DEBUG "microcode: size %lu, total_size %u, offset %ld\n", + bufsize, mpbuf->len, off); -- printk(KERN_INFO "microcode: size %lu, total_size %lu, offset %ld\n", -+ printk(KERN_DEBUG "microcode: size %lu, total_size %lu, offset %ld\n", - (unsigned long)size, total_size, off); - - if ( (off + total_size) > size ) + if ( (off + mpbuf->len) > bufsize ) diff --git a/24137-revert-23666.patch b/24137-revert-23666.patch deleted file mode 100644 index 7bc0b91..0000000 --- a/24137-revert-23666.patch +++ /dev/null @@ -1,77 +0,0 @@ -# HG changeset patch -# User Andrew Cooper -# Date 1321035275 0 -# Node ID 0844b17df7a9dd885e98e505f14fc99c1951b483 -# Parent 3622d7fae14dfc2d00f378738ace3b65ee65b6cc -Revert c/s 23666:b96f8bdcaa15 KEXEC: disconnect all PCI devices from the PCI bus on crash - -It turns out that this causes all mannor of problems on certain -motherboards (so far with no pattern I can discern) - -Problems include: -* Hanging forever checking hlt instruction. -* Panics when trying to change switch root device -* Drivers hanging when trying to check for interrupts. - -From: Andrew Cooper -Signed-off-by: Keir Fraser -Committed-by: Keir Fraser - ---- a/xen/arch/x86/crash.c -+++ b/xen/arch/x86/crash.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - #include - - static atomic_t waiting_for_crash_ipi; -@@ -83,8 +82,6 @@ static void nmi_shootdown_cpus(void) - msecs--; - } - -- disconnect_pci_devices(); -- - /* Crash shutdown any IOMMU functionality as the crashdump kernel is not - * happy when booting if interrupt/dma remapping is still enabled */ - iommu_crash_shutdown(); ---- a/xen/drivers/passthrough/pci.c -+++ b/xen/drivers/passthrough/pci.c -@@ -518,25 +518,6 @@ int __init scan_pci_devices(void) - return 0; - } - --/* Disconnect all PCI devices from the PCI buses. From the PCI spec: -- * "When a 0 is written to [the COMMAND] register, the device is -- * logically disconnected from the PCI bus for all accesses except -- * configuration accesses. All devices are required to support -- * this base level of functionality." -- */ --void disconnect_pci_devices(void) --{ -- struct pci_dev *pdev; -- -- spin_lock(&pcidevs_lock); -- -- list_for_each_entry ( pdev, &alldevs_list, alldevs_list ) -- pci_conf_write16(pdev->bus, PCI_SLOT(pdev->devfn), -- PCI_FUNC(pdev->devfn), PCI_COMMAND, 0); -- -- spin_unlock(&pcidevs_lock); --} -- - #ifdef SUPPORT_MSI_REMAPPING - static void dump_pci_devices(unsigned char ch) - { ---- a/xen/include/xen/pci.h -+++ b/xen/include/xen/pci.h -@@ -94,8 +94,6 @@ int pci_remove_device(u8 bus, u8 devfn); - struct pci_dev *pci_get_pdev(int bus, int devfn); - struct pci_dev *pci_get_pdev_by_domain(struct domain *d, int bus, int devfn); - --void disconnect_pci_devices(void); -- - uint8_t pci_conf_read8( - unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg); - uint16_t pci_conf_read16( diff --git a/24144-cpufreq-turbo-crash.patch b/24144-cpufreq-turbo-crash.patch deleted file mode 100644 index 4991b63..0000000 --- a/24144-cpufreq-turbo-crash.patch +++ /dev/null @@ -1,95 +0,0 @@ -# HG changeset patch -# User Ian Campbell -# Date 1321363478 -3600 -# Node ID cd3ef25f207a3925f1f8650c227e24f839da13ad -# Parent 848049b14ec7fbd28bd4cd756e01609698b60c7a -xen: avoid crash enabling turbo mode - -On a system which has not had P-state information pushed down into the -hypervisor running "xenpm enable-turbo-mode" will reliably crash the host. - -(XEN) PM OP 38 on CPU0 -(XEN) ----[ Xen-4.2-unstable x86_64 debug=y Not tainted ]---- -(XEN) CPU: 0 -(XEN) RIP: e008:[] cpufreq_enable_turbo+0x1d/0x29 -(XEN) RFLAGS: 0000000000010297 CONTEXT: hypervisor -(XEN) rax: 0000000000000000 rbx: ffff82c48029fe40 rcx: 0000000000000000 -(XEN) rdx: 0000000000000000 rsi: 000000000000000a rdi: 0000000000000000 -(XEN) rbp: ffff82c48029fd08 rsp: ffff82c48029fd08 r8: 0000000000000004 -(XEN) r9: 0000000000000000 r10: 00000000fffffffd r11: ffff82c480218f20 -(XEN) r12: ffff830106e720b0 r13: 0000000000000000 r14: ffff82c4802bff80 -(XEN) r15: ffff82c48025c0e4 cr0: 000000008005003b cr4: 00000000000026f0 -(XEN) cr3: 000000011f459000 cr2: 0000000000000051 -(XEN) ds: 007b es: 007b fs: 00d8 gs: 0033 ss: 0000 cs: e008 -(XEN) Xen stack trace from rsp=ffff82c48029fd08: -(XEN) ffff82c48029fdb8 ffff82c48014c427 ffff82c48029fd98 ffff82c48016b2d6 -(XEN) ffff82c48029fdb8 ffff82c48029fd60 00000000001196c5 0000000116bbe025 -(XEN) 0000000116bbe025 ffff8301196c5338 ffff82f6022d77c0 0000000000000000 -(XEN) ffff82f60205edf0 0000000000000000 0000000000000000 ffff8300dffba000 -(XEN) ffff82c48029fdb8 ffff82c48029ff18 0000000008050004 0000000000000000 -(XEN) ffff82c4802bff80 ffff82c48025c0e4 ffff82c48029fef8 ffff82c480124fd8 -(XEN) 0000000000000000 ffff83011f48c000 0000000116bbe025 0000000000000025 -(XEN) ffff82c48029fe28 0000000080167722 ffff82c48029ff08 ffff83011f48c000 -(XEN) ffff82f60232d8a0 ffff8300dffba000 ffff83011f48c000 ffff82f60232d8a0 -(XEN) ffff82c48029fed8 ffff82c48017296a 000000080000000c 0000000000000026 -(XEN) bfb338b000000000 bfb33874bfb33868 b78988f800000000 0000008800000000 -(XEN) b787a6e0b78533a0 ffffffff00000001 080487aeb7897ff4 bfb3389000000001 -(XEN) b7898ab0b7889626 0000000100000000 0000000000000001 0804867800000001 -(XEN) 000000000804e998 00000000b78533a0 bfb33e70bfb33a7c 0000000000000000 -(XEN) 0000000000000000 ffff8300dffba000 0000000000000000 0000000000000000 -(XEN) 0000000000000000 0000000000000000 00007d3b7fd600c7 ffff82c48021511e -(XEN) 00000000c1002467 0000000000000023 0000000000000000 0000000000000000 -(XEN) 0000000000000000 0000000000000000 00000000dbf5bef8 0000000008050004 -(XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000 -(XEN) 0000000000000023 00000000bfb33874 00000000bfb33868 0000000000000000 -(XEN) Xen call trace: -(XEN) [] cpufreq_enable_turbo+0x1d/0x29 -(XEN) [] do_pm_op+0x884/0x8e7 -(XEN) [] do_sysctl+0x6d8/0x9f0 -(XEN) [] compat_hypercall+0xae/0x107 -(XEN) -(XEN) Pagetable walk from 0000000000000051: -(XEN) L4[0x000] = 0000000116dbc027 000000000001bd22 -(XEN) L3[0x000] = 0000000119ba8027 000000000001eb36 -(XEN) L2[0x000] = 0000000000000000 ffffffffffffffff -(XEN) -(XEN) **************************************** -(XEN) Panic on CPU 0: -(XEN) FATAL PAGE FAULT -(XEN) [error_code=0000] -(XEN) Faulting linear address: 0000000000000051 -(XEN) **************************************** -(XEN) - -Signed-off-by: Ian Campbell -Committed-by: Jan Beulich - ---- a/xen/drivers/cpufreq/utility.c -+++ b/xen/drivers/cpufreq/utility.c -@@ -400,7 +400,7 @@ void cpufreq_enable_turbo(int cpuid) - struct cpufreq_policy *policy; - - policy = per_cpu(cpufreq_cpu_policy, cpuid); -- if (policy->turbo != CPUFREQ_TURBO_UNSUPPORTED) -+ if (policy && policy->turbo != CPUFREQ_TURBO_UNSUPPORTED) - policy->turbo = CPUFREQ_TURBO_ENABLED; - } - -@@ -409,7 +409,7 @@ void cpufreq_disable_turbo(int cpuid) - struct cpufreq_policy *policy; - - policy = per_cpu(cpufreq_cpu_policy, cpuid); -- if (policy->turbo != CPUFREQ_TURBO_UNSUPPORTED) -+ if (policy && policy->turbo != CPUFREQ_TURBO_UNSUPPORTED) - policy->turbo = CPUFREQ_TURBO_DISABLED; - } - -@@ -418,7 +418,7 @@ int cpufreq_get_turbo_status(int cpuid) - struct cpufreq_policy *policy; - - policy = per_cpu(cpufreq_cpu_policy, cpuid); -- return policy->turbo; -+ return policy && policy->turbo; - } - - /********************************************************************* diff --git a/24148-shadow-pgt-dying-op-performance.patch b/24148-shadow-pgt-dying-op-performance.patch deleted file mode 100644 index f73a4ed..0000000 --- a/24148-shadow-pgt-dying-op-performance.patch +++ /dev/null @@ -1,29 +0,0 @@ -References: bnc#726332 - -# HG changeset patch -# User Gianluca Guida -# Date 1321456773 0 -# Node ID 3ecc8fef428138e4304ef11b47498981e63626b3 -# Parent a5f1d3b1612bb48e1cb09dc66b0909e3613dc855 -[shadow] Disable higher level pagetables early unshadow only when the "process dying" hypercall is used. - -This patch fixes a performance problem in fully virtualized guests. - -Signed-off-by: Gianluca Guida -Tested-by: Jan Beulich -Committed-by: Keir Fraser - ---- a/xen/arch/x86/mm/shadow/multi.c -+++ b/xen/arch/x86/mm/shadow/multi.c -@@ -2743,8 +2743,9 @@ static inline void check_for_early_unsha - || ( !v->domain->arch.paging.shadow.pagetable_dying_op - && v->arch.paging.shadow.last_emulated_mfn_for_unshadow == mfn_x(gmfn) ) ) - && sh_mfn_is_a_page_table(gmfn) -- && !(mfn_to_page(gmfn)->shadow_flags -- & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64)) ) -+ && (!v->domain->arch.paging.shadow.pagetable_dying_op || -+ !(mfn_to_page(gmfn)->shadow_flags -+ & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64))) ) - { - perfc_incr(shadow_early_unshadow); - sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ ); diff --git a/24153-x86-emul-feature-checks.patch b/24153-x86-emul-feature-checks.patch index 7126f25..6bf0b9a 100644 --- a/24153-x86-emul-feature-checks.patch +++ b/24153-x86-emul-feature-checks.patch @@ -14,8 +14,10 @@ movnti, and cmpxchg16b. Signed-off-by: Jan Beulich Signed-off-by: Keir Fraser ---- a/xen/arch/x86/x86_emulate/x86_emulate.c -+++ b/xen/arch/x86/x86_emulate/x86_emulate.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_emulate/x86_emulate.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_emulate/x86_emulate.c @@ -955,6 +955,47 @@ in_protmode( return !(in_realmode(ctxt, ops) || (ctxt->regs->eflags & EFLG_VM)); } @@ -64,7 +66,7 @@ Signed-off-by: Keir Fraser static int in_longmode( struct x86_emulate_ctxt *ctxt, -@@ -2738,6 +2779,7 @@ x86_emulate( +@@ -2741,6 +2782,7 @@ x86_emulate( emulate_fpu_insn_memsrc("fildl", src.val); break; case 1: /* fisttp m32i */ @@ -72,7 +74,7 @@ Signed-off-by: Keir Fraser ea.bytes = 4; dst = ea; dst.type = OP_MEM; -@@ -2846,6 +2888,7 @@ x86_emulate( +@@ -2849,6 +2891,7 @@ x86_emulate( emulate_fpu_insn_memsrc("fldl", src.val); break; case 1: /* fisttp m64i */ @@ -80,7 +82,7 @@ Signed-off-by: Keir Fraser ea.bytes = 8; dst = ea; dst.type = OP_MEM; -@@ -2953,6 +2996,7 @@ x86_emulate( +@@ -2956,6 +2999,7 @@ x86_emulate( emulate_fpu_insn_memsrc("fild", src.val); break; case 1: /* fisttp m16i */ @@ -88,7 +90,7 @@ Signed-off-by: Keir Fraser ea.bytes = 2; dst = ea; dst.type = OP_MEM; -@@ -4141,6 +4185,7 @@ x86_emulate( +@@ -4144,6 +4188,7 @@ x86_emulate( case 0xc3: /* movnti */ /* Ignore the non-temporal hint for now. */ @@ -96,7 +98,7 @@ Signed-off-by: Keir Fraser generate_exception_if(dst.bytes <= 2, EXC_UD, -1); dst.val = src.val; break; -@@ -4151,6 +4196,8 @@ x86_emulate( +@@ -4154,6 +4199,8 @@ x86_emulate( generate_exception_if((modrm_reg & 7) != 1, EXC_UD, -1); generate_exception_if(ea.type != OP_MEM, EXC_UD, -1); diff --git a/24155-x86-ioapic-EOI-after-migration.patch b/24155-x86-ioapic-EOI-after-migration.patch deleted file mode 100644 index ee5e966..0000000 --- a/24155-x86-ioapic-EOI-after-migration.patch +++ /dev/null @@ -1,130 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1321604321 -3600 -# Node ID 0d50e704834fb53c6c86b8b0badd19d88e73c4ed -# Parent dbdc840f8f62db58321b5009e5e0f7833066386f -x86/IO-APIC: refine EOI-ing of migrating level interrupts - -Rather than going through all IO-APICs and calling io_apic_eoi_vector() -for the vector in question, just use eoi_IO_APIC_irq(). - -This in turn allows to eliminate quite a bit of other code. - -Signed-off-by: Jan Beulich -Tested-by: Andrew Cooper -Acked-by: Andrew Cooper - ---- a/xen/arch/x86/io_apic.c -+++ b/xen/arch/x86/io_apic.c -@@ -69,10 +69,6 @@ int __read_mostly nr_ioapics; - - #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20) - --#define io_apic_eoi_vector(apic, vector) io_apic_eoi((apic), (vector), -1) --#define io_apic_eoi_pin(apic, pin) io_apic_eoi((apic), -1, (pin)) -- -- - /* - * This is performance-critical, we want to do it O(1) - * -@@ -208,21 +204,18 @@ static void ioapic_write_entry(int apic, - spin_unlock_irqrestore(&ioapic_lock, flags); - } - --/* EOI an IO-APIC entry. One of vector or pin may be -1, indicating that -- * it should be worked out using the other. This function expect that the -- * ioapic_lock is taken, and interrupts are disabled (or there is a good reason -- * not to), and that if both pin and vector are passed, that they refer to the -+/* EOI an IO-APIC entry. Vector may be zero, indicating that it should be -+ * worked out using the pin. This function expects that the ioapic_lock is -+ * being held, and interrupts are disabled (or there is a good reason not -+ * to), and that if both pin and vector are passed, that they refer to the - * same redirection entry in the IO-APIC. */ - static void __io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin) - { -- /* Ensure some useful information is passed in */ -- BUG_ON( (vector == -1 && pin == -1) ); -- - /* Prefer the use of the EOI register if available */ - if ( ioapic_has_eoi_reg(apic) ) - { - /* If vector is unknown, read it from the IO-APIC */ -- if ( vector == -1 ) -+ if ( !vector ) - vector = __ioapic_read_entry(apic, pin, TRUE).vector; - - *(IO_APIC_BASE(apic)+16) = vector; -@@ -234,42 +227,6 @@ static void __io_apic_eoi(unsigned int a - struct IO_APIC_route_entry entry; - bool_t need_to_unmask = 0; - -- /* If pin is unknown, search for it */ -- if ( pin == -1 ) -- { -- unsigned int p; -- for ( p = 0; p < nr_ioapic_registers[apic]; ++p ) -- { -- entry = __ioapic_read_entry(apic, p, TRUE); -- if ( entry.vector == vector ) -- { -- pin = p; -- /* break; */ -- -- /* Here should be a break out of the loop, but at the -- * Xen code doesn't actually prevent multiple IO-APIC -- * entries being assigned the same vector, so EOI all -- * pins which have the correct vector. -- * -- * Remove the following code when the above assertion -- * is fulfilled. */ -- __io_apic_eoi(apic, vector, p); -- } -- } -- -- /* If search fails, nothing to do */ -- -- /* if ( pin == -1 ) */ -- -- /* Because the loop wasn't broken out of (see comment above), -- * all relevant pins have been EOI, so we can always return. -- * -- * Re-instate the if statement above when the Xen logic has been -- * fixed.*/ -- -- return; -- } -- - entry = __ioapic_read_entry(apic, pin, TRUE); - - if ( ! entry.mask ) -@@ -296,17 +253,6 @@ static void __io_apic_eoi(unsigned int a - } - } - --/* EOI an IO-APIC entry. One of vector or pin may be -1, indicating that -- * it should be worked out using the other. This function disables interrupts -- * and takes the ioapic_lock */ --static void io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin) --{ -- unsigned int flags; -- spin_lock_irqsave(&ioapic_lock, flags); -- __io_apic_eoi(apic, vector, pin); -- spin_unlock_irqrestore(&ioapic_lock, flags); --} -- - /* - * Saves all the IO-APIC RTE's - */ -@@ -1830,11 +1776,7 @@ static void end_level_ioapic_irq (unsign - - /* Manually EOI the old vector if we are moving to the new */ - if ( vector && i != vector ) -- { -- int ioapic; -- for (ioapic = 0; ioapic < nr_ioapics; ioapic++) -- io_apic_eoi_vector(ioapic, i); -- } -+ eoi_IO_APIC_irq(irq); - - v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1)); - diff --git a/24156-x86-ioapic-shared-vectors.patch b/24156-x86-ioapic-shared-vectors.patch deleted file mode 100644 index 793c751..0000000 --- a/24156-x86-ioapic-shared-vectors.patch +++ /dev/null @@ -1,159 +0,0 @@ -References: bnc#713503 - -# HG changeset patch -# User Jan Beulich -# Date 1321604484 -3600 -# Node ID f29b5bd6e25fd78409baa5461914c67065f7579f -# Parent 0d50e704834fb53c6c86b8b0badd19d88e73c4ed -x86/IRQ: prevent vector sharing within IO-APICs - -Following the prevention of vector sharing for MSIs, this change -enforces the same within IO-APICs: Pin based interrupts use the IO-APIC -as their identifying device under the AMD IOMMU (and just like for -MSIs, only the identifying device is used to remap interrupts here, -with no regard to an interrupt's destination). - -Additionally, LAPIC initiated EOIs (for level triggered interrupts) too -use only the vector for identifying which interrupts to end. While this -generally causes no significant problem (at worst an interrupt would be -re-raised without a new interrupt event actually having occurred), it -still seems better to avoid the situation. - -For this second aspect, a distinction is being made between the -traditional and the directed-EOI cases: In the former, vectors should -not be shared throughout all IO-APICs in the system, while in the -latter case only individual IO-APICs need to be contrained (or, if the -firmware indicates so, sub- groups of them having the same GSI appear -at multiple pins). - -Signed-off-by: Jan Beulich -Acked-by: Andrew Cooper - ---- a/xen/arch/x86/io_apic.c -+++ b/xen/arch/x86/io_apic.c -@@ -69,6 +69,34 @@ int __read_mostly nr_ioapics; - - #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20) - -+static int apic_pin_2_gsi_irq(int apic, int pin); -+ -+static vmask_t *__read_mostly vector_map[MAX_IO_APICS]; -+ -+static void share_vector_maps(unsigned int src, unsigned int dst) -+{ -+ unsigned int pin; -+ -+ if (vector_map[src] == vector_map[dst]) -+ return; -+ -+ bitmap_or(vector_map[src]->_bits, vector_map[src]->_bits, -+ vector_map[dst]->_bits, NR_VECTORS); -+ -+ for (pin = 0; pin < nr_ioapic_registers[dst]; ++pin) { -+ int irq = apic_pin_2_gsi_irq(dst, pin); -+ struct irq_cfg *cfg; -+ -+ if (irq < 0) -+ continue; -+ cfg = irq_cfg(irq); -+ if (cfg->used_vectors == vector_map[dst]) -+ cfg->used_vectors = vector_map[src]; -+ } -+ -+ vector_map[dst] = vector_map[src]; -+} -+ - /* - * This is performance-critical, we want to do it O(1) - * -@@ -109,6 +137,7 @@ static void add_pin_to_irq(unsigned int - } - entry->apic = apic; - entry->pin = pin; -+ share_vector_maps(irq_2_pin[irq].apic, apic); - } - - /* -@@ -124,6 +153,7 @@ static void __init replace_pin_at_irq(un - if (entry->apic == oldapic && entry->pin == oldpin) { - entry->apic = newapic; - entry->pin = newpin; -+ share_vector_maps(oldapic, newapic); - } - if (!entry->next) - break; -@@ -131,6 +161,16 @@ static void __init replace_pin_at_irq(un - } - } - -+vmask_t *io_apic_get_used_vector_map(unsigned int irq) -+{ -+ struct irq_pin_list *entry = irq_2_pin + irq; -+ -+ if (entry->pin == -1) -+ return NULL; -+ -+ return vector_map[entry->apic]; -+} -+ - struct IO_APIC_route_entry **alloc_ioapic_entries(void) - { - int apic; -@@ -1314,6 +1354,18 @@ static void __init enable_IO_APIC(void) - for (i = irq_2_pin_free_entry = nr_irqs_gsi; i < PIN_MAP_SIZE; i++) - irq_2_pin[i].next = i + 1; - -+ if (directed_eoi_enabled) { -+ for (apic = 0; apic < nr_ioapics; apic++) { -+ vector_map[apic] = xzalloc(vmask_t); -+ BUG_ON(!vector_map[apic]); -+ } -+ } else { -+ vector_map[0] = xzalloc(vmask_t); -+ BUG_ON(!vector_map[0]); -+ for (apic = 1; apic < nr_ioapics; apic++) -+ vector_map[apic] = vector_map[0]; -+ } -+ - for(apic = 0; apic < nr_ioapics; apic++) { - int pin; - /* See if any of the pins is in ExtINT mode */ -@@ -2479,13 +2531,12 @@ int ioapic_guest_write(unsigned long phy - } - - if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) { -+ add_pin_to_irq(irq, apic, pin); - vector = assign_irq_vector(irq); - if ( vector < 0 ) - return vector; - - printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq); -- -- add_pin_to_irq(irq, apic, pin); - } - spin_lock(&pcidevs_lock); - spin_lock(&dom0->event_lock); ---- a/xen/arch/x86/irq.c -+++ b/xen/arch/x86/irq.c -@@ -403,6 +403,11 @@ static vmask_t *irq_get_used_vector_mask - } - } - } -+ else if ( IO_APIC_IRQ(irq) && -+ opt_irq_vector_map != OPT_IRQ_VECTOR_MAP_NONE ) -+ { -+ ret = io_apic_get_used_vector_map(irq); -+ } - - return ret; - } ---- a/xen/include/asm-x86/irq.h -+++ b/xen/include/asm-x86/irq.h -@@ -113,6 +113,7 @@ void setup_IO_APIC(void); - void disable_IO_APIC(void); - void print_IO_APIC(void); - void setup_ioapic_dest(void); -+vmask_t *io_apic_get_used_vector_map(unsigned int irq); - - extern unsigned long io_apic_irqs; - diff --git a/24157-x86-xstate-init.patch b/24157-x86-xstate-init.patch deleted file mode 100644 index e1e0170..0000000 --- a/24157-x86-xstate-init.patch +++ /dev/null @@ -1,96 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1321604565 -3600 -# Node ID 7b5e1cb94bfa43a9268479b9a255fb88c07e4ce2 -# Parent f29b5bd6e25fd78409baa5461914c67065f7579f -x86/xsave: provide guests with finit-like environment - -Without the use of xsave, guests get their initial floating point -environment set up with finit. At least NetWare actually depends on -this (in particular on all exceptions being masked), so to be -consistent set the same environment also when using xsave. This is -also in line with all SSE exceptions getting masked initially. - -To avoid further fragile casts in xstate_alloc_save_area() the patch -also changes xsave_struct's fpu_see member to have actually usable -fields. - -The patch was tested in its technically identical, but modified-file- -wise different 4.1.2 version. - -Signed-off-by: Jan Beulich -Tested-by: Charles Arnold -Acked-by: Keir Fraser - ---- a/xen/arch/x86/i387.c -+++ b/xen/arch/x86/i387.c -@@ -92,11 +92,14 @@ void setup_fpu(struct vcpu *v) - v->fpu_dirtied = 1; - } - -+#define FCW_DEFAULT 0x037f -+#define MXCSR_DEFAULT 0x1f80 -+ - static void init_fpu(void) - { - asm volatile ( "fninit" ); - if ( cpu_has_xmm ) -- load_mxcsr(0x1f80); -+ load_mxcsr(MXCSR_DEFAULT); - } - - void save_init_fpu(struct vcpu *v) -@@ -287,7 +290,7 @@ void xsave_init(void) - - int xsave_alloc_save_area(struct vcpu *v) - { -- void *save_area; -+ struct xsave_struct *save_area; - - if ( !cpu_has_xsave || is_idle_vcpu(v) ) - return 0; -@@ -300,8 +303,9 @@ int xsave_alloc_save_area(struct vcpu *v - return -ENOMEM; - - memset(save_area, 0, xsave_cntxt_size); -- ((u32 *)save_area)[6] = 0x1f80; /* MXCSR */ -- *(uint64_t *)(save_area + 512) = XSTATE_FP_SSE; /* XSETBV */ -+ save_area->fpu_sse.fcw = FCW_DEFAULT; -+ save_area->fpu_sse.mxcsr = MXCSR_DEFAULT; -+ save_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE; - - v->arch.xsave_area = save_area; - v->arch.xcr0 = XSTATE_FP_SSE; ---- a/xen/include/asm-x86/i387.h -+++ b/xen/include/asm-x86/i387.h -@@ -37,7 +37,29 @@ bool_t xsave_enabled(const struct vcpu * - - struct xsave_struct - { -- struct { char x[512]; } fpu_sse; /* FPU/MMX, SSE */ -+ union { /* FPU/MMX, SSE */ -+ char x[512]; -+ struct { -+ uint16_t fcw; -+ uint16_t fsw; -+ uint8_t ftw; -+ uint8_t rsvd1; -+ uint16_t fop; -+ union { -+#ifdef __x86_64__ -+ uint64_t addr; -+#endif -+ struct { -+ uint32_t offs; -+ uint16_t sel; -+ uint16_t rsvd; -+ }; -+ } fip, fdp; -+ uint32_t mxcsr; -+ uint32_t mxcsr_mask; -+ /* data registers follow here */ -+ }; -+ } fpu_sse; - - struct { - u64 xstate_bv; diff --git a/24168-x86-vioapic-clear-remote_irr.patch b/24168-x86-vioapic-clear-remote_irr.patch deleted file mode 100644 index a2b9c6d..0000000 --- a/24168-x86-vioapic-clear-remote_irr.patch +++ /dev/null @@ -1,30 +0,0 @@ -References: bnc#694863 - -# HG changeset patch -# User Jan Beulich -# Date 1321864171 -3600 -# Node ID 9c350ab8d3ea64866421de756ab2bf3daaf63187 -# Parent 335e8273a3f34a5e2972643a028f83684609f1c1 -x86/vioapic: clear remote IRR when switching RTE to edge triggered mode - -Xen itself (as much as Linux) relies on this behavior, so it should -also emulate it properly. Not doing so reportedly gets in the way of -kexec inside a HVM guest. - -Signed-off-by: Jan Beulich -Tested-by: Olaf Hering - ---- a/xen/arch/x86/hvm/vioapic.c -+++ b/xen/arch/x86/hvm/vioapic.c -@@ -154,8 +154,9 @@ static void vioapic_write_redirent( - { - vlapic_adjust_i8259_target(d); - } -- else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) && -- !ent.fields.mask && -+ else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG ) -+ pent->fields.remote_irr = 0; -+ else if ( !ent.fields.mask && - !ent.fields.remote_irr && - hvm_irq->gsi_assert_count[idx] ) - { diff --git a/24189-x86-p2m-pod-locking.patch b/24189-x86-p2m-pod-locking.patch deleted file mode 100644 index dfc25ab..0000000 --- a/24189-x86-p2m-pod-locking.patch +++ /dev/null @@ -1,50 +0,0 @@ -# HG changeset patch -# User Andres Lagar-Cavilla -# Date 1322148057 0 -# Node ID 7da681c490e0a8a2b3f1fb311d254dc7ce618a43 -# Parent b082fdc52ad7607d93b59148fb289aafe21f294b -x86/mm/p2m: fix pod locking - -The path p2m-lookup -> p2m-pt->get_entry -> 1GB PoD superpage -> -pod_demand_populate ends in the pod code performing a p2m_set_entry with -no locks held (in order to split the 1GB superpage into 512 2MB ones) - -Further, it calls p2m_unlock after that, which will break the spinlock. - -This patch attempts to fix that. - -Signed-off-by: Andres Lagar-Cavilla -Acked-by: George Dunlap -Acked-by: Tim Deegan -Committed-by: Tim Deegan - ---- a/xen/arch/x86/mm/p2m.c -+++ b/xen/arch/x86/mm/p2m.c -@@ -1244,7 +1244,6 @@ p2m_pod_demand_populate(struct p2m_domai - set_p2m_entry(p2m, gfn_aligned, _mfn(POPULATE_ON_DEMAND_MFN), 9, - p2m_populate_on_demand, p2m->default_access); - audit_p2m(p2m, 1); -- p2m_unlock(p2m); - return 0; - } - -@@ -1602,7 +1601,8 @@ pod_retry_l3: - { - if ( q != p2m_query ) - { -- if ( !p2m_pod_demand_populate(p2m, gfn, 18, q) ) -+ if ( !p2m_pod_check_and_populate(p2m, gfn, -+ (l1_pgentry_t *) &l3e, 18, q) ) - goto pod_retry_l3; - } - else -@@ -1733,7 +1733,8 @@ static mfn_t p2m_gfn_to_mfn_current(stru - /* The read has succeeded, so we know that mapping exists */ - if ( q != p2m_query ) - { -- if ( !p2m_pod_demand_populate(p2m, gfn, 18, q) ) -+ if ( !p2m_pod_check_and_populate(p2m, gfn, -+ (l1_pgentry_t *) &l3e, 18, q) ) - goto pod_retry_l3; - p2mt = p2m_invalid; - printk("%s: Allocate 1GB failed!\n", __func__); diff --git a/24190-hap-log-dirty-disable-rc.patch b/24190-hap-log-dirty-disable-rc.patch deleted file mode 100644 index 2b1e173..0000000 --- a/24190-hap-log-dirty-disable-rc.patch +++ /dev/null @@ -1,25 +0,0 @@ -# HG changeset patch -# User Andres Lagar-Cavilla -# Date 1322148057 0 -# Node ID 6b3d8250ee2c63d90680c142549123a4b1559f55 -# Parent 7da681c490e0a8a2b3f1fb311d254dc7ce618a43 -x86/mm: change return code for log-dirty disabling - -Disabling log dirty mode in HAP always returns -EINVAL. Make it -return the correct rc on success. - -Signed-off-by: Andres Lagar-Cavilla -Signed-off-by: Tim Deegan -Committed-by: Tim Deegan - ---- a/xen/arch/x86/mm/hap/hap.c -+++ b/xen/arch/x86/mm/hap/hap.c -@@ -710,6 +710,8 @@ int hap_domctl(struct domain *d, xen_dom - return rc; - case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION: - sc->mb = hap_get_allocation(d); -+ /* Fall through... */ -+ case XEN_DOMCTL_SHADOW_OP_OFF: - return 0; - default: - HAP_ERROR("Bad hap domctl op %u\n", sc->op); diff --git a/24193-hap-track-dirty-vram-rc.patch b/24193-hap-track-dirty-vram-rc.patch deleted file mode 100644 index ef1b068..0000000 --- a/24193-hap-track-dirty-vram-rc.patch +++ /dev/null @@ -1,21 +0,0 @@ -# HG changeset patch -# User Andres Lagar-Cavilla -# Date 1322149491 0 -# Node ID 67d2ac426defedad9c10eb339019f9dc9f02d2ae -# Parent 3c864e04c2ad060ca1cac6579994777993fef6e6 -Trivial fix for rc val in hap track dirty vram - -Signed-off-by: Andres Lagar-Cavilla -Committed-by: Keir Fraser - ---- a/xen/arch/x86/mm/hap/hap.c -+++ b/xen/arch/x86/mm/hap/hap.c -@@ -143,7 +143,7 @@ int hap_track_dirty_vram(struct domain * - } - else if ( !paging_mode_log_dirty(d) && !dirty_vram ) - { -- rc -ENOMEM; -+ rc = -ENOMEM; - if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL ) - goto param_fail; - diff --git a/24201-x86-pcpu-platform-op.patch b/24201-x86-pcpu-platform-op.patch deleted file mode 100644 index 7865d57..0000000 --- a/24201-x86-pcpu-platform-op.patch +++ /dev/null @@ -1,64 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1322153786 -3600 -# Node ID 9c6bea25f71233787a36893deaf0e811f2dcb8d8 -# Parent 480531cab3f4468b1ec9b549bc84d66e420ce685 -x86: small fixes to pcpu platform op handling - -XENPF_get_cpuinfo should init the flags output field rather than only -modify it. - -XENPF_cpu_online must check for the input CPU number to be in range. - -XENPF_cpu_offline must also do that, and should also reject attempts to -offline CPU 0 (this fails in cpu_down() too, but preventing this here -appears more correct given that the code here calls -continue_hypercall_on_cpu(0, ...), which would be flawed if cpu_down() -would ever allow bringing down CPU 0 (and a distinct error code is -easier to deal with when debugging issues). - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/x86/platform_hypercall.c -+++ b/xen/arch/x86/platform_hypercall.c -@@ -449,13 +449,14 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe - if ( (g_info->xen_cpuid >= NR_CPUS) || - !cpu_present(g_info->xen_cpuid) ) - { -- g_info->flags |= XEN_PCPU_FLAGS_INVALID; -+ g_info->flags = XEN_PCPU_FLAGS_INVALID; - } - else - { - g_info->apic_id = x86_cpu_to_apicid[g_info->xen_cpuid]; - g_info->acpi_id = acpi_get_processor_id(g_info->xen_cpuid); - ASSERT(g_info->apic_id != BAD_APICID); -+ g_info->flags = 0; - if (cpu_online(g_info->xen_cpuid)) - g_info->flags |= XEN_PCPU_FLAGS_ONLINE; - } -@@ -472,7 +473,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe - { - int cpu = op->u.cpu_ol.cpuid; - -- if ( !cpu_present(cpu) ) -+ if ( cpu >= NR_CPUS || !cpu_present(cpu) ) - { - ret = -EINVAL; - break; -@@ -493,7 +494,13 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe - { - int cpu = op->u.cpu_ol.cpuid; - -- if ( !cpu_present(cpu) ) -+ if ( cpu == 0 ) -+ { -+ ret = -EOPNOTSUPP; -+ break; -+ } -+ -+ if ( cpu >= NR_CPUS || !cpu_present(cpu) ) - { - ret = -EINVAL; - break; diff --git a/24222-xenpaging_use_guests_tot_pages_as_working_target.patch b/24222-xenpaging_use_guests_tot_pages_as_working_target.patch index 4978381..aba5952 100644 --- a/24222-xenpaging_use_guests_tot_pages_as_working_target.patch +++ b/24222-xenpaging_use_guests_tot_pages_as_working_target.patch @@ -19,10 +19,10 @@ Committed-by: Ian Jackson tools/xenpaging/xenpaging.h | 2 - 3 files changed, 61 insertions(+), 20 deletions(-) -Index: xen-4.1.2-testing/tools/xenpaging/policy_default.c +Index: xen-4.1.3-testing/tools/xenpaging/policy_default.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/policy_default.c -+++ xen-4.1.2-testing/tools/xenpaging/policy_default.c +--- xen-4.1.3-testing.orig/tools/xenpaging/policy_default.c ++++ xen-4.1.3-testing/tools/xenpaging/policy_default.c @@ -71,7 +71,6 @@ int policy_init(xenpaging_t *paging) /* Start in the middle to avoid paging during BIOS startup */ @@ -31,10 +31,10 @@ Index: xen-4.1.2-testing/tools/xenpaging/policy_default.c rc = 0; out: -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.c ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.c @@ -136,6 +136,21 @@ err: return rc; } @@ -177,10 +177,10 @@ Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c } DPRINTF("xenpaging got signal %d\n", interrupted); -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.h =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.h ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.h @@ -50,7 +50,7 @@ typedef struct xenpaging { /* number of pages for which data structures were allocated */ int max_pages; diff --git a/24261-x86-cpuidle-Westmere-EX.patch b/24261-x86-cpuidle-Westmere-EX.patch deleted file mode 100644 index 337a00c..0000000 --- a/24261-x86-cpuidle-Westmere-EX.patch +++ /dev/null @@ -1,23 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1322645021 -3600 -# Node ID 64088ba60263d3a623851b43a872c93c71cc3cbf -# Parent df7cec2c6c03f07932555954948ce7c8d09e88f4 -x86/cpuidle: add Westmere-EX support to hw residencies reading logic - -This is in accordance with -http://software.intel.com/en-us/articles/intel-processor-identification-with-cpuid-model-and-family-numbers/ - -Signed-off-by: Jan Beulich -Acked-by: Haitao Shan - ---- a/xen/arch/x86/acpi/cpu_idle.c -+++ b/xen/arch/x86/acpi/cpu_idle.c -@@ -113,6 +113,7 @@ static void do_get_hw_residencies(void * - /* Westmere */ - case 0x25: - case 0x2C: -+ case 0x2F: - GET_PC3_RES(hw_res->pc3); - GET_PC6_RES(hw_res->pc6); - GET_PC7_RES(hw_res->pc7); diff --git a/24269-mem_event_move_mem_event_domain_out_of_struct_domain.patch b/24269-mem_event_move_mem_event_domain_out_of_struct_domain.patch index 5fa7cf0..d3e9e43 100644 --- a/24269-mem_event_move_mem_event_domain_out_of_struct_domain.patch +++ b/24269-mem_event_move_mem_event_domain_out_of_struct_domain.patch @@ -25,9 +25,11 @@ Committed-by: Keir Fraser xen/include/xen/sched.h | 18 ++++++++++++------ 6 files changed, 34 insertions(+), 23 deletions(-) ---- a/xen/arch/x86/hvm/hvm.c -+++ b/xen/arch/x86/hvm/hvm.c -@@ -3909,7 +3909,7 @@ static int hvm_memory_event_traps(long p +Index: xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +@@ -3920,7 +3920,7 @@ static int hvm_memory_event_traps(long p if ( (p & HVMPME_onchangeonly) && (value == old) ) return 1; @@ -36,7 +38,7 @@ Committed-by: Keir Fraser if ( rc ) return rc; -@@ -3932,7 +3932,7 @@ static int hvm_memory_event_traps(long p +@@ -3943,7 +3943,7 @@ static int hvm_memory_event_traps(long p req.gla_valid = 1; } @@ -45,8 +47,10 @@ Committed-by: Keir Fraser return 1; } ---- a/xen/arch/x86/mm/mem_event.c -+++ b/xen/arch/x86/mm/mem_event.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_event.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c @@ -252,7 +252,7 @@ int mem_event_domctl(struct domain *d, x { case XEN_DOMCTL_MEM_EVENT_OP_PAGING: @@ -74,8 +78,10 @@ Committed-by: Keir Fraser } break; ---- a/xen/arch/x86/mm/mem_sharing.c -+++ b/xen/arch/x86/mm/mem_sharing.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_sharing.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c @@ -322,12 +322,12 @@ static struct page_info* mem_sharing_all req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED; } @@ -100,9 +106,11 @@ Committed-by: Keir Fraser /* Unpause domain/vcpu */ if( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) ---- a/xen/arch/x86/mm/p2m.c -+++ b/xen/arch/x86/mm/p2m.c -@@ -2996,7 +2996,7 @@ void p2m_mem_paging_drop_page(struct p2m +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2998,7 +2998,7 @@ void p2m_mem_paging_drop_page(struct p2m struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ @@ -111,7 +119,7 @@ Committed-by: Keir Fraser { /* Send release notification to pager */ memset(&req, 0, sizeof(req)); -@@ -3004,7 +3004,7 @@ void p2m_mem_paging_drop_page(struct p2m +@@ -3006,7 +3006,7 @@ void p2m_mem_paging_drop_page(struct p2m req.gfn = gfn; req.vcpu_id = v->vcpu_id; @@ -120,7 +128,7 @@ Committed-by: Keir Fraser } } -@@ -3039,7 +3039,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3041,7 +3041,7 @@ void p2m_mem_paging_populate(struct p2m_ struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ @@ -129,7 +137,7 @@ Committed-by: Keir Fraser return; memset(&req, 0, sizeof(req)); -@@ -3070,7 +3070,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3072,7 +3072,7 @@ void p2m_mem_paging_populate(struct p2m_ else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged ) { /* gfn is already on its way back and vcpu is not paused */ @@ -138,7 +146,7 @@ Committed-by: Keir Fraser return; } -@@ -3079,7 +3079,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3081,7 +3081,7 @@ void p2m_mem_paging_populate(struct p2m_ req.p2mt = p2mt; req.vcpu_id = v->vcpu_id; @@ -147,7 +155,7 @@ Committed-by: Keir Fraser } /** -@@ -3157,7 +3157,7 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3159,7 +3159,7 @@ void p2m_mem_paging_resume(struct p2m_do mfn_t mfn; /* Pull the response off the ring */ @@ -156,7 +164,7 @@ Committed-by: Keir Fraser /* Fix p2m entry if the page was not dropped */ if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) ) -@@ -3210,7 +3210,7 @@ void p2m_mem_access_check(unsigned long +@@ -3212,7 +3212,7 @@ void p2m_mem_access_check(paddr_t gpa, b p2m_unlock(p2m); /* Otherwise, check if there is a memory event listener, and send the message along */ @@ -165,7 +173,7 @@ Committed-by: Keir Fraser if ( res < 0 ) { /* No listener */ -@@ -3254,7 +3254,7 @@ void p2m_mem_access_check(unsigned long +@@ -3256,7 +3256,7 @@ void p2m_mem_access_check(paddr_t gpa, b req.vcpu_id = v->vcpu_id; @@ -174,7 +182,7 @@ Committed-by: Keir Fraser /* VCPU paused, mem event request sent */ } -@@ -3264,7 +3264,7 @@ void p2m_mem_access_resume(struct p2m_do +@@ -3266,7 +3266,7 @@ void p2m_mem_access_resume(struct p2m_do struct domain *d = p2m->domain; mem_event_response_t rsp; @@ -183,8 +191,10 @@ Committed-by: Keir Fraser /* Unpause domain */ if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) ---- a/xen/common/domain.c -+++ b/xen/common/domain.c +Index: xen-4.1.3-testing/xen/common/domain.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/common/domain.c ++++ xen-4.1.3-testing/xen/common/domain.c @@ -298,6 +298,10 @@ struct domain *domain_create( init_status |= INIT_gnttab; @@ -204,8 +214,10 @@ Committed-by: Keir Fraser if ( init_status & INIT_arch ) arch_domain_destroy(d); if ( init_status & INIT_gnttab ) ---- a/xen/include/xen/sched.h -+++ b/xen/include/xen/sched.h +Index: xen-4.1.3-testing/xen/include/xen/sched.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/xen/sched.h ++++ xen-4.1.3-testing/xen/include/xen/sched.h @@ -201,6 +201,16 @@ struct mem_event_domain int xen_port; }; diff --git a/24275-x86-emul-lzcnt.patch b/24275-x86-emul-lzcnt.patch index 62c51e2..ce7c8af 100644 --- a/24275-x86-emul-lzcnt.patch +++ b/24275-x86-emul-lzcnt.patch @@ -12,8 +12,10 @@ CPUs. Signed-off-by: Jan Beulich ---- a/xen/arch/x86/x86_emulate/x86_emulate.c -+++ b/xen/arch/x86/x86_emulate/x86_emulate.c +Index: xen-4.1.3-testing/xen/arch/x86/x86_emulate/x86_emulate.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c ++++ xen-4.1.3-testing/xen/arch/x86/x86_emulate/x86_emulate.c @@ -990,6 +990,9 @@ static bool_t vcpu_has( return rc == X86EMUL_OKAY; } @@ -24,7 +26,7 @@ Signed-off-by: Jan Beulich #define vcpu_must_have(leaf, reg, bit) \ generate_exception_if(!vcpu_has(leaf, reg, bit, ctxt, ops), EXC_UD, -1) #define vcpu_must_have_sse2() vcpu_must_have(0x00000001, EDX, 26) -@@ -4114,13 +4117,24 @@ x86_emulate( +@@ -4117,13 +4120,24 @@ x86_emulate( dst.val = (uint8_t)src.val; break; @@ -53,7 +55,7 @@ Signed-off-by: Jan Beulich { _regs.eflags |= EFLG_ZF; dst.type = OP_NONE; -@@ -4128,13 +4142,28 @@ x86_emulate( +@@ -4131,13 +4145,28 @@ x86_emulate( break; } diff --git a/24282-x86-log-dirty-bitmap-leak.patch b/24282-x86-log-dirty-bitmap-leak.patch deleted file mode 100644 index 78432f5..0000000 --- a/24282-x86-log-dirty-bitmap-leak.patch +++ /dev/null @@ -1,38 +0,0 @@ -# HG changeset patch -# User Tim Deegan -# Date 1322749036 0 -# Node ID a06cda9fb25f2d7b7b5c7da170813e4a8bb0cd67 -# Parent 75f4e4d9f039ea656051e6dfd73e40d4cb32896b -x86/mm: Don't lose track of the log dirty bitmap - -hap_log_dirty_init unconditionally sets the top of the log dirty -bitmap to INVALID_MFN. If there had been a bitmap allocated, it is -then leaked, and the host crashes on an ASSERT when the domain is -cleaned up. - -Signed-off-by: Tim Deegan -Acked-by: Andres Lagar-Cavilla -Committed-by: Tim Deegan - ---- a/xen/arch/x86/mm/paging.c -+++ b/xen/arch/x86/mm/paging.c -@@ -665,7 +665,6 @@ void paging_log_dirty_init(struct domain - d->arch.paging.log_dirty.enable_log_dirty = enable_log_dirty; - d->arch.paging.log_dirty.disable_log_dirty = disable_log_dirty; - d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap; -- d->arch.paging.log_dirty.top = _mfn(INVALID_MFN); - } - - /* This function fress log dirty bitmap resources. */ -@@ -686,6 +685,11 @@ int paging_domain_init(struct domain *d, - if ( (rc = p2m_init(d)) != 0 ) - return rc; - -+ /* This must be initialized separately from the rest of the -+ * log-dirty init code as that can be called more than once and we -+ * don't want to leak any active log-dirty bitmaps */ -+ d->arch.paging.log_dirty.top = _mfn(INVALID_MFN); -+ - /* The order of the *_init calls below is important, as the later - * ones may rewrite some common fields. Shadow pagetables are the - * default... */ diff --git a/24318-x86-mm_Fix_checks_during_foreign_mapping_of_paged_pages.patch b/24318-x86-mm_Fix_checks_during_foreign_mapping_of_paged_pages.patch index 3d04a05..2c6371d 100644 --- a/24318-x86-mm_Fix_checks_during_foreign_mapping_of_paged_pages.patch +++ b/24318-x86-mm_Fix_checks_during_foreign_mapping_of_paged_pages.patch @@ -17,11 +17,11 @@ Committed-by: Tim Deegan xen/arch/x86/mm.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -3492,8 +3492,9 @@ int do_mmu_update( +--- xen-4.1.3-testing.orig/xen/arch/x86/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/mm.c +@@ -3494,8 +3494,9 @@ int do_mmu_update( { l1_pgentry_t l1e = l1e_from_intpte(req.val); p2m_type_t l1e_p2mt; @@ -32,17 +32,17 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c if ( p2m_is_paged(l1e_p2mt) ) { -@@ -3502,7 +3503,8 @@ int do_mmu_update( +@@ -3504,7 +3505,8 @@ int do_mmu_update( rc = -ENOENT; break; } - else if ( p2m_ram_paging_in_start == l1e_p2mt && !mfn_valid(mfn) ) -+ else if ( p2m_ram_paging_in_start == l1e_p2mt && ++ else if ( p2m_ram_paging_in_start == l1e_p2mt && + !mfn_valid(l1emfn) ) { rc = -ENOENT; break; -@@ -3534,7 +3536,8 @@ int do_mmu_update( +@@ -3536,7 +3538,8 @@ int do_mmu_update( { l2_pgentry_t l2e = l2e_from_intpte(req.val); p2m_type_t l2e_p2mt; @@ -52,17 +52,17 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c if ( p2m_is_paged(l2e_p2mt) ) { -@@ -3543,7 +3546,8 @@ int do_mmu_update( +@@ -3545,7 +3548,8 @@ int do_mmu_update( rc = -ENOENT; break; } - else if ( p2m_ram_paging_in_start == l2e_p2mt && !mfn_valid(mfn) ) -+ else if ( p2m_ram_paging_in_start == l2e_p2mt && ++ else if ( p2m_ram_paging_in_start == l2e_p2mt && + !mfn_valid(l2emfn) ) { rc = -ENOENT; break; -@@ -3563,7 +3567,8 @@ int do_mmu_update( +@@ -3565,7 +3569,8 @@ int do_mmu_update( { l3_pgentry_t l3e = l3e_from_intpte(req.val); p2m_type_t l3e_p2mt; @@ -72,17 +72,17 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c if ( p2m_is_paged(l3e_p2mt) ) { -@@ -3572,7 +3577,8 @@ int do_mmu_update( +@@ -3574,7 +3579,8 @@ int do_mmu_update( rc = -ENOENT; break; } - else if ( p2m_ram_paging_in_start == l3e_p2mt && !mfn_valid(mfn) ) -+ else if ( p2m_ram_paging_in_start == l3e_p2mt && ++ else if ( p2m_ram_paging_in_start == l3e_p2mt && + !mfn_valid(l3emfn) ) { rc = -ENOENT; break; -@@ -3592,8 +3598,9 @@ int do_mmu_update( +@@ -3594,8 +3600,9 @@ int do_mmu_update( { l4_pgentry_t l4e = l4e_from_intpte(req.val); p2m_type_t l4e_p2mt; @@ -93,12 +93,12 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c if ( p2m_is_paged(l4e_p2mt) ) { -@@ -3602,7 +3609,8 @@ int do_mmu_update( +@@ -3604,7 +3611,8 @@ int do_mmu_update( rc = -ENOENT; break; } - else if ( p2m_ram_paging_in_start == l4e_p2mt && !mfn_valid(mfn) ) -+ else if ( p2m_ram_paging_in_start == l4e_p2mt && ++ else if ( p2m_ram_paging_in_start == l4e_p2mt && + !mfn_valid(l4emfn) ) { rc = -ENOENT; diff --git a/24327-After_preparing_a_page_for_page-in_allow_immediate_fill-in_of_the_page_contents.patch b/24327-After_preparing_a_page_for_page-in_allow_immediate_fill-in_of_the_page_contents.patch index 6a80d5b..0844ca2 100644 --- a/24327-After_preparing_a_page_for_page-in_allow_immediate_fill-in_of_the_page_contents.patch +++ b/24327-After_preparing_a_page_for_page-in_allow_immediate_fill-in_of_the_page_contents.patch @@ -33,8 +33,10 @@ Committed-by: Tim Deegan xen/include/public/domctl.h | 8 ++++++-- 5 files changed, 39 insertions(+), 7 deletions(-) ---- a/xen/arch/x86/mm/mem_event.c -+++ b/xen/arch/x86/mm/mem_event.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_event.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c @@ -45,7 +45,7 @@ static int mem_event_enable(struct domai struct domain *dom_mem_event = current->domain; struct vcpu *v = current; @@ -44,9 +46,11 @@ Committed-by: Tim Deegan l1_pgentry_t l1e; unsigned long gfn; p2m_type_t p2mt; ---- a/xen/arch/x86/mm/mem_paging.c -+++ b/xen/arch/x86/mm/mem_paging.c -@@ -50,7 +50,7 @@ int mem_paging_domctl(struct domain *d, +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_paging.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_paging.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_paging.c +@@ -50,7 +50,7 @@ int mem_paging_domctl(struct domain *d, case XEN_DOMCTL_MEM_EVENT_OP_PAGING_PREP: { unsigned long gfn = mec->gfn; @@ -55,9 +59,11 @@ Committed-by: Tim Deegan } break; ---- a/xen/arch/x86/mm/p2m.c -+++ b/xen/arch/x86/mm/p2m.c -@@ -3093,13 +3093,20 @@ void p2m_mem_paging_populate(struct p2m_ +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -3095,13 +3095,20 @@ void p2m_mem_paging_populate(struct p2m_ * mfn if populate was called for gfn which was nominated but not evicted. In * this case only the p2mt needs to be forwarded. */ @@ -80,7 +86,7 @@ Committed-by: Tim Deegan p2m_lock(p2m); -@@ -3119,6 +3126,28 @@ int p2m_mem_paging_prep(struct p2m_domai +@@ -3121,6 +3128,28 @@ int p2m_mem_paging_prep(struct p2m_domai if ( unlikely(page == NULL) ) goto out; mfn = page_to_mfn(page); @@ -109,9 +115,11 @@ Committed-by: Tim Deegan } /* Fix p2m mapping */ ---- a/xen/include/asm-x86/p2m.h -+++ b/xen/include/asm-x86/p2m.h -@@ -524,7 +524,7 @@ void p2m_mem_paging_drop_page(struct p2m +Index: xen-4.1.3-testing/xen/include/asm-x86/p2m.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/asm-x86/p2m.h ++++ xen-4.1.3-testing/xen/include/asm-x86/p2m.h +@@ -526,7 +526,7 @@ void p2m_mem_paging_drop_page(struct p2m /* Start populating a paged out frame */ void p2m_mem_paging_populate(struct p2m_domain *p2m, unsigned long gfn); /* Prepare the p2m for paging a frame in */ @@ -120,8 +128,10 @@ Committed-by: Tim Deegan /* Resume normal operation (in case a domain was paused) */ void p2m_mem_paging_resume(struct p2m_domain *p2m); #else ---- a/xen/include/public/domctl.h -+++ b/xen/include/public/domctl.h +Index: xen-4.1.3-testing/xen/include/public/domctl.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/public/domctl.h ++++ xen-4.1.3-testing/xen/include/public/domctl.h @@ -741,8 +741,12 @@ struct xen_domctl_mem_event_op { uint32_t op; /* XEN_DOMCTL_MEM_EVENT_OP_*_* */ uint32_t mode; /* XEN_DOMCTL_MEM_EVENT_OP_* */ diff --git a/24344-tools-x86_64_Fix_cpuid_inline_asm_to_not_clobber_stacks_red_zone.patch b/24344-tools-x86_64_Fix_cpuid_inline_asm_to_not_clobber_stacks_red_zone.patch deleted file mode 100644 index ec2ad0a..0000000 --- a/24344-tools-x86_64_Fix_cpuid_inline_asm_to_not_clobber_stacks_red_zone.patch +++ /dev/null @@ -1,89 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1322836274 28800 -# Node ID 72f4e4cb7440c6ab64d4c08dfdc3158112cc95ac -# Parent 109b99239b21275ee2249873dcdb9a413741142d -tools/x86_64: Fix cpuid() inline asm to not clobber stack's red zone - -Pushing stuff onto the stack on x86-64 when we do not specify --mno-red-zone is unsafe. Since the complicated asm is due to register -pressure on i386, we simply implement an all-new simpler alternative -for x86-64. - -Signed-off-by: Keir Fraser -Acked-by: Jan Beulich - -# HG changeset patch -# User Keir Fraser -# Date 1322844002 28800 -# Node ID 491c3ebf1d371d03fdd0aabe82b0f422037c67ba -# Parent 72f4e4cb7440c6ab64d4c08dfdc3158112cc95ac -tools/libxc: Fix x86_32 build breakage in previous changeset. - -Signed-off-by: Keir Fraser - ---- a/tools/libxc/xc_cpuid_x86.c -+++ b/tools/libxc/xc_cpuid_x86.c -@@ -42,23 +42,23 @@ static int hypervisor_is_64bit(xc_interf - static void cpuid(const unsigned int *input, unsigned int *regs) - { - unsigned int count = (input[1] == XEN_CPUID_INPUT_UNUSED) ? 0 : input[1]; -- asm ( - #ifdef __i386__ -+ /* Use the stack to avoid reg constraint failures with some gcc flags */ -+ asm ( - "push %%ebx; push %%edx\n\t" --#else -- "push %%rbx; push %%rdx\n\t" --#endif - "cpuid\n\t" - "mov %%ebx,4(%4)\n\t" - "mov %%edx,12(%4)\n\t" --#ifdef __i386__ - "pop %%edx; pop %%ebx\n\t" --#else -- "pop %%rdx; pop %%rbx\n\t" --#endif - : "=a" (regs[0]), "=c" (regs[2]) - : "0" (input[0]), "1" (count), "S" (regs) - : "memory" ); -+#else -+ asm ( -+ "cpuid" -+ : "=a" (regs[0]), "=b" (regs[1]), "=c" (regs[2]), "=d" (regs[3]) -+ : "0" (input[0]), "2" (count) ); -+#endif - } - - /* Get the manufacturer brand name of the host processor. */ ---- a/tools/misc/xen-detect.c -+++ b/tools/misc/xen-detect.c -@@ -35,18 +35,21 @@ - - static void cpuid(uint32_t idx, uint32_t *regs, int pv_context) - { -- asm volatile ( - #ifdef __i386__ --#define R(x) "%%e"#x"x" --#else --#define R(x) "%%r"#x"x" --#endif -- "push "R(a)"; push "R(b)"; push "R(c)"; push "R(d)"\n\t" -+ /* Use the stack to avoid reg constraint failures with some gcc flags */ -+ asm volatile ( -+ "push %%eax; push %%ebx; push %%ecx; push %%edx\n\t" - "test %1,%1 ; jz 1f ; ud2a ; .ascii \"xen\" ; 1: cpuid\n\t" - "mov %%eax,(%2); mov %%ebx,4(%2)\n\t" - "mov %%ecx,8(%2); mov %%edx,12(%2)\n\t" -- "pop "R(d)"; pop "R(c)"; pop "R(b)"; pop "R(a)"\n\t" -+ "pop %%edx; pop %%ecx; pop %%ebx; pop %%eax\n\t" - : : "a" (idx), "c" (pv_context), "S" (regs) : "memory" ); -+#else -+ asm volatile ( -+ "test %5,%5 ; jz 1f ; ud2a ; .ascii \"xen\" ; 1: cpuid\n\t" -+ : "=a" (regs[0]), "=b" (regs[1]), "=c" (regs[2]), "=d" (regs[3]) -+ : "0" (idx), "1" (pv_context), "2" (0) ); -+#endif - } - - static int check_for_xen(int pv_context) diff --git a/24357-firmware-no-_PS0-_PS3.patch b/24357-firmware-no-_PS0-_PS3.patch deleted file mode 100644 index 1392d7b..0000000 --- a/24357-firmware-no-_PS0-_PS3.patch +++ /dev/null @@ -1,49 +0,0 @@ -References: bnc#711219 - -# HG changeset patch -# User Xudong Hao -# Date 1323113706 0 -# Node ID 832fa3f3543298a7125cd5f996d1e28dd7ba47b1 -# Parent 60ea36c0512b779f291bb6c007e1f05c16054ec2 -tools/firmware: remove "_PS0/3" Method - -Do not expose the ACPI power management "_PS0/3" Method to guest -firmware. According to section 3.4 of the APCI specification 4.0, PCI -device control the device power through its own specification but not -through APCI. - -Qemu pushes "_PS0/3" to guest will cause a mess between ACPI PM and -PCI PM as a result of incorrect ACPI table shipped with the guest -BIOS, it may cause a failure of PCI device PM state transition(from -PCI_UNKNOWN to PCI_D0). - -Signed-off-by: Xudong Hao -Signed-off-by: Haitao Shan -Committed-by: Keir Fraser - ---- a/tools/firmware/hvmloader/acpi/mk_dsdt.c -+++ b/tools/firmware/hvmloader/acpi/mk_dsdt.c -@@ -251,8 +251,6 @@ int main(int argc, char **argv) - * the ACPI event: - * _EJ0: eject a device - * _STA: return a device's status, e.g. enabled or removed -- * Other methods are optional: -- * _PS0/3: put them here for debug purpose - * - * Eject button would generate a general-purpose event, then the - * control method for this event uses Notify() to inform OSPM which -@@ -271,14 +269,6 @@ int main(int argc, char **argv) - stmt("Name", "_ADR, 0x%08x", ((slot & ~7) << 13) | (slot & 7)); - /* _SUN == dev */ - stmt("Name", "_SUN, 0x%08x", slot >> 3); -- push_block("Method", "_PS0, 0"); -- stmt("Store", "0x%02x, \\_GPE.DPT1", slot); -- stmt("Store", "0x80, \\_GPE.DPT2"); -- pop_block(); -- push_block("Method", "_PS3, 0"); -- stmt("Store", "0x%02x, \\_GPE.DPT1", slot); -- stmt("Store", "0x83, \\_GPE.DPT2"); -- pop_block(); - push_block("Method", "_EJ0, 1"); - stmt("Store", "0x%02x, \\_GPE.DPT1", slot); - stmt("Store", "0x88, \\_GPE.DPT2"); diff --git a/24358-kexec-compat-overflow.patch b/24358-kexec-compat-overflow.patch deleted file mode 100644 index 4fd6985..0000000 --- a/24358-kexec-compat-overflow.patch +++ /dev/null @@ -1,29 +0,0 @@ -# HG changeset patch -# User Andrew Cooper -# Date 1323114166 0 -# Node ID 9961a6d5356a57685b06f65133c6ade5041e3356 -# Parent 832fa3f3543298a7125cd5f996d1e28dd7ba47b1 -KEXEC: fix kexec_get_range_compat to fail vocally. - -Fail with -ERANGE rather than silently truncating 64bit values (a -physical address and size) into 32bit integers for dom0 to consume. - -Signed-off-by: Andrew Cooper - -Simplify the bitwise arithmetic a bit. - -Signed-off-by: Keir Fraser - ---- a/xen/common/kexec.c -+++ b/xen/common/kexec.c -@@ -395,6 +395,10 @@ static int kexec_get_range_compat(XEN_GU - - ret = kexec_get_range_internal(&range); - -+ /* Dont silently truncate physical addresses or sizes. */ -+ if ( (range.start | range.size) & ~(unsigned long)(~0u) ) -+ return -ERANGE; -+ - if ( ret == 0 ) { - XLAT_kexec_range(&compat_range, &range); - if ( unlikely(copy_to_guest(uarg, &compat_range, 1)) ) diff --git a/24389-amd-fam10-gart-tlb-walk-err.patch b/24389-amd-fam10-gart-tlb-walk-err.patch deleted file mode 100644 index 6972509..0000000 --- a/24389-amd-fam10-gart-tlb-walk-err.patch +++ /dev/null @@ -1,109 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1323765911 -3600 -# Node ID 868d82faf6511de3b3edce18cc6a9e1c938f0b8f -# Parent 7ca56cca09ade16645fb4806be2c5b2b0bc3332b -x86, amd: Disable GartTlbWlkErr when BIOS forgets it - -This patch disables GartTlbWlk errors on AMD Fam10h CPUs if the BIOS -forgets to do is (or is just too old). Letting these errors enabled -can cause a sync-flood on the CPU causing a reboot. - -The AMD BKDG recommends disabling GART TLB Wlk Error completely. - -Based on a Linux patch from Joerg Roedel ; see e.g. -https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=patch;h=5bbc097d890409d8eff4e3f1d26f11a9d6b7c07e - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/x86/cpu/mcheck/amd_f10.c -+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c -@@ -46,6 +46,7 @@ - #include - - #include "mce.h" -+#include "mce_quirks.h" - #include "x86_mca.h" - - -@@ -91,9 +92,14 @@ amd_f10_handler(struct mc_info *mi, uint - /* AMD Family10 machine check */ - enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c) - { -+ enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(c); -+ - if (amd_k8_mcheck_init(c) == mcheck_none) - return mcheck_none; - -+ if (quirkflag == MCEQUIRK_F10_GART) -+ mcequirk_amd_apply(quirkflag); -+ - x86_mce_callback_register(amd_f10_handler); - - return mcheck_amd_famXX; ---- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c -+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c -@@ -29,6 +29,8 @@ static const struct mce_quirkdata mce_am - MCEQUIRK_K7_BANK0 }, - { 0xf /* cpu family */, ANY /* all models */, ANY /* all steppings */, - MCEQUIRK_K8_GART }, -+ { 0x10 /* cpu family */, ANY /* all models */, ANY /* all steppings */, -+ MCEQUIRK_F10_GART }, - }; - - enum mcequirk_amd_flags -@@ -54,6 +56,8 @@ mcequirk_lookup_amd_quirkdata(struct cpu - - int mcequirk_amd_apply(enum mcequirk_amd_flags flags) - { -+ u64 val; -+ - switch (flags) { - case MCEQUIRK_K7_BANK0: - return 1; /* first bank */ -@@ -67,6 +71,10 @@ int mcequirk_amd_apply(enum mcequirk_amd - wrmsrl(MSR_IA32_MC4_CTL, ~(1ULL << 10)); - wrmsrl(MSR_IA32_MC4_STATUS, 0ULL); - break; -+ case MCEQUIRK_F10_GART: -+ if (rdmsr_safe(MSR_AMD64_MCx_MASK(4), val) == 0) -+ wrmsr_safe(MSR_AMD64_MCx_MASK(4), val | (1 << 10)); -+ break; - } - - return 0; ---- a/xen/arch/x86/cpu/mcheck/mce_quirks.h -+++ b/xen/arch/x86/cpu/mcheck/mce_quirks.h -@@ -33,8 +33,9 @@ struct mce_quirkdata { - */ - - enum mcequirk_amd_flags { -- MCEQUIRK_K7_BANK0 = 0x1, -- MCEQUIRK_K8_GART = 0x2, -+ MCEQUIRK_K7_BANK0 = 1, -+ MCEQUIRK_K8_GART, -+ MCEQUIRK_F10_GART - }; - - enum mcequirk_intel_flags { ---- a/xen/include/asm-x86/msr-index.h -+++ b/xen/include/asm-x86/msr-index.h -@@ -98,6 +98,8 @@ - #define CMCI_EN (1UL<<30) - #define CMCI_THRESHOLD_MASK 0x7FFF - -+#define MSR_AMD64_MC0_MASK 0xc0010044 -+ - #define MSR_IA32_MC1_CTL 0x00000404 - #define MSR_IA32_MC1_CTL2 0x00000281 - #define MSR_IA32_MC1_STATUS 0x00000405 -@@ -151,6 +153,8 @@ - #define MSR_IA32_MCx_ADDR(x) (MSR_IA32_MC0_ADDR + 4*(x)) - #define MSR_IA32_MCx_MISC(x) (MSR_IA32_MC0_MISC + 4*(x)) - -+#define MSR_AMD64_MCx_MASK(x) (MSR_AMD64_MC0_MASK + (x)) -+ - #define MSR_P6_PERFCTR0 0x000000c1 - #define MSR_P6_PERFCTR1 0x000000c2 - #define MSR_P6_EVNTSEL0 0x00000186 diff --git a/24411-x86-ucode-AMD-Fam15.patch b/24411-x86-ucode-AMD-Fam15.patch deleted file mode 100644 index bf93e91..0000000 --- a/24411-x86-ucode-AMD-Fam15.patch +++ /dev/null @@ -1,143 +0,0 @@ -References: bnc#736824 - -# HG changeset patch -# User Christoph Egger -# Date 1323943209 -3600 -# Node ID ca5f588bd203c9207e0988fcc80f43d83eed5420 -# Parent 25f8952313ae683f41b634163f62651185d7be38 -x86/ucode: fix for AMD Fam15 CPUs - -Remove hardcoded maximum size a microcode patch can have. This is -dynamic now. - -The microcode patch for family15h can be larger than 2048 bytes and -gets silently truncated. - -Signed-off-by: Christoph Egger -Signed-off-by: Jan Beulich - ---- 2011-12-14.orig/xen/arch/x86/microcode_amd.c 2011-12-15 14:55:15.000000000 +0100 -+++ 2011-12-14/xen/arch/x86/microcode_amd.c 2011-12-15 14:59:47.000000000 +0100 -@@ -27,18 +27,10 @@ - #include - #include - --#define pr_debug(x...) ((void)0) -- - #define UCODE_MAGIC 0x00414d44 - #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000 - #define UCODE_UCODE_TYPE 0x00000001 - --#define UCODE_MAX_SIZE (2048) --#define DEFAULT_UCODE_DATASIZE (896) --#define MC_HEADER_SIZE (sizeof(struct microcode_header_amd)) --#define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) --#define DWSIZE (sizeof(uint32_t)) -- - /* serialize access to the physical write */ - static DEFINE_SPINLOCK(microcode_update_lock); - -@@ -99,7 +91,7 @@ static int microcode_fits(void *mc, int - } - - if ( mc_header->patch_id <= uci->cpu_sig.rev ) -- return -EINVAL; -+ return 0; - - printk(KERN_DEBUG "microcode: CPU%d found a matching microcode " - "update with version 0x%x (current=0x%x)\n", -@@ -147,8 +139,12 @@ static int apply_microcode(int cpu) - return 0; - } - --static int get_next_ucode_from_buffer_amd(void *mc, const void *buf, -- size_t size, unsigned long *offset) -+static int get_next_ucode_from_buffer_amd( -+ void **mc, -+ size_t *mc_size, -+ const void *buf, -+ size_t size, -+ unsigned long *offset) - { - struct microcode_header_amd *mc_header; - size_t total_size; -@@ -181,8 +177,17 @@ static int get_next_ucode_from_buffer_am - return -EINVAL; - } - -- memset(mc, 0, UCODE_MAX_SIZE); -- memcpy(mc, (const void *)(&bufp[off + 8]), total_size); -+ if ( *mc_size < total_size ) -+ { -+ xfree(*mc); -+ *mc = xmalloc_bytes(total_size); -+ if ( !*mc ) -+ return -ENOMEM; -+ *mc_size = total_size; -+ } -+ else if ( *mc_size > total_size ) -+ memset(*mc + total_size, 0, *mc_size - total_size); -+ memcpy(*mc, mc_header, total_size); - - *offset = off + total_size + 8; - -@@ -236,10 +241,10 @@ static int cpu_request_microcode(int cpu - { - const uint32_t *buf_pos; - unsigned long offset = 0; -- int error = 0; -- int ret; -+ int error; - struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu); - void *mc; -+ size_t mc_size; - - /* We should bind the task to the CPU */ - BUG_ON(cpu != raw_smp_processor_id()); -@@ -260,7 +265,9 @@ static int cpu_request_microcode(int cpu - return -EINVAL; - } - -- mc = xmalloc_bytes(UCODE_MAX_SIZE); -+ /* Size of 1st microcode patch in bytes */ -+ mc_size = buf_pos[offset / sizeof(*buf_pos) + 1]; -+ mc = xmalloc_bytes(mc_size); - if ( mc == NULL ) - { - printk(KERN_ERR "microcode: error! " -@@ -276,24 +284,33 @@ static int cpu_request_microcode(int cpu - * It's possible the data file has multiple matching ucode, - * lets keep searching till the latest version - */ -- while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0) -+ while ( (error = get_next_ucode_from_buffer_amd(&mc, &mc_size, buf, size, -+ &offset)) == 0 ) - { -+ uci->mc.mc_amd = mc; -+ - error = microcode_fits(mc, cpu); - if (error <= 0) - continue; - - error = apply_microcode(cpu); - if (error == 0) -+ { -+ error = 1; - break; -+ } - } - - /* On success keep the microcode patch for - * re-apply on resume. - */ -- if (error) { -+ if ( error <= 0 ) -+ { - xfree(mc); - mc = NULL; - } -+ else -+ error = 0; - uci->mc.mc_amd = mc; - - out: diff --git a/24412-x86-AMD-errata-model-shift.patch b/24412-x86-AMD-errata-model-shift.patch deleted file mode 100644 index bef04f3..0000000 --- a/24412-x86-AMD-errata-model-shift.patch +++ /dev/null @@ -1,23 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1323955725 -3600 -# Node ID 99caac2e35df41cbece606f663cb5570a62613c3 -# Parent ca5f588bd203c9207e0988fcc80f43d83eed5420 -x86/AMD: use correct shift count when merging model and stepping - -... for legacy errata matching. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/x86/cpu/amd.c -+++ b/xen/arch/x86/cpu/amd.c -@@ -216,7 +216,7 @@ int cpu_has_amd_erratum(const struct cpu - } - - /* OSVW unavailable or ID unknown, match family-model-stepping range */ -- ms = (cpu->x86_model << 8) | cpu->x86_mask; -+ ms = (cpu->x86_model << 4) | cpu->x86_mask; - while ((range = va_arg(ap, int))) { - if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) && - (ms >= AMD_MODEL_RANGE_START(range)) && diff --git a/24417-amd-erratum-573.patch b/24417-amd-erratum-573.patch deleted file mode 100644 index ffdbb22..0000000 --- a/24417-amd-erratum-573.patch +++ /dev/null @@ -1,85 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1324046740 -3600 -# Node ID 1452fb248cd513832cfbbd1100b9b72a0dde7ea6 -# Parent 01c8b27e3d7d4ad2b469be9922bb04b5eb0195e8 -x86/emulator: workaround for AMD erratum 573 - -The only cases where we might end up emulating fsincos (as any other -x87 operations without memory operands) are -- when a HVM guest is in real mode (not applicable on AMD) -- between two half page table updates in PAE mode (unlikely, and not - doing the emulation here does affect only performance, not - correctness) -- when a guest maliciously (or erroneously) modifies an (MMIO or page - table update) instruction under emulation (unspecified behavior) - -Hence, in order to avoid the erratum to cause harm to the entire host, -don't emulate fsincos on the affected AMD CPU families. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/tools/tests/x86_emulator/x86_emulate.c -+++ b/tools/tests/x86_emulator/x86_emulate.c -@@ -3,5 +3,7 @@ - #include - #include - -+#define cpu_has_amd_erratum(nr) 0 -+ - #include "x86_emulate/x86_emulate.h" - #include "x86_emulate/x86_emulate.c" ---- a/xen/arch/x86/x86_emulate.c -+++ b/xen/arch/x86/x86_emulate.c -@@ -10,8 +10,15 @@ - */ - - #include -+#include /* current_cpu_info */ -+#include /* cpu_has_amd_erratum() */ - - /* Avoid namespace pollution. */ - #undef cmpxchg -+#undef cpuid -+#undef wbinvd -+ -+#define cpu_has_amd_erratum(nr) \ -+ cpu_has_amd_erratum(¤t_cpu_data, AMD_ERRATUM_##nr) - - #include "x86_emulate/x86_emulate.c" ---- a/xen/arch/x86/x86_emulate/x86_emulate.c -+++ b/xen/arch/x86/x86_emulate/x86_emulate.c -@@ -2621,6 +2621,9 @@ x86_emulate( - case 0xd9: /* FPU 0xd9 */ - switch ( modrm ) - { -+ case 0xfb: /* fsincos */ -+ fail_if(cpu_has_amd_erratum(573)); -+ /* fall through */ - case 0xc0 ... 0xc7: /* fld %stN */ - case 0xc8 ... 0xcf: /* fxch %stN */ - case 0xd0: /* fnop */ -@@ -2646,7 +2649,6 @@ x86_emulate( - case 0xf8: /* fprem */ - case 0xf9: /* fyl2xp1 */ - case 0xfa: /* fsqrt */ -- case 0xfb: /* fsincos */ - case 0xfc: /* frndint */ - case 0xfd: /* fscale */ - case 0xfe: /* fsin */ ---- a/xen/include/asm-x86/amd.h -+++ b/xen/include/asm-x86/amd.h -@@ -138,6 +138,12 @@ - AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf), \ - AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf)) - -+#define AMD_ERRATUM_573 \ -+ AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0xff, 0xf), \ -+ AMD_MODEL_RANGE(0x10, 0x0, 0x0, 0xff, 0xf), \ -+ AMD_MODEL_RANGE(0x11, 0x0, 0x0, 0xff, 0xf), \ -+ AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0xff, 0xf)) -+ - struct cpuinfo_x86; - int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...); - diff --git a/24429-mceinj-tool.patch b/24429-mceinj-tool.patch deleted file mode 100644 index 7167052..0000000 --- a/24429-mceinj-tool.patch +++ /dev/null @@ -1,28 +0,0 @@ -# HG changeset patch -# User Liu, Jinsong -# Date 1324219200 0 -# Node ID 9587ccc2ae3192fd5625a87fa58e840377471867 -# Parent 5b4b7e565ab82b06940889f2be7e30042b2881fc -X86-MCE: fix a bug of xen-mceinj tool - -Fix a bug of xen-mceinj tool which used to test mce by software way. - -Signed-off-by: Liu, Jinsong -Committed-by: Keir Fraser - ---- a/tools/tests/mce-test/tools/xen-mceinj.c -+++ b/tools/tests/mce-test/tools/xen-mceinj.c -@@ -134,8 +134,12 @@ static int mca_cpuinfo(xc_interface *xc_ - { - struct xen_mc mc; - -+ memset(&mc, 0, sizeof(struct xen_mc)); -+ - mc.cmd = XEN_MC_physcpuinfo; -- if (xc_mca_op(xc_handle, &mc)) -+ mc.interface_version = XEN_MCA_INTERFACE_VERSION; -+ -+ if (!xc_mca_op(xc_handle, &mc)) - return mc.u.mc_physcpuinfo.ncpus; - else - return 0; diff --git a/24447-x86-TXT-INIT-SIPI-delay.patch b/24447-x86-TXT-INIT-SIPI-delay.patch deleted file mode 100644 index 6018922..0000000 --- a/24447-x86-TXT-INIT-SIPI-delay.patch +++ /dev/null @@ -1,46 +0,0 @@ -# HG changeset patch -# User Gang Wei -# Date 1325153274 0 -# Node ID a7b2610b8e5c9a15b1f5de9a3eabf7f19d0b4199 -# Parent 2863b2f43a3bc9268885379d6fd55ed325b8c0a2 -X86: Add a delay between INIT & SIPIs for tboot AP bring-up in X2APIC case - -Without this delay, Xen could not bring APs up while working with -TXT/tboot, because tboot needs some time in APs to handle INIT before -becoming ready for receiving SIPIs (this delay was removed as part of -c/s 23724 by Tim Deegan). - -Signed-off-by: Gang Wei -Acked-by: Keir Fraser -Acked-by: Tim Deegan -Committed-by: Tim Deegan - ---- a/xen/arch/x86/smpboot.c -+++ b/xen/arch/x86/smpboot.c -@@ -42,6 +42,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -473,6 +474,18 @@ static int wakeup_secondary_cpu(int phys - send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY; - } while ( send_status && (timeout++ < 1000) ); - } -+ else if ( tboot_in_measured_env() ) -+ { -+ /* -+ * With tboot AP is actually spinning in a mini-guest before -+ * receiving INIT. Upon receiving INIT ipi, AP need time to VMExit, -+ * update VMCS to tracking SIPIs and VMResume. -+ * -+ * While AP is in root mode handling the INIT the CPU will drop -+ * any SIPIs -+ */ -+ udelay(10); -+ } - - /* - * Should we send STARTUP IPIs ? diff --git a/24448-x86-pt-irq-leak.patch b/24448-x86-pt-irq-leak.patch deleted file mode 100644 index 3694421..0000000 --- a/24448-x86-pt-irq-leak.patch +++ /dev/null @@ -1,31 +0,0 @@ -References: bnc#735806 - -# HG changeset patch -# User Jan Beulich -# Date 1325492779 -3600 -# Node ID 3a22ed3ec534799b3cab55b0dc0a7380e701ecbe -# Parent a7b2610b8e5c9a15b1f5de9a3eabf7f19d0b4199 -x86/passthrough: don't leak guest IRQs - -As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must not -be called for the non-emu-IRQ case (to prevent the entire unmap -operation failing). - -Based on a suggestion from Stefano. - -Signed-off-by: Jan Beulich -Tested-by: Yongjie Ren -Acked-by: Stefano Stabellini - ---- a/xen/arch/x86/physdev.c -+++ b/xen/arch/x86/physdev.c -@@ -228,7 +228,8 @@ static int physdev_unmap_pirq(struct phy - if ( is_hvm_domain(d) ) - { - spin_lock(&d->event_lock); -- ret = unmap_domain_pirq_emuirq(d, unmap->pirq); -+ if ( domain_pirq_to_emuirq(d, unmap->pirq) != IRQ_UNBOUND ) -+ ret = unmap_domain_pirq_emuirq(d, unmap->pirq); - spin_unlock(&d->event_lock); - if ( unmap->domid == DOMID_SELF || ret ) - goto free_domain; diff --git a/24453-x86-vIRQ-IRR-TMR-race.patch b/24453-x86-vIRQ-IRR-TMR-race.patch deleted file mode 100644 index a2cdb9f..0000000 --- a/24453-x86-vIRQ-IRR-TMR-race.patch +++ /dev/null @@ -1,38 +0,0 @@ -# HG changeset patch -# User Yongan Liu -# Date 1325752199 -3600 -# Node ID 02b92d035f6484ea33f03c4a59630d82e0469eeb -# Parent efaa28639a71524a693ba500624f8512e5795e18 -x86/vIRQ: IRR and TMR race condition bug fix - -In vlapic_set_irq, we set the IRR register before the TMR. And the IRR -might be serviced before setting TMR, and even worse EOI might occur -before TMR setting, in which case the vioapic_update_EOI won't be -called, and further prevent all the subsequent interrupt injecting. -Reorder setting the TMR and IRR will solve the problem. - -Besides, KVM has fixed a similar bug in: -http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results - -Signed-off-by: Yongan Liu -Signed-off-by: Jan Beulich -Committed-by: Jan Beulich - ---- a/xen/arch/x86/hvm/vlapic.c -+++ b/xen/arch/x86/hvm/vlapic.c -@@ -142,14 +142,11 @@ static int vlapic_find_highest_irr(struc - - int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig) - { -- int ret; -- -- ret = !vlapic_test_and_set_irr(vec, vlapic); - if ( trig ) - vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]); - - /* We may need to wake up target vcpu, besides set pending bit here */ -- return ret; -+ return !vlapic_test_and_set_irr(vec, vlapic); - } - - static int vlapic_find_highest_isr(struct vlapic *vlapic) diff --git a/24456-x86-emul-lea.patch b/24456-x86-emul-lea.patch deleted file mode 100644 index c511a14..0000000 --- a/24456-x86-emul-lea.patch +++ /dev/null @@ -1,27 +0,0 @@ -# HG changeset patch -# User David Vrabel -# Date 1325778436 0 -# Node ID 03781de56c31072266fb464e7dfeec133bcf0fb4 -# Parent 94180a5a0c7c7d680ede2e54bd13f56ed43f452d -x86: emulate lea with two register operands correctly - -An lea instruction with two register operands should raise an -undefined instruction exception. - -Skype does such a instruction and will crash when starting if it does -not get the exception. - -Signed-off-by: David Vrabel -Signed-off-by: Keir Fraser -Committed-by: Keir Fraser - ---- a/xen/arch/x86/x86_emulate/x86_emulate.c -+++ b/xen/arch/x86/x86_emulate/x86_emulate.c -@@ -2100,6 +2100,7 @@ x86_emulate( - } - - case 0x8d: /* lea */ -+ generate_exception_if(ea.type != OP_MEM, EXC_UD, -1); - dst.val = ea.mem.off; - break; - diff --git a/24459-libxl-vifname.patch b/24459-libxl-vifname.patch index 6dc854a..b776a78 100644 --- a/24459-libxl-vifname.patch +++ b/24459-libxl-vifname.patch @@ -11,11 +11,11 @@ Signed-off-by: Wei Liu Acked-by: Ian Campbell Committed-by: Ian Jackson -Index: xen-4.1.2-testing/tools/libxl/libxl.c +Index: xen-4.1.3-testing/tools/libxl/libxl.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/libxl.c -+++ xen-4.1.2-testing/tools/libxl/libxl.c -@@ -1233,6 +1233,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, +--- xen-4.1.3-testing.orig/tools/libxl/libxl.c ++++ xen-4.1.3-testing/tools/libxl/libxl.c +@@ -1239,6 +1239,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, flexarray_append(back, libxl__sprintf(&gc, "%02x:%02x:%02x:%02x:%02x:%02x", nic->mac[0], nic->mac[1], nic->mac[2], nic->mac[3], nic->mac[4], nic->mac[5])); diff --git a/24460-pygrub-extlinux.patch b/24460-pygrub-extlinux.patch deleted file mode 100644 index 2f85426..0000000 --- a/24460-pygrub-extlinux.patch +++ /dev/null @@ -1,69 +0,0 @@ -# HG changeset patch -# User Roger Pau Monne -# Date 1325592706 -3600 -# Node ID ff0685e8419bc54b631f017c63a983362363c87a -# Parent caf9753d4cc100183eeda26d00c8c38f14215651 -pygrub: fix extlinux parsing - -pygrub was unable to parse extlinux config files correctly, exactly -the ones like: - -LABEL grsec - KERNEL vmlinuz-3.0.10-grsec - APPEND initrd=initramfs-3.0.10-grsec -root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee -modules=sd-mod,usb-storage,ext4 xen quiet - -This patch fixes it, adding a new case when parsing the "append" line, -that searches for the initrd image. - -Signed-off-by: Roger Pau Monne -Acked-by: Ian Campbell -Committed-by: Ian Jackson - -diff -r caf9753d4cc1 -r ff0685e8419b tools/pygrub/examples/alpine-linux-2.3.2.extlinux ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/tools/pygrub/examples/alpine-linux-2.3.2.extlinux Tue Jan 03 13:11:46 2012 +0100 -@@ -0,0 +1,11 @@ -+DEFAULT menu.c32 -+PROMPT 0 -+MENU TITLE Alpine/Linux Boot Menu -+MENU HIDDEN -+MENU AUTOBOOT Alpine will be booted automatically in # seconds. -+TIMEOUT 30 -+LABEL grsec -+ MENU DEFAULT -+ MENU LABEL Linux 3.0.10-grsec -+ KERNEL vmlinuz-3.0.10-grsec -+ APPEND initrd=initramfs-3.0.10-grsec root=UUID=a97ffe64-430f-4fd3-830e-4736d9a27af0 modules=sd-mod,usb-storage,ext4 quiet -diff -r caf9753d4cc1 -r ff0685e8419b tools/pygrub/src/ExtLinuxConf.py ---- a/tools/pygrub/src/ExtLinuxConf.py Thu Jan 05 17:13:33 2012 +0000 -+++ b/tools/pygrub/src/ExtLinuxConf.py Tue Jan 03 13:11:46 2012 +0100 -@@ -60,6 +60,13 @@ - - # Bypass regular self.commands handling - com = None -+ elif arg.find("initrd="): -+ # find initrd image in append line -+ args = arg.strip().split(" ") -+ for a in args: -+ if a.lower().startswith("initrd="): -+ setattr(self, "initrd", a.replace("initrd=", "")) -+ arg = arg.replace(a, "") - - if com is not None and self.commands.has_key(com): - if self.commands[com] is not None: -@@ -86,10 +93,12 @@ - self._args = args - def get_kernel(self): - return self._kernel -+ def set_args(self, val): -+ self._args = val - def get_args(self): - return self._args - kernel = property(get_kernel, set_kernel) -- args = property(get_args) -+ args = property(get_args, set_args) - - def set_initrd(self, val): - self._initrd = (None,val) diff --git a/24517-VT-d-fault-softirq.patch b/24517-VT-d-fault-softirq.patch deleted file mode 100644 index a7c977b..0000000 --- a/24517-VT-d-fault-softirq.patch +++ /dev/null @@ -1,89 +0,0 @@ -References: bnc#712051, CVE-2011-3131 - -# HG changeset patch -# User Dario Faggioli -# Date 1326798686 0 -# Node ID a7ae457c327cd790704643e0ed4def3e717b47b3 -# Parent 2913ccc6d70f15ffcc15c7e066c9269b15a30a09 -Move IOMMU faults handling into softirq for VT-d. - -Dealing with interrupts from VT-d IOMMU(s) is deferred to a -softirq-tasklet, raised by the actual IRQ handler. Since a new -interrupt is not generated, even if further faults occur, until we -cleared all the pending ones, there's no need of disabling IRQs, as -the hardware does it by its own. Notice that this may cause the log -to overflow, but none of the existing entry will be overwritten. - -Signed-off-by: Dario Faggioli -Committed-by: Keir Fraser - ---- a/xen/drivers/passthrough/vtd/iommu.c -+++ b/xen/drivers/passthrough/vtd/iommu.c -@@ -53,6 +53,8 @@ bool_t __read_mostly untrusted_msi; - - int nr_iommus; - -+static struct tasklet vtd_fault_tasklet; -+ - static void setup_dom0_devices(struct domain *d); - static void setup_dom0_rmrr(struct domain *d); - -@@ -866,10 +868,8 @@ static void iommu_fault_status(u32 fault - } - - #define PRIMARY_FAULT_REG_LEN (16) --static void iommu_page_fault(int irq, void *dev_id, -- struct cpu_user_regs *regs) -+static void __do_iommu_page_fault(struct iommu *iommu) - { -- struct iommu *iommu = dev_id; - int reg, fault_index; - u32 fault_status; - unsigned long flags; -@@ -943,6 +943,37 @@ clear_overflow: - } - } - -+static void do_iommu_page_fault(unsigned long data) -+{ -+ struct acpi_drhd_unit *drhd; -+ -+ if ( list_empty(&acpi_drhd_units) ) -+ { -+ INTEL_IOMMU_DEBUG("no device found, something must be very wrong!\n"); -+ return; -+ } -+ -+ /* -+ * No matter from whom the interrupt came from, check all the -+ * IOMMUs present in the system. This allows for having just one -+ * tasklet (instead of one per each IOMMUs) and should be more than -+ * fine, considering how rare the event of a fault should be. -+ */ -+ for_each_drhd_unit ( drhd ) -+ __do_iommu_page_fault(drhd->iommu); -+} -+ -+static void iommu_page_fault(int irq, void *dev_id, -+ struct cpu_user_regs *regs) -+{ -+ /* -+ * Just flag the tasklet as runnable. This is fine, according to VT-d -+ * specs since a new interrupt won't be generated until we clear all -+ * the faults that caused this one to happen. -+ */ -+ tasklet_schedule(&vtd_fault_tasklet); -+} -+ - static void dma_msi_unmask(unsigned int irq) - { - struct iommu *iommu = irq_to_iommu[irq]; -@@ -2083,6 +2114,8 @@ int __init intel_vtd_setup(void) - iommu_hap_pt_share = FALSE; - } - -+ softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0); -+ - if ( !iommu_qinval && iommu_intremap ) - { - iommu_intremap = 0; diff --git a/24527-AMD-Vi-fault-softirq.patch b/24527-AMD-Vi-fault-softirq.patch deleted file mode 100644 index 3b01e61..0000000 --- a/24527-AMD-Vi-fault-softirq.patch +++ /dev/null @@ -1,124 +0,0 @@ -References: bnc#712051, CVE-2011-3131 - -# HG changeset patch -# User Dario Faggioli -# Date 1327054832 0 -# Node ID 028230eb2359f33da48b3b7f85173a1b49b9c7d6 -# Parent d600a3d7faeeee3cf947bf1658b873e966fc0f16 -iommu: Move IOMMU faults handling into softirq for AMD-Vi. - -Dealing with interrupts from AMD-Vi IOMMU(s) is deferred to a -softirq-tasklet, raised by the actual IRQ handler. To avoid more -interrupts being generated (because of further faults), they must be -masked in the IOMMU within the low level IRQ handler and enabled back -in the tasklet body. Notice that this may cause the log to overflow, -but none of the existing entry will be overwritten. - -Signed-off-by: Dario Faggioli -Committed-by: Keir Fraser - ---- a/xen/drivers/passthrough/amd/iommu_init.c -+++ b/xen/drivers/passthrough/amd/iommu_init.c -@@ -33,6 +33,8 @@ static int nr_amd_iommus; - static long amd_iommu_cmd_buffer_entries = IOMMU_CMD_BUFFER_DEFAULT_ENTRIES; - static long amd_iommu_event_log_entries = IOMMU_EVENT_LOG_DEFAULT_ENTRIES; - -+static struct tasklet amd_iommu_irq_tasklet; -+ - unsigned short ivrs_bdf_entries; - struct ivrs_mappings *ivrs_mappings; - struct list_head amd_iommu_head; -@@ -517,34 +519,70 @@ static void parse_event_log_entry(u32 en - } - } - -+static void do_amd_iommu_irq(unsigned long data) -+{ -+ struct amd_iommu *iommu; -+ -+ if ( !iommu_found() ) -+ { -+ AMD_IOMMU_DEBUG("no device found, something must be very wrong!\n"); -+ return; -+ } -+ -+ /* -+ * No matter from where the interrupt came from, check all the -+ * IOMMUs present in the system. This allows for having just one -+ * tasklet (instead of one per each IOMMUs). -+ */ -+ for_each_amd_iommu ( iommu ) -+ { -+ u32 entry; -+ unsigned long flags; -+ int of; -+ -+ spin_lock_irqsave(&iommu->lock, flags); -+ amd_iommu_read_event_log(iommu); -+ -+ /* check event overflow */ -+ entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); -+ of = get_field_from_reg_u32(entry, -+ IOMMU_STATUS_EVENT_OVERFLOW_MASK, -+ IOMMU_STATUS_EVENT_OVERFLOW_SHIFT); -+ -+ /* reset event log if event overflow */ -+ if ( of ) -+ amd_iommu_reset_event_log(iommu); -+ -+ /* reset interrupt status bit */ -+ entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); -+ set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry, -+ IOMMU_STATUS_EVENT_LOG_INT_MASK, -+ IOMMU_STATUS_EVENT_LOG_INT_SHIFT, &entry); -+ writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET); -+ spin_unlock_irqrestore(&iommu->lock, flags); -+ } -+} -+ - static void amd_iommu_page_fault(int irq, void *dev_id, - struct cpu_user_regs *regs) - { - u32 entry; - unsigned long flags; -- int of; - struct amd_iommu *iommu = dev_id; - - spin_lock_irqsave(&iommu->lock, flags); -- amd_iommu_read_event_log(iommu); - -- /*check event overflow */ -+ /* Silence interrupts from both event logging */ - entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); -- of = get_field_from_reg_u32(entry, -- IOMMU_STATUS_EVENT_OVERFLOW_MASK, -- IOMMU_STATUS_EVENT_OVERFLOW_SHIFT); -- -- /* reset event log if event overflow */ -- if ( of ) -- amd_iommu_reset_event_log(iommu); -- -- /* reset interrupt status bit */ -- entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); -- set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry, -+ set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, entry, - IOMMU_STATUS_EVENT_LOG_INT_MASK, - IOMMU_STATUS_EVENT_LOG_INT_SHIFT, &entry); - writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET); -+ - spin_unlock_irqrestore(&iommu->lock, flags); -+ -+ /* It is the tasklet that will clear the logs and re-enable interrupts */ -+ tasklet_schedule(&amd_iommu_irq_tasklet); - } - - static int set_iommu_interrupt_handler(struct amd_iommu *iommu) -@@ -689,6 +727,8 @@ static int __init amd_iommu_init_one(str - printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus ); - nr_amd_iommus++; - -+ softirq_tasklet_init(&amd_iommu_irq_tasklet, do_amd_iommu_irq, 0); -+ - return 0; - - error_out: diff --git a/24535-x86-vMSI-misc.patch b/24535-x86-vMSI-misc.patch deleted file mode 100644 index d0148ad..0000000 --- a/24535-x86-vMSI-misc.patch +++ /dev/null @@ -1,208 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1327311317 0 -# Node ID fb81b807c1540eb5797b3daa4bddff99363b20ef -# Parent eca719b621a1201528bfec25fb1786ec21c0c9d3 -x86/vMSI: miscellaneous fixes - -This addresses a number of problems in msixtbl_{read,write}(): -- address alignment was not checked, allowing for memory corruption in - the hypervisor (write case) or returning of hypervisor private data - to the guest (read case) -- the interrupt mask bit was permitted to be written by the guest - (while Xen's interrupt flow control routines need to control it) -- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain - numbers (making it unobvious why they have these values, and making - the latter non-portable) -- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a - non-zero table offset); this was also affecting host MSI-X code -- struct msixtbl_entry's table_flags[] was one element larger than - necessary due to improper open-coding of BITS_TO_LONGS() -- msixtbl_read() unconditionally accessed the physical table, even - though the data was only needed in a quarter of all cases -- various calculations were done unnecessarily for both of the rather - distinct code paths in msixtbl_read() - -Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was -chosen to be 3. - -Signed-off-by: Jan Beulich -Committed-by: Keir Fraser - ---- a/xen/arch/x86/hvm/vmsi.c -+++ b/xen/arch/x86/hvm/vmsi.c -@@ -158,7 +158,7 @@ struct msixtbl_entry - struct pci_dev *pdev; - unsigned long gtable; /* gpa of msix table */ - unsigned long table_len; -- unsigned long table_flags[MAX_MSIX_TABLE_ENTRIES / BITS_PER_LONG + 1]; -+ unsigned long table_flags[BITS_TO_LONGS(MAX_MSIX_TABLE_ENTRIES)]; - #define MAX_MSIX_ACC_ENTRIES 3 - struct { - uint32_t msi_ad[3]; /* Shadow of address low, high and data */ -@@ -185,17 +185,14 @@ static struct msixtbl_entry *msixtbl_fin - static void __iomem *msixtbl_addr_to_virt( - struct msixtbl_entry *entry, unsigned long addr) - { -- int idx, nr_page; -+ unsigned int idx, nr_page; - -- if ( !entry ) -+ if ( !entry || !entry->pdev ) - return NULL; - - nr_page = (addr >> PAGE_SHIFT) - - (entry->gtable >> PAGE_SHIFT); - -- if ( !entry->pdev ) -- return NULL; -- - idx = entry->pdev->msix_table_idx[nr_page]; - if ( !idx ) - return NULL; -@@ -208,37 +205,34 @@ static int msixtbl_read( - struct vcpu *v, unsigned long address, - unsigned long len, unsigned long *pval) - { -- unsigned long offset, val; -+ unsigned long offset; - struct msixtbl_entry *entry; - void *virt; -- int nr_entry, index; -+ unsigned int nr_entry, index; - int r = X86EMUL_UNHANDLEABLE; - -- rcu_read_lock(&msixtbl_rcu_lock); -+ if ( len != 4 || (address & 3) ) -+ return r; - -- if ( len != 4 ) -- goto out; -+ rcu_read_lock(&msixtbl_rcu_lock); - - entry = msixtbl_find_entry(v, address); -- virt = msixtbl_addr_to_virt(entry, address); -- if ( !virt ) -- goto out; -- -- nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE; - offset = address & (PCI_MSIX_ENTRY_SIZE - 1); -- if ( nr_entry >= MAX_MSIX_ACC_ENTRIES && -- offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET ) -- goto out; - -- val = readl(virt); - if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET ) - { -+ nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE; -+ if ( nr_entry >= MAX_MSIX_ACC_ENTRIES ) -+ goto out; - index = offset / sizeof(uint32_t); - *pval = entry->gentries[nr_entry].msi_ad[index]; - } - else - { -- *pval = val; -+ virt = msixtbl_addr_to_virt(entry, address); -+ if ( !virt ) -+ goto out; -+ *pval = readl(virt); - } - - r = X86EMUL_OKAY; -@@ -253,13 +247,13 @@ static int msixtbl_write(struct vcpu *v, - unsigned long offset; - struct msixtbl_entry *entry; - void *virt; -- int nr_entry, index; -+ unsigned int nr_entry, index; - int r = X86EMUL_UNHANDLEABLE; - -- rcu_read_lock(&msixtbl_rcu_lock); -+ if ( len != 4 || (address & 3) ) -+ return r; - -- if ( len != 4 ) -- goto out; -+ rcu_read_lock(&msixtbl_rcu_lock); - - entry = msixtbl_find_entry(v, address); - nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE; -@@ -284,9 +278,22 @@ static int msixtbl_write(struct vcpu *v, - if ( !virt ) - goto out; - -+ /* Do not allow the mask bit to be changed. */ -+#if 0 /* XXX -+ * As the mask bit is the only defined bit in the word, and as the -+ * host MSI-X code doesn't preserve the other bits anyway, doing -+ * this is pointless. So for now just discard the write (also -+ * saving us from having to determine the matching irq_desc). -+ */ -+ spin_lock_irqsave(&desc->lock, flags); -+ orig = readl(virt); -+ val &= ~PCI_MSIX_VECTOR_BITMASK; -+ val |= orig & PCI_MSIX_VECTOR_BITMASK; - writel(val, virt); -- r = X86EMUL_OKAY; -+ spin_unlock_irqrestore(&desc->lock, flags); -+#endif - -+ r = X86EMUL_OKAY; - out: - rcu_read_unlock(&msixtbl_rcu_lock); - return r; ---- a/xen/include/asm-x86/msi.h -+++ b/xen/include/asm-x86/msi.h -@@ -119,12 +119,6 @@ int msi_free_irq(struct msi_desc *entry) - - extern const struct hw_interrupt_type pci_msi_type; - --#define PCI_MSIX_ENTRY_SIZE 16 --#define PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET 0 --#define PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET 4 --#define PCI_MSIX_ENTRY_DATA_OFFSET 8 --#define PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET 12 -- - #define msi_control_reg(base) (base + PCI_MSI_FLAGS) - #define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) - #define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI) ---- a/xen/include/xen/pci.h -+++ b/xen/include/xen/pci.h -@@ -12,6 +12,8 @@ - #include - #include - #include -+#include -+#include - - /* - * The PCI interface treats multi-function devices as independent -@@ -30,8 +32,10 @@ - #define PCI_BDF(b,d,f) ((((b) & 0xff) << 8) | PCI_DEVFN(d,f)) - #define PCI_BDF2(b,df) ((((b) & 0xff) << 8) | ((df) & 0xff)) - --#define MAX_MSIX_TABLE_ENTRIES 2048 --#define MAX_MSIX_TABLE_PAGES 8 -+#define MAX_MSIX_TABLE_ENTRIES (PCI_MSIX_FLAGS_QSIZE + 1) -+#define MAX_MSIX_TABLE_PAGES PFN_UP(MAX_MSIX_TABLE_ENTRIES * \ -+ PCI_MSIX_ENTRY_SIZE + \ -+ (~PCI_MSIX_BIRMASK & (PAGE_SIZE - 1))) - struct pci_dev_info { - unsigned is_extfn; - unsigned is_virtfn; ---- a/xen/include/xen/pci_regs.h -+++ b/xen/include/xen/pci_regs.h -@@ -305,6 +305,12 @@ - #define PCI_MSIX_PBA 8 - #define PCI_MSIX_BIRMASK (7 << 0) - -+#define PCI_MSIX_ENTRY_SIZE 16 -+#define PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET 0 -+#define PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET 4 -+#define PCI_MSIX_ENTRY_DATA_OFFSET 8 -+#define PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET 12 -+ - #define PCI_MSIX_VECTOR_BITMASK (1 << 0) - - /* CompactPCI Hotswap Register */ diff --git a/24586-x86-mm_Properly_account_for_paged_out_pages.patch b/24586-x86-mm_Properly_account_for_paged_out_pages.patch index 786be95..d37ca27 100644 --- a/24586-x86-mm_Properly_account_for_paged_out_pages.patch +++ b/24586-x86-mm_Properly_account_for_paged_out_pages.patch @@ -17,11 +17,11 @@ Committed-by: Tim Deegan xen/arch/x86/mm/p2m.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -3154,7 +3154,8 @@ int p2m_mem_paging_prep(struct p2m_domai +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -3156,7 +3156,8 @@ int p2m_mem_paging_prep(struct p2m_domai set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_in, a); audit_p2m(p2m, 1); diff --git a/24615-VESA-lfb-flush.patch b/24615-VESA-lfb-flush.patch deleted file mode 100644 index d66269a..0000000 --- a/24615-VESA-lfb-flush.patch +++ /dev/null @@ -1,75 +0,0 @@ -# HG changeset patch -# User Andrew Cooper -# Date 1327758145 0 -# Node ID ac9f32525376922fdf5b9efac7a1fe0ff866cc76 -# Parent f8c2cf24a26cc6cdaaad9140e4b1dfc54f07bab3 -vesa: flush lfb after zeroing - -If Xen is going to relinquish the VGA console, flush the linear frame -buffer after zeroing it in vesa_endboot(). - -Failing to do so in some circumstances leads to the actual linear -framebuffer on the graphics card still containing the output of the -Xen boot console can lead to ugly graphics output when dom0 is setting -up the graphics card for its own use. - -While the patch is quite large, it is mostly just code motion to -prevent having to forward declare lfb_flush(). The only functional -change to vesa_endboot() is to insert a call to lbf_flush(). - -Signed-off-by: Andrew Cooper -Committed-by: Keir Fraser - ---- a/xen/drivers/video/vesa.c -+++ b/xen/drivers/video/vesa.c -@@ -153,24 +153,6 @@ void __init vesa_init(void) - xfree(line_len); - } - --void __init vesa_endboot(bool_t keep) --{ -- if ( keep ) -- { -- xpos = 0; -- vga_puts = vesa_scroll_puts; -- } -- else -- { -- unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3; -- for ( i = 0; i < vlfb_info.height; i++ ) -- memset(lfb + i * vlfb_info.bytes_per_line, 0, -- vlfb_info.width * bpp); -- } -- -- xfree(line_len); --} -- - #if defined(CONFIG_X86) - - #include -@@ -217,6 +199,25 @@ static void lfb_flush(void) - - #endif - -+void __init vesa_endboot(bool_t keep) -+{ -+ if ( keep ) -+ { -+ xpos = 0; -+ vga_puts = vesa_scroll_puts; -+ } -+ else -+ { -+ unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3; -+ for ( i = 0; i < vlfb_info.height; i++ ) -+ memset(lfb + i * vlfb_info.bytes_per_line, 0, -+ vlfb_info.width * bpp); -+ lfb_flush(); -+ } -+ -+ xfree(line_len); -+} -+ - /* Render one line of text to given linear framebuffer line. */ - static void vesa_show_line( - const unsigned char *text_line, diff --git a/24690-x86-PCI-SERR-no-deadlock.patch b/24690-x86-PCI-SERR-no-deadlock.patch deleted file mode 100644 index 3ae760a..0000000 --- a/24690-x86-PCI-SERR-no-deadlock.patch +++ /dev/null @@ -1,67 +0,0 @@ -# HG changeset patch -# User David Vrabel -# Date 1328196538 0 -# Node ID dcc6d57e4c07728693c685a2cfa7f094ef726267 -# Parent 7091b2e4cc2cff07ad1bf24ba7b9506bae071fa8 -x86: avoid deadlock after a PCI SERR NMI - -If a PCI System Error (SERR) is asserted it causes an NMI. If this NMI -occurs while the CPU is in printk() then Xen may deadlock as -pci_serr_error() calls console_force_unlock() which screws up the -console lock. - -printk() isn't safe to call from NMI context so defer the diagnostic -message to a softirq. - -Signed-off-by: David Vrabel -Tested-by: George Dunlap -Committed-by: Keir Fraser - ---- a/xen/arch/x86/traps.c -+++ b/xen/arch/x86/traps.c -@@ -3137,6 +3137,11 @@ static void nmi_mce_softirq(void) - st->vcpu = NULL; - } - -+static void pci_serr_softirq(void) -+{ -+ printk("\n\nNMI - PCI system error (SERR)\n"); -+} -+ - void async_exception_cleanup(struct vcpu *curr) - { - int trap; -@@ -3223,10 +3228,11 @@ static void nmi_dom0_report(unsigned int - - static void pci_serr_error(struct cpu_user_regs *regs) - { -- console_force_unlock(); -- printk("\n\nNMI - PCI system error (SERR)\n"); -- - outb((inb(0x61) & 0x0f) | 0x04, 0x61); /* clear-and-disable the PCI SERR error line. */ -+ -+ /* Would like to print a diagnostic here but can't call printk() -+ from NMI context -- raise a softirq instead. */ -+ raise_softirq(PCI_SERR_SOFTIRQ); - } - - static void io_check_error(struct cpu_user_regs *regs) -@@ -3529,6 +3535,7 @@ void __init trap_init(void) - cpu_init(); - - open_softirq(NMI_MCE_SOFTIRQ, nmi_mce_softirq); -+ open_softirq(PCI_SERR_SOFTIRQ, pci_serr_softirq); - } - - long register_guest_nmi_callback(unsigned long address) ---- a/xen/include/asm-x86/softirq.h -+++ b/xen/include/asm-x86/softirq.h -@@ -6,6 +6,7 @@ - #define VCPU_KICK_SOFTIRQ (NR_COMMON_SOFTIRQS + 2) - - #define MACHINE_CHECK_SOFTIRQ (NR_COMMON_SOFTIRQS + 3) --#define NR_ARCH_SOFTIRQS 4 -+#define PCI_SERR_SOFTIRQ (NR_COMMON_SOFTIRQS + 4) -+#define NR_ARCH_SOFTIRQS 5 - - #endif /* __ASM_SOFTIRQ_H__ */ diff --git a/24701-gnttab-map-grant-ref-recovery.patch b/24701-gnttab-map-grant-ref-recovery.patch deleted file mode 100644 index f045e5c..0000000 --- a/24701-gnttab-map-grant-ref-recovery.patch +++ /dev/null @@ -1,37 +0,0 @@ -# HG changeset patch -# User Haoyu Zhang -# Date 1328563421 28800 -# Node ID 3574f4d67843733ccaabab5f8ebb859c99d7314a -# Parent 5bd5830dea13f2a80a1b9728d3e61c34661fe764 -Fix error recovery path in __gnttab_map_grant_ref - -In file grant_table.c function __gnttab_map_grant_ref, if -__get_paged_frame failed, the effect of _set_status previously -called should be rollback, so the flag GTF_reading and _GTF_writing -will be recovered. - - -Signed-off-by: Haoyu Zhang -Signed-off-by: Liang Wang -Acked-by: Andres Lagar-Cavilla -Committed-by: Keir Fraser - ---- a/xen/common/grant_table.c -+++ b/xen/common/grant_table.c -@@ -566,7 +566,7 @@ __gnttab_map_grant_ref( - gfn = sha1 ? sha1->frame : sha2->full_page.frame; - rc = __get_paged_frame(gfn, &frame, !!(op->flags & GNTMAP_readonly), rd); - if ( rc != GNTST_okay ) -- goto unlock_out; -+ goto unlock_out_clear; - act->gfn = gfn; - act->domid = ld->domain_id; - act->frame = frame; -@@ -722,6 +722,7 @@ __gnttab_map_grant_ref( - act->pin -= (op->flags & GNTMAP_readonly) ? - GNTPIN_hstr_inc : GNTPIN_hstw_inc; - -+ unlock_out_clear: - if ( !(op->flags & GNTMAP_readonly) && - !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) ) - gnttab_clear_flag(_GTF_writing, status); diff --git a/24742-gnttab-misc.patch b/24742-gnttab-misc.patch deleted file mode 100644 index b8fe15f..0000000 --- a/24742-gnttab-misc.patch +++ /dev/null @@ -1,97 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1328801956 -3600 -# Node ID 9fc810bb814558bc5c8f9d086af7576516e07244 -# Parent fb71a97fe339282965d584663236ce71a2400659 -gnttab: miscellaneous fixes - -- _GTF_* constants name bit positions, so binary arithmetic on them is - wrong -- gnttab_clear_flag() cannot (on x86 and ia64 at least) simply use - clear_bit(), as that may access more than the two bytes that are - intended to be accessed - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/common/grant_table.c -+++ b/xen/common/grant_table.c -@@ -389,7 +389,8 @@ static int _set_status_v2(domid_t domid - (id != domid) || - (!readonly && (flags & GTF_readonly)) ) - { -- gnttab_clear_flag(_GTF_reading | _GTF_writing, status); -+ gnttab_clear_flag(_GTF_writing, status); -+ gnttab_clear_flag(_GTF_reading, status); - PIN_FAIL(done, GNTST_general_error, - "Unstable flags (%x) or dom (%d). (expected dom %d) " - "(r/w: %d)\n", -@@ -1704,14 +1705,14 @@ __release_grant_for_copy( - under the domain's grant table lock. */ - /* Only safe on transitive grants. Even then, note that we don't - attempt to drop any pin on the referent grant. */ --static void __fixup_status_for_pin(struct active_grant_entry *act, -+static void __fixup_status_for_pin(const struct active_grant_entry *act, - uint16_t *status) - { - if ( !(act->pin & GNTPIN_hstw_mask) ) -- *status &= ~_GTF_writing; -+ *status &= ~GTF_writing; - - if ( !(act->pin & GNTPIN_hstr_mask) ) -- *status &= ~_GTF_reading; -+ *status &= ~GTF_reading; - } - - /* Grab a frame number from a grant entry and update the flags and pin ---- a/xen/include/asm-ia64/grant_table.h -+++ b/xen/include/asm-ia64/grant_table.h -@@ -5,6 +5,8 @@ - #ifndef __ASM_GRANT_TABLE_H__ - #define __ASM_GRANT_TABLE_H__ - -+#include -+ - #define INITIAL_NR_GRANT_FRAMES 1 - - // for grant map/unmap -@@ -82,9 +84,19 @@ int guest_physmap_add_page(struct domain - - #define gnttab_mark_dirty(d, f) ((void)f) - --static inline void gnttab_clear_flag(unsigned long nr, uint16_t *addr) -+static inline void gnttab_clear_flag(unsigned int nr, volatile uint16_t *st) - { -- clear_bit(nr, addr); -+ /* -+ * Note that this cannot be clear_bit(), as the access must be -+ * confined to the specified 2 bytes. -+ */ -+ uint16_t mask = ~(1 << nr), old; -+ CMPXCHG_BUGCHECK_DECL -+ -+ do { -+ CMPXCHG_BUGCHECK(st); -+ old = *st; -+ } while (cmpxchg_rel(st, old, old & mask) != old); - } - - #define gnttab_host_mapping_get_page_type(op, ld, rd) \ ---- a/xen/include/asm-x86/grant_table.h -+++ b/xen/include/asm-x86/grant_table.h -@@ -48,9 +48,13 @@ int replace_grant_host_mapping( - - #define gnttab_mark_dirty(d, f) paging_mark_dirty((d), (f)) - --static inline void gnttab_clear_flag(unsigned long nr, uint16_t *addr) -+static inline void gnttab_clear_flag(unsigned int nr, uint16_t *st) - { -- clear_bit(nr, (unsigned long *)addr); -+ /* -+ * Note that this cannot be clear_bit(), as the access must be -+ * confined to the specified 2 bytes. -+ */ -+ asm volatile ("lock btrw %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st)); - } - - /* Foreign mappings of HHVM-guest pages do not modify the type count. */ diff --git a/24780-x86-paging-use-clear_guest.patch b/24780-x86-paging-use-clear_guest.patch index ca5d538..cdfdb40 100644 --- a/24780-x86-paging-use-clear_guest.patch +++ b/24780-x86-paging-use-clear_guest.patch @@ -17,9 +17,11 @@ Acked-by: Tim Deegan (Include necessary prerequisite bits from 24543:d6cdbc4fe078 "Introduce clear_user and clear_guest".) ---- a/xen/arch/x86/hvm/hvm.c -+++ b/xen/arch/x86/hvm/hvm.c -@@ -2163,6 +2163,86 @@ static enum hvm_copy_result __hvm_copy( +Index: xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +@@ -2171,6 +2171,86 @@ static enum hvm_copy_result __hvm_copy( return HVMCOPY_okay; } @@ -106,7 +108,7 @@ Acked-by: Tim Deegan enum hvm_copy_result hvm_copy_to_guest_phys( paddr_t paddr, void *buf, int size) { -@@ -2249,6 +2329,23 @@ unsigned long copy_to_user_hvm(void *to, +@@ -2257,6 +2337,23 @@ unsigned long copy_to_user_hvm(void *to, return rc ? len : 0; /* fake a copy_to_user() return code */ } @@ -130,8 +132,10 @@ Acked-by: Tim Deegan unsigned long copy_from_user_hvm(void *to, const void *from, unsigned len) { int rc; ---- a/xen/arch/x86/mm/paging.c -+++ b/xen/arch/x86/mm/paging.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/paging.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/paging.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/paging.c @@ -21,11 +21,11 @@ */ @@ -248,8 +252,10 @@ Acked-by: Tim Deegan b1 = b1 & 0x7; } b2 = 0; ---- a/xen/arch/x86/usercopy.c -+++ b/xen/arch/x86/usercopy.c +Index: xen-4.1.3-testing/xen/arch/x86/usercopy.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/usercopy.c ++++ xen-4.1.3-testing/xen/arch/x86/usercopy.c @@ -110,6 +110,42 @@ copy_to_user(void __user *to, const void return n; } @@ -293,8 +299,10 @@ Acked-by: Tim Deegan /** * copy_from_user: - Copy a block of data from user space. * @to: Destination address, in kernel space. ---- a/xen/include/asm-x86/guest_access.h -+++ b/xen/include/asm-x86/guest_access.h +Index: xen-4.1.3-testing/xen/include/asm-x86/guest_access.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/asm-x86/guest_access.h ++++ xen-4.1.3-testing/xen/include/asm-x86/guest_access.h @@ -21,6 +21,10 @@ (is_hvm_vcpu(current) ? \ copy_from_user_hvm((dst), (src), (len)) : \ @@ -341,8 +349,10 @@ Acked-by: Tim Deegan #define __copy_field_to_guest(hnd, ptr, field) ({ \ const typeof(&(ptr)->field) _s = &(ptr)->field; \ void *_d = &(hnd).p->field; \ ---- a/xen/include/asm-x86/hvm/guest_access.h -+++ b/xen/include/asm-x86/hvm/guest_access.h +Index: xen-4.1.3-testing/xen/include/asm-x86/hvm/guest_access.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/asm-x86/hvm/guest_access.h ++++ xen-4.1.3-testing/xen/include/asm-x86/hvm/guest_access.h @@ -2,6 +2,7 @@ #define __ASM_X86_HVM_GUEST_ACCESS_H__ @@ -351,8 +361,10 @@ Acked-by: Tim Deegan unsigned long copy_from_user_hvm(void *to, const void *from, unsigned len); #endif /* __ASM_X86_HVM_GUEST_ACCESS_H__ */ ---- a/xen/include/asm-x86/uaccess.h -+++ b/xen/include/asm-x86/uaccess.h +Index: xen-4.1.3-testing/xen/include/asm-x86/uaccess.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/asm-x86/uaccess.h ++++ xen-4.1.3-testing/xen/include/asm-x86/uaccess.h @@ -16,6 +16,7 @@ #endif @@ -361,8 +373,10 @@ Acked-by: Tim Deegan unsigned long copy_from_user(void *to, const void *from, unsigned len); /* Handles exceptions in both to and from, but doesn't do access_ok */ unsigned long __copy_to_user_ll(void *to, const void *from, unsigned n); ---- a/xen/include/xen/guest_access.h -+++ b/xen/include/xen/guest_access.h +Index: xen-4.1.3-testing/xen/include/xen/guest_access.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/xen/guest_access.h ++++ xen-4.1.3-testing/xen/include/xen/guest_access.h @@ -15,10 +15,16 @@ #define copy_from_guest(ptr, hnd, nr) \ copy_from_guest_offset(ptr, hnd, 0, nr) diff --git a/24805-x86-MSI-X-dom0-ro.patch b/24805-x86-MSI-X-dom0-ro.patch index 42e3942..d9f0d87 100644 --- a/24805-x86-MSI-X-dom0-ro.patch +++ b/24805-x86-MSI-X-dom0-ro.patch @@ -17,9 +17,11 @@ the original c/s 22182:68cc3c514a0a description for options). Signed-off-by: Jan Beulich Acked-by: Keir Fraser ---- a/xen/arch/x86/mm.c -+++ b/xen/arch/x86/mm.c -@@ -835,7 +835,7 @@ get_page_from_l1e( +Index: xen-4.1.3-testing/xen/arch/x86/mm.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/mm.c +@@ -836,7 +836,7 @@ get_page_from_l1e( return -EINVAL; } diff --git a/24883-x86-guest-walk-not-present.patch b/24883-x86-guest-walk-not-present.patch deleted file mode 100644 index 5fcc062..0000000 --- a/24883-x86-guest-walk-not-present.patch +++ /dev/null @@ -1,70 +0,0 @@ -References: bnc#747331 - -# HG changeset patch -# User Tim Deegan -# Date 1329992967 0 -# Node ID adcd6ab160fae996d53c6843da0c5728ca8a8bd3 -# Parent 3d4955cbcb67a1c41e6b71af783b0921a3f7b081 -x86/mm: Don't check for invalid bits in non-present PTEs. - -If _PAGE_PRESENT is clean in a pagetable entry, any pattern of bits -is valid in the rest of the entry. OSes that special-case -PFEC_invalid_bits (since it should never happen) will be confused -by our setting it in this way. - -Signed-off-by: Tim Deegan - ---- a/xen/arch/x86/mm/guest_walk.c -+++ b/xen/arch/x86/mm/guest_walk.c -@@ -162,8 +162,11 @@ guest_walk_tables(struct vcpu *v, struct - l4p = (guest_l4e_t *) top_map; - gw->l4e = l4p[guest_l4_table_offset(va)]; - gflags = guest_l4e_get_flags(gw->l4e) ^ iflags; -+ if ( !(gflags & _PAGE_PRESENT) ) { -+ rc |= _PAGE_PRESENT; -+ goto out; -+ } - rc |= ((gflags & mflags) ^ mflags); -- if ( rc & _PAGE_PRESENT ) goto out; - - /* Map the l3 table */ - l3p = map_domain_gfn(p2m, -@@ -176,9 +179,11 @@ guest_walk_tables(struct vcpu *v, struct - /* Get the l3e and check its flags*/ - gw->l3e = l3p[guest_l3_table_offset(va)]; - gflags = guest_l3e_get_flags(gw->l3e) ^ iflags; -- rc |= ((gflags & mflags) ^ mflags); -- if ( rc & _PAGE_PRESENT ) -+ if ( !(gflags & _PAGE_PRESENT) ) { -+ rc |= _PAGE_PRESENT; - goto out; -+ } -+ rc |= ((gflags & mflags) ^ mflags); - - #else /* PAE only... */ - -@@ -213,9 +218,11 @@ guest_walk_tables(struct vcpu *v, struct - #endif /* All levels... */ - - gflags = guest_l2e_get_flags(gw->l2e) ^ iflags; -- rc |= ((gflags & mflags) ^ mflags); -- if ( rc & _PAGE_PRESENT ) -+ if ( !(gflags & _PAGE_PRESENT) ) { -+ rc |= _PAGE_PRESENT; - goto out; -+ } -+ rc |= ((gflags & mflags) ^ mflags); - - pse = (guest_supports_superpages(v) && - (guest_l2e_get_flags(gw->l2e) & _PAGE_PSE)); -@@ -277,6 +284,10 @@ guest_walk_tables(struct vcpu *v, struct - goto out; - gw->l1e = l1p[guest_l1_table_offset(va)]; - gflags = guest_l1e_get_flags(gw->l1e) ^ iflags; -+ if ( !(gflags & _PAGE_PRESENT) ) { -+ rc |= _PAGE_PRESENT; -+ goto out; -+ } - rc |= ((gflags & mflags) ^ mflags); - } - diff --git a/24887-x86-vmce-sr.patch b/24887-x86-vmce-sr.patch index 0c4ac0f..aea8754 100644 --- a/24887-x86-vmce-sr.patch +++ b/24887-x86-vmce-sr.patch @@ -37,9 +37,11 @@ number of banks and other MCA capabilities for a guest before it starts Signed-off-by: Jan Beulich Acked-by: Keir Fraser ---- a/tools/libxc/xc_domain_save.c -+++ b/tools/libxc/xc_domain_save.c -@@ -1766,6 +1766,7 @@ int xc_domain_save(xc_interface *xch, in +Index: xen-4.1.3-testing/tools/libxc/xc_domain_save.c +=================================================================== +--- xen-4.1.3-testing.orig/tools/libxc/xc_domain_save.c ++++ xen-4.1.3-testing/tools/libxc/xc_domain_save.c +@@ -1778,6 +1778,7 @@ int xc_domain_save(xc_interface *xch, in domctl.cmd = XEN_DOMCTL_get_ext_vcpucontext; domctl.domain = dom; @@ -47,8 +49,10 @@ Acked-by: Keir Fraser domctl.u.ext_vcpucontext.vcpu = i; if ( xc_domctl(xch, &domctl) < 0 ) { ---- a/tools/misc/xen-hvmctx.c -+++ b/tools/misc/xen-hvmctx.c +Index: xen-4.1.3-testing/tools/misc/xen-hvmctx.c +=================================================================== +--- xen-4.1.3-testing.orig/tools/misc/xen-hvmctx.c ++++ xen-4.1.3-testing/tools/misc/xen-hvmctx.c @@ -375,6 +375,13 @@ static void dump_viridian(void) (unsigned long long) p.guest_os_id); } @@ -71,8 +75,10 @@ Acked-by: Keir Fraser case HVM_SAVE_CODE(END): break; default: printf(" ** Don't understand type %u: skipping\n", ---- a/xen/arch/x86/cpu/mcheck/mce.h -+++ b/xen/arch/x86/cpu/mcheck/mce.h +Index: xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/mce.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/cpu/mcheck/mce.h ++++ xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/mce.h @@ -3,6 +3,7 @@ #define _MCE_H @@ -118,8 +124,10 @@ Acked-by: Keir Fraser return 1; return 0; } ---- a/xen/arch/x86/cpu/mcheck/mce_intel.c -+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c +Index: xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/mce_intel.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/cpu/mcheck/mce_intel.c ++++ xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/mce_intel.c @@ -1322,11 +1322,12 @@ enum mcheck_type intel_mcheck_init(struc } @@ -150,8 +158,10 @@ Acked-by: Keir Fraser { mce_printk(MCE_QUIET, "We have disabled CMCI capability, " "Guest should not read this MSR!\n"); ---- a/xen/arch/x86/cpu/mcheck/vmce.c -+++ b/xen/arch/x86/cpu/mcheck/vmce.c +Index: xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/vmce.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/cpu/mcheck/vmce.c ++++ xen-4.1.3-testing/xen/arch/x86/cpu/mcheck/vmce.c @@ -10,6 +10,7 @@ #include #include @@ -218,7 +228,7 @@ Acked-by: Keir Fraser mce_printk(MCE_VERBOSE, "MCE: rdmsr MC%u_CTL 0x%"PRIx64"\n", bank, *val); break; -@@ -126,7 +146,7 @@ static int bank_mce_rdmsr(struct domain +@@ -126,7 +146,7 @@ static int bank_mce_rdmsr(struct domain switch ( boot_cpu_data.x86_vendor ) { case X86_VENDOR_INTEL: @@ -227,7 +237,7 @@ Acked-by: Keir Fraser break; default: ret = 0; -@@ -145,13 +165,13 @@ static int bank_mce_rdmsr(struct domain +@@ -145,13 +165,13 @@ static int bank_mce_rdmsr(struct domain */ int vmce_rdmsr(uint32_t msr, uint64_t *val) { @@ -295,7 +305,7 @@ Acked-by: Keir Fraser break; case MSR_IA32_MC0_STATUS: /* Give the first entry of the list, it corresponds to current -@@ -202,9 +221,9 @@ static int bank_mce_wrmsr(struct domain +@@ -202,9 +221,9 @@ static int bank_mce_wrmsr(struct domain * the guest, this node will be deleted. * Only error bank is written. Non-error banks simply return. */ @@ -307,7 +317,7 @@ Acked-by: Keir Fraser struct bank_entry, list); if ( entry->bank == bank ) entry->mci_status = val; -@@ -228,7 +247,7 @@ static int bank_mce_wrmsr(struct domain +@@ -228,7 +247,7 @@ static int bank_mce_wrmsr(struct domain switch ( boot_cpu_data.x86_vendor ) { case X86_VENDOR_INTEL: @@ -316,7 +326,7 @@ Acked-by: Keir Fraser break; default: ret = 0; -@@ -247,9 +266,9 @@ static int bank_mce_wrmsr(struct domain +@@ -247,9 +266,9 @@ static int bank_mce_wrmsr(struct domain */ int vmce_wrmsr(u32 msr, u64 val) { @@ -393,8 +403,10 @@ Acked-by: Keir Fraser int inject_vmce(struct domain *d) { int cpu = smp_processor_id(); ---- a/xen/arch/x86/domain.c -+++ b/xen/arch/x86/domain.c +Index: xen-4.1.3-testing/xen/arch/x86/domain.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/domain.c ++++ xen-4.1.3-testing/xen/arch/x86/domain.c @@ -376,6 +376,8 @@ int vcpu_initialise(struct vcpu *v) if ( (rc = xsave_alloc_save_area(v)) != 0 ) return rc; @@ -404,9 +416,11 @@ Acked-by: Keir Fraser if ( is_hvm_domain(d) ) { if ( (rc = hvm_vcpu_initialise(v)) != 0 ) ---- a/xen/arch/x86/domctl.c -+++ b/xen/arch/x86/domctl.c -@@ -1137,11 +1137,12 @@ long arch_do_domctl( +Index: xen-4.1.3-testing/xen/arch/x86/domctl.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/domctl.c ++++ xen-4.1.3-testing/xen/arch/x86/domctl.c +@@ -1140,11 +1140,12 @@ long arch_do_domctl( evc->syscall32_callback_eip = 0; evc->syscall32_disables_events = 0; #endif @@ -420,7 +434,7 @@ Acked-by: Keir Fraser goto ext_vcpucontext_out; #ifdef __x86_64__ fixup_guest_code_selector(d, evc->sysenter_callback_cs); -@@ -1160,6 +1161,9 @@ long arch_do_domctl( +@@ -1163,6 +1164,9 @@ long arch_do_domctl( evc->syscall32_callback_eip ) goto ext_vcpucontext_out; #endif @@ -430,9 +444,11 @@ Acked-by: Keir Fraser } ret = 0; ---- a/xen/include/asm-x86/domain.h -+++ b/xen/include/asm-x86/domain.h -@@ -425,6 +425,8 @@ struct arch_vcpu +Index: xen-4.1.3-testing/xen/include/asm-x86/domain.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/asm-x86/domain.h ++++ xen-4.1.3-testing/xen/include/asm-x86/domain.h +@@ -429,6 +429,8 @@ struct arch_vcpu */ uint64_t xcr0_accum; @@ -441,8 +457,10 @@ Acked-by: Keir Fraser /* Current LDT details. */ unsigned long shadow_ldt_mapcnt; spinlock_t shadow_ldt_lock; ---- a/xen/include/asm-x86/mce.h -+++ b/xen/include/asm-x86/mce.h +Index: xen-4.1.3-testing/xen/include/asm-x86/mce.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/asm-x86/mce.h ++++ xen-4.1.3-testing/xen/include/asm-x86/mce.h @@ -16,7 +16,6 @@ struct bank_entry { struct domain_mca_msrs { @@ -460,8 +478,10 @@ Acked-by: Keir Fraser extern int vmce_wrmsr(uint32_t msr, uint64_t val); extern int vmce_rdmsr(uint32_t msr, uint64_t *val); #endif ---- a/xen/include/asm-x86/msr-index.h -+++ b/xen/include/asm-x86/msr-index.h +Index: xen-4.1.3-testing/xen/include/asm-x86/msr-index.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/asm-x86/msr-index.h ++++ xen-4.1.3-testing/xen/include/asm-x86/msr-index.h @@ -101,48 +101,40 @@ #define MSR_AMD64_MC0_MASK 0xc0010044 @@ -519,8 +539,10 @@ Acked-by: Keir Fraser #define MSR_AMD64_MCx_MASK(x) (MSR_AMD64_MC0_MASK + (x)) ---- a/xen/include/public/arch-x86/hvm/save.h -+++ b/xen/include/public/arch-x86/hvm/save.h +Index: xen-4.1.3-testing/xen/include/public/arch-x86/hvm/save.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/public/arch-x86/hvm/save.h ++++ xen-4.1.3-testing/xen/include/public/arch-x86/hvm/save.h @@ -580,9 +580,15 @@ struct hvm_hw_cpu_xsave { #define CPU_XSAVE_CODE 16 @@ -538,8 +560,10 @@ Acked-by: Keir Fraser +#define HVM_SAVE_CODE_MAX 18 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */ ---- a/xen/include/public/domctl.h -+++ b/xen/include/public/domctl.h +Index: xen-4.1.3-testing/xen/include/public/domctl.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/public/domctl.h ++++ xen-4.1.3-testing/xen/include/public/domctl.h @@ -558,7 +558,7 @@ struct xen_domctl_ext_vcpucontext { uint32_t vcpu; /* diff --git a/24888-pci-release-devices.patch b/24888-pci-release-devices.patch deleted file mode 100644 index 77291d1..0000000 --- a/24888-pci-release-devices.patch +++ /dev/null @@ -1,114 +0,0 @@ -References: bnc#744771 - -# HG changeset patch -# User Jan Beulich -# Date 1330080392 -3600 -# Node ID 71159fb049f253030c3820c260d092d4aec6b166 -# Parent 35d855e520038bf5814f53d105dc4adf58a670f2 -passthrough: release assigned PCI devices earlier during domain shutdown - -At least with xend, where there's not even a tool stack side attempt to -de-assign devices during domain shutdown, this allows immediate re- -starts of a domain to work reliably. (There's no apparent reason why -c/s 18010:c1577f094ae4 chose to put this in the asynchronous part of -domain destruction). - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - -# HG changeset patch -# User Jan Beulich -# Date 1331114358 -3600 -# Node ID f234e34ea28f753bba92980f367cf545666d69a1 -# Parent e0d944b501512fe3b9866f79e95ad0f29cd5caca -passthrough: fix domain ref leak after 24888:71159fb049f2 - -As pointed out by Keir. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/ia64/xen/dom0_ops.c -+++ b/xen/arch/ia64/xen/dom0_ops.c -@@ -330,10 +330,13 @@ long arch_do_domctl(xen_domctl_t *op, XE - break; - - ret = -EINVAL; -- if ( unlikely((d = get_domain_by_id(op->domain)) == NULL) ) -+ if ( unlikely((d = get_domain_by_id(op->domain)) == NULL) || -+ unlikely(d->is_dying) ) - { - gdprintk(XENLOG_ERR, - "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n"); -+ if ( d ) -+ put_domain(d); - break; - } - bus = (op->u.assign_device.machine_bdf >> 16) & 0xff; -@@ -344,6 +347,7 @@ long arch_do_domctl(xen_domctl_t *op, XE - gdprintk(XENLOG_ERR, "XEN_DOMCTL_assign_device: " - "%x:%x.%x already assigned, or non-existent\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); -+ put_domain(d); - break; - } - ---- a/xen/arch/ia64/xen/domain.c -+++ b/xen/arch/ia64/xen/domain.c -@@ -671,10 +671,8 @@ void arch_domain_destroy(struct domain * - free_xenheap_pages(d->shared_info, - get_order_from_shift(XSI_SHIFT)); - -- if ( iommu_enabled && need_iommu(d) ) { -- pci_release_devices(d); -+ if ( iommu_enabled && need_iommu(d) ) - iommu_domain_destroy(d); -- } - - tlb_track_destroy(d); - -@@ -1719,6 +1717,8 @@ int domain_relinquish_resources(struct d - - switch (d->arch.relres) { - case RELRES_not_started: -+ pci_release_devices(d); -+ - /* Relinquish guest resources for VT-i domain. */ - if (is_hvm_domain(d)) - vmx_relinquish_guest_resources(d); ---- a/xen/arch/x86/domain.c -+++ b/xen/arch/x86/domain.c -@@ -607,7 +607,6 @@ void arch_domain_destroy(struct domain * - hvm_domain_destroy(d); - - vmce_destroy_msr(d); -- pci_release_devices(d); - free_domain_pirqs(d); - if ( !is_idle_domain(d) ) - iommu_domain_destroy(d); -@@ -1956,6 +1955,8 @@ int domain_relinquish_resources(struct d - switch ( d->arch.relmem ) - { - case RELMEM_not_started: -+ pci_release_devices(d); -+ - /* Tear down paging-assistance stuff. */ - paging_teardown(d); - ---- a/xen/arch/x86/domctl.c -+++ b/xen/arch/x86/domctl.c -@@ -828,10 +828,13 @@ long arch_do_domctl( - break; - - ret = -EINVAL; -- if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) ) -+ if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) || -+ unlikely(d->is_dying) ) - { - gdprintk(XENLOG_ERR, - "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n"); -+ if ( d ) -+ goto assign_device_out; - break; - } - diff --git a/24950-gnttab-copy-mapped.patch b/24950-gnttab-copy-mapped.patch deleted file mode 100644 index 30670a3..0000000 --- a/24950-gnttab-copy-mapped.patch +++ /dev/null @@ -1,27 +0,0 @@ -# HG changeset patch -# User Wei Liu -# Date 1330619838 0 -# Node ID 9ef985f5e6a57d2e78d27c5f0f64e6a049d8d1ff -# Parent ce5ef8a192c1050d85580305921d2e5caf220461 -Grant table: fix a bug when grant copying a previous grant mapped page. - -In grant table version 2, when we create a non-transitive mapping from -DomU to Dom0, we need to set active entry's trans_domain and -trans_ref. Otherwise when we grant copy from this previous mapped -ref, preemption count will get messed up. - -See changeset 22994:299ed79acecf for more information. - -Signed-off-by: Wei Liu - ---- a/xen/common/grant_table.c -+++ b/xen/common/grant_table.c -@@ -574,6 +574,8 @@ __gnttab_map_grant_ref( - act->start = 0; - act->length = PAGE_SIZE; - act->is_sub_page = 0; -+ act->trans_dom = op->dom; -+ act->trans_gref = op->ref; - } - } - diff --git a/24970-x86-cpuidle-deny-port-access.patch b/24970-x86-cpuidle-deny-port-access.patch deleted file mode 100644 index 92109c7..0000000 --- a/24970-x86-cpuidle-deny-port-access.patch +++ /dev/null @@ -1,32 +0,0 @@ -# HG changeset patch -# User Jan Beulich -# Date 1331048501 -3600 -# Node ID 33980e36597b9f780ef515210863034b5e3080bf -# Parent fb70e48ee3c2ea7060a97d9ddaa6dfc864f1efc0 -x86/cpuidle: deny access to the I/O port used for EM_SYSIO - -Nothing, not even Dom0, should fiddle with this. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/x86/acpi/cpu_idle.c -+++ b/xen/arch/x86/acpi/cpu_idle.c -@@ -44,6 +44,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -885,6 +886,9 @@ static void set_cx( - cx->entry_method = ACPI_CSTATE_EM_HALT; - break; - case ACPI_ADR_SPACE_SYSTEM_IO: -+ if ( ioports_deny_access(dom0, cx->address, cx->address) ) -+ printk(XENLOG_WARNING "Could not deny access to port %04x\n", -+ cx->address); - cx->entry_method = ACPI_CSTATE_EM_SYSIO; - break; - default: diff --git a/24996-x86-cpuidle-array-overrun.patch b/24996-x86-cpuidle-array-overrun.patch deleted file mode 100644 index 998a2bf..0000000 --- a/24996-x86-cpuidle-array-overrun.patch +++ /dev/null @@ -1,156 +0,0 @@ -# HG changeset patch -# User Eric Chanudet -# Date 1331222672 -3600 -# Node ID 396801f25e922bdf1db5fd644435f46407586524 -# Parent 66de4220113e937811529b12ea7f6427c0848630 -XENPF_set_processor_pminfo XEN_PM_CX overflows states array - -Calling XENPF_set_processor_pminfo with XEN_PM_CX could cause states -array in "struct acpi_processor_power" to exceed its limit. - -The array used to be reset (by function cpuidle_init_cpu()) for each -hypercall. The patch puts it back that way and adds an assertion to -make it clear in case that happens again. - -Signed-off-by: Eric Chanudet - -- convert assertion to printk() & bail -- eliminate struct acpi_processor_cx's valid member (not read anymore) -- further adjustments to one-time-only vs each-time operations in - cpuidle_init_cpu() -- don't use ACPI_STATE_Cn as array index anymore - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/x86/acpi/cpu_idle.c -+++ b/xen/arch/x86/acpi/cpu_idle.c -@@ -70,10 +70,8 @@ static void lapic_timer_nop(void) { } - static void (*lapic_timer_off)(void); - static void (*lapic_timer_on)(void); - --static uint64_t (*get_tick)(void); --static uint64_t (*ticks_elapsed)(uint64_t t1, uint64_t t2); --static uint64_t (*tick_to_ns)(uint64_t ticks); --static uint64_t (*ns_to_tick)(uint64_t ticks); -+static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns; -+static uint64_t (*__read_mostly ns_to_tick)(uint64_t) = ns_to_acpi_pm_tick; - - extern void (*pm_idle) (void); - extern void (*dead_idle) (void); -@@ -224,6 +222,10 @@ static uint64_t acpi_pm_ticks_elapsed(ui - return ((0xFFFFFFFF - t1) + t2 +1); - } - -+static uint64_t (*__read_mostly get_tick)(void) = get_acpi_pm_tick; -+static uint64_t (*__read_mostly ticks_elapsed)(uint64_t, uint64_t) -+ = acpi_pm_ticks_elapsed; -+ - #define MWAIT_ECX_INTERRUPT_BREAK (0x1) - - /* -@@ -609,7 +611,16 @@ static int cpuidle_init_cpu(int cpu) - acpi_power = processor_powers[cpu]; - if ( !acpi_power ) - { -- int i; -+ unsigned int i; -+ -+ if ( cpu == 0 && boot_cpu_has(X86_FEATURE_NONSTOP_TSC) ) -+ { -+ get_tick = get_stime_tick; -+ ticks_elapsed = stime_ticks_elapsed; -+ tick_to_ns = stime_tick_to_ns; -+ ns_to_tick = ns_to_stime_tick; -+ } -+ - acpi_power = xmalloc(struct acpi_processor_power); - if ( !acpi_power ) - return -ENOMEM; -@@ -617,36 +628,15 @@ static int cpuidle_init_cpu(int cpu) - - for ( i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++ ) - acpi_power->states[i].idx = i; -- -- acpi_power->states[ACPI_STATE_C1].type = ACPI_STATE_C1; -- acpi_power->states[ACPI_STATE_C1].entry_method = ACPI_CSTATE_EM_HALT; -- -- acpi_power->states[ACPI_STATE_C0].valid = 1; -- acpi_power->states[ACPI_STATE_C1].valid = 1; -- -- acpi_power->count = 2; -- acpi_power->safe_state = &acpi_power->states[ACPI_STATE_C1]; -+ - acpi_power->cpu = cpu; - processor_powers[cpu] = acpi_power; - } - -- if ( cpu == 0 ) -- { -- if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) ) -- { -- get_tick = get_stime_tick; -- ticks_elapsed = stime_ticks_elapsed; -- tick_to_ns = stime_tick_to_ns; -- ns_to_tick = ns_to_stime_tick; -- } -- else -- { -- get_tick = get_acpi_pm_tick; -- ticks_elapsed = acpi_pm_ticks_elapsed; -- tick_to_ns = acpi_pm_tick_to_ns; -- ns_to_tick = ns_to_acpi_pm_tick; -- } -- } -+ acpi_power->count = 2; -+ acpi_power->states[1].type = ACPI_STATE_C1; -+ acpi_power->states[1].entry_method = ACPI_CSTATE_EM_HALT; -+ acpi_power->safe_state = &acpi_power->states[1]; - - return 0; - } -@@ -863,17 +853,25 @@ static void set_cx( - if ( check_cx(acpi_power, xen_cx) != 0 ) - return; - -- if ( xen_cx->type == ACPI_STATE_C1 ) -+ switch ( xen_cx->type ) -+ { -+ case ACPI_STATE_C1: - cx = &acpi_power->states[1]; -- else -- cx = &acpi_power->states[acpi_power->count]; -- -- if ( !cx->valid ) -- acpi_power->count++; -+ break; -+ default: -+ if ( acpi_power->count >= ACPI_PROCESSOR_MAX_POWER ) -+ { -+ case ACPI_STATE_C0: -+ printk(XENLOG_WARNING "CPU%u: C%d data ignored\n", -+ acpi_power->cpu, xen_cx->type); -+ return; -+ } -+ cx = &acpi_power->states[acpi_power->count++]; -+ cx->type = xen_cx->type; -+ break; -+ } - -- cx->valid = 1; -- cx->type = xen_cx->type; -- cx->address = xen_cx->reg.address; -+ cx->address = xen_cx->reg.address; - - switch ( xen_cx->reg.space_id ) - { ---- a/xen/include/xen/cpuidle.h -+++ b/xen/include/xen/cpuidle.h -@@ -40,7 +40,6 @@ - struct acpi_processor_cx - { - u8 idx; -- u8 valid; - u8 type; - u32 address; - u8 entry_method; /* ACPI_CSTATE_EM_xxx */ diff --git a/25098-x86-emul-lock-UD.patch b/25098-x86-emul-lock-UD.patch deleted file mode 100644 index c9e1c1c..0000000 --- a/25098-x86-emul-lock-UD.patch +++ /dev/null @@ -1,73 +0,0 @@ -# HG changeset patch -# User Andrew Cooper -# Date 1332535516 0 -# Node ID 2e45b26bc412099a2b8f009bcf111e4b6c23847b -# Parent 2ca43b65718fbe2d3f9ea36132e139ef774d9a11 -x86_emulate: raise #UD rather than #GP on invalid use of LOCK prefix - -From: Andrew Cooper -Signed-off-by: Keir Fraser -Committed-by: Keir Fraser - -# HG changeset patch -# User Keir Fraser -# Date 1332535908 0 -# Node ID 4bd752a4cdf323c41c50f8cd6286f566d67adeae -# Parent 2e45b26bc412099a2b8f009bcf111e4b6c23847b -x86_emulate: Do not push an error code onto a #UD exception stack - -Signed-off-by: Keir Fraser - ---- a/xen/arch/x86/x86_emulate/x86_emulate.c -+++ b/xen/arch/x86/x86_emulate/x86_emulate.c -@@ -1353,7 +1353,7 @@ x86_emulate( - } - - /* Lock prefix is allowed only on RMW instructions. */ -- generate_exception_if((d & Mov) && lock_prefix, EXC_GP, 0); -+ generate_exception_if((d & Mov) && lock_prefix, EXC_UD, -1); - - /* ModRM and SIB bytes. */ - if ( d & ModRM ) -@@ -1572,12 +1572,12 @@ x86_emulate( - lock_prefix && - ((b < 0x20) || (b > 0x23)) && /* MOV CRn/DRn */ - (b != 0xc7), /* CMPXCHG{8,16}B */ -- EXC_GP, 0); -+ EXC_UD, -1); - dst.type = OP_NONE; - break; - - case DstReg: -- generate_exception_if(lock_prefix, EXC_GP, 0); -+ generate_exception_if(lock_prefix, EXC_UD, -1); - dst.type = OP_REG; - if ( d & ByteOp ) - { -@@ -1633,7 +1633,7 @@ x86_emulate( - dst = ea; - if ( dst.type == OP_REG ) - { -- generate_exception_if(lock_prefix, EXC_GP, 0); -+ generate_exception_if(lock_prefix, EXC_UD, -1); - switch ( dst.bytes ) - { - case 1: dst.val = *(uint8_t *)dst.reg; break; -@@ -3645,14 +3645,14 @@ x86_emulate( - struct segment_register cs = { 0 }, ss = { 0 }; - int rc; - -- generate_exception_if(in_realmode(ctxt, ops), EXC_UD, 0); -- generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, 0); -+ generate_exception_if(in_realmode(ctxt, ops), EXC_UD, -1); -+ generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1); - - /* Inject #UD if syscall/sysret are disabled. */ - fail_if(ops->read_msr == NULL); - if ( (rc = ops->read_msr(MSR_EFER, &msr_content, ctxt)) != 0 ) - goto done; -- generate_exception_if((msr_content & EFER_SCE) == 0, EXC_UD, 0); -+ generate_exception_if((msr_content & EFER_SCE) == 0, EXC_UD, -1); - - if ( (rc = ops->read_msr(MSR_STAR, &msr_content, ctxt)) != 0 ) - goto done; diff --git a/25101-x86-hpet-disable.patch b/25101-x86-hpet-disable.patch deleted file mode 100644 index 304a01b..0000000 --- a/25101-x86-hpet-disable.patch +++ /dev/null @@ -1,125 +0,0 @@ -References: bnc#748896 - -# HG changeset patch -# User Jan Beulich -# Date 1332854423 -7200 -# Node ID f06ff3dfde08ee563970cffba502742249ff5820 -# Parent ed48258053aea953afd28b746b53af7b8b30531b -x86/hpet: disable before reboot or kexec - -Linux up to now is not smart enough to properly clear the HPET when it -boots, which is particularly a problem when a kdump attempt from -running under Xen is being made. Linux itself added code to work around -this to its shutdown paths quite some time ago, so let's do something -similar in Xen: Save the configuration register settings during boot, -and restore them during shutdown. This should cover the majority of -cases where the secondary kernel might not come up because timer -interrupts don't work. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/x86/crash.c -+++ b/xen/arch/x86/crash.c -@@ -94,6 +94,7 @@ static void nmi_shootdown_cpus(void) - x2apic_enabled = (current_local_apic_mode() == APIC_MODE_X2APIC); - - disable_IO_APIC(); -+ hpet_disable(); - } - - void machine_crash_shutdown(void) ---- a/xen/arch/x86/hpet.c -+++ b/xen/arch/x86/hpet.c -@@ -721,12 +721,14 @@ int hpet_legacy_irq_tick(void) - return 1; - } - -+static u32 *hpet_boot_cfg; -+ - u64 hpet_setup(void) - { - static u64 hpet_rate; - static u32 system_reset_latch; - u32 hpet_id, hpet_period, cfg; -- int i; -+ unsigned int i, last; - - if ( system_reset_latch == system_reset_counter ) - return hpet_rate; -@@ -752,13 +754,20 @@ u64 hpet_setup(void) - return 0; - } - -+ last = (hpet_id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT; -+ hpet_boot_cfg = xmalloc_array(u32, 2 + last); -+ - cfg = hpet_read32(HPET_CFG); -+ if ( hpet_boot_cfg ) -+ *hpet_boot_cfg = cfg; - cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY); - hpet_write32(cfg, HPET_CFG); - -- for ( i = 0; i <= ((hpet_id >> 8) & 31); i++ ) -+ for ( i = 0; i <= last; ++i ) - { - cfg = hpet_read32(HPET_Tn_CFG(i)); -+ if ( hpet_boot_cfg ) -+ hpet_boot_cfg[i + 1] = cfg; - cfg &= ~HPET_TN_ENABLE; - hpet_write32(cfg, HPET_Tn_CFG(i)); - } -@@ -772,3 +781,21 @@ u64 hpet_setup(void) - - return hpet_rate; - } -+ -+void hpet_disable(void) -+{ -+ unsigned int i; -+ u32 id; -+ -+ if ( !hpet_boot_cfg ) -+ return; -+ -+ hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG); -+ -+ id = hpet_read32(HPET_ID); -+ for ( i = 0; i <= ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT); ++i ) -+ hpet_write32(hpet_boot_cfg[i + 1], HPET_Tn_CFG(i)); -+ -+ if ( *hpet_boot_cfg & HPET_CFG_ENABLE ) -+ hpet_write32(*hpet_boot_cfg, HPET_CFG); -+} ---- a/xen/arch/x86/smp.c -+++ b/xen/arch/x86/smp.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -373,6 +374,7 @@ void smp_send_stop(void) - local_irq_disable(); - __stop_this_cpu(); - disable_IO_APIC(); -+ hpet_disable(); - local_irq_enable(); - } - ---- a/xen/include/asm-x86/hpet.h -+++ b/xen/include/asm-x86/hpet.h -@@ -68,6 +68,11 @@ extern unsigned long hpet_address; - u64 hpet_setup(void); - - /* -+ * Disable HPET hardware: restore it to boot time state. -+ */ -+void hpet_disable(void); -+ -+/* - * Callback from legacy timer (PIT channel 0) IRQ handler. - * Returns 1 if tick originated from HPET; else 0. - */ diff --git a/25168-x86-memset-size.patch b/25168-x86-memset-size.patch deleted file mode 100644 index 7a1e88d..0000000 --- a/25168-x86-memset-size.patch +++ /dev/null @@ -1,27 +0,0 @@ -# HG changeset patch -# User Tim Deegan -# Date 1334146233 -3600 -# Node ID d5f9005dfc4ac2edb444e342a427dbe0f2cdf2f5 -# Parent 2badbf64a582ed62f39ca465c189f759c67350c8 -x86: fix memset(ptr, 0, sizeof ptr). - -Signed-off-by: Tim Deegan -Acked-by: Jan Beulich -Acked-by: Christoph Egger -Acked-by: Keir Fraser -Committed-by: Tim Deegan - ---- a/xen/arch/x86/cpu/mcheck/amd_f10.c -+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c -@@ -73,9 +73,9 @@ amd_f10_handler(struct mc_info *mi, uint - return NULL; - } - -- memset(mc_ext, 0, sizeof(mc_ext)); -+ memset(mc_ext, 0, sizeof(*mc_ext)); - mc_ext->common.type = MC_TYPE_EXTENDED; -- mc_ext->common.size = sizeof(mc_ext); -+ mc_ext->common.size = sizeof(*mc_ext); - mc_ext->mc_msrs = 3; - - mc_ext->mc_msr[0].reg = MSR_F10_MC4_MISC1; diff --git a/25191-x86-tdt-delta-calculation.patch b/25191-x86-tdt-delta-calculation.patch deleted file mode 100644 index 953651d..0000000 --- a/25191-x86-tdt-delta-calculation.patch +++ /dev/null @@ -1,55 +0,0 @@ -# HG changeset patch -# User David Vrabel -# Date 1334159385 -3600 -# Node ID a95fc7decc831a01ed43c307c52287b32e7f4832 -# Parent d196634484a9f86136704f973293925445961079 -x86: fix delta calculation in TSC deadline timer emulation - -In the virtual LAPIC, correct the delta calculation when emulating the -TSC deadline timer. - -Without this fix, XenServer (which is based on Xen 4.1) does not work -when running as an HVM guest. dom0 fails to boot because its timer -interrupts are very delayed (by several minutes in some cases). - -Signed-off-by: David Vrabel -Acked-by: Jan Beulich -Committed-by: Keir Fraser - ---- a/xen/arch/x86/hvm/vlapic.c -+++ b/xen/arch/x86/hvm/vlapic.c -@@ -889,7 +889,6 @@ uint64_t vlapic_tdt_msr_get(struct vlap - void vlapic_tdt_msr_set(struct vlapic *vlapic, uint64_t value) - { - uint64_t guest_tsc; -- uint64_t guest_time; - struct vcpu *v = vlapic_vcpu(vlapic); - - /* may need to exclude some other conditions like vlapic->hw.disabled */ -@@ -901,12 +900,10 @@ void vlapic_tdt_msr_set(struct vlapic *v - - /* new_value = 0, >0 && <= now, > now */ - guest_tsc = hvm_get_guest_tsc(v); -- guest_time = hvm_get_guest_time(v); - if ( value > guest_tsc ) - { -- uint64_t delta = value - v->arch.hvm_vcpu.cache_tsc_offset; -- delta = gtsc_to_gtime(v->domain, delta); -- delta = max_t(s64, delta - guest_time, 0); -+ uint64_t delta = gtsc_to_gtime(v->domain, value - guest_tsc); -+ delta = max_t(s64, delta, 0); - - HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "delta[0x%016"PRIx64"]", delta); - -@@ -940,9 +937,8 @@ void vlapic_tdt_msr_set(struct vlapic *v - - HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, - "tdt_msr[0x%016"PRIx64"]," -- " gtsc[0x%016"PRIx64"]," -- " gtime[0x%016"PRIx64"]", -- vlapic->hw.tdt_msr, guest_tsc, guest_time); -+ " gtsc[0x%016"PRIx64"]", -+ vlapic->hw.tdt_msr, guest_tsc); - } - - static int __vlapic_accept_pic_intr(struct vcpu *v) diff --git a/25195-x86-cpuidle-C2-no-flush-or-bm-check.patch b/25195-x86-cpuidle-C2-no-flush-or-bm-check.patch deleted file mode 100644 index a7d8fd5..0000000 --- a/25195-x86-cpuidle-C2-no-flush-or-bm-check.patch +++ /dev/null @@ -1,37 +0,0 @@ -# HG changeset patch -# User Wei Wang -# Date 1334574328 -7200 -# Node ID a06e6cdeafe34964721df3ddb32774d4634fd7ad -# Parent 6b72eb3b40cf2b3d5a6c75d68fa7093c57fc0d1f -x86/cpuidle: do not flush cache unless entering C3 - -Nor is there a need to disable bus master arbitration in that case. - -Signed-off-by: Wei Wang -Modified-by: Zhang, Yang Z -Signed-off-by: Jan Beulich -Committed-by: Jan Beulich - ---- a/xen/arch/x86/acpi/cpu_idle.c -+++ b/xen/arch/x86/acpi/cpu_idle.c -@@ -485,7 +485,9 @@ static void acpi_processor_idle(void) - * not set. In that case we cannot do much, we enter C3 - * without doing anything. - */ -- if ( power->flags.bm_check && power->flags.bm_control ) -+ if ( cx->type != ACPI_STATE_C3 ) -+ /* nothing to be done here */; -+ else if ( power->flags.bm_check && power->flags.bm_control ) - { - spin_lock(&c3_cpu_status.lock); - if ( ++c3_cpu_status.count == num_online_cpus() ) -@@ -507,7 +509,8 @@ static void acpi_processor_idle(void) - /* Invoke C3 */ - acpi_idle_do_entry(cx); - -- if ( power->flags.bm_check && power->flags.bm_control ) -+ if ( (cx->type == ACPI_STATE_C3) && -+ power->flags.bm_check && power->flags.bm_control ) - { - /* Enable bus master arbitration */ - spin_lock(&c3_cpu_status.lock); diff --git a/25196-x86-HAP-PAT-sr.patch b/25196-x86-HAP-PAT-sr.patch index 8b71662..55ea4be 100644 --- a/25196-x86-HAP-PAT-sr.patch +++ b/25196-x86-HAP-PAT-sr.patch @@ -17,9 +17,11 @@ Signed-off-by: Gianluca Guida Acked-by: Tim Deegan Committed-by: Keir Fraser ---- a/xen/arch/x86/hvm/hvm.c -+++ b/xen/arch/x86/hvm/hvm.c -@@ -209,6 +209,31 @@ void hvm_set_rdtsc_exiting(struct domain +Index: xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +@@ -217,6 +217,31 @@ void hvm_set_rdtsc_exiting(struct domain hvm_funcs.set_rdtsc_exiting(v, enable); } @@ -51,7 +53,7 @@ Committed-by: Keir Fraser void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc) { uint64_t tsc; -@@ -2483,7 +2508,7 @@ int hvm_msr_read_intercept(unsigned int +@@ -2491,7 +2516,7 @@ int hvm_msr_read_intercept(unsigned int break; case MSR_IA32_CR_PAT: @@ -60,7 +62,7 @@ Committed-by: Keir Fraser break; case MSR_MTRRcap: -@@ -2599,7 +2624,7 @@ int hvm_msr_write_intercept(unsigned int +@@ -2607,7 +2632,7 @@ int hvm_msr_write_intercept(unsigned int break; case MSR_IA32_CR_PAT: @@ -69,8 +71,10 @@ Committed-by: Keir Fraser goto gp_fault; break; ---- a/xen/arch/x86/hvm/mtrr.c -+++ b/xen/arch/x86/hvm/mtrr.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/mtrr.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/mtrr.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/mtrr.c @@ -406,26 +406,6 @@ uint32_t get_pat_flags(struct vcpu *v, return pat_type_2_pte_flags(pat_entry_value); } @@ -116,8 +120,10 @@ Committed-by: Keir Fraser mtrr_state->mtrr_cap = hw_mtrr.msr_mtrr_cap; ---- a/xen/arch/x86/hvm/svm/svm.c -+++ b/xen/arch/x86/hvm/svm/svm.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/svm/svm.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/svm/svm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/svm/svm.c @@ -585,6 +585,28 @@ static void svm_set_segment_register(str svm_vmload(vmcb); } @@ -147,7 +153,7 @@ Committed-by: Keir Fraser static void svm_set_tsc_offset(struct vcpu *v, u64 offset) { struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb; -@@ -1507,6 +1529,8 @@ static struct hvm_function_table __read_ +@@ -1519,6 +1541,8 @@ static struct hvm_function_table __read_ .update_host_cr3 = svm_update_host_cr3, .update_guest_cr = svm_update_guest_cr, .update_guest_efer = svm_update_guest_efer, @@ -156,8 +162,10 @@ Committed-by: Keir Fraser .set_tsc_offset = svm_set_tsc_offset, .inject_exception = svm_inject_exception, .init_hypercall_page = svm_init_hypercall_page, ---- a/xen/arch/x86/hvm/vmx/vmx.c -+++ b/xen/arch/x86/hvm/vmx/vmx.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/vmx/vmx.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/vmx/vmx.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/vmx/vmx.c @@ -921,6 +921,34 @@ static void vmx_set_segment_register(str vmx_vmcs_exit(v); } @@ -202,8 +210,10 @@ Committed-by: Keir Fraser .set_tsc_offset = vmx_set_tsc_offset, .inject_exception = vmx_inject_exception, .init_hypercall_page = vmx_init_hypercall_page, ---- a/xen/include/asm-x86/hvm/hvm.h -+++ b/xen/include/asm-x86/hvm/hvm.h +Index: xen-4.1.3-testing/xen/include/asm-x86/hvm/hvm.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/asm-x86/hvm/hvm.h ++++ xen-4.1.3-testing/xen/include/asm-x86/hvm/hvm.h @@ -116,6 +116,9 @@ struct hvm_function_table { void (*update_guest_cr)(struct vcpu *v, unsigned int cr); void (*update_guest_efer)(struct vcpu *v); diff --git a/25200-x86_64-trap-bounce-flags.patch b/25200-x86_64-trap-bounce-flags.patch deleted file mode 100644 index ec53c7c..0000000 --- a/25200-x86_64-trap-bounce-flags.patch +++ /dev/null @@ -1,138 +0,0 @@ -References: bnc#757970 - -# HG changeset patch -# User Jan Beulich -# Date 1334669633 -7200 -# Node ID 80f4113be5007f5b8a61048272193ce134b4fc28 -# Parent 6092641e364428e7be20c9e23497d7a1fc535112 -x86-64: fix #GP generation in assembly code - -When guest use of sysenter (64-bit PV guest) or syscall (32-bit PV -guest) gets converted into a GP fault (due to no callback having got -registered), we must -- honor the GP fault handler's request the keep enabled or mask event - delivery -- not allow TBF_EXCEPTION to remain set past the generation of the - (guest) exception in the vCPU's trap_bounce.flags, as that would - otherwise allow for the next exception occurring in guest mode, - should it happen to get handled in Xen itself, to nevertheless get - bounced to the guest kernel. - -Also, just like compat mode syscall handling already did, native mode -sysenter handling should, when converting to #GP, subtract 2 from the -RIP present in the frame so that the guest's GP fault handler would -see the fault pointing to the offending instruction instead of past it. - -Finally, since those exception generating code blocks needed to be -modified anyway, convert them to make use of UNLIKELY_{START,END}(). - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - -# HG changeset patch -# User Jan Beulich -# Date 1334675825 -7200 -# Node ID 569d6f05e1ef3146c269bca6313e2777420d616d -# Parent cf129a80e47e3664eb14070600a3b5c8c2a60440 -x86-64: fix updating of UREGS_rip when converting sysenter to #GP - -(I spotted this copy-and-paste mistake only when backporting c/s -25200:80f4113be500 to 4.1 and 4.0.) - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/x86/x86_64/asm-offsets.c -+++ b/xen/arch/x86/x86_64/asm-offsets.c -@@ -90,6 +90,8 @@ void __dummy__(void) - arch.guest_context.trap_ctxt[TRAP_gp_fault].address); - OFFSET(VCPU_gp_fault_sel, struct vcpu, - arch.guest_context.trap_ctxt[TRAP_gp_fault].cs); -+ OFFSET(VCPU_gp_fault_flags, struct vcpu, -+ arch.guest_context.trap_ctxt[TRAP_gp_fault].flags); - OFFSET(VCPU_kernel_sp, struct vcpu, arch.guest_context.kernel_sp); - OFFSET(VCPU_kernel_ss, struct vcpu, arch.guest_context.kernel_ss); - OFFSET(VCPU_guest_context_flags, struct vcpu, arch.guest_context.flags); ---- a/xen/arch/x86/x86_64/compat/entry.S -+++ b/xen/arch/x86/x86_64/compat/entry.S -@@ -214,6 +214,7 @@ compat_failsafe_callback: - ENTRY(compat_post_handle_exception) - testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx) - jz compat_test_all_events -+.Lcompat_bounce_exception: - call compat_create_bounce_frame - movb $0,TRAPBOUNCE_flags(%rdx) - jmp compat_test_all_events -@@ -226,19 +227,20 @@ ENTRY(compat_syscall) - leaq VCPU_trap_bounce(%rbx),%rdx - testl $~3,%esi - leal (,%rcx,TBF_INTERRUPT),%ecx -- jz 2f --1: movq %rax,TRAPBOUNCE_eip(%rdx) -- movw %si,TRAPBOUNCE_cs(%rdx) -- movb %cl,TRAPBOUNCE_flags(%rdx) -- call compat_create_bounce_frame -- jmp compat_test_all_events --2: movl $TRAP_gp_fault,UREGS_entry_vector(%rsp) -+UNLIKELY_START(z, compat_syscall_gpf) -+ movl $TRAP_gp_fault,UREGS_entry_vector(%rsp) - subl $2,UREGS_rip(%rsp) -- movq VCPU_gp_fault_addr(%rbx),%rax -- movzwl VCPU_gp_fault_sel(%rbx),%esi -- movb $(TBF_EXCEPTION|TBF_EXCEPTION_ERRCODE|TBF_INTERRUPT),%cl - movl $0,TRAPBOUNCE_error_code(%rdx) -- jmp 1b -+ movl VCPU_gp_fault_addr(%rbx),%eax -+ movzwl VCPU_gp_fault_sel(%rbx),%esi -+ testb $4,VCPU_gp_fault_flags(%rbx) -+ setnz %cl -+ leal TBF_EXCEPTION|TBF_EXCEPTION_ERRCODE(,%rcx,TBF_INTERRUPT),%ecx -+UNLIKELY_END(compat_syscall_gpf) -+ movq %rax,TRAPBOUNCE_eip(%rdx) -+ movw %si,TRAPBOUNCE_cs(%rdx) -+ movb %cl,TRAPBOUNCE_flags(%rdx) -+ jmp .Lcompat_bounce_exception - - ENTRY(compat_sysenter) - cmpl $TRAP_gp_fault,UREGS_entry_vector(%rsp) ---- a/xen/arch/x86/x86_64/entry.S -+++ b/xen/arch/x86/x86_64/entry.S -@@ -278,19 +278,21 @@ sysenter_eflags_saved: - leaq VCPU_trap_bounce(%rbx),%rdx - testq %rax,%rax - leal (,%rcx,TBF_INTERRUPT),%ecx -- jz 2f --1: movq VCPU_domain(%rbx),%rdi -+UNLIKELY_START(z, sysenter_gpf) -+ movl $TRAP_gp_fault,UREGS_entry_vector(%rsp) -+ subq $2,UREGS_rip(%rsp) -+ movl %eax,TRAPBOUNCE_error_code(%rdx) -+ movq VCPU_gp_fault_addr(%rbx),%rax -+ testb $4,VCPU_gp_fault_flags(%rbx) -+ setnz %cl -+ leal TBF_EXCEPTION|TBF_EXCEPTION_ERRCODE(,%rcx,TBF_INTERRUPT),%ecx -+UNLIKELY_END(sysenter_gpf) -+ movq VCPU_domain(%rbx),%rdi - movq %rax,TRAPBOUNCE_eip(%rdx) - movb %cl,TRAPBOUNCE_flags(%rdx) - testb $1,DOMAIN_is_32bit_pv(%rdi) - jnz compat_sysenter -- call create_bounce_frame -- jmp test_all_events --2: movl %eax,TRAPBOUNCE_error_code(%rdx) -- movq VCPU_gp_fault_addr(%rbx),%rax -- movb $(TBF_EXCEPTION|TBF_EXCEPTION_ERRCODE|TBF_INTERRUPT),%cl -- movl $TRAP_gp_fault,UREGS_entry_vector(%rsp) -- jmp 1b -+ jmp .Lbounce_exception - - ENTRY(int80_direct_trap) - pushq $0 -@@ -482,6 +484,7 @@ handle_exception_saved: - jnz compat_post_handle_exception - testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx) - jz test_all_events -+.Lbounce_exception: - call create_bounce_frame - movb $0,TRAPBOUNCE_flags(%rdx) - jmp test_all_events diff --git a/25242-x86_64-hotplug-compat-m2p.patch b/25242-x86_64-hotplug-compat-m2p.patch deleted file mode 100644 index 1995493..0000000 --- a/25242-x86_64-hotplug-compat-m2p.patch +++ /dev/null @@ -1,27 +0,0 @@ -# HG changeset patch -# User Malcolm Crossley -# Date 1335350156 -7200 -# Node ID b7ce6a88bebbbd8d03fe50099ede8de4d9adef0f -# Parent 15f094c85c85fb769f72a48b9c5d924a8e455855 -x86-64: Fix memory hotplug epfn upper limit test for updating the compat M2P table - -The epfn is being compared to (RDWR_COMPAT_MPT_VIRT_END - -RDWR_COMPAT_MPT_VIRT_START) without a 2 bit shift, resulting in the -epfn being compared to the size of the RDWR_COMPAT_MPT table in bytes -instead of the maximum page frame number that the RDWR_COMPAT_MPT -table can map. - -Signed-off-by: Malcolm Crossley -Committed-by: Jan Beulich - ---- a/xen/arch/x86/x86_64/mm.c -+++ b/xen/arch/x86/x86_64/mm.c -@@ -451,7 +451,7 @@ static int setup_compat_m2p_table(struct - if ((smap > ((RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2)) ) - return 0; - -- if (epfn > (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START)) -+ if ( epfn > ((RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2) ) - epfn = (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2; - - emap = ( (epfn + ((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1 )) & diff --git a/25271-x86_64-IST-index.patch b/25271-x86_64-IST-index.patch deleted file mode 100644 index 2cefb8b..0000000 --- a/25271-x86_64-IST-index.patch +++ /dev/null @@ -1,57 +0,0 @@ -# HG changeset patch -# User Andrew Cooper -# Date 1336644272 -3600 -# Node ID 54da0329e259c11b63afe3312c9fa6cc1cb7cc9d -# Parent b059c62449fb490074d85c00aa03c38fb34a0e80 -x86_64: Fix off-by-one error setting up the Interrupt Stack Tables - -The Interrupt Stack Table entries in a 64bit TSS are a 1 based data -structure as far as hardware is concerned. As a result, the code -setting up stacks in subarch_percpu_traps_init() fills in the wrong -IST entries. - -The result is that the MCE handler executes on the stack set up for -NMIs; the NMI handler executes on a stack set up for Double Faults, -and Double Faults are executed with a stack pointer set to 0. - -Once the #DF handler starts to execute, it will usually take a page -fault looking up the address at 0xfffffffffffffff8, which will cause a -triple fault. If a guest has mapped a page in that location, then it -will have some state overwritten, but as the #DF handler always calls -panic(), this is not a problem the guest will have time to care about. - -Signed-off-by: Andrew Cooper -Committed-by: Keir Fraser - ---- a/xen/arch/x86/x86_64/traps.c -+++ b/xen/arch/x86/x86_64/traps.c -@@ -389,13 +389,13 @@ void __devinit subarch_percpu_traps_init - BUILD_BUG_ON((IST_MAX + 2) * PAGE_SIZE + PRIMARY_STACK_SIZE > STACK_SIZE); - - /* Machine Check handler has its own per-CPU 4kB stack. */ -- this_cpu(init_tss).ist[IST_MCE] = (unsigned long)&stack[IST_MCE * PAGE_SIZE]; -+ this_cpu(init_tss).ist[IST_MCE-1] = (unsigned long)&stack[IST_MCE * PAGE_SIZE]; - - /* Double-fault handler has its own per-CPU 4kB stack. */ -- this_cpu(init_tss).ist[IST_DF] = (unsigned long)&stack[IST_DF * PAGE_SIZE]; -+ this_cpu(init_tss).ist[IST_DF-1] = (unsigned long)&stack[IST_DF * PAGE_SIZE]; - - /* NMI handler has its own per-CPU 4kB stack. */ -- this_cpu(init_tss).ist[IST_NMI] = (unsigned long)&stack[IST_NMI * PAGE_SIZE]; -+ this_cpu(init_tss).ist[IST_NMI-1] = (unsigned long)&stack[IST_NMI * PAGE_SIZE]; - - /* Trampoline for SYSCALL entry from long mode. */ - stack = &stack[IST_MAX * PAGE_SIZE]; /* Skip the IST stacks. */ ---- a/xen/include/asm-x86/processor.h -+++ b/xen/include/asm-x86/processor.h -@@ -427,7 +427,9 @@ struct tss_struct { - union { u64 rsp1, esp1; }; - union { u64 rsp2, esp2; }; - u64 reserved1; -- u64 ist[7]; -+ u64 ist[7]; /* Interrupt Stack Table is 1-based so tss->ist[0] -+ * corresponds to an IST value of 1 in an Interrupt -+ * Descriptor */ - u64 reserved2; - u16 reserved3; - #else diff --git a/25327-pvdrv-no-asm-system-h.patch b/25327-pvdrv-no-asm-system-h.patch deleted file mode 100644 index ef2ed5c..0000000 --- a/25327-pvdrv-no-asm-system-h.patch +++ /dev/null @@ -1,24 +0,0 @@ -# HG changeset patch -# User Olaf Hering -# Date 1336989867 -7200 -# Node ID cc7a054a5a27bbb75a9b83d3c62ed6094c209e66 -# Parent cd4dd23a831d954ba530ced0fdea9685c1975d44 -unmodified_drivers: remove inclusion of asm/system.h - -Allow compilation of PVonHVM drivers with forward-ported xenlinux -sources in openSuSE 12.2. Since Linux 3.4 asm/system.h is not present -anymore. Remove inclusion of this header, its not needed. - -Signed-off-by: Olaf Hering -Committed-by: Jan Beulich - ---- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -@@ -30,7 +30,6 @@ - #include - #include - #include --#include - #include - #include - #include diff --git a/25382-x86-masked-MCE-masking-NMI.patch b/25382-x86-masked-MCE-masking-NMI.patch new file mode 100644 index 0000000..4cd8260 --- /dev/null +++ b/25382-x86-masked-MCE-masking-NMI.patch @@ -0,0 +1,73 @@ +# HG changeset patch +# User Jan Beulich +# Date 1337697011 -7200 +# Node ID 6dc80df50fa8a01da0494a6413d70573aeeef7a2 +# Parent d718706de1f0667c4a4ee137b9ba18e5c7d9817c +x86: don't hold off NMI delivery when MCE is masked + +Likely through copy'n'paste, all three instances of guest MCE +processing jumped to the wrong place (where NMI processing code +correctly jumps to) when MCE-s are temporarily masked (due to one +currently being processed by the guest). A nested, unmasked NMI should +get delivered immediately, however. + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/x86_32/entry.S ++++ b/xen/arch/x86/x86_32/entry.S +@@ -215,6 +215,7 @@ test_all_events: + jnz process_softirqs + testb $1,VCPU_mce_pending(%ebx) + jnz process_mce ++.Ltest_guest_nmi: + testb $1,VCPU_nmi_pending(%ebx) + jnz process_nmi + test_guest_events: +@@ -244,7 +245,7 @@ process_softirqs: + /* %ebx: struct vcpu */ + process_mce: + testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%ebx) +- jnz test_guest_events ++ jnz .Ltest_guest_nmi + sti + movb $0,VCPU_mce_pending(%ebx) + call set_guest_machinecheck_trapbounce +--- a/xen/arch/x86/x86_64/compat/entry.S ++++ b/xen/arch/x86/x86_64/compat/entry.S +@@ -104,6 +104,7 @@ ENTRY(compat_test_all_events) + jnz compat_process_softirqs + testb $1,VCPU_mce_pending(%rbx) + jnz compat_process_mce ++.Lcompat_test_guest_nmi: + testb $1,VCPU_nmi_pending(%rbx) + jnz compat_process_nmi + compat_test_guest_events: +@@ -134,7 +135,7 @@ compat_process_softirqs: + /* %rbx: struct vcpu */ + compat_process_mce: + testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx) +- jnz compat_test_guest_events ++ jnz .Lcompat_test_guest_nmi + sti + movb $0,VCPU_mce_pending(%rbx) + call set_guest_machinecheck_trapbounce +--- a/xen/arch/x86/x86_64/entry.S ++++ b/xen/arch/x86/x86_64/entry.S +@@ -204,6 +204,7 @@ test_all_events: + jnz process_softirqs + testb $1,VCPU_mce_pending(%rbx) + jnz process_mce ++.Ltest_guest_nmi: + testb $1,VCPU_nmi_pending(%rbx) + jnz process_nmi + test_guest_events: +@@ -232,7 +233,7 @@ process_softirqs: + /* %rbx: struct vcpu */ + process_mce: + testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx) +- jnz test_guest_events ++ jnz .Ltest_guest_nmi + sti + movb $0,VCPU_mce_pending(%rbx) + call set_guest_machinecheck_trapbounce diff --git a/25387-amd-iommu-workaround-73x.patch b/25387-amd-iommu-workaround-73x.patch new file mode 100644 index 0000000..e4e9ad2 --- /dev/null +++ b/25387-amd-iommu-workaround-73x.patch @@ -0,0 +1,79 @@ +# HG changeset patch +# User Wei Wang +# Date 1337786286 -7200 +# Node ID af559b5afbecba1048ad690347455ad54098f935 +# Parent 340062faf2988eeea94e37dbb3943c5a449bff10 +amd iommu: Add workaround for erratum 732 & 733 + +Signed-off-by: Wei Wang + +Add missing barriers. Fix early return from parse_ppr_log_entry(). +Slightly adjust comments. Strip trailing blanks. + +Signed-off-by: Jan Beulich +Committed-by: Jan Beulich + +--- a/xen/drivers/passthrough/amd/iommu_init.c ++++ b/xen/drivers/passthrough/amd/iommu_init.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + static struct amd_iommu **irq_to_iommu; + static int nr_amd_iommus; +@@ -467,6 +468,7 @@ static void parse_event_log_entry(u32 en + u16 domain_id, device_id, bdf, cword; + u32 code; + u64 *addr; ++ int count = 0; + char * event_str[] = {"ILLEGAL_DEV_TABLE_ENTRY", + "IO_PAGE_FAULT", + "DEV_TABLE_HW_ERROR", +@@ -479,6 +481,25 @@ static void parse_event_log_entry(u32 en + code = get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK, + IOMMU_EVENT_CODE_SHIFT); + ++ /* ++ * Workaround for erratum 732: ++ * It can happen that the tail pointer is updated before the actual entry ++ * got written. As suggested by RevGuide, we initialize the event log ++ * buffer to all zeros and clear event log entries after processing them. ++ */ ++ while ( code == 0 ) ++ { ++ if ( unlikely(++count == IOMMU_LOG_ENTRY_TIMEOUT) ) ++ { ++ AMD_IOMMU_DEBUG("AMD-Vi: No event written to log\n"); ++ return; ++ } ++ udelay(1); ++ rmb(); ++ code = get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK, ++ IOMMU_EVENT_CODE_SHIFT); ++ } ++ + if ( (code > IOMMU_EVENT_INVALID_DEV_REQUEST) || + (code < IOMMU_EVENT_ILLEGAL_DEV_TABLE_ENTRY) ) + { +@@ -517,6 +538,8 @@ static void parse_event_log_entry(u32 en + AMD_IOMMU_DEBUG("event 0x%08x 0x%08x 0x%08x 0x%08x\n", entry[0], + entry[1], entry[2], entry[3]); + } ++ ++ memset(entry, 0, IOMMU_EVENT_LOG_ENTRY_SIZE); + } + + static void do_amd_iommu_irq(unsigned long data) +--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h ++++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h +@@ -269,6 +269,8 @@ + #define IOMMU_EVENT_DEVICE_ID_MASK 0x0000FFFF + #define IOMMU_EVENT_DEVICE_ID_SHIFT 0 + ++#define IOMMU_LOG_ENTRY_TIMEOUT 1000 ++ + /* Control Register */ + #define IOMMU_CONTROL_MMIO_OFFSET 0x18 + #define IOMMU_CONTROL_TRANSLATION_ENABLE_MASK 0x00000001 diff --git a/25430-x86-AMD-Fam15-reenable-topoext.patch b/25430-x86-AMD-Fam15-reenable-topoext.patch new file mode 100644 index 0000000..a4138be --- /dev/null +++ b/25430-x86-AMD-Fam15-reenable-topoext.patch @@ -0,0 +1,48 @@ +# HG changeset patch +# User Andreas Herrmann +# Date 1338452142 -7200 +# Node ID d7ae665b03afb88a813c6f197612215697eaf8f6 +# Parent a120d24f90fb5e94244331e530aacf5b0ea86f25 +x86/amd: re-enable CPU topology extensions in case BIOS has disabled it + +BIOS will switch off the corresponding feature flag on family +15h models 10h-1fh non-desktop CPUs. + +The topology extension CPUID leafs are required to detect which +cores belong to the same compute unit. (thread siblings mask is +set accordingly and also correct information about L1i and L2 +cache sharing depends on this). + +W/o this patch we wouldn't see which cores belong to the same +compute unit and also cache sharing information for L1i and L2 +would be incorrect on such systems. + +Signed-off-by: Andreas Herrmann +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser +Committed-by: Jan Beulich + +--- a/xen/arch/x86/cpu/amd.c ++++ b/xen/arch/x86/cpu/amd.c +@@ -612,6 +612,21 @@ static void __devinit init_amd(struct cp + } + } + ++ /* re-enable TopologyExtensions if switched off by BIOS */ ++ if ((c->x86 == 0x15) && ++ (c->x86_model >= 0x10) && (c->x86_model <= 0x1f) && ++ !cpu_has(c, X86_FEATURE_TOPOEXT) && ++ !rdmsr_safe(MSR_K8_EXT_FEATURE_MASK, value)) { ++ value |= 1ULL << 54; ++ wrmsr_safe(MSR_K8_EXT_FEATURE_MASK, value); ++ rdmsrl(MSR_K8_EXT_FEATURE_MASK, value); ++ if (value & (1ULL << 54)) { ++ set_bit(X86_FEATURE_TOPOEXT, c->x86_capability); ++ printk(KERN_INFO "CPU: Re-enabling disabled " ++ "Topology Extensions Support\n"); ++ } ++ } ++ + amd_get_topology(c); + + /* Pointless to use MWAIT on Family10 as it does not deep sleep. */ diff --git a/25431-x86-EDD-MBR-sig-check.patch b/25431-x86-EDD-MBR-sig-check.patch new file mode 100644 index 0000000..8120e06 --- /dev/null +++ b/25431-x86-EDD-MBR-sig-check.patch @@ -0,0 +1,30 @@ +# HG changeset patch +# User Jan Beulich +# Date 1338452293 -7200 +# Node ID cdced279e79296f06ede71d92f5047235e4b6d55 +# Parent d7ae665b03afb88a813c6f197612215697eaf8f6 +x86/EDD: check MBR for BIOS magic before considering signature valid + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/boot/edd.S ++++ b/xen/arch/x86/boot/edd.S +@@ -53,12 +53,16 @@ edd_mbr_sig_read: + jc edd_mbr_sig_done # on failure, we're done. + cmpb $0, %ah # some BIOSes do not set CF + jne edd_mbr_sig_done # on failure, we're done. ++ cmpw $0xaa55, bootsym(boot_edd_info)+0x1fe ++ jne .Ledd_mbr_sig_next + movl bootsym(boot_edd_info)+EDD_MBR_SIG_OFFSET,%eax + movb %dl, (%bx) # store BIOS drive number + movl %eax, 4(%bx) # store signature from MBR + incb bootsym(boot_mbr_signature_nr) # note that we stored something +- incb %dl # increment to next device + addw $8, %bx # increment sig buffer ptr ++.Ledd_mbr_sig_next: ++ incb %dl # increment to next device ++ jz edd_mbr_sig_done + cmpb $EDD_MBR_SIG_MAX,bootsym(boot_mbr_signature_nr) + jb edd_mbr_sig_read + edd_mbr_sig_done: diff --git a/25459-page-list-splice.patch b/25459-page-list-splice.patch new file mode 100644 index 0000000..17716e9 --- /dev/null +++ b/25459-page-list-splice.patch @@ -0,0 +1,33 @@ +# HG changeset patch +# User Jan Beulich +# Date 1338997025 -3600 +# Node ID f6bfaf9daa508c31b2bca0e461202db2759426fc +# Parent 8ec2c428f4dad55cf6d91b893a19c2218972db5e +xen: fix page_list_splice() + +Other than in __list_splice(), the first element's prev pointer +doesn't need adjustment here - it already is PAGE_LIST_NULL. Rather +than fixing the assignment (to formally match __list_splice()), simply +assert that this assignment is really unnecessary. + +Reported-by: Jisoo Yang +Signed-off-by: Jan Beulich + +Also assert that the prev pointers are both PAGE_LIST_NULL. + +Signed-off-by: Keir Fraser + +Committed-by: Keir Fraser + +--- a/xen/include/xen/mm.h ++++ b/xen/include/xen/mm.h +@@ -268,7 +268,8 @@ page_list_splice(struct page_list_head * + last = list->tail; + at = head->next; + +- first->list.prev = page_to_pdx(head->next); ++ ASSERT(first->list.prev == PAGE_LIST_NULL); ++ ASSERT(first->list.prev == at->list.prev); + head->next = first; + + last->list.next = page_to_pdx(at); diff --git a/25479-x86-boot-trampoline-remove.patch b/25479-x86-boot-trampoline-remove.patch new file mode 100644 index 0000000..76fff01 --- /dev/null +++ b/25479-x86-boot-trampoline-remove.patch @@ -0,0 +1,463 @@ +# HG changeset patch +# User Jan Beulich +# Date 1313744093 -3600 +# Node ID dd90b59cb11c60c48e174c899190e2967341fe32 +# Parent 29aeed4979a78f26519f5fde8a405f8438297ab9 +x86: trampoline cleanup + +To make future changes less error prone, and to slightly simplify a +possible future conversion to a relocatable trampoline even for the +multiboot path (pretty desirable given that we had to change the +trampoline base a number of times to escape collisions with firmware +placed data), +- remove final uses of bootsym_phys() from trampoline.S, allowing the + symbol to be undefined before including this file (to make sure no + new references get added) +- replace two easy to deal with uses of bootsym_phys() in head.S +- remove an easy to replace reference to BOOT_TRAMPOLINE + +Signed-off-by: Jan Beulich + +# HG changeset patch +# User Jan Beulich +# Date 1339424128 -3600 +# Node ID 61dfb3da56b0a3ac86f81f4a8770e11e1dbc2aa9 +# Parent 6d1a30dc47e8dfcb826ff14c833d694fd4e6afb2 +x86: get rid of BOOT_TRAMPOLINE + +We recently saw a machine that has the EBDA extending as low as +0x7c000, so that Xen fails to boot after relocating the trampoline. +To fix this, I removed BOOT_TRAMPOLINE and bootsym_phys completely. + +Here are the parts: + +1) the trampoline segment is set to 64k below the EBDA. head.S grows +the ability to relocate the trampoline segment + +2) reloc.c is made position-independent. It allocates data below the +trampoline, whose address is passed in _eax. + +3) cmdline.S is called before relocating, so all bootsym_phys there +become sym_phys. + +Signed-off-by: Paolo Bonzini + +jb: - fall back to low memory size (instead of segment 0x7c00) if EBDA + value is out of range + - also add upper limit check on EBDA value + - fix and simplify inline assembly operands in reloc_mbi_struct() + - use lret instead of retf + - renamed early_stack to wakeup_stack, defined and used now only + in wakeup.S + - aligned reloc.bin's end of .text to 16 bytes, so that checking + __bss_start == end works reliably + +Signed-off-by: Jan Beulich + +Committed-by: Keir Fraser + +--- a/xen/arch/x86/boot/Makefile ++++ b/xen/arch/x86/boot/Makefile +@@ -2,8 +2,7 @@ obj-y += head.o + + head.o: reloc.S + +-BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\{1\,\}BOOT_TRAMPOLINE[[:space:]]\{1\,\},,p' head.S) + %.S: %.c +- RELOC=$(BOOT_TRAMPOLINE) $(MAKE) -f build32.mk $@ ++ $(MAKE) -f build32.mk $@ + + reloc.S: head.S +--- a/xen/arch/x86/boot/build32.mk ++++ b/xen/arch/x86/boot/build32.mk +@@ -15,9 +15,10 @@ CFLAGS += -Werror -fno-builtin -msoft-fl + $(OBJCOPY) -O binary $< $@ + + %.lnk: %.o +- $(LD) $(LDFLAGS_DIRECT) -N -Ttext $(RELOC) -o $@ $< ++ $(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $< + + %.o: %.c +- $(CC) $(CFLAGS) -c $< -o $@ ++ $(CC) $(CFLAGS) -c -fpic $< -o $@ + + reloc.o: $(BASEDIR)/include/asm-x86/config.h ++.PRECIOUS: %.bin %.lnk +--- a/xen/arch/x86/boot/cmdline.S ++++ b/xen/arch/x86/boot/cmdline.S +@@ -164,13 +164,13 @@ cmdline_parse_early: + pushl MB_cmdline(%ebx) + call .Lfind_option + test %eax,%eax +- setnz bootsym_phys(skip_realmode) ++ setnz sym_phys(skip_realmode) + + /* Check for 'tboot=' command-line option. */ + movl $sym_phys(.Ltboot_opt),4(%esp) + call .Lfind_option + test %eax,%eax +- setnz bootsym_phys(skip_realmode) /* tboot= implies no-real-mode */ ++ setnz sym_phys(skip_realmode) /* tboot= implies no-real-mode */ + + .Lparse_edd: + /* Check for 'edd=' command-line option. */ +@@ -181,13 +181,13 @@ cmdline_parse_early: + cmpb $'=',3(%eax) + jne .Lparse_edid + add $4,%eax +- movb $2,bootsym_phys(opt_edd) /* opt_edd=2: edd=off */ ++ movb $2,sym_phys(opt_edd) /* opt_edd=2: edd=off */ + cmpw $0x666f,(%eax) /* 0x666f == "of" */ + je .Lparse_edid +- decb bootsym_phys(opt_edd) /* opt_edd=1: edd=skipmbr */ ++ decb sym_phys(opt_edd) /* opt_edd=1: edd=skipmbr */ + cmpw $0x6b73,(%eax) /* 0x6b73 == "sk" */ + je .Lparse_edid +- decb bootsym_phys(opt_edd) /* opt_edd=0: edd=on (default) */ ++ decb sym_phys(opt_edd) /* opt_edd=0: edd=on (default) */ + + .Lparse_edid: + /* Check for 'edid=' command-line option. */ +@@ -203,17 +203,17 @@ cmdline_parse_early: + pushl $sym_phys(.Ledid_force) + call .Lstr_prefix + add $8,%esp +- movb $2,bootsym_phys(opt_edid) /* opt_edid=2: edid=force */ ++ movb $2,sym_phys(opt_edid) /* opt_edid=2: edid=force */ + test %eax,%eax + jz .Lparse_vga + push %ebx + pushl $sym_phys(.Ledid_no) + call .Lstr_prefix + add $8,%esp +- decb bootsym_phys(opt_edid) /* opt_edid=1: edid=no */ ++ decb sym_phys(opt_edid) /* opt_edid=1: edid=no */ + test %eax,%eax + jz .Lparse_vga +- decb bootsym_phys(opt_edid) /* opt_edid=0: default */ ++ decb sym_phys(opt_edid) /* opt_edid=0: default */ + + .Lparse_vga: + /* Check for 'vga=' command-line option. */ +@@ -227,7 +227,7 @@ cmdline_parse_early: + add $4,%eax + + /* Found the 'vga=' option. Default option is to display vga menu. */ +- movw $ASK_VGA,bootsym_phys(boot_vid_mode) ++ movw $ASK_VGA,sym_phys(boot_vid_mode) + + /* Check for 'vga=text-80x. */ + mov %eax,%ebx +@@ -251,7 +251,7 @@ cmdline_parse_early: + cmp %ax,%bx + lodsw + jne 1b +- mov %ax,bootsym_phys(boot_vid_mode) ++ mov %ax,sym_phys(boot_vid_mode) + jmp .Lcmdline_exit + + .Lparse_vga_gfx: +@@ -270,7 +270,7 @@ cmdline_parse_early: + push %ebx + call .Latoi + pop %esi +- mov %ax,bootsym_phys(vesa_size)+0 ++ mov %ax,sym_phys(vesa_size)+0 + /* skip 'x' */ + lodsb + cmpb $'x',%al +@@ -279,7 +279,7 @@ cmdline_parse_early: + push %esi + call .Latoi + pop %esi +- mov %ax,bootsym_phys(vesa_size)+2 ++ mov %ax,sym_phys(vesa_size)+2 + /* skip 'x' */ + lodsb + cmpb $'x',%al +@@ -288,9 +288,9 @@ cmdline_parse_early: + push %esi + call .Latoi + pop %esi +- mov %ax,bootsym_phys(vesa_size)+4 ++ mov %ax,sym_phys(vesa_size)+4 + /* commit to vesa mode */ +- movw $VIDEO_VESA_BY_SIZE,bootsym_phys(boot_vid_mode) ++ movw $VIDEO_VESA_BY_SIZE,sym_phys(boot_vid_mode) + jmp .Lcmdline_exit + + .Lparse_vga_mode: +@@ -307,7 +307,7 @@ cmdline_parse_early: + push %ebx + call .Latoi + add $4,%esp +- mov %ax,bootsym_phys(boot_vid_mode) ++ mov %ax,sym_phys(boot_vid_mode) + jmp .Lcmdline_exit + + .Lparse_vga_current: +@@ -320,7 +320,7 @@ cmdline_parse_early: + jnz .Lcmdline_exit + + /* We have 'vga=current'. */ +- movw $VIDEO_CURRENT_MODE,bootsym_phys(boot_vid_mode) ++ movw $VIDEO_CURRENT_MODE,sym_phys(boot_vid_mode) + + .Lcmdline_exit: + popa +--- a/xen/arch/x86/boot/head.S ++++ b/xen/arch/x86/boot/head.S +@@ -9,9 +9,7 @@ + .text + .code32 + +-#define BOOT_TRAMPOLINE 0x7c000 + #define sym_phys(sym) ((sym) - __XEN_VIRT_START) +-#define bootsym_phys(sym) ((sym) - trampoline_start + BOOT_TRAMPOLINE) + + #define BOOT_CS32 0x0008 + #define BOOT_CS64 0x0010 +@@ -79,6 +77,23 @@ __start: + cmp $0x2BADB002,%eax + jne not_multiboot + ++ /* Set up trampoline segment 64k below EBDA */ ++ movzwl 0x40e,%eax /* EBDA segment */ ++ cmp $0xa000,%eax /* sanity check (high) */ ++ jae 0f ++ cmp $0x4000,%eax /* sanity check (low) */ ++ jae 1f ++0: ++ movzwl 0x413,%eax /* use base memory size on failure */ ++ shl $10-4,%eax ++1: ++ sub $0x1000,%eax ++ ++ /* From arch/x86/smpboot.c: start_eip had better be page-aligned! */ ++ xor %al, %al ++ shl $4, %eax ++ mov %eax,sym_phys(trampoline_phys) ++ + /* Save the Multiboot info struct (after relocation) for later use. */ + mov $sym_phys(cpu0_stack)+1024,%esp + push %ebx +@@ -190,7 +205,7 @@ __start: + #endif + + /* Apply relocations to bootstrap trampoline. */ +- mov $BOOT_TRAMPOLINE,%edx ++ mov sym_phys(trampoline_phys),%edx + mov $sym_phys(__trampoline_rel_start),%edi + mov %edx,sym_phys(trampoline_phys) + 1: +@@ -200,17 +215,32 @@ __start: + cmp $sym_phys(__trampoline_rel_stop),%edi + jb 1b + ++ /* Patch in the trampoline segment. */ ++ shr $4,%edx ++ mov $sym_phys(__trampoline_seg_start),%edi ++1: ++ mov (%edi),%eax ++ mov %dx,(%edi,%eax) ++ add $4,%edi ++ cmp $sym_phys(__trampoline_seg_stop),%edi ++ jb 1b ++ ++ call cmdline_parse_early ++ ++ /* Switch to low-memory stack. */ ++ mov sym_phys(trampoline_phys),%edi ++ lea 0x10000(%edi),%esp ++ lea trampoline_boot_cpu_entry-trampoline_start(%edi),%eax ++ pushl $BOOT_CS32 ++ push %eax ++ + /* Copy bootstrap trampoline to low memory, below 1MB. */ + mov $sym_phys(trampoline_start),%esi +- mov $bootsym_phys(trampoline_start),%edi + mov $trampoline_end - trampoline_start,%ecx + rep movsb + +- mov $bootsym_phys(early_stack),%esp +- call cmdline_parse_early +- + /* Jump into the relocated trampoline. */ +- jmp $BOOT_CS32,$bootsym_phys(trampoline_boot_cpu_entry) ++ lret + + #include "cmdline.S" + +--- a/xen/arch/x86/boot/reloc.c ++++ b/xen/arch/x86/boot/reloc.c +@@ -10,42 +10,49 @@ + * Keir Fraser + */ + ++/* entered with %eax = BOOT_TRAMPOLINE */ + asm ( + " .text \n" + " .globl _start \n" + "_start: \n" +- " mov $_start,%edi \n" + " call 1f \n" +- "1: pop %esi \n" +- " sub $1b-_start,%esi \n" +- " mov $__bss_start-_start,%ecx \n" +- " rep movsb \n" +- " xor %eax,%eax \n" +- " mov $_end,%ecx \n" +- " sub %edi,%ecx \n" +- " rep stosb \n" +- " mov $reloc,%eax \n" +- " jmp *%eax \n" ++ "1: pop %ebx \n" ++ " mov %eax,alloc-1b(%ebx) \n" ++ " mov $_end,%ecx \n" /* check that BSS is empty! */ ++ " sub $__bss_start,%ecx \n" ++ " jz reloc \n" ++ "1: jmp 1b \n" ++ ); ++ ++/* This is our data. Because the code must be relocatable, no BSS is ++ * allowed. All data is accessed PC-relative with inline assembly. ++ */ ++asm ( ++ "alloc: \n" ++ " .long 0 \n" ++ " .subsection 1 \n" ++ " .p2align 4, 0xcc \n" ++ " .subsection 0 \n" + ); + + typedef unsigned int u32; + #include "../../../include/xen/multiboot.h" + +-extern char _start[]; +- +-static void *memcpy(void *dest, const void *src, unsigned int n) +-{ +- char *s = (char *)src, *d = dest; +- while ( n-- ) +- *d++ = *s++; +- return dest; +-} +- + static void *reloc_mbi_struct(void *old, unsigned int bytes) + { +- static void *alloc = &_start; +- alloc = (void *)(((unsigned long)alloc - bytes) & ~15ul); +- return memcpy(alloc, old, bytes); ++ void *new; ++ asm( ++ " call 1f \n" ++ "1: pop %%edx \n" ++ " mov alloc-1b(%%edx),%0 \n" ++ " sub %1,%0 \n" ++ " and $~15,%0 \n" ++ " mov %0,alloc-1b(%%edx) \n" ++ " mov %0,%%edi \n" ++ " rep movsb \n" ++ : "=&r" (new), "+c" (bytes), "+S" (old) ++ : : "edx", "edi"); ++ return new; + } + + static char *reloc_mbi_string(char *old) +--- a/xen/arch/x86/boot/trampoline.S ++++ b/xen/arch/x86/boot/trampoline.S +@@ -11,6 +11,13 @@ + .long 111b - (off) - .; \ + .popsection + ++#define bootsym_segrel(sym, off) \ ++ $0,$bootsym(sym); \ ++111:; \ ++ .pushsection .trampoline_seg, "a"; \ ++ .long 111b - (off) - .; \ ++ .popsection ++ + .globl trampoline_realmode_entry + trampoline_realmode_entry: + mov %cs,%ax +@@ -132,7 +139,7 @@ high_start: + + .code32 + trampoline_boot_cpu_entry: +- cmpb $0,bootsym_phys(skip_realmode) ++ cmpb $0,bootsym_rel(skip_realmode,5) + jnz .Lskip_realmode + + /* Load pseudo-real-mode segments. */ +@@ -151,14 +158,14 @@ trampoline_boot_cpu_entry: + 1: mov %eax,%cr0 # CR0.PE = 0 (leave protected mode) + + /* Load proper real-mode values into %cs, %ds, %es and %ss. */ +- ljmp $(BOOT_TRAMPOLINE>>4),$bootsym(1f) +-1: mov $(BOOT_TRAMPOLINE>>4),%ax ++ ljmp bootsym_segrel(1f,2) ++1: mov %cs,%ax + mov %ax,%ds + mov %ax,%es + mov %ax,%ss + + /* Initialise stack pointer and IDT, and enable irqs. */ +- mov $bootsym(early_stack),%sp ++ xor %sp,%sp + lidt bootsym(rm_idt) + sti + +@@ -195,7 +202,7 @@ trampoline_boot_cpu_entry: + lmsw %ax # CR0.PE = 1 (enter protected mode) + + /* Load proper protected-mode values into all segment registers. */ +- ljmpl $BOOT_CS32,$bootsym_phys(1f) ++ ljmpl $BOOT_CS32,$bootsym_rel(1f,6) + .code32 + 1: mov $BOOT_DS,%eax + mov %eax,%ds +@@ -220,7 +227,3 @@ rm_idt: .word 256*4-1, 0, 0 + #include "edd.S" + #include "video.S" + #include "wakeup.S" +- +- .align 16 +- .fill PAGE_SIZE,1,0 +-early_stack: +--- a/xen/arch/x86/boot/wakeup.S ++++ b/xen/arch/x86/boot/wakeup.S +@@ -11,7 +11,7 @@ ENTRY(wakeup_start) + movw %cs, %ax + movw %ax, %ds + movw %ax, %ss # A stack required for BIOS call +- movw $wakesym(early_stack), %sp ++ movw $wakesym(wakeup_stack), %sp + + pushl $0 # Kill dangerous flag early + popfl +@@ -101,7 +101,7 @@ real_magic: .long 0x12345678 + .globl video_mode, video_flags + video_mode: .long 0 + video_flags: .long 0 +-trampoline_seg: .word BOOT_TRAMPOLINE >> 4 ++trampoline_seg: .word 0 + .pushsection .trampoline_seg, "a" + .long trampoline_seg - . + .popsection +@@ -116,7 +116,7 @@ wakeup_32: + mov $BOOT_DS, %eax + mov %eax, %ds + mov %eax, %ss +- mov $bootsym_rel(early_stack, 4, %esp) ++ mov $bootsym_rel(wakeup_stack, 4, %esp) + + # check saved magic again + mov $sym_phys(saved_magic), %eax +@@ -188,3 +188,7 @@ ret_point: + bogus_saved_magic: + movw $0x0e00 + 'S', 0xb8014 + jmp bogus_saved_magic ++ ++ .align 16 ++ .fill PAGE_SIZE,1,0 ++wakeup_stack: diff --git a/25485-x86_64-canonical-checks.patch b/25485-x86_64-canonical-checks.patch new file mode 100644 index 0000000..35e70ae --- /dev/null +++ b/25485-x86_64-canonical-checks.patch @@ -0,0 +1,78 @@ +# HG changeset patch +# User Jan Beulich +# Date 1340031721 -7200 +# Node ID 5b6a857411ba5212c71885a2fd39cae4c3d8231c +# Parent c272cfe25bea00375fb65c339926c83b6e830230 +x86-64: don't allow non-canonical addresses to be set for any callback + +Rather than deferring the detection of these to the point where they +get actually used (the fix for XSA-7, 25480:76eaf5966c05, causing a #GP +to be raised by IRET, which invokes the guest's [fragile] fail-safe +callback), don't even allow such to be set. + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/domain.c ++++ b/xen/arch/x86/domain.c +@@ -683,6 +683,14 @@ int arch_set_info_guest( + { + if ( !compat ) + { ++#ifdef __x86_64__ ++ if ( !is_canonical_address(c.nat->user_regs.eip) || ++ !is_canonical_address(c.nat->event_callback_eip) || ++ !is_canonical_address(c.nat->syscall_callback_eip) || ++ !is_canonical_address(c.nat->failsafe_callback_eip) ) ++ return -EINVAL; ++#endif ++ + fixup_guest_stack_selector(d, c.nat->user_regs.ss); + fixup_guest_stack_selector(d, c.nat->kernel_ss); + fixup_guest_code_selector(d, c.nat->user_regs.cs); +@@ -692,7 +700,11 @@ int arch_set_info_guest( + #endif + + for ( i = 0; i < 256; i++ ) ++ { ++ if ( !is_canonical_address(c.nat->trap_ctxt[i].address) ) ++ return -EINVAL; + fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs); ++ } + + /* LDT safety checks. */ + if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) || +--- a/xen/arch/x86/domctl.c ++++ b/xen/arch/x86/domctl.c +@@ -1148,6 +1148,9 @@ long arch_do_domctl( + if ( evc->size < offsetof(typeof(*evc), mcg_cap) ) + goto ext_vcpucontext_out; + #ifdef __x86_64__ ++ if ( !is_canonical_address(evc->sysenter_callback_eip) || ++ !is_canonical_address(evc->syscall32_callback_eip) ) ++ goto ext_vcpucontext_out; + fixup_guest_code_selector(d, evc->sysenter_callback_cs); + v->arch.sysenter_callback_cs = evc->sysenter_callback_cs; + v->arch.sysenter_callback_eip = evc->sysenter_callback_eip; +--- a/xen/arch/x86/traps.c ++++ b/xen/arch/x86/traps.c +@@ -3544,6 +3544,9 @@ long register_guest_nmi_callback(unsigne + struct domain *d = v->domain; + struct trap_info *t = &v->arch.guest_context.trap_ctxt[TRAP_nmi]; + ++ if ( !is_canonical_address(address) ) ++ return -EINVAL; ++ + t->vector = TRAP_nmi; + t->flags = 0; + t->cs = (is_pv_32on64_domain(d) ? +@@ -3671,6 +3674,9 @@ long do_set_trap_table(XEN_GUEST_HANDLE( + if ( cur.address == 0 ) + break; + ++ if ( !is_canonical_address(cur.address) ) ++ return -EINVAL; ++ + fixup_guest_code_selector(curr->domain, cur.cs); + + memcpy(&dst[cur.vector], &cur, sizeof(cur)); diff --git a/25589-pygrub-size-limits.patch b/25589-pygrub-size-limits.patch new file mode 100644 index 0000000..f2ca475 --- /dev/null +++ b/25589-pygrub-size-limits.patch @@ -0,0 +1,114 @@ +# HG changeset patch +# User M A Young +# Date 1341413174 -3600 +# Node ID 60f09d1ab1fe5dee87db1bf55c7479a5d71e85a5 +# Parent 42f76d536b116d2ebad1b6705ae51ecd171d2581 +pygrub: cope better with big files in the guest. + +Only read the first megabyte of a configuration file (grub etc.) and read the +kernel and ramdisk files from the guest in one megabyte pieces so pygrub +doesn't use a lot of memory if the files are large. With --not-really option +check that the chosen kernel and ramdisk files exist. If there are problems +writing the copy of the kernel or ramdisk, delete the copied files and exit in +case they have filled the filesystem. + +Signed-off-by: Michael Young +Acked-by: Matt Wilson +Acked-by: Ian Campbell +Acked-by: Ian Jackson +Committed-by: Ian Campbell + +diff -r 42f76d536b11 -r 60f09d1ab1fe tools/pygrub/src/pygrub +--- a/tools/pygrub/src/pygrub Tue Jul 03 13:39:01 2012 +0100 ++++ b/tools/pygrub/src/pygrub Wed Jul 04 15:46:14 2012 +0100 +@@ -28,6 +28,7 @@ + import grub.ExtLinuxConf + + PYGRUB_VER = 0.6 ++FS_READ_MAX = 1024 * 1024 + + def enable_cursor(ison): + if ison: +@@ -448,7 +449,8 @@ + if self.__dict__.get('cf', None) is None: + raise RuntimeError, "couldn't find bootloader config file in the image provided." + f = fs.open_file(self.cf.filename) +- buf = f.read() ++ # limit read size to avoid pathological cases ++ buf = f.read(FS_READ_MAX) + del f + self.cf.parse(buf) + +@@ -697,6 +699,37 @@ + def usage(): + print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] " %(sys.argv[0],) + ++ def copy_from_image(fs, file_to_read, file_type, output_directory, ++ not_really): ++ if not_really: ++ if fs.file_exists(file_to_read): ++ return "<%s:%s>" % (file_type, file_to_read) ++ else: ++ sys.exit("The requested %s file does not exist" % file_type) ++ try: ++ datafile = fs.open_file(file_to_read) ++ except Exception, e: ++ print >>sys.stderr, e ++ sys.exit("Error opening %s in guest" % file_to_read) ++ (tfd, ret) = tempfile.mkstemp(prefix="boot_"+file_type+".", ++ dir=output_directory) ++ dataoff = 0 ++ while True: ++ data = datafile.read(FS_READ_MAX, dataoff) ++ if len(data) == 0: ++ os.close(tfd) ++ del datafile ++ return ret ++ try: ++ os.write(tfd, data) ++ except Exception, e: ++ print >>sys.stderr, e ++ os.close(tfd) ++ os.unlink(ret) ++ del datafile ++ sys.exit("Error writing temporary copy of "+file_type) ++ dataoff += len(data) ++ + try: + opts, args = getopt.gnu_getopt(sys.argv[1:], 'qinh::', + ["quiet", "interactive", "not-really", "help", +@@ -821,24 +854,18 @@ + if not fs: + raise RuntimeError, "Unable to find partition containing kernel" + +- if not_really: +- bootcfg["kernel"] = "" % chosencfg["kernel"] +- else: +- data = fs.open_file(chosencfg["kernel"]).read() +- (tfd, bootcfg["kernel"]) = tempfile.mkstemp(prefix="boot_kernel.", +- dir=output_directory) +- os.write(tfd, data) +- os.close(tfd) ++ bootcfg["kernel"] = copy_from_image(fs, chosencfg["kernel"], "kernel", ++ output_directory, not_really) + + if chosencfg["ramdisk"]: +- if not_really: +- bootcfg["ramdisk"] = "" % chosencfg["ramdisk"] +- else: +- data = fs.open_file(chosencfg["ramdisk"],).read() +- (tfd, bootcfg["ramdisk"]) = tempfile.mkstemp( +- prefix="boot_ramdisk.", dir=output_directory) +- os.write(tfd, data) +- os.close(tfd) ++ try: ++ bootcfg["ramdisk"] = copy_from_image(fs, chosencfg["ramdisk"], ++ "ramdisk", output_directory, ++ not_really) ++ except: ++ if not not_really: ++ os.unlink(bootcfg["kernel"]) ++ raise + else: + initrd = None + diff --git a/25616-x86-MCi_CTL-default.patch b/25616-x86-MCi_CTL-default.patch new file mode 100644 index 0000000..3b56126 --- /dev/null +++ b/25616-x86-MCi_CTL-default.patch @@ -0,0 +1,125 @@ +# HG changeset patch +# User Liu, Jinsong +# Date 1342709122 -3600 +# Node ID 8a4cda0bbdc2309c7f86445eaa14e4f75e9bd21a +# Parent 3625ff5e9f80aebb403d6efc75522eef08cd3802 +Xen/MCE: stick all 1's to MCi_CTL of vMCE + +This patch is a middle-work patch, prepare for future new vMCE model. +It remove mci_ctl array, and keep MCi_CTL all 1's. + +Signed-off-by: Liu, Jinsong +Committed-by: Keir Fraser + +--- a/xen/arch/x86/cpu/mcheck/vmce.c ++++ b/xen/arch/x86/cpu/mcheck/vmce.c +@@ -25,7 +25,6 @@ uint64_t g_mcg_cap; + + /* Real value in physical CTL MSR */ + uint64_t h_mcg_ctl = 0UL; +-uint64_t *h_mci_ctrl; + + int vmce_init_msr(struct domain *d) + { +@@ -33,15 +32,6 @@ int vmce_init_msr(struct domain *d) + if ( !dom_vmce(d) ) + return -ENOMEM; + +- dom_vmce(d)->mci_ctl = xmalloc_array(uint64_t, nr_mce_banks); +- if ( !dom_vmce(d)->mci_ctl ) +- { +- xfree(dom_vmce(d)); +- return -ENOMEM; +- } +- memset(dom_vmce(d)->mci_ctl, ~0, +- nr_mce_banks * sizeof(*dom_vmce(d)->mci_ctl)); +- + dom_vmce(d)->mcg_status = 0x0; + dom_vmce(d)->mcg_ctl = ~(uint64_t)0x0; + dom_vmce(d)->nr_injection = 0; +@@ -56,7 +46,6 @@ void vmce_destroy_msr(struct domain *d) + { + if ( !dom_vmce(d) ) + return; +- xfree(dom_vmce(d)->mci_ctl); + xfree(dom_vmce(d)); + dom_vmce(d) = NULL; + } +@@ -93,9 +82,8 @@ static int bank_mce_rdmsr(const struct v + switch ( msr & (MSR_IA32_MC0_CTL | 3) ) + { + case MSR_IA32_MC0_CTL: +- if ( bank < nr_mce_banks ) +- *val = vmce->mci_ctl[bank] & +- (h_mci_ctrl ? h_mci_ctrl[bank] : ~0UL); ++ /* stick all 1's to MCi_CTL */ ++ *val = ~0UL; + mce_printk(MCE_VERBOSE, "MCE: rdmsr MC%u_CTL 0x%"PRIx64"\n", + bank, *val); + break; +@@ -220,8 +208,10 @@ static int bank_mce_wrmsr(struct vcpu *v + switch ( msr & (MSR_IA32_MC0_CTL | 3) ) + { + case MSR_IA32_MC0_CTL: +- if ( bank < nr_mce_banks ) +- vmce->mci_ctl[bank] = val; ++ /* ++ * if guest crazy clear any bit of MCi_CTL, ++ * treat it as not implement and ignore write change it. ++ */ + break; + case MSR_IA32_MC0_STATUS: + if ( entry && (entry->bank == bank) ) +@@ -522,22 +512,6 @@ int vmce_domain_inject( + int vmce_init(struct cpuinfo_x86 *c) + { + u64 value; +- unsigned int i; +- +- if ( !h_mci_ctrl ) +- { +- h_mci_ctrl = xmalloc_array(uint64_t, nr_mce_banks); +- if (!h_mci_ctrl) +- { +- dprintk(XENLOG_INFO, "Failed to alloc h_mci_ctrl\n"); +- return -ENOMEM; +- } +- /* Don't care banks before firstbank */ +- memset(h_mci_ctrl, ~0, +- min(firstbank, nr_mce_banks) * sizeof(*h_mci_ctrl)); +- for (i = firstbank; i < nr_mce_banks; i++) +- rdmsrl(MSR_IA32_MCx_CTL(i), h_mci_ctrl[i]); +- } + + rdmsrl(MSR_IA32_MCG_CAP, value); + /* For Guest vMCE usage */ +@@ -550,18 +524,13 @@ int vmce_init(struct cpuinfo_x86 *c) + + static int mca_ctl_conflict(struct mcinfo_bank *bank, struct domain *d) + { +- int bank_nr; +- +- if ( !bank || !d || !h_mci_ctrl ) ++ if ( !bank || !d ) + return 1; + + /* Will MCE happen in host if If host mcg_ctl is 0? */ + if ( ~d->arch.vmca_msrs->mcg_ctl & h_mcg_ctl ) + return 1; + +- bank_nr = bank->mc_bank; +- if (~d->arch.vmca_msrs->mci_ctl[bank_nr] & h_mci_ctrl[bank_nr] ) +- return 1; + return 0; + } + +--- a/xen/include/asm-x86/mce.h ++++ b/xen/include/asm-x86/mce.h +@@ -18,7 +18,6 @@ struct domain_mca_msrs + /* Guest should not change below values after DOM boot up */ + uint64_t mcg_ctl; + uint64_t mcg_status; +- uint64_t *mci_ctl; + uint16_t nr_injection; + struct list_head impact_header; + spinlock_t lock; diff --git a/cve-2012-0029-qemu-xen-unstable.patch b/cve-2012-0029-qemu-xen-unstable.patch deleted file mode 100644 index 9af1dfc..0000000 --- a/cve-2012-0029-qemu-xen-unstable.patch +++ /dev/null @@ -1,21 +0,0 @@ -Index: xen-4.1.2-testing/tools/ioemu-qemu-xen/hw/e1000.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/ioemu-qemu-xen/hw/e1000.c -+++ xen-4.1.2-testing/tools/ioemu-qemu-xen/hw/e1000.c -@@ -444,6 +444,8 @@ process_tx_desc(E1000State *s, struct e1 - bytes = split_size; - if (tp->size + bytes > msh) - bytes = msh - tp->size; -+ -+ bytes = MIN(sizeof(tp->data) - tp->size, bytes); - cpu_physical_memory_read(addr, tp->data + tp->size, bytes); - if ((sz = tp->size + bytes) >= hdr && tp->size < hdr) - memmove(tp->header, tp->data, hdr); -@@ -459,6 +461,7 @@ process_tx_desc(E1000State *s, struct e1 - // context descriptor TSE is not set, while data descriptor TSE is set - DBGOUT(TXERR, "TCP segmentaion Error\n"); - } else { -+ split_size = MIN(sizeof(tp->data) - tp->size, split_size); - cpu_physical_memory_read(addr, tp->data + tp->size, split_size); - tp->size += split_size; - } diff --git a/disable-xl-when-using-xend.patch b/disable-xl-when-using-xend.patch index 28419b6..4e76d7e 100644 --- a/disable-xl-when-using-xend.patch +++ b/disable-xl-when-using-xend.patch @@ -5,10 +5,10 @@ toolstack. xl could be useful even when xend is running, e.g. to debug xend itself, so add a '-f' option to override the exit. -Index: xen-4.1.2-testing/tools/libxl/xl.c +Index: xen-4.1.3-testing/tools/libxl/xl.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/xl.c -+++ xen-4.1.2-testing/tools/libxl/xl.c +--- xen-4.1.3-testing.orig/tools/libxl/xl.c ++++ xen-4.1.3-testing/tools/libxl/xl.c @@ -88,12 +88,16 @@ int main(int argc, char **argv) char *config_file; void *config_data = 0; @@ -46,11 +46,11 @@ Index: xen-4.1.2-testing/tools/libxl/xl.c logger = xtl_createlogger_stdiostream(stderr, minmsglevel, 0); if (!logger) exit(1); -Index: xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c +Index: xen-4.1.3-testing/tools/libxl/xl_cmdimpl.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/xl_cmdimpl.c -+++ xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c -@@ -1725,7 +1725,7 @@ void help(const char *command) +--- xen-4.1.3-testing.orig/tools/libxl/xl_cmdimpl.c ++++ xen-4.1.3-testing/tools/libxl/xl_cmdimpl.c +@@ -1741,7 +1741,7 @@ void help(const char *command) struct cmd_spec *cmd; if (!command || !strcmp(command, "help")) { @@ -59,7 +59,7 @@ Index: xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c printf("xl full list of subcommands:\n\n"); for (i = 0; i < cmdtable_len; i++) printf(" %-20s%s\n", -@@ -1733,7 +1733,7 @@ void help(const char *command) +@@ -1749,7 +1749,7 @@ void help(const char *command) } else { cmd = cmdtable_lookup(command); if (cmd) { diff --git a/disable_emulated_device.diff b/disable_emulated_device.diff index 86332b5..f3d5fca 100644 --- a/disable_emulated_device.diff +++ b/disable_emulated_device.diff @@ -1,8 +1,8 @@ -Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +Index: xen-4.1.3-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c =================================================================== ---- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -@@ -425,6 +425,11 @@ static int __devinit platform_pci_init(s +--- xen-4.1.3-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ xen-4.1.3-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +@@ -424,6 +424,11 @@ static int __devinit platform_pci_init(s platform_mmio = mmio_addr; platform_mmiolen = mmio_len; diff --git a/ioemu-9868-MSI-X.patch b/ioemu-9868-MSI-X.patch index 9c5e7b8..877bc64 100644 --- a/ioemu-9868-MSI-X.patch +++ b/ioemu-9868-MSI-X.patch @@ -24,8 +24,10 @@ Acked-by: Stefano Stabellini committer: Ian Jackson ---- a/tools/ioemu-qemu-xen/hw/pass-through.c -+++ b/tools/ioemu-qemu-xen/hw/pass-through.c +Index: xen-4.1.3-testing/tools/ioemu-qemu-xen/hw/pass-through.c +=================================================================== +--- xen-4.1.3-testing.orig/tools/ioemu-qemu-xen/hw/pass-through.c ++++ xen-4.1.3-testing/tools/ioemu-qemu-xen/hw/pass-through.c @@ -92,6 +92,7 @@ #include @@ -135,8 +137,10 @@ committer: Ian Jackson if ( old_ebase != e_phys && old_ebase != -1 ) pt_msix_update_remap(assigned_device, i); } ---- a/tools/ioemu-qemu-xen/hw/pt-msi.c -+++ b/tools/ioemu-qemu-xen/hw/pt-msi.c +Index: xen-4.1.3-testing/tools/ioemu-qemu-xen/hw/pt-msi.c +=================================================================== +--- xen-4.1.3-testing.orig/tools/ioemu-qemu-xen/hw/pt-msi.c ++++ xen-4.1.3-testing/tools/ioemu-qemu-xen/hw/pt-msi.c @@ -284,15 +284,6 @@ void pt_disable_msi_translate(struct pt_ dev->msi_trans_en = 0; } @@ -225,9 +229,11 @@ committer: Ian Jackson fd, dev->msix->table_base + table_off - dev->msix->table_offset_adjust); dev->msix->phys_iomem_base = (void *)((char *)dev->msix->phys_iomem_base + dev->msix->table_offset_adjust); ---- a/tools/ioemu-qemu-xen/hw/pt-msi.h -+++ b/tools/ioemu-qemu-xen/hw/pt-msi.h -@@ -107,10 +107,7 @@ void +Index: xen-4.1.3-testing/tools/ioemu-qemu-xen/hw/pt-msi.h +=================================================================== +--- xen-4.1.3-testing.orig/tools/ioemu-qemu-xen/hw/pt-msi.h ++++ xen-4.1.3-testing/tools/ioemu-qemu-xen/hw/pt-msi.h +@@ -109,10 +109,7 @@ void pt_msix_disable(struct pt_dev *dev); int diff --git a/ipxe-gcc45-warnings.patch b/ipxe-gcc45-warnings.patch index 811b415..e451fab 100644 --- a/ipxe-gcc45-warnings.patch +++ b/ipxe-gcc45-warnings.patch @@ -1,7 +1,7 @@ -Index: xen-4.1.2-testing/tools/firmware/etherboot/patches/ipxe-git-f7c5918b179b +Index: xen-4.1.3-testing/tools/firmware/etherboot/patches/ipxe-git-f7c5918b179b =================================================================== --- /dev/null -+++ xen-4.1.2-testing/tools/firmware/etherboot/patches/ipxe-git-f7c5918b179b ++++ xen-4.1.3-testing/tools/firmware/etherboot/patches/ipxe-git-f7c5918b179b @@ -0,0 +1,61 @@ + +Subject: [drivers] Fix warnings identified by gcc 4.5 @@ -64,12 +64,12 @@ Index: xen-4.1.2-testing/tools/firmware/etherboot/patches/ipxe-git-f7c5918b179b + + return 1; + } -Index: xen-4.1.2-testing/tools/firmware/etherboot/patches/series +Index: xen-4.1.3-testing/tools/firmware/etherboot/patches/series =================================================================== ---- xen-4.1.2-testing.orig/tools/firmware/etherboot/patches/series -+++ xen-4.1.2-testing/tools/firmware/etherboot/patches/series -@@ -1,3 +1,4 @@ - boot_prompt_option.patch - gpxe-git-0edf2405b457 +--- xen-4.1.3-testing.orig/tools/firmware/etherboot/patches/series ++++ xen-4.1.3-testing/tools/firmware/etherboot/patches/series +@@ -3,3 +3,4 @@ gpxe-git-0edf2405b457 gpxe-git-a803ef3dfeac + gpxe-git-b8924c1aed51 + gpxe-git-fe61f6de0dd5 +ipxe-git-f7c5918b179b diff --git a/ipxe-ipv4-fragment.patch b/ipxe-ipv4-fragment.patch index 637c6a1..026d1c5 100644 --- a/ipxe-ipv4-fragment.patch +++ b/ipxe-ipv4-fragment.patch @@ -1,20 +1,21 @@ -Index: xen-4.1.2-testing/tools/firmware/etherboot/patches/ipxe-git-13186b64b6c3 +Index: xen-4.1.3-testing/tools/firmware/etherboot/patches/ipxe-git-13186b64b6c3 =================================================================== ---- /dev/null 2010-05-08 03:31:08.000000000 -0600 -+++ xen-4.1.2-testing/tools/firmware/etherboot/patches/ipxe-git-13186b64b6c3 2011-12-19 15:05:32.000000000 -0700 -@@ -0,0 +1,354 @@ +--- /dev/null 2010-08-26 08:28:41.000000000 -0600 ++++ xen-4.1.3-testing/tools/firmware/etherboot/patches/ipxe-git-13186b64b6c3 2012-06-19 09:29:52.000000000 -0600 +@@ -0,0 +1,357 @@ +commit 13186b64b6c3d5cbe9ed13bda1532e79b1afe81d +Author: Michael Brown +Date: Sat Jul 16 01:15:53 2011 +0100 + + [ipv4] Fix fragment reassembly -+ ++ + Signed-off-by: Michael Brown + Signed-off-by: Michal Kubecek + -+diff -up a/src/include/gpxe/ip.h.orig-frag b/src/include/gpxe/ip.h -+--- a/src/include/gpxe/ip.h.orig-frag 2010-02-02 17:12:44.000000000 +0100 -++++ b/src/include/gpxe/ip.h 2011-11-18 15:49:17.202660163 +0100 ++Index: ipxe/src/include/gpxe/ip.h ++=================================================================== ++--- ipxe.orig/src/include/gpxe/ip.h +++++ ipxe/src/include/gpxe/ip.h +@@ -32,9 +32,6 @@ struct net_protocol; + #define IP_TOS 0 + #define IP_TTL 64 @@ -54,9 +55,10 @@ Index: xen-4.1.2-testing/tools/firmware/etherboot/patches/ipxe-git-13186b64b6c3 + }; + + extern struct list_head ipv4_miniroutes; -+diff -up a/src/include/gpxe/retry.h.orig-frag b/src/include/gpxe/retry.h -+--- a/src/include/gpxe/retry.h.orig-frag 2010-02-02 17:12:44.000000000 +0100 -++++ b/src/include/gpxe/retry.h 2011-11-18 15:59:25.258837891 +0100 ++Index: ipxe/src/include/gpxe/retry.h ++=================================================================== ++--- ipxe.orig/src/include/gpxe/retry.h +++++ ipxe/src/include/gpxe/retry.h +@@ -51,6 +51,19 @@ struct retry_timer { + void ( * expired ) ( struct retry_timer *timer, int over ); + }; @@ -77,9 +79,10 @@ Index: xen-4.1.2-testing/tools/firmware/etherboot/patches/ipxe-git-13186b64b6c3 + extern void start_timer ( struct retry_timer *timer ); + extern void start_timer_fixed ( struct retry_timer *timer, + unsigned long timeout ); -+diff -up a/src/net/ipv4.c.orig-frag b/src/net/ipv4.c -+--- a/src/net/ipv4.c.orig-frag 2010-02-02 17:12:44.000000000 +0100 -++++ b/src/net/ipv4.c 2011-11-18 15:49:17.203660142 +0100 ++Index: ipxe/src/net/ipv4.c ++=================================================================== ++--- ipxe.orig/src/net/ipv4.c +++++ ipxe/src/net/ipv4.c +@@ -14,6 +14,7 @@ + #include + #include @@ -357,12 +360,12 @@ Index: xen-4.1.2-testing/tools/firmware/etherboot/patches/ipxe-git-13186b64b6c3 + if ( ( rc = tcpip_rx ( iobuf, iphdr->protocol, &src.st, + &dest.st, pshdr_csum ) ) != 0 ) { + DBG ( "IPv4 received packet rejected by stack: %s\n", -Index: xen-4.1.2-testing/tools/firmware/etherboot/patches/series +Index: xen-4.1.3-testing/tools/firmware/etherboot/patches/series =================================================================== ---- xen-4.1.2-testing.orig/tools/firmware/etherboot/patches/series -+++ xen-4.1.2-testing/tools/firmware/etherboot/patches/series -@@ -2,3 +2,4 @@ boot_prompt_option.patch - gpxe-git-0edf2405b457 - gpxe-git-a803ef3dfeac +--- xen-4.1.3-testing.orig/tools/firmware/etherboot/patches/series ++++ xen-4.1.3-testing/tools/firmware/etherboot/patches/series +@@ -4,3 +4,4 @@ gpxe-git-a803ef3dfeac + gpxe-git-b8924c1aed51 + gpxe-git-fe61f6de0dd5 ipxe-git-f7c5918b179b +ipxe-git-13186b64b6c3 diff --git a/log-guest-console.patch b/log-guest-console.patch index 4064db8..32cef51 100644 --- a/log-guest-console.patch +++ b/log-guest-console.patch @@ -6,10 +6,10 @@ Signed-off-by: Chunyan Liu hw/xen_console.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 71 insertions(+), 0 deletions(-) -Index: xen-4.1.2-testing/tools/ioemu-qemu-xen/hw/xen_console.c +Index: xen-4.1.3-testing/tools/ioemu-qemu-xen/hw/xen_console.c =================================================================== ---- xen-4.1.2-testing.orig/tools/ioemu-qemu-xen/hw/xen_console.c -+++ xen-4.1.2-testing/tools/ioemu-qemu-xen/hw/xen_console.c +--- xen-4.1.3-testing.orig/tools/ioemu-qemu-xen/hw/xen_console.c ++++ xen-4.1.3-testing/tools/ioemu-qemu-xen/hw/xen_console.c @@ -38,6 +38,8 @@ #include "qemu-char.h" #include "xen_backend.h" @@ -126,7 +126,7 @@ Index: xen-4.1.2-testing/tools/ioemu-qemu-xen/hw/xen_console.c return 0; } -@@ -264,6 +329,12 @@ static void con_disconnect(struct XenDev +@@ -266,6 +331,12 @@ static void con_disconnect(struct XenDev xc_gnttab_munmap(xendev->gnttabdev, con->sring, 1); con->sring = NULL; } diff --git a/pv-driver-build.patch b/pv-driver-build.patch deleted file mode 100644 index 59d9173..0000000 --- a/pv-driver-build.patch +++ /dev/null @@ -1,39 +0,0 @@ -Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h -=================================================================== ---- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h -+++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h -@@ -161,4 +161,14 @@ typedef irqreturn_t (*irq_handler_t)(int - #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) - #endif - -+#ifdef sync_test_bit -+#define synch_change_bit sync_change_bit -+#define synch_clear_bit sync_clear_bit -+#define synch_set_bit sync_set_bit -+#define synch_test_and_change_bit sync_test_and_change_bit -+#define synch_test_and_clear_bit sync_test_and_clear_bit -+#define synch_test_and_set_bit sync_test_and_set_bit -+#define synch_test_bit sync_test_bit -+#endif -+ - #endif -Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -=================================================================== ---- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -@@ -122,6 +122,7 @@ unsigned long alloc_xen_mmio(unsigned lo - - #ifndef __ia64__ - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) - static uint32_t xen_cpuid_base(void) - { - uint32_t base, eax, ebx, ecx, edx; -@@ -140,6 +141,7 @@ static uint32_t xen_cpuid_base(void) - - return 0; - } -+#endif - - static int init_hypercall_stubs(void) - { diff --git a/pvdrv-import-shared-info.patch b/pvdrv-import-shared-info.patch index 580478b..323f715 100644 --- a/pvdrv-import-shared-info.patch +++ b/pvdrv-import-shared-info.patch @@ -1,7 +1,5 @@ -Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/evtchn.c -=================================================================== ---- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/evtchn.c -+++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/evtchn.c +--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c ++++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c @@ -40,7 +40,9 @@ #include #endif @@ -12,10 +10,8 @@ Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/evtchn.c #define is_valid_evtchn(x) ((x) != 0) #define evtchn_from_irq(x) (irq_evtchn[irq].evtchn) -Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -=================================================================== ---- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c @@ -76,7 +76,6 @@ static uint64_t callback_via; static int __devinit init_xen_info(void) { @@ -44,10 +40,8 @@ Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci. return 0; } -Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h -=================================================================== ---- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h -+++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h @@ -27,6 +27,11 @@ unsigned long alloc_xen_mmio(unsigned long len); void platform_pci_resume(void); diff --git a/snapshot-xend.patch b/snapshot-xend.patch index fe767ce..e08b8d9 100644 --- a/snapshot-xend.patch +++ b/snapshot-xend.patch @@ -1,7 +1,7 @@ -Index: xen-4.1.2-testing/tools/python/xen/xend/image.py +Index: xen-4.1.3-testing/tools/python/xen/xend/image.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/image.py -+++ xen-4.1.2-testing/tools/python/xen/xend/image.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/image.py ++++ xen-4.1.3-testing/tools/python/xen/xend/image.py @@ -490,7 +490,7 @@ class ImageHandler: domains.domains_lock.acquire() @@ -43,10 +43,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xend/image.py def recreate(self): if self.device_model is None: return -Index: xen-4.1.2-testing/tools/python/xen/xend/server/blkif.py +Index: xen-4.1.3-testing/tools/python/xen/xend/server/blkif.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/server/blkif.py -+++ xen-4.1.2-testing/tools/python/xen/xend/server/blkif.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/server/blkif.py ++++ xen-4.1.3-testing/tools/python/xen/xend/server/blkif.py @@ -88,6 +88,10 @@ class BlkifController(DevController): if bootable != None: back['bootable'] = str(bootable) @@ -58,10 +58,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xend/server/blkif.py if security.on() == xsconstants.XS_POLICY_USE: self.do_access_control(config, uname) -Index: xen-4.1.2-testing/tools/python/xen/xend/server/SrvDomain.py +Index: xen-4.1.3-testing/tools/python/xen/xend/server/SrvDomain.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/server/SrvDomain.py -+++ xen-4.1.2-testing/tools/python/xen/xend/server/SrvDomain.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/server/SrvDomain.py ++++ xen-4.1.3-testing/tools/python/xen/xend/server/SrvDomain.py @@ -95,6 +95,31 @@ class SrvDomain(SrvDir): def do_save(self, _, req): return self.xd.domain_save(self.dom.domid, req.args['file'][0]) @@ -103,10 +103,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xend/server/SrvDomain.py return self.perform(req) # -Index: xen-4.1.2-testing/tools/python/xen/xend/XendCheckpoint.py +Index: xen-4.1.3-testing/tools/python/xen/xend/XendCheckpoint.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/XendCheckpoint.py -+++ xen-4.1.2-testing/tools/python/xen/xend/XendCheckpoint.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.1.3-testing/tools/python/xen/xend/XendCheckpoint.py @@ -65,7 +65,7 @@ def insert_after(list, pred, value): return @@ -331,10 +331,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xend/XendCheckpoint.py if not paused: dominfo.unpause() -Index: xen-4.1.2-testing/tools/python/xen/xend/XendConfig.py +Index: xen-4.1.3-testing/tools/python/xen/xend/XendConfig.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/XendConfig.py -+++ xen-4.1.2-testing/tools/python/xen/xend/XendConfig.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/XendConfig.py ++++ xen-4.1.3-testing/tools/python/xen/xend/XendConfig.py @@ -244,6 +244,7 @@ XENAPI_CFG_TYPES = { 'memory_sharing': int, 'pool_name' : str, @@ -343,10 +343,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xend/XendConfig.py } # List of legacy configuration keys that have no equivalent in the -Index: xen-4.1.2-testing/tools/python/xen/xend/XendDomain.py +Index: xen-4.1.3-testing/tools/python/xen/xend/XendDomain.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/XendDomain.py -+++ xen-4.1.2-testing/tools/python/xen/xend/XendDomain.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/XendDomain.py ++++ xen-4.1.3-testing/tools/python/xen/xend/XendDomain.py @@ -53,6 +53,7 @@ from xen.xend.xenstore.xstransact import from xen.xend.xenstore.xswatch import xswatch from xen.util import mkdir, rwlock @@ -561,10 +561,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xend/XendDomain.py def domain_pincpu(self, domid, vcpu, cpumap): """Set which cpus vcpu can use -Index: xen-4.1.2-testing/tools/python/xen/xm/main.py +Index: xen-4.1.3-testing/tools/python/xen/xm/main.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xm/main.py -+++ xen-4.1.2-testing/tools/python/xen/xm/main.py +--- xen-4.1.3-testing.orig/tools/python/xen/xm/main.py ++++ xen-4.1.3-testing/tools/python/xen/xm/main.py @@ -123,6 +123,14 @@ SUBCOMMAND_HELP = { 'Restore a domain from a saved state.'), 'save' : ('[-c|-f] ', @@ -686,10 +686,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xm/main.py "shutdown": xm_shutdown, "start": xm_start, "sysrq": xm_sysrq, -Index: xen-4.1.2-testing/tools/python/xen/xend/XendDomainInfo.py +Index: xen-4.1.3-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-4.1.2-testing/tools/python/xen/xend/XendDomainInfo.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.1.3-testing/tools/python/xen/xend/XendDomainInfo.py @@ -508,8 +508,6 @@ class XendDomainInfo: self._setSchedParams() self._storeVmDetails() diff --git a/tmp-initscript-modprobe.patch b/tmp-initscript-modprobe.patch index f47150b..f977f9d 100644 --- a/tmp-initscript-modprobe.patch +++ b/tmp-initscript-modprobe.patch @@ -1,10 +1,10 @@ -Index: xen-4.1.2-testing/tools/hotplug/Linux/init.d/xencommons +Index: xen-4.1.3-testing/tools/hotplug/Linux/init.d/xencommons =================================================================== ---- xen-4.1.2-testing.orig/tools/hotplug/Linux/init.d/xencommons -+++ xen-4.1.2-testing/tools/hotplug/Linux/init.d/xencommons -@@ -57,6 +57,20 @@ do_start () { - local time=0 - local timeout=30 +--- xen-4.1.3-testing.orig/tools/hotplug/Linux/init.d/xencommons ++++ xen-4.1.3-testing/tools/hotplug/Linux/init.d/xencommons +@@ -62,6 +62,20 @@ do_start () { + modprobe evtchn 2>/dev/null + modprobe gntdev 2>/dev/null + # Load XEN backend modules + # NB: They could be loaded later, e.g. when dom0 hotplug events occur, @@ -17,8 +17,8 @@ Index: xen-4.1.2-testing/tools/hotplug/Linux/init.d/xencommons + modprobe usbbk 2>/dev/null || true + # xenblk (frontend module) is needed in dom0, allowing it to use vbds + modprobe xenblk 2>/dev/null || true -+ # support xl create pv guest with qcow/qcow2 disk image -+ modprobe nbd max_part=8 2>/dev/null || true ++ # support xl create pv guest with qcow/qcow2 disk image ++ modprobe nbd max_part=8 2>/dev/null || true + if ! `xenstore-read -s / >/dev/null 2>&1` then diff --git a/tools-watchdog-support.patch b/tools-watchdog-support.patch index 2502ec0..3edec07 100644 --- a/tools-watchdog-support.patch +++ b/tools-watchdog-support.patch @@ -1,7 +1,7 @@ -Index: xen-4.1.2-testing/tools/python/xen/xm/create.py +Index: xen-4.1.3-testing/tools/python/xen/xm/create.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xm/create.py -+++ xen-4.1.2-testing/tools/python/xen/xm/create.py +--- xen-4.1.3-testing.orig/tools/python/xen/xm/create.py ++++ xen-4.1.3-testing/tools/python/xen/xm/create.py @@ -535,6 +535,21 @@ gopts.var('usbdevice', val='NAME', fn=set_value, default='', use="Name of USB device to add?") @@ -32,10 +32,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xm/create.py 'xauthority', 'xen_extended_power_mgmt', 'xen_platform_pci', 'memory_sharing' ] -Index: xen-4.1.2-testing/tools/python/xen/xm/xenapi_create.py +Index: xen-4.1.3-testing/tools/python/xen/xm/xenapi_create.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xm/xenapi_create.py -+++ xen-4.1.2-testing/tools/python/xen/xm/xenapi_create.py +--- xen-4.1.3-testing.orig/tools/python/xen/xm/xenapi_create.py ++++ xen-4.1.3-testing/tools/python/xen/xm/xenapi_create.py @@ -1113,7 +1113,9 @@ class sxp2xml: 'xen_platform_pci', 'tsc_mode' @@ -47,10 +47,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xm/xenapi_create.py ] platform_configs = [] -Index: xen-4.1.2-testing/tools/python/xen/xend/image.py +Index: xen-4.1.3-testing/tools/python/xen/xend/image.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/image.py -+++ xen-4.1.2-testing/tools/python/xen/xend/image.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/image.py ++++ xen-4.1.3-testing/tools/python/xen/xend/image.py @@ -866,7 +866,8 @@ class HVMImageHandler(ImageHandler): dmargs = [ 'boot', 'fda', 'fdb', 'soundhw', @@ -69,10 +69,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xend/image.py # Handle booleans gracefully if a in ['localtime', 'std-vga', 'isa', 'usb', 'acpi']: -Index: xen-4.1.2-testing/tools/python/xen/xend/XendConfig.py +Index: xen-4.1.3-testing/tools/python/xen/xend/XendConfig.py =================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/xend/XendConfig.py -+++ xen-4.1.2-testing/tools/python/xen/xend/XendConfig.py +--- xen-4.1.3-testing.orig/tools/python/xen/xend/XendConfig.py ++++ xen-4.1.3-testing/tools/python/xen/xend/XendConfig.py @@ -191,6 +191,8 @@ XENAPI_PLATFORM_CFG_TYPES = { 'xen_platform_pci': int, "gfx_passthru": int, @@ -82,10 +82,10 @@ Index: xen-4.1.2-testing/tools/python/xen/xend/XendConfig.py } # Xen API console 'other_config' keys. -Index: xen-4.1.2-testing/tools/libxl/libxl_dm.c +Index: xen-4.1.3-testing/tools/libxl/libxl_dm.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/libxl_dm.c -+++ xen-4.1.2-testing/tools/libxl/libxl_dm.c +--- xen-4.1.3-testing.orig/tools/libxl/libxl_dm.c ++++ xen-4.1.3-testing/tools/libxl/libxl_dm.c @@ -117,6 +117,12 @@ static char ** libxl_build_device_model_ flexarray_vappend(dm_args, "-usbdevice", info->usbdevice, NULL); } @@ -112,11 +112,11 @@ Index: xen-4.1.2-testing/tools/libxl/libxl_dm.c if (info->soundhw) { flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL); } -Index: xen-4.1.2-testing/tools/libxl/libxl.idl +Index: xen-4.1.3-testing/tools/libxl/libxl.idl =================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/libxl.idl -+++ xen-4.1.2-testing/tools/libxl/libxl.idl -@@ -164,6 +164,8 @@ libxl_device_model_info = Struct("device +--- xen-4.1.3-testing.orig/tools/libxl/libxl.idl ++++ xen-4.1.3-testing/tools/libxl/libxl.idl +@@ -166,6 +166,8 @@ libxl_device_model_info = Struct("device ("vcpu_avail", integer, False, "vcpus actually available"), ("xen_platform_pci", integer, False, "enable/disable the xen platform pci device"), ("extra", libxl_string_list, False, "extra parameters pass directly to qemu, NULL terminated"), @@ -125,10 +125,10 @@ Index: xen-4.1.2-testing/tools/libxl/libxl.idl ], comment= """Device Model information. -Index: xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c +Index: xen-4.1.3-testing/tools/libxl/xl_cmdimpl.c =================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/xl_cmdimpl.c -+++ xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c +--- xen-4.1.3-testing.orig/tools/libxl/xl_cmdimpl.c ++++ xen-4.1.3-testing/tools/libxl/xl_cmdimpl.c @@ -365,6 +365,8 @@ static void printf_info(int domid, printf("\t\t\t(usb %d)\n", dm_info->usb); printf("\t\t\t(usbdevice %s)\n", dm_info->usbdevice); @@ -138,7 +138,7 @@ Index: xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c printf("\t\t)\n"); } else { printf("\t\t(linux %d)\n", b_info->hvm); -@@ -1142,6 +1144,8 @@ skip_vfb: +@@ -1158,6 +1160,8 @@ skip_vfb: xlu_cfg_replace_string (config, "soundhw", &dm_info->soundhw); if (!xlu_cfg_get_long (config, "xen_platform_pci", &l)) dm_info->xen_platform_pci = l; diff --git a/x86-extra-trap-info.patch b/x86-extra-trap-info.patch index f79ce83..531e3a4 100644 --- a/x86-extra-trap-info.patch +++ b/x86-extra-trap-info.patch @@ -1,8 +1,6 @@ -Index: xen-4.1.2-testing/xen/arch/x86/x86_32/entry.S -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/entry.S -+++ xen-4.1.2-testing/xen/arch/x86/x86_32/entry.S -@@ -389,29 +389,41 @@ UNLIKELY_END(bounce_vm86_3) +--- a/xen/arch/x86/x86_32/entry.S ++++ b/xen/arch/x86/x86_32/entry.S +@@ -390,29 +390,41 @@ UNLIKELY_END(bounce_vm86_3) movl %eax,UREGS_eip+4(%esp) ret _ASM_EXTABLE(.Lft6, domain_crash_synchronous) @@ -62,11 +60,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_32/entry.S domain_crash_synchronous: pushl $domain_crash_synchronous_string call printk -Index: xen-4.1.2-testing/xen/arch/x86/x86_64/entry.S -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/entry.S -+++ xen-4.1.2-testing/xen/arch/x86/x86_64/entry.S -@@ -418,22 +418,35 @@ UNLIKELY_END(bounce_failsafe) +--- a/xen/arch/x86/x86_64/entry.S ++++ b/xen/arch/x86/x86_64/entry.S +@@ -430,22 +430,35 @@ UNLIKELY_END(bounce_failsafe) jz domain_crash_synchronous movq %rax,UREGS_rip+8(%rsp) ret diff --git a/x86-ioapic-ack-default.patch b/x86-ioapic-ack-default.patch index 852362b..c354761 100644 --- a/x86-ioapic-ack-default.patch +++ b/x86-ioapic-ack-default.patch @@ -1,8 +1,10 @@ Change default IO-APIC ack mode for single IO-APIC systems to old-style. ---- a/xen/arch/x86/io_apic.c -+++ b/xen/arch/x86/io_apic.c -@@ -1679,7 +1679,7 @@ static unsigned int startup_level_ioapic +Index: xen-4.1.3-testing/xen/arch/x86/io_apic.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/io_apic.c ++++ xen-4.1.3-testing/xen/arch/x86/io_apic.c +@@ -1680,7 +1680,7 @@ static unsigned int startup_level_ioapic return 0; /* don't check for pending */ } @@ -11,7 +13,7 @@ Change default IO-APIC ack mode for single IO-APIC systems to old-style. static void setup_ioapic_ack(char *s) { if ( !strcmp(s, "old") ) -@@ -2180,6 +2180,8 @@ void __init setup_IO_APIC(void) +@@ -2187,6 +2187,8 @@ void __init setup_IO_APIC(void) else io_apic_irqs = ~PIC_IRQS; diff --git a/x86_64-AMD-erratum-121.patch b/x86_64-AMD-erratum-121.patch deleted file mode 100644 index 367409b..0000000 --- a/x86_64-AMD-erratum-121.patch +++ /dev/null @@ -1,38 +0,0 @@ -References: CVE-2012-2934, bnc#764077 - ---- a/xen/arch/x86/cpu/amd.c -+++ b/xen/arch/x86/cpu/amd.c -@@ -32,6 +32,9 @@ - static char opt_famrev[14]; - string_param("cpuid_mask_cpu", opt_famrev); - -+static int opt_allow_unsafe; -+boolean_param("allow_unsafe", opt_allow_unsafe); -+ - static inline void wrmsr_amd(unsigned int index, unsigned int lo, - unsigned int hi) - { -@@ -620,6 +623,11 @@ static void __devinit init_amd(struct cp - clear_bit(X86_FEATURE_MCE, c->x86_capability); - - #ifdef __x86_64__ -+ if (cpu_has_amd_erratum(c, AMD_ERRATUM_121) && !opt_allow_unsafe) -+ panic("Xen will not boot on this CPU for security reasons.\n" -+ "Pass \"allow_unsafe\" if you're trusting all your" -+ " (PV) guest kernels.\n"); -+ - /* AMD CPUs do not support SYSENTER outside of legacy mode. */ - clear_bit(X86_FEATURE_SEP, c->x86_capability); - ---- a/xen/include/asm-x86/amd.h -+++ b/xen/include/asm-x86/amd.h -@@ -127,6 +127,9 @@ - #define AMD_MODEL_RANGE_START(range) (((range) >> 12) & 0xfff) - #define AMD_MODEL_RANGE_END(range) ((range) & 0xfff) - -+#define AMD_ERRATUM_121 \ -+ AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x3f, 0xf)) -+ - #define AMD_ERRATUM_170 \ - AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x67, 0xf)) - diff --git a/x86_64-allow-unsafe-adjust.patch b/x86_64-allow-unsafe-adjust.patch index 06b4162..098ec68 100644 --- a/x86_64-allow-unsafe-adjust.patch +++ b/x86_64-allow-unsafe-adjust.patch @@ -21,7 +21,7 @@ means of a single line change. static inline void wrmsr_amd(unsigned int index, unsigned int lo, unsigned int hi) -@@ -623,10 +626,19 @@ static void __devinit init_amd(struct cp +@@ -638,10 +641,19 @@ static void __devinit init_amd(struct cp clear_bit(X86_FEATURE_MCE, c->x86_capability); #ifdef __x86_64__ diff --git a/x86_64-sysret-canonical.patch b/x86_64-sysret-canonical.patch deleted file mode 100644 index 57919b1..0000000 --- a/x86_64-sysret-canonical.patch +++ /dev/null @@ -1,29 +0,0 @@ -References: CVE-2012-0217, bnc#757537 - ---- a/xen/arch/x86/x86_64/entry.S -+++ b/xen/arch/x86/x86_64/entry.S -@@ -40,6 +40,13 @@ restore_all_guest: - testw $TRAP_syscall,4(%rsp) - jz iret_exit_to_guest - -+ /* Don't use SYSRET path if the return address is not canonical. */ -+ movq 8(%rsp),%rcx -+ sarq $47,%rcx -+ incl %ecx -+ cmpl $1,%ecx -+ ja .Lforce_iret -+ - addq $8,%rsp - popq %rcx # RIP - popq %r11 # CS -@@ -50,6 +57,10 @@ restore_all_guest: - sysretq - 1: sysretl - -+.Lforce_iret: -+ /* Mimic SYSRET behavior. */ -+ movq 8(%rsp),%rcx # RIP -+ movq 24(%rsp),%r11 # RFLAGS - ALIGN - /* No special register assumptions. */ - iret_exit_to_guest: diff --git a/xen-4.1.2-testing-src.tar.bz2 b/xen-4.1.2-testing-src.tar.bz2 deleted file mode 100644 index 33c6297..0000000 --- a/xen-4.1.2-testing-src.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:24db3184741ea494f3a11cd522ad308c6dae6a47572360efe5d902ccb4780822 -size 10787209 diff --git a/xen-4.1.3-testing-src.tar.bz2 b/xen-4.1.3-testing-src.tar.bz2 new file mode 100644 index 0000000..757cd76 --- /dev/null +++ b/xen-4.1.3-testing-src.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e2d148ca62ed1c2b498c860c5c1a783506152ab69897de4642efe910035cb73 +size 10789169 diff --git a/xen-config.diff b/xen-config.diff index 85757cb..53b99bc 100644 --- a/xen-config.diff +++ b/xen-config.diff @@ -1,5 +1,7 @@ ---- a/Config.mk -+++ b/Config.mk +Index: xen-4.1.3-testing/Config.mk +=================================================================== +--- xen-4.1.3-testing.orig/Config.mk ++++ xen-4.1.3-testing/Config.mk @@ -178,7 +178,7 @@ endif # Specify which qemu-dm to use. This may be `ioemu' to use the old # Mercurial in-tree version, or a local directory, or a git URL. @@ -7,9 +9,9 @@ -CONFIG_QEMU ?= $(QEMU_REMOTE) +CONFIG_QEMU ?= ioemu-qemu-xen - QEMU_TAG := xen-4.1.2 - #QEMU_TAG ?= e073e69457b4d99b6da0b6536296e3498f7f6599 -@@ -188,7 +188,7 @@ QEMU_TAG := xen-4.1.2 + QEMU_TAG ?= xen-4.1.3 + # Mon Apr 2 17:55:05 2012 +0100 +@@ -187,7 +187,7 @@ QEMU_TAG ?= xen-4.1.3 # Optional components XENSTAT_XENTOP ?= y VTPM_TOOLS ?= n @@ -18,8 +20,10 @@ PYTHON_TOOLS ?= y OCAML_TOOLS ?= y CONFIG_MINITERM ?= n ---- a/tools/Makefile -+++ b/tools/Makefile +Index: xen-4.1.3-testing/tools/Makefile +=================================================================== +--- xen-4.1.3-testing.orig/tools/Makefile ++++ xen-4.1.3-testing/tools/Makefile @@ -79,14 +79,16 @@ IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TAR --interp-prefix=$(CROSS_SYS_ROOT) endif @@ -50,8 +54,10 @@ .PHONY: ioemu-dir-force-update ioemu-dir-force-update: ---- a/tools/libxc/Makefile -+++ b/tools/libxc/Makefile +Index: xen-4.1.3-testing/tools/libxc/Makefile +=================================================================== +--- xen-4.1.3-testing.orig/tools/libxc/Makefile ++++ xen-4.1.3-testing/tools/libxc/Makefile @@ -195,7 +195,7 @@ xc_dom_bzimageloader.opic: CFLAGS += $(c libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l) @@ -61,8 +67,10 @@ xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so $(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) -lxenctrl ---- a/tools/firmware/etherboot/Makefile -+++ b/tools/firmware/etherboot/Makefile +Index: xen-4.1.3-testing/tools/firmware/etherboot/Makefile +=================================================================== +--- xen-4.1.3-testing.orig/tools/firmware/etherboot/Makefile ++++ xen-4.1.3-testing/tools/firmware/etherboot/Makefile @@ -35,11 +35,13 @@ eb-roms.h: Config mv -f $@.new $@ diff --git a/xen-optimize.patch b/xen-optimize.patch deleted file mode 100644 index ba120b8..0000000 --- a/xen-optimize.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- xen-4.1.2-testing/tools/blktap2/drivers/Makefile.orig 2012-07-29 13:02:16.275448839 +0200 -+++ xen-4.1.2-testing/tools/blktap2/drivers/Makefile 2012-07-29 13:02:37.041208027 +0200 -@@ -9,7 +9,7 @@ - LOCK_UTIL = lock-util - INST_DIR = $(SBINDIR) - --CFLAGS += -Werror -g -O0 -+#CFLAGS += -Werror -g -O0 - CFLAGS += -Wno-unused - CFLAGS += -fno-strict-aliasing - CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers diff --git a/xen-warnings-unused.diff b/xen-warnings-unused.diff index 912e2fd..b553892 100644 --- a/xen-warnings-unused.diff +++ b/xen-warnings-unused.diff @@ -1,7 +1,5 @@ -Index: xen-4.1.2-testing/tools/libxc/xc_tmem.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_tmem.c -+++ xen-4.1.2-testing/tools/libxc/xc_tmem.c +--- a/tools/libxc/xc_tmem.c ++++ b/tools/libxc/xc_tmem.c @@ -390,7 +390,8 @@ static int xc_tmem_restore_new_pool( int xc_tmem_restore(xc_interface *xch, int dom, int io_fd) @@ -12,11 +10,9 @@ Index: xen-4.1.2-testing/tools/libxc/xc_tmem.c uint32_t this_max_pools, this_version; uint32_t pool_id; uint32_t minusone; -Index: xen-4.1.2-testing/tools/libxc/xc_domain_restore.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/libxc/xc_domain_restore.c -+++ xen-4.1.2-testing/tools/libxc/xc_domain_restore.c -@@ -1087,7 +1087,6 @@ int xc_domain_restore(xc_interface *xch, +--- a/tools/libxc/xc_domain_restore.c ++++ b/tools/libxc/xc_domain_restore.c +@@ -1098,7 +1098,6 @@ int xc_domain_restore(xc_interface *xch, int vcpuextstate = 0; uint32_t vcpuextstate_size = 0; unsigned long mfn, pfn; @@ -24,7 +20,7 @@ Index: xen-4.1.2-testing/tools/libxc/xc_domain_restore.c int nraces = 0; /* The new domain's shared-info frame number. */ -@@ -1251,7 +1250,6 @@ int xc_domain_restore(xc_interface *xch, +@@ -1262,7 +1261,6 @@ int xc_domain_restore(xc_interface *xch, * Now simply read each saved frame into its new machine frame. * We uncanonicalise page tables as we go. */ @@ -32,10 +28,8 @@ Index: xen-4.1.2-testing/tools/libxc/xc_domain_restore.c n = m = 0; loadpages: -Index: xen-4.1.2-testing/tools/misc/gtraceview.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/misc/gtraceview.c -+++ xen-4.1.2-testing/tools/misc/gtraceview.c +--- a/tools/misc/gtraceview.c ++++ b/tools/misc/gtraceview.c @@ -622,7 +622,8 @@ void crt_init(void) void nr_addch(int nr, int ch) { @@ -46,10 +40,8 @@ Index: xen-4.1.2-testing/tools/misc/gtraceview.c getyx(stdscr, y, x); for (i = 0; i < nr; i++) { if (x == COLS-1) -Index: xen-4.1.2-testing/tools/xcutils/xc_restore.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/xcutils/xc_restore.c -+++ xen-4.1.2-testing/tools/xcutils/xc_restore.c +--- a/tools/xcutils/xc_restore.c ++++ b/tools/xcutils/xc_restore.c @@ -19,7 +19,8 @@ int main(int argc, char **argv) { @@ -60,10 +52,8 @@ Index: xen-4.1.2-testing/tools/xcutils/xc_restore.c xc_interface *xch; int io_fd, ret; int superpages; -Index: xen-4.1.2-testing/tools/firmware/rombios/32bit/tcgbios/tcgbios.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/firmware/rombios/32bit/tcgbios/tcgbios.c -+++ xen-4.1.2-testing/tools/firmware/rombios/32bit/tcgbios/tcgbios.c +--- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c ++++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c @@ -1064,7 +1064,7 @@ uint32_t HashLogEvent32(struct hlei *hle uint32_t rc = 0; uint16_t size; @@ -73,10 +63,8 @@ Index: xen-4.1.2-testing/tools/firmware/rombios/32bit/tcgbios/tcgbios.c uint32_t hashdataptr; uint32_t hashdatalen; -Index: xen-4.1.2-testing/tools/console/client/main.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/console/client/main.c -+++ xen-4.1.2-testing/tools/console/client/main.c +--- a/tools/console/client/main.c ++++ b/tools/console/client/main.c @@ -277,7 +277,8 @@ int main(int argc, char **argv) }; @@ -87,10 +75,8 @@ Index: xen-4.1.2-testing/tools/console/client/main.c struct xs_handle *xs; char *end; console_type type = CONSOLE_INVAL; -Index: xen-4.1.2-testing/tools/xenstat/xentop/xentop.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/xenstat/xentop/xentop.c -+++ xen-4.1.2-testing/tools/xenstat/xentop/xentop.c +--- a/tools/xenstat/xentop/xentop.c ++++ b/tools/xenstat/xentop/xentop.c @@ -272,7 +272,8 @@ static void fail(const char *str) /* Return the row containing the cursor. */ static int current_row(void) @@ -111,11 +97,9 @@ Index: xen-4.1.2-testing/tools/xenstat/xentop/xentop.c getmaxyx(stdscr, y, x); return y; } -Index: xen-4.1.2-testing/tools/libxl/libxlu_cfg.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/libxlu_cfg.c -+++ xen-4.1.2-testing/tools/libxl/libxlu_cfg.c -@@ -348,7 +348,7 @@ char *xlu__cfgl_dequote(CfgParseContext +--- a/tools/libxl/libxlu_cfg.c ++++ b/tools/libxl/libxlu_cfg.c +@@ -348,7 +348,7 @@ char *xlu__cfgl_dequote(CfgParseContext #define NUMERIC_CHAR(minlen,maxlen,base,basetext) do{ \ char numbuf[(maxlen)+1], *ep; \ @@ -124,11 +108,9 @@ Index: xen-4.1.2-testing/tools/libxl/libxlu_cfg.c \ strncpy(numbuf,p,(maxlen)); \ numbuf[(maxlen)]= 0; \ -Index: xen-4.1.2-testing/tools/libxl/libxl.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/libxl.c -+++ xen-4.1.2-testing/tools/libxl/libxl.c -@@ -221,7 +221,7 @@ int libxl_domain_rename(libxl_ctx *ctx, +--- a/tools/libxl/libxl.c ++++ b/tools/libxl/libxl.c +@@ -221,7 +221,7 @@ int libxl_domain_rename(libxl_ctx *ctx, int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid) { libxl__gc gc = LIBXL_INIT_GC(ctx); @@ -137,7 +119,7 @@ Index: xen-4.1.2-testing/tools/libxl/libxl.c if (libxl__domain_is_hvm(ctx, domid)) { LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Called domain_resume on " -@@ -1297,7 +1297,7 @@ libxl_nicinfo *libxl_list_nics(libxl_ctx +@@ -1303,7 +1303,7 @@ libxl_nicinfo *libxl_list_nics(libxl_ctx { libxl__gc gc = LIBXL_INIT_GC(ctx); char *dompath, *nic_path_fe; @@ -146,7 +128,7 @@ Index: xen-4.1.2-testing/tools/libxl/libxl.c char *val, *tok; unsigned int nb_nics, i; libxl_nicinfo *res, *nics; -@@ -1305,7 +1305,7 @@ libxl_nicinfo *libxl_list_nics(libxl_ctx +@@ -1311,7 +1311,7 @@ libxl_nicinfo *libxl_list_nics(libxl_ctx dompath = libxl__xs_get_dompath(&gc, domid); if (!dompath) goto err; @@ -155,10 +137,8 @@ Index: xen-4.1.2-testing/tools/libxl/libxl.c libxl__sprintf(&gc, "%s/device/vif", dompath), &nb_nics); if (!l) goto err; -Index: xen-4.1.2-testing/tools/libxl/libxl_pci.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/libxl_pci.c -+++ xen-4.1.2-testing/tools/libxl/libxl_pci.c +--- a/tools/libxl/libxl_pci.c ++++ b/tools/libxl/libxl_pci.c @@ -240,7 +240,7 @@ static int libxl_create_pci_backend(libx flexarray_t *front = NULL; flexarray_t *back = NULL; @@ -177,11 +157,9 @@ Index: xen-4.1.2-testing/tools/libxl/libxl_pci.c LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Creating pci backend"); /* add pci device */ -Index: xen-4.1.2-testing/tools/libxl/libxl_dom.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/libxl_dom.c -+++ xen-4.1.2-testing/tools/libxl/libxl_dom.c -@@ -265,14 +265,13 @@ int libxl__build_hvm(libxl_ctx *ctx, uin +--- a/tools/libxl/libxl_dom.c ++++ b/tools/libxl/libxl_dom.c +@@ -268,14 +268,13 @@ int libxl__build_hvm(libxl_ctx *ctx, uin libxl_domain_build_info *info, libxl_domain_build_state *state) { libxl__gc gc = LIBXL_INIT_GC(ctx); @@ -197,7 +175,7 @@ Index: xen-4.1.2-testing/tools/libxl/libxl_dom.c ret = xc_hvm_build_target_mem( ctx->xch, domid, -@@ -290,7 +289,6 @@ int libxl__build_hvm(libxl_ctx *ctx, uin +@@ -293,7 +292,6 @@ int libxl__build_hvm(libxl_ctx *ctx, uin LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, ret, "hvm build set params failed"); goto out; } @@ -205,10 +183,8 @@ Index: xen-4.1.2-testing/tools/libxl/libxl_dom.c out: libxl__free_all(&gc); return 0; -Index: xen-4.1.2-testing/tools/libxl/libxl_utils.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/libxl_utils.c -+++ xen-4.1.2-testing/tools/libxl/libxl_utils.c +--- a/tools/libxl/libxl_utils.c ++++ b/tools/libxl/libxl_utils.c @@ -531,7 +531,7 @@ int libxl_devid_to_device_disk(libxl_ctx libxl__gc gc = LIBXL_INIT_GC(ctx); char *val; @@ -218,23 +194,8 @@ Index: xen-4.1.2-testing/tools/libxl/libxl_utils.c int rc = ERROR_INVAL; devid_n = libxl__device_disk_dev_number(devid); -Index: xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/libxl/xl_cmdimpl.c -+++ xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c -@@ -5448,7 +5448,7 @@ int main_cpupoollist(int argc, char **ar - {"cpus", 0, 0, 'c'}, - {0, 0, 0, 0} - }; -- int opt_long = 0; -+ int __attribute__((__unused__)) opt_long = 0; - int opt_cpus = 0; - const char *pool = NULL; - libxl_cpupoolinfo *poolinfo; -Index: xen-4.1.2-testing/tools/debugger/gdbsx/gx/gx_comm.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/debugger/gdbsx/gx/gx_comm.c -+++ xen-4.1.2-testing/tools/debugger/gdbsx/gx/gx_comm.c +--- a/tools/debugger/gdbsx/gx/gx_comm.c ++++ b/tools/debugger/gdbsx/gx/gx_comm.c @@ -163,7 +163,7 @@ readchar(void) static char buf[BUFSIZ]; static int bufcnt = 0; @@ -244,10 +205,8 @@ Index: xen-4.1.2-testing/tools/debugger/gdbsx/gx/gx_comm.c if (bufcnt-- > 0) return *bufp++ & 0x7f; -Index: xen-4.1.2-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c -+++ xen-4.1.2-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c +--- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c ++++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c @@ -820,7 +820,7 @@ static int create_suspend_thread(checkpo static void stop_suspend_thread(checkpoint_state* s) @@ -257,10 +216,8 @@ Index: xen-4.1.2-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c s->done = 1; -Index: xen-4.1.2-testing/tools/python/xen/lowlevel/netlink/libnetlink.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/python/xen/lowlevel/netlink/libnetlink.c -+++ xen-4.1.2-testing/tools/python/xen/lowlevel/netlink/libnetlink.c +--- a/tools/python/xen/lowlevel/netlink/libnetlink.c ++++ b/tools/python/xen/lowlevel/netlink/libnetlink.c @@ -433,7 +433,8 @@ int rtnl_from_file(FILE *rtnl, rtnl_filt nladdr.nl_groups = 0; @@ -271,10 +228,8 @@ Index: xen-4.1.2-testing/tools/python/xen/lowlevel/netlink/libnetlink.c int l; status = fread(&buf, 1, sizeof(*h), rtnl); -Index: xen-4.1.2-testing/xen/arch/x86/msi.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/msi.c -+++ xen-4.1.2-testing/xen/arch/x86/msi.c +--- a/xen/arch/x86/msi.c ++++ b/xen/arch/x86/msi.c @@ -799,7 +799,7 @@ static void __pci_disable_msi(struct msi { struct pci_dev *dev; @@ -284,10 +239,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/msi.c u8 bus, slot, func; dev = entry->dev; -Index: xen-4.1.2-testing/xen/common/cpupool.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/common/cpupool.c -+++ xen-4.1.2-testing/xen/common/cpupool.c +--- a/xen/common/cpupool.c ++++ b/xen/common/cpupool.c @@ -356,7 +356,7 @@ int cpupool_add_domain(struct domain *d, { struct cpupool *c; @@ -308,10 +261,8 @@ Index: xen-4.1.2-testing/xen/common/cpupool.c if ( d->cpupool == NULL ) return; -Index: xen-4.1.2-testing/xen/common/grant_table.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/common/grant_table.c -+++ xen-4.1.2-testing/xen/common/grant_table.c +--- a/xen/common/grant_table.c ++++ b/xen/common/grant_table.c @@ -769,7 +769,7 @@ __gnttab_unmap_common( struct domain *ld, *rd; struct active_grant_entry *act; @@ -321,10 +272,8 @@ Index: xen-4.1.2-testing/xen/common/grant_table.c ld = current->domain; -Index: xen-4.1.2-testing/xen/common/kexec.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/common/kexec.c -+++ xen-4.1.2-testing/xen/common/kexec.c +--- a/xen/common/kexec.c ++++ b/xen/common/kexec.c @@ -573,7 +573,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v { xen_kexec_exec_t exec; @@ -335,10 +284,8 @@ Index: xen-4.1.2-testing/xen/common/kexec.c if ( unlikely(copy_from_guest(&exec, uarg, 1)) ) return -EFAULT; -Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/intremap.c -+++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c +--- a/xen/drivers/passthrough/vtd/intremap.c ++++ b/xen/drivers/passthrough/vtd/intremap.c @@ -367,7 +367,7 @@ unsigned int io_apic_read_remap_rte( unsigned int ioapic_pin = (reg - 0x10) / 2; int index; @@ -357,10 +304,8 @@ Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c iommu = drhd->iommu; qi_ctrl = iommu_qi_ctrl(iommu); -Index: xen-4.1.2-testing/xen/common/sched_credit2.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/common/sched_credit2.c -+++ xen-4.1.2-testing/xen/common/sched_credit2.c +--- a/xen/common/sched_credit2.c ++++ b/xen/common/sched_credit2.c @@ -1854,7 +1854,8 @@ static void deactivate_runqueue(struct c static void init_pcpu(const struct scheduler *ops, int cpu) @@ -371,11 +316,9 @@ Index: xen-4.1.2-testing/xen/common/sched_credit2.c struct csched_private *prv = CSCHED_PRIV(ops); struct csched_runqueue_data *rqd; spinlock_t *old_lock; -Index: xen-4.1.2-testing/xen/common/unlzo.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/common/unlzo.c -+++ xen-4.1.2-testing/xen/common/unlzo.c -@@ -68,7 +68,7 @@ static int INIT parse_header(u8 *input, +--- a/xen/common/unlzo.c ++++ b/xen/common/unlzo.c +@@ -68,7 +68,7 @@ static int INIT parse_header(u8 *input, { int l; u8 *parse = input; @@ -384,10 +327,8 @@ Index: xen-4.1.2-testing/xen/common/unlzo.c u16 version; /* read magic: 9 first bits */ -Index: xen-4.1.2-testing/xen/arch/x86/time.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/time.c -+++ xen-4.1.2-testing/xen/arch/x86/time.c +--- a/xen/arch/x86/time.c ++++ b/xen/arch/x86/time.c @@ -1009,7 +1009,8 @@ static void local_time_calibration(void) * System timestamps, extrapolated from local and master oscillators, * taken during this calibration and the previous calibration. @@ -398,11 +339,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/time.c s_time_t prev_master_stime, curr_master_stime; /* TSC timestamps taken during this calibration and prev calibration. */ -Index: xen-4.1.2-testing/xen/arch/x86/cpu/amd.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/amd.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/amd.c -@@ -391,7 +391,7 @@ static void __devinit init_amd(struct cp +--- a/xen/arch/x86/cpu/amd.c ++++ b/xen/arch/x86/cpu/amd.c +@@ -394,7 +394,7 @@ static void __devinit init_amd(struct cp { u32 l, h; int mbytes = num_physpages >> (20-PAGE_SHIFT); @@ -411,11 +350,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/cpu/amd.c #ifdef CONFIG_SMP unsigned long long value; -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2339,7 +2339,7 @@ p2m_remove_page(struct p2m_domain *p2m, +--- a/xen/arch/x86/mm/p2m.c ++++ b/xen/arch/x86/mm/p2m.c +@@ -2341,7 +2341,7 @@ p2m_remove_page(struct p2m_domain *p2m, unsigned int page_order) { unsigned long i; @@ -424,7 +361,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c p2m_type_t t; p2m_access_t a; -@@ -2408,7 +2408,7 @@ guest_physmap_mark_populate_on_demand(st +@@ -2410,7 +2410,7 @@ guest_physmap_mark_populate_on_demand(st struct p2m_domain *p2m = p2m_get_hostp2m(d); unsigned long i; p2m_type_t ot; @@ -433,10 +370,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c int pod_count = 0; int rc = 0; -Index: xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/emulate.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c +--- a/xen/arch/x86/hvm/emulate.c ++++ b/xen/arch/x86/hvm/emulate.c @@ -59,7 +59,7 @@ static int hvmemul_do_io( ioreq_t *p = get_ioreq(curr); unsigned long ram_gfn = paddr_to_pfn(ram_gpa); @@ -446,11 +381,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c int rc; /* Check for paged out page */ -Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -@@ -278,7 +278,8 @@ void hvm_migrate_timers(struct vcpu *v) +--- a/xen/arch/x86/hvm/hvm.c ++++ b/xen/arch/x86/hvm/hvm.c +@@ -286,7 +286,8 @@ void hvm_migrate_timers(struct vcpu *v) void hvm_migrate_pirqs(struct vcpu *v) { @@ -460,7 +393,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c struct irq_desc *desc; struct domain *d = v->domain; struct hvm_irq_dpci *hvm_irq_dpci = d->arch.hvm_domain.irq.dpci; -@@ -3711,7 +3712,7 @@ long do_hvm_op(unsigned long op, XEN_GUE +@@ -3722,7 +3723,7 @@ long do_hvm_op(unsigned long op, XEN_GUE { p2m_type_t t; p2m_type_t nt; @@ -469,10 +402,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c mfn = gfn_to_mfn_unshare(p2m, pfn, &t, 0); if ( p2m_is_paging(t) ) { -Index: xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/acpi/cpu_idle.c -+++ xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c +--- a/xen/arch/x86/acpi/cpu_idle.c ++++ b/xen/arch/x86/acpi/cpu_idle.c @@ -279,7 +279,7 @@ static void acpi_processor_ffh_cstate_en static void acpi_idle_do_entry(struct acpi_processor_cx *cx) @@ -482,10 +413,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c switch ( cx->entry_method ) { -Index: xen-4.1.2-testing/xen/arch/x86/cpu/intel_cacheinfo.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/intel_cacheinfo.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/intel_cacheinfo.c +--- a/xen/arch/x86/cpu/intel_cacheinfo.c ++++ b/xen/arch/x86/cpu/intel_cacheinfo.c @@ -170,7 +170,8 @@ unsigned int __cpuinit init_intel_cachei unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */ unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */ @@ -496,11 +425,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/cpu/intel_cacheinfo.c if (c->cpuid_level > 3) { static int is_initialized; -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c -@@ -375,7 +375,7 @@ int mem_sharing_debug_gfn(struct domain +--- a/xen/arch/x86/mm/mem_sharing.c ++++ b/xen/arch/x86/mm/mem_sharing.c +@@ -375,7 +375,7 @@ int mem_sharing_debug_gfn(struct domain { p2m_type_t p2mt; mfn_t mfn; @@ -509,10 +436,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c mfn = gfn_to_mfn(p2m_get_hostp2m(d), gfn, &p2mt); page = mfn_to_page(mfn); -Index: xen-4.1.2-testing/xen/arch/x86/hvm/viridian.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/viridian.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/viridian.c +--- a/xen/arch/x86/hvm/viridian.c ++++ b/xen/arch/x86/hvm/viridian.c @@ -270,7 +270,7 @@ int rdmsr_viridian_regs(uint32_t idx, ui int viridian_hypercall(struct cpu_user_regs *regs) { @@ -522,11 +447,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/viridian.c uint16_t status = HV_STATUS_SUCCESS; union hypercall_input { -Index: xen-4.1.2-testing/xen/arch/x86/mm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -4914,7 +4914,7 @@ static int ptwr_emulated_update( +--- a/xen/arch/x86/mm.c ++++ b/xen/arch/x86/mm.c +@@ -4943,7 +4943,7 @@ static int ptwr_emulated_update( { unsigned long mfn; unsigned long unaligned_addr = addr; @@ -535,10 +458,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c l1_pgentry_t pte, ol1e, nl1e, *pl1e; struct vcpu *v = current; struct domain *d = v->domain; -Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c +--- a/xen/arch/x86/x86_64/mm.c ++++ b/xen/arch/x86/x86_64/mm.c @@ -436,7 +436,8 @@ void destroy_m2p_mapping(struct mem_hota static int setup_compat_m2p_table(struct mem_hotadd_info *info) { @@ -549,10 +470,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c l3_pgentry_t *l3_ro_mpt = NULL; l2_pgentry_t *l2_ro_mpt = NULL; struct page_info *l1_pg; -Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/mce.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c +--- a/xen/arch/x86/cpu/mcheck/mce.c ++++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -151,7 +151,6 @@ static struct mcinfo_bank *mca_init_bank struct mc_info *mi, int bank) { @@ -569,7 +488,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c if (mib->mc_status & MCi_STATUS_MISCV) mib->mc_misc = mca_rdmsr(MSR_IA32_MCx_MISC(bank)); -@@ -281,7 +279,7 @@ mctelem_cookie_t mcheck_mca_logout(enum +@@ -281,7 +279,7 @@ mctelem_cookie_t mcheck_mca_logout(enum recover = (mc_recoverable_scan)? 1: 0; for (i = 0; i < 32 && i < nr_mce_banks; i++) { @@ -587,10 +506,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c uint64_t hwcr = 0; int intpose; int i; -Index: xen-4.1.2-testing/xen/common/tmem.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/common/tmem.c -+++ xen-4.1.2-testing/xen/common/tmem.c +--- a/xen/common/tmem.c ++++ b/xen/common/tmem.c @@ -1351,7 +1351,8 @@ obj_unlock: static int tmem_evict(void) { @@ -611,10 +528,8 @@ Index: xen-4.1.2-testing/xen/common/tmem.c client_t *client = pool->client; int ret = client->frozen ? -EFROZEN : -ENOMEM; -Index: xen-4.1.2-testing/xen/common/tmem_xen.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/common/tmem_xen.c -+++ xen-4.1.2-testing/xen/common/tmem_xen.c +--- a/xen/common/tmem_xen.c ++++ b/xen/common/tmem_xen.c @@ -177,7 +177,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn, void **out_va, size_t *out_len, void *cli_va) @@ -652,11 +567,9 @@ Index: xen-4.1.2-testing/xen/common/tmem_xen.c tmh->persistent_pool = xmem_pool_create(name, tmh_persistent_pool_page_get, tmh_persistent_pool_page_put, PAGE_SIZE, 0, PAGE_SIZE); if ( tmh->persistent_pool == NULL ) -Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/vmce.c -+++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c -@@ -656,7 +656,7 @@ int is_vmce_ready(struct mcinfo_bank *ba +--- a/xen/arch/x86/cpu/mcheck/vmce.c ++++ b/xen/arch/x86/cpu/mcheck/vmce.c +@@ -625,7 +625,7 @@ int is_vmce_ready(struct mcinfo_bank *ba */ int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn) { @@ -665,11 +578,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c struct p2m_domain *p2m; p2m_type_t pt; -Index: xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/shadow/multi.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c -@@ -124,7 +124,7 @@ set_shadow_status(struct vcpu *v, mfn_t +--- a/xen/arch/x86/mm/shadow/multi.c ++++ b/xen/arch/x86/mm/shadow/multi.c +@@ -124,7 +124,7 @@ set_shadow_status(struct vcpu *v, mfn_t /* Put a shadow into the hash table */ { struct domain *d = v->domain; @@ -687,10 +598,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c shadow_l1e_t *sl1p, sl1e; struct page_info *sp; -Index: xen-4.1.2-testing/xen/arch/x86/domain_build.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/domain_build.c -+++ xen-4.1.2-testing/xen/arch/x86/domain_build.c +--- a/xen/arch/x86/domain_build.c ++++ b/xen/arch/x86/domain_build.c @@ -378,8 +378,7 @@ int __init construct_dom0( return rc; @@ -701,11 +610,9 @@ Index: xen-4.1.2-testing/xen/arch/x86/domain_build.c machine = elf_uval(&elf, elf.ehdr, e_machine); switch (CONFIG_PAGING_LEVELS) { case 3: /* x86_32p */ -Index: xen-4.1.2-testing/xen/arch/x86/traps.c -=================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/traps.c -+++ xen-4.1.2-testing/xen/arch/x86/traps.c -@@ -1858,7 +1858,11 @@ static int emulate_privileged_op(struct +--- a/xen/arch/x86/traps.c ++++ b/xen/arch/x86/traps.c +@@ -1858,7 +1858,11 @@ static int emulate_privileged_op(struct struct vcpu *v = current; unsigned long *reg, eip = regs->eip; u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0, lock = 0, rex = 0; diff --git a/xen.changes b/xen.changes index 13b9de1..4b7d001 100644 --- a/xen.changes +++ b/xen.changes @@ -1,13 +1,45 @@ +------------------------------------------------------------------- +Fri Aug 10 10:07:27 MDT 2012 - carnold@novell.com + +- Update to Xen 4.1.3 c/s 23336 + +------------------------------------------------------------------- +Mon Jul 30 09:39:35 MDT 2012 - carnold@novell.com + +- Upstream or pending upstream patches from Jan + 25587-fix-off-by-one-parsing-error.patch + 25616-x86-MCi_CTL-default.patch + 25617-vtd-qinval-addr.patch + 25688-x86-nr_irqs_gsi.patch + ------------------------------------------------------------------- Sun Jul 29 11:19:53 UTC 2012 - aj@suse.de - Build all files with optimization (fortify source does not work with -O0). +------------------------------------------------------------------- +Fri Jul 27 09:29:37 MDT 2012 - carnold@novell.com + +- bnc#773393 - VUL-0: CVE-2012-3433: xen: HVM guest destroy p2m + teardown host DoS vulnerability + CVE-2012-3433-xsa11.patch +- bnc#773401 - VUL-1: CVE-2012-3432: xen: HVM guest user mode MMIO + emulation DoS + 25682-x86-inconsistent-io-state.patch + +------------------------------------------------------------------- +Wed Jul 18 10:22:33 MDT 2012 - carnold@novell.com + +- bnc#762484 - VUL-1: CVE-2012-2625: xen: pv bootloader doesn't + check the size of the bzip2 or lzma compressed kernel, leading to + denial of service + 25589-pygrub-size-limits.patch + ------------------------------------------------------------------- Tue Jul 10 10:16:42 UTC 2012 - werner@suse.de -- Make it build with latest TeXLive 2012 with new package layout +- Make it build with latest TeXLive 2012 with new package layout ------------------------------------------------------------------- Fri Jun 15 08:45:50 MDT 2012 - carnold@novell.com diff --git a/xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch b/xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch deleted file mode 100644 index f3282c7..0000000 --- a/xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch +++ /dev/null @@ -1,65 +0,0 @@ -Use new Xen HVMOP_get_mem_type hvmop hypercall option and new Linux kernel -register_oldmem_pfn_is_ram interface. - -Signed-off-by: Olaf Hering - ---- - unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | 31 +++++++++++++++ - 1 file changed, 31 insertions(+) - -Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -=================================================================== ---- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -358,6 +359,32 @@ static int check_platform_magic(struct d - return -ENODEV; - } - -+#if defined(HAVE_OLDMEM_PFN_IS_RAM) && defined(HVMOP_get_mem_type) -+static int xen_oldmem_pfn_is_ram(unsigned long pfn) -+{ -+ struct xen_hvm_get_mem_type a; -+ int ram; -+ -+ a.domid = DOMID_SELF; -+ a.pfn = pfn; -+ if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a)) -+ return -ENXIO; -+ -+ switch (a.mem_type) { -+ case HVMMEM_mmio_dm: -+ ram = 0; -+ break; -+ case HVMMEM_ram_rw: -+ case HVMMEM_ram_ro: -+ default: -+ ram = 1; -+ break; -+ } -+ -+ return ram; -+} -+#endif -+ - static int __devinit platform_pci_init(struct pci_dev *pdev, - const struct pci_device_id *ent) - { -@@ -426,6 +453,10 @@ static int __devinit platform_pci_init(s - if ((ret = xen_panic_handler_init())) - goto out; - -+#if defined(HAVE_OLDMEM_PFN_IS_RAM) && defined(HVMOP_get_mem_type) -+ register_oldmem_pfn_is_ram(&xen_oldmem_pfn_is_ram); -+#endif -+ - out: - if (ret) { - pci_release_region(pdev, 0); diff --git a/xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch b/xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch index 0fc3add..f693116 100644 --- a/xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch +++ b/xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch @@ -9,10 +9,10 @@ Signed-off-by: Olaf Hering unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +Index: xen-4.1.3-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c =================================================================== ---- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +--- xen-4.1.3-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ xen-4.1.3-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c @@ -27,6 +27,7 @@ #include #include @@ -21,7 +21,7 @@ Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci. #include #include #include -@@ -479,6 +480,18 @@ static struct pci_device_id platform_pci +@@ -477,6 +478,18 @@ static struct pci_device_id platform_pci MODULE_DEVICE_TABLE(pci, platform_pci_tbl); diff --git a/xen.spec b/xen.spec index 4f0b018..67ec7fb 100644 --- a/xen.spec +++ b/xen.spec @@ -15,13 +15,12 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - Name: xen ExclusiveArch: %ix86 x86_64 %define xvers 4.1 %define xvermaj 4 -%define changeset 23174 -%define xen_build_dir xen-4.1.2-testing +%define changeset 23336 +%define xen_build_dir xen-4.1.3-testing %define with_kmp 1 %define with_stubdom 1 # EFI requires gcc46 or newer @@ -112,13 +111,13 @@ BuildRequires: kernel-syms BuildRequires: module-init-tools BuildRequires: xorg-x11 %endif -Version: 4.1.2_17 +Version: 4.1.3_01 Release: 0 PreReq: %insserv_prereq %fillup_prereq Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) License: GPL-2.0+ Group: System/Kernel -Source0: xen-4.1.2-testing-src.tar.bz2 +Source0: xen-4.1.3-testing-src.tar.bz2 Source1: stubdom.tar.bz2 Source2: xen-utils-0.1.tar.bz2 Source3: README.SuSE @@ -175,17 +174,10 @@ Patch23128: 23128-xentrace_correct_formula_to_calculate_t_info_pages.patch Patch23129: 23129-xentrace_remove_unneeded_debug_printk.patch Patch23173: 23173-xentrace_Move_register_cpu_notifier_call_into_boot-time_init..patch Patch23199: 23199-amd-iommu-unmapped-intr-fault.patch -Patch23233: 23233-hvm-cr-access.patch -Patch23234: 23234-svm-decode-assist-base.patch -Patch23235: 23235-svm-decode-assist-crs.patch Patch23236: 23236-svm-decode-assist-invlpg.patch -Patch23238: 23238-svm-decode-assist-insn-fetch.patch Patch23239: 23239-xentrace_correct_overflow_check_for_number_of_per-cpu_trace_pages.patch Patch23246: 23246-x86-xsave-enable.patch Patch23303: 23303-cpufreq-misc.patch -Patch23304: 23304-amd-oprofile-strings.patch -Patch23305: 23305-amd-fam15-xenoprof.patch -Patch23306: 23306-amd-fam15-vpmu.patch Patch23308: 23308-xentrace_Move_the_global_variable_t_info_first_offset_into_calculate_tbuf_size.patch Patch23309: 23309-xentrace_Mark_data_size___read_mostly_because_its_only_written_once.patch Patch23310: 23310-xentrace_Remove_unneeded_cast_when_assigning_pointer_value_to_dst.patch @@ -195,13 +187,11 @@ Patch23404: 23404-xentrace_reduce_trace_buffer_size_to_something_mfn_offset_ Patch23405: 23405-xentrace_fix_type_of_offset_to_avoid_ouf-of-bounds_access.patch Patch23406: 23406-xentrace_update___insert_record_to_copy_the_trace_record_to_individual_mfns.patch Patch23407: 23407-xentrace_allocate_non-contiguous_per-cpu_trace_buffers.patch -Patch23437: 23437-amd-fam15-TSC-scaling.patch Patch23462: 23462-libxc-cpu-feature.patch Patch23506: 23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch Patch23507: 23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch Patch23508: 23508-vmx-proc-based-ctls-probe.patch Patch23509: 23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch -Patch23511: 23511-amd-fam15-no-flush-for-C3.patch Patch23562: 23562-xenpaging_remove_unused_spinlock_in_pager.patch Patch23571: 23571-vtd-fault-verbosity.patch Patch23574: 23574-x86-dom0-compressed-ELF.patch @@ -229,90 +219,59 @@ Patch23595: 23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch Patch23596: 23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch Patch23597: 23597-xenpaging_remove_private_mem_event.h.patch Patch23599: 23599-tools_fix_build_after_recent_xenpaging_changes.patch -Patch23610: 23610-x86-topology-info.patch -Patch23611: 23611-amd-fam15-topology.patch Patch23613: 23613-EFI-headers.patch Patch23614: 23614-x86_64-EFI-boot.patch Patch23615: 23615-x86_64-EFI-runtime.patch Patch23616: 23616-x86_64-EFI-MPS.patch Patch23643: 23643-xentrace_Allow_tracing_to_be_enabled_at_boot.patch Patch23676: 23676-x86_64-image-map-bounds.patch -Patch23686: 23686-pygrub-solaris.patch Patch23697: 23697-pygrub-grub2.patch Patch23719: 23719-xentrace_update___trace_var_comment.patch Patch23723: 23723-x86-CMOS-lock.patch -Patch23724: 23724-x86-smpboot-x2apic.patch -Patch23726: 23726-x86-intel-flexmigration-v2.patch Patch23735: 23735-guest-dom0-cap.patch Patch23747: 23747-mmcfg-base-address.patch Patch23749: 23749-mmcfg-reservation.patch -Patch23752: 23752-x86-shared-IRQ-vector-maps.patch -Patch23754: 23754-AMD-perdev-vector-map.patch Patch23771: 23771-x86-ioapic-clear-pin.patch Patch23772: 23772-x86-trampoline.patch Patch23774: 23774-x86_64-EFI-EDD.patch -Patch23781: 23781-pm-wide-ACPI-ids.patch Patch23782: 23782-x86-ioapic-clear-irr.patch Patch23783: 23783-ACPI-set-_PDC-bits.patch -Patch23795: 23795-intel-ich10-quirk.patch Patch23800: 23800-x86_64-guest-addr-range.patch Patch23804: 23804-x86-IPI-counts.patch Patch23817: 23817-mem_event_add_ref_counting_for_free_requestslots.patch Patch23818: 23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch -Patch23819: 23819-make-docs.patch Patch23827: 23827-xenpaging_use_batch_of_pages_during_final_page-in.patch Patch23841: 23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch Patch23842: 23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch -Patch23853: 23853-x86-pv-cpuid-xsave.patch Patch23874: 23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch Patch23897: 23897-x86-mce-offline-again.patch -Patch23900: 23900-xzalloc.patch Patch23904: 23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch Patch23905: 23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch Patch23906: 23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch -Patch23908: 23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch -Patch23925: 23925-x86-AMD-ARAT-Fam12.patch Patch23933: 23933-pt-bus2bridge-update.patch Patch23943: 23943-xenpaging_clear_page_content_after_evict.patch Patch23944: 23944-pygrub-debug.patch Patch23949: 23949-constify_vcpu_set_affinitys_second_parameter.patch Patch23953: 23953-xenpaging_handle_evict_failures.patch -Patch23955: 23955-x86-pv-cpuid-xsave.patch Patch23957: 23957-cpufreq-error-paths.patch Patch23978: 23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch Patch23979: 23979-xenpaging_document_p2m_mem_paging_functions.patch Patch23980: 23980-xenpaging_disallow_paging_in_a_PoD_guest.patch Patch23993: 23993-x86-microcode-amd-fix-23871.patch -Patch23998: 23998-pygrub-GPT.patch Patch23999: 23999-pygrub-grub2.patch -Patch24000: 24000-pygrub-grub2.patch -Patch24001: 24001-pygrub-grub2.patch -Patch24002: 24002-pygrub-grub2.patch Patch24064: 24064-pygrub-HybridISO.patch Patch24104: 24104-waitqueue_Double_size_of_x86_shadow_stack..patch Patch24105: 24105-xenpaging_compare_domain_pointer_in_p2m_mem_paging_populate.patch Patch24106: 24106-mem_event_check_capabilities_only_once.patch -Patch24116: 24116-x86-continuation-cancel.patch Patch24123: 24123-x86-cpuidle-quiesce.patch Patch24124: 24124-x86-microcode-amd-quiesce.patch -Patch24137: 24137-revert-23666.patch Patch24138: 24138-xenpaging_munmap_all_pages_after_page-in.patch -Patch24144: 24144-cpufreq-turbo-crash.patch -Patch24148: 24148-shadow-pgt-dying-op-performance.patch Patch24153: 24153-x86-emul-feature-checks.patch -Patch24155: 24155-x86-ioapic-EOI-after-migration.patch -Patch24156: 24156-x86-ioapic-shared-vectors.patch -Patch24157: 24157-x86-xstate-init.patch -Patch24168: 24168-x86-vioapic-clear-remote_irr.patch Patch24171: 24171-x86waitqueue_Allocate_whole_page_for_shadow_stack..patch Patch24178: 24178-debug_Add_domain-vcpu_pause_count_info_to_d_key..patch -Patch24189: 24189-x86-p2m-pod-locking.patch -Patch24190: 24190-hap-log-dirty-disable-rc.patch -Patch24193: 24193-hap-track-dirty-vram-rc.patch Patch24195: 24195-waitqueue_Detect_saved-stack_overflow_and_crash_the_guest..patch Patch24196: 24196-waitqueue_Reorder_prepare_to_wait_so_that_vcpu_is_definitely_on_the.patch Patch24197: 24197-x86-waitqueue_Because_we_have_per-cpu_stacks_we_must_wake_up_on_teh.patch -Patch24201: 24201-x86-pcpu-platform-op.patch Patch24208: 24208-xenpaging_remove_filename_from_comment.patch Patch24209: 24209-xenpaging_remove_obsolete_comment_in_resume_path.patch Patch24210: 24210-xenpaging_use_PERROR_to_print_errno.patch @@ -335,81 +294,53 @@ Patch24226: 24226-xenpaging_add_debug_to_show_received_watch_event..patch Patch24227: 24227-xenpaging_restrict_pagefile_permissions.patch Patch24231: 24231-waitqueue_Implement_wake_up_nroneall..patch Patch24232: 24232-waitqueue_Hold_a_reference_to_a_domain_on_a_waitqueue..patch -Patch24261: 24261-x86-cpuidle-Westmere-EX.patch Patch24269: 24269-mem_event_move_mem_event_domain_out_of_struct_domain.patch Patch24270: 24270-Free_d-mem_event_on_domain_destruction..patch Patch24272: 24272-xenpaging_Fix_c-s_235070a29c8c3ddf7_update_machine_to_phys_mapping_during_page_deallocation.patch Patch24275: 24275-x86-emul-lzcnt.patch Patch24277: 24277-x86-dom0-features.patch Patch24278: 24278-x86-dom0-no-PCID.patch -Patch24282: 24282-x86-log-dirty-bitmap-leak.patch Patch24318: 24318-x86-mm_Fix_checks_during_foreign_mapping_of_paged_pages.patch -Patch24344: 24344-tools-x86_64_Fix_cpuid_inline_asm_to_not_clobber_stacks_red_zone.patch Patch24327: 24327-After_preparing_a_page_for_page-in_allow_immediate_fill-in_of_the_page_contents.patch Patch24328: 24328-Tools_Libxc_wrappers_to_automatically_fill_in_page_oud_page_contents_on_prepare.patch Patch24329: 24329-Teach_xenpaging_to_use_the_new_and_non-racy_xc_mem_paging_load_interface.patch -Patch24357: 24357-firmware-no-_PS0-_PS3.patch -Patch24358: 24358-kexec-compat-overflow.patch Patch24359: 24359-x86-domU-features.patch Patch24360: 24360-x86-pv-domU-no-PCID.patch -Patch24389: 24389-amd-fam10-gart-tlb-walk-err.patch Patch24391: 24391-x86-pcpu-version.patch Patch24401: 24401-pygrub-scrolling.patch Patch24402: 24402-pygrub-edit-fix.patch -Patch24411: 24411-x86-ucode-AMD-Fam15.patch -Patch24412: 24412-x86-AMD-errata-model-shift.patch -Patch24417: 24417-amd-erratum-573.patch -Patch24429: 24429-mceinj-tool.patch -Patch24447: 24447-x86-TXT-INIT-SIPI-delay.patch -Patch24448: 24448-x86-pt-irq-leak.patch -Patch24453: 24453-x86-vIRQ-IRR-TMR-race.patch -Patch24456: 24456-x86-emul-lea.patch Patch24459: 24459-libxl-vifname.patch -Patch24460: 24460-pygrub-extlinux.patch Patch24466: 24466-libxc_Only_retry_mapping_pages_when_ENOENT_is_returned.patch Patch24478: 24478-libxl_add_feature_flag_to_xenstore_for_XS_RESET_WATCHES.patch -Patch24517: 24517-VT-d-fault-softirq.patch -Patch24527: 24527-AMD-Vi-fault-softirq.patch -Patch24535: 24535-x86-vMSI-misc.patch Patch24566: 24566-tools-libxc_fix_error_handling_in_xc_mem_paging_load.patch Patch24586: 24586-x86-mm_Properly_account_for_paged_out_pages.patch Patch24609: 24609-tools-libxc_handle_fallback_in_linux_privcmd_map_foreign_bulk_properly.patch Patch24610: 24610-xenpaging_make_file_op_largefile_aware.patch -Patch24615: 24615-VESA-lfb-flush.patch -Patch24690: 24690-x86-PCI-SERR-no-deadlock.patch -Patch24701: 24701-gnttab-map-grant-ref-recovery.patch Patch24706: 24706-pygrub-extlinux.patch -Patch24742: 24742-gnttab-misc.patch Patch24780: 24780-x86-paging-use-clear_guest.patch Patch24781: 24781-x86-vmce-mcg_ctl.patch Patch24805: 24805-x86-MSI-X-dom0-ro.patch -Patch24883: 24883-x86-guest-walk-not-present.patch Patch24886: 24886-x86-vmce-mcg_ctl-default.patch Patch24887: 24887-x86-vmce-sr.patch -Patch24888: 24888-pci-release-devices.patch -Patch24950: 24950-gnttab-copy-mapped.patch -Patch24970: 24970-x86-cpuidle-deny-port-access.patch -Patch24996: 24996-x86-cpuidle-array-overrun.patch Patch25041: 25041-tapdisk2-create-init-name.patch -Patch25098: 25098-x86-emul-lock-UD.patch -Patch25101: 25101-x86-hpet-disable.patch -Patch25168: 25168-x86-memset-size.patch -Patch25191: 25191-x86-tdt-delta-calculation.patch -Patch25195: 25195-x86-cpuidle-C2-no-flush-or-bm-check.patch Patch25196: 25196-x86-HAP-PAT-sr.patch -Patch25200: 25200-x86_64-trap-bounce-flags.patch -Patch25242: 25242-x86_64-hotplug-compat-m2p.patch Patch25247: 25247-SVM-no-rdtsc-intercept.patch Patch25267: 25267-x86-text-unlikely.patch Patch25269: 25269-x86-vMCE-addr-misc-write.patch -Patch25271: 25271-x86_64-IST-index.patch -Patch25327: 25327-pvdrv-no-asm-system-h.patch +Patch25382: 25382-x86-masked-MCE-masking-NMI.patch +Patch25387: 25387-amd-iommu-workaround-73x.patch +Patch25430: 25430-x86-AMD-Fam15-reenable-topoext.patch +Patch25431: 25431-x86-EDD-MBR-sig-check.patch +Patch25459: 25459-page-list-splice.patch +Patch25479: 25479-x86-boot-trampoline-remove.patch +Patch25485: 25485-x86_64-canonical-checks.patch +Patch25589: 25589-pygrub-size-limits.patch +Patch25616: 25616-x86-MCi_CTL-default.patch # Upstream qemu patches Patch100: ioemu-9868-MSI-X.patch Patch101: ioemu-9869-MSI-X-init.patch Patch102: ioemu-9873-MSI-X-fix-unregister_iomem.patch Patch103: ioemu-9877-MSI-X-device-cleanup.patch -Patch104: cve-2012-0029-qemu-xen-unstable.patch # Our patches Patch300: xen-config.diff Patch301: xend-config.diff @@ -467,8 +398,7 @@ Patch378: log-guest-console.patch Patch379: xend-migration-domname-fix.patch Patch380: xm-create-maxmem.patch Patch381: vif-bridge-tap-fix.patch -Patch382: xencommons-xenstored-root.patch -Patch383: xend-cpuid.patch +Patch382: xend-cpuid.patch # Patches for snapshot support Patch400: snapshot-ioemu-save.patch Patch401: snapshot-ioemu-restore.patch @@ -535,17 +465,13 @@ Patch505: pvdrv-import-shared-info.patch Patch507: x86-extra-trap-info.patch Patch508: pvdrv_emulation_control.patch Patch509: blktap-pv-cdrom.patch -Patch510: pv-driver-build.patch -Patch511: supported_module.diff -Patch512: magic_ioport_compat.patch -Patch513: xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch -Patch514: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch +Patch510: supported_module.diff +Patch511: magic_ioport_compat.patch +Patch512: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch Patch650: disable_emulated_device.diff Patch651: ioemu-disable-scsi.patch Patch652: ioemu-disable-emulated-ide-if-pv.patch -Patch653: x86_64-sysret-canonical.patch -Patch654: x86_64-AMD-erratum-121.patch -Patch655: x86_64-allow-unsafe-adjust.patch +Patch653: x86_64-allow-unsafe-adjust.patch Patch700: hv_extid_compatibility.patch Patch701: xen.no-default-runlevel-4.patch # FATE 310510 @@ -570,7 +496,6 @@ Patch1142: xenpaging.qemu.flush-cache.patch # xenalyze Patch20000: xenalyze.gcc46.patch # Build patch -Patch99997: xen-optimize.patch Patch99998: tmp-initscript-modprobe.patch Patch99999: tmp_build.patch Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ @@ -927,17 +852,10 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch23129 -p1 %patch23173 -p1 %patch23199 -p1 -%patch23233 -p1 -%patch23234 -p1 -%patch23235 -p1 %patch23236 -p1 -%patch23238 -p1 %patch23239 -p1 %patch23246 -p1 %patch23303 -p1 -%patch23304 -p1 -%patch23305 -p1 -%patch23306 -p1 %patch23308 -p1 %patch23309 -p1 %patch23310 -p1 @@ -947,13 +865,11 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch23405 -p1 %patch23406 -p1 %patch23407 -p1 -%patch23437 -p1 %patch23462 -p1 %patch23506 -p1 %patch23507 -p1 %patch23508 -p1 %patch23509 -p1 -%patch23511 -p1 %patch23562 -p1 %patch23571 -p1 %patch23574 -p1 @@ -981,90 +897,59 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch23596 -p1 %patch23597 -p1 %patch23599 -p1 -%patch23610 -p1 -%patch23611 -p1 %patch23613 -p1 %patch23614 -p1 %patch23615 -p1 %patch23616 -p1 %patch23643 -p1 %patch23676 -p1 -%patch23686 -p1 %patch23697 -p1 %patch23719 -p1 %patch23723 -p1 -%patch23724 -p1 -%patch23726 -p1 %patch23735 -p1 %patch23747 -p1 %patch23749 -p1 -%patch23752 -p1 -%patch23754 -p1 %patch23771 -p1 %patch23772 -p1 %patch23774 -p1 -%patch23781 -p1 %patch23782 -p1 %patch23783 -p1 -%patch23795 -p1 %patch23800 -p1 %patch23804 -p1 %patch23817 -p1 %patch23818 -p1 -%patch23819 -p1 %patch23827 -p1 %patch23841 -p1 %patch23842 -p1 -%patch23853 -p1 %patch23874 -p1 %patch23897 -p1 -%patch23900 -p1 %patch23904 -p1 %patch23905 -p1 %patch23906 -p1 -%patch23908 -p1 -%patch23925 -p1 %patch23933 -p1 %patch23943 -p1 %patch23944 -p1 %patch23949 -p1 %patch23953 -p1 -%patch23955 -p1 %patch23957 -p1 %patch23978 -p1 %patch23979 -p1 %patch23980 -p1 %patch23993 -p1 -%patch23998 -p1 %patch23999 -p1 -%patch24000 -p1 -%patch24001 -p1 -%patch24002 -p1 %patch24064 -p1 %patch24104 -p1 %patch24105 -p1 %patch24106 -p1 -%patch24116 -p1 %patch24123 -p1 %patch24124 -p1 -%patch24137 -p1 %patch24138 -p1 -%patch24144 -p1 -%patch24148 -p1 %patch24153 -p1 -%patch24155 -p1 -%patch24156 -p1 -%patch24157 -p1 -%patch24168 -p1 %patch24171 -p1 %patch24178 -p1 -%patch24189 -p1 -%patch24190 -p1 -%patch24193 -p1 %patch24195 -p1 %patch24196 -p1 %patch24197 -p1 -%patch24201 -p1 %patch24208 -p1 %patch24209 -p1 %patch24210 -p1 @@ -1087,81 +972,53 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch24227 -p1 %patch24231 -p1 %patch24232 -p1 -%patch24261 -p1 %patch24269 -p1 %patch24270 -p1 %patch24272 -p1 %patch24275 -p1 %patch24277 -p1 %patch24278 -p1 -%patch24282 -p1 %patch24318 -p1 -%patch24344 -p1 %patch24327 -p1 %patch24328 -p1 %patch24329 -p1 -%patch24357 -p1 -%patch24358 -p1 %patch24359 -p1 %patch24360 -p1 -%patch24389 -p1 %patch24391 -p1 %patch24401 -p1 %patch24402 -p1 -%patch24411 -p1 -%patch24412 -p1 -%patch24417 -p1 -%patch24429 -p1 -%patch24447 -p1 -%patch24448 -p1 -%patch24453 -p1 -%patch24456 -p1 %patch24459 -p1 -%patch24460 -p1 %patch24466 -p1 %patch24478 -p1 -%patch24517 -p1 -%patch24527 -p1 -%patch24535 -p1 %patch24566 -p1 %patch24586 -p1 %patch24609 -p1 %patch24610 -p1 -%patch24615 -p1 -%patch24690 -p1 -%patch24701 -p1 %patch24706 -p1 -%patch24742 -p1 %patch24780 -p1 %patch24781 -p1 %patch24805 -p1 -%patch24883 -p1 %patch24886 -p1 %patch24887 -p1 -%patch24888 -p1 -%patch24950 -p1 -%patch24970 -p1 -%patch24996 -p1 %patch25041 -p1 -%patch25098 -p1 -%patch25101 -p1 -%patch25168 -p1 -%patch25191 -p1 -%patch25195 -p1 %patch25196 -p1 -%patch25200 -p1 -%patch25242 -p1 %patch25247 -p1 %patch25267 -p1 %patch25269 -p1 -%patch25271 -p1 -%patch25327 -p1 +%patch25382 -p1 +%patch25387 -p1 +%patch25430 -p1 +%patch25431 -p1 +%patch25459 -p1 +%patch25479 -p1 +%patch25485 -p1 +%patch25589 -p1 +%patch25616 -p1 # Qemu %patch100 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1 -%patch104 -p1 # Our patches %patch300 -p1 %patch301 -p1 @@ -1219,7 +1076,6 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch380 -p1 %patch381 -p1 %patch382 -p1 -%patch383 -p1 %patch400 -p1 %patch401 -p1 %patch402 -p1 @@ -1284,14 +1140,10 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch510 -p1 %patch511 -p1 %patch512 -p1 -%patch513 -p1 -%patch514 -p1 %patch650 -p1 %patch651 -p1 %patch652 -p1 %patch653 -p1 -%patch654 -p1 -%patch655 -p1 %patch700 -p1 %patch701 -p1 # FATE 310510 @@ -1314,7 +1166,6 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch1137 -p1 %patch1142 -p1 # -%patch99997 -p1 %patch99998 -p1 %patch99999 -p1 diff --git a/xencommons-proc-xen.patch b/xencommons-proc-xen.patch index 18865ea..29299cf 100644 --- a/xencommons-proc-xen.patch +++ b/xencommons-proc-xen.patch @@ -15,41 +15,47 @@ Signed-off-by: Olaf Hering tools/hotplug/Linux/init.d/xencommons | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) -Index: xen-4.1.2-testing/tools/hotplug/Linux/init.d/xencommons +Index: xen-4.1.3-testing/tools/hotplug/Linux/init.d/xencommons =================================================================== ---- xen-4.1.2-testing.orig/tools/hotplug/Linux/init.d/xencommons -+++ xen-4.1.2-testing/tools/hotplug/Linux/init.d/xencommons -@@ -27,17 +27,29 @@ fi +--- xen-4.1.3-testing.orig/tools/hotplug/Linux/init.d/xencommons ++++ xen-4.1.3-testing/tools/hotplug/Linux/init.d/xencommons +@@ -27,27 +27,30 @@ fi test -f $xencommons_config/xencommons && . $xencommons_config/xencommons XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid +XEN_CAPABILITIES=/proc/xen/capabilities shopt -s extglob -+# not running in Xen dom0 or domU -+if ! test -d /proc/xen ; then -+ exit 0 -+fi -+ -+# mount xenfs in dom0 or domU with a pv_ops kernel + # not running in Xen dom0 or domU + if ! test -d /proc/xen ; then +- exit 0 ++ exit 0 + fi + + # mount xenfs in dom0 or domU with a pv_ops kernel if test "x$1" = xstart && \ -- test -d /proc/xen && \ - ! test -f /proc/xen/capabilities && \ - ! grep '^xenfs ' /proc/mounts >/dev/null; + ! test -f $XEN_CAPABILITIES && \ + ! grep -q '^xenfs ' /proc/mounts ; then - mount -t xenfs xenfs /proc/xen +- mount -t xenfs xenfs /proc/xen ++ mount -t xenfs xenfs /proc/xen fi --if ! grep -q "control_d" /proc/xen/capabilities ; then -+# run this script only in dom0: + # run this script only in dom0: +-# no capabilities file in xenlinux domU kernel +-# empty capabilities file in pv_ops domU kernel +-if test -f /proc/xen/capabilities && \ +- ! grep -q "control_d" /proc/xen/capabilities ; then +- exit 0 +# no capabilities file in xenlinux kernel +if ! test -f $XEN_CAPABILITIES ; then -+ exit 0 ++ exit 0 +fi +# empty capabilities file in pv_ops kernel +if ! grep -q "control_d" $XEN_CAPABILITIES ; then - exit 0 ++ exit 0 fi + do_start () { diff --git a/xencommons-xenstored-root.patch b/xencommons-xenstored-root.patch deleted file mode 100644 index 68f3012..0000000 --- a/xencommons-xenstored-root.patch +++ /dev/null @@ -1,19 +0,0 @@ -Fix setting XENSTORED_ROOTDIR in xencommons - -Due to a logic bug, XENSTORED_ROOTDIR was not being set to -default value when zero length. - - Signed-off-by: Jim Fehlig -Index: xen-4.1.2-testing/tools/hotplug/Linux/init.d/xencommons -=================================================================== ---- xen-4.1.2-testing.orig/tools/hotplug/Linux/init.d/xencommons -+++ xen-4.1.2-testing/tools/hotplug/Linux/init.d/xencommons -@@ -47,7 +47,7 @@ do_start () { - - if ! `xenstore-read -s / >/dev/null 2>&1` - then -- test -z "$XENSTORED_ROOTDIR" || XENSTORED_ROOTDIR="/var/lib/xenstored" -+ test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored" - rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null - test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log" - diff --git a/xenpaging.error-handling.patch b/xenpaging.error-handling.patch index b0b1699..14fb29e 100644 --- a/xenpaging.error-handling.patch +++ b/xenpaging.error-handling.patch @@ -20,10 +20,10 @@ Signed-off-by: Olaf Hering xen/include/public/mem_event.h | 2 - 3 files changed, 33 insertions(+), 23 deletions(-) -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.c =================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.c ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.c @@ -569,29 +569,35 @@ static int xenpaging_evict_page(xenpagin xc_interface *xch = paging->xc_handle; void *page; @@ -132,11 +132,11 @@ Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c } } while ( ret ); -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2863,19 +2863,17 @@ int p2m_mem_paging_nominate(struct p2m_d +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2865,19 +2865,17 @@ int p2m_mem_paging_nominate(struct p2m_d p2m_type_t p2mt; p2m_access_t a; mfn_t mfn; @@ -157,7 +157,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c if ( !p2m_is_pageable(p2mt) ) goto out; -@@ -2928,7 +2926,7 @@ int p2m_mem_paging_evict(struct p2m_doma +@@ -2930,7 +2928,7 @@ int p2m_mem_paging_evict(struct p2m_doma p2m_access_t a; mfn_t mfn; struct domain *d = p2m->domain; @@ -166,7 +166,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c p2m_lock(p2m); -@@ -2941,7 +2939,6 @@ int p2m_mem_paging_evict(struct p2m_doma +@@ -2943,7 +2941,6 @@ int p2m_mem_paging_evict(struct p2m_doma if ( p2mt != p2m_ram_paging_out ) goto out; @@ -174,10 +174,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Get the page so it doesn't get modified under Xen's feet */ page = mfn_to_page(mfn); if ( unlikely(!get_page(page, d)) ) -Index: xen-4.1.2-testing/xen/include/public/mem_event.h +Index: xen-4.1.3-testing/xen/include/public/mem_event.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/public/mem_event.h -+++ xen-4.1.2-testing/xen/include/public/mem_event.h +--- xen-4.1.3-testing.orig/xen/include/public/mem_event.h ++++ xen-4.1.3-testing/xen/include/public/mem_event.h @@ -49,7 +49,7 @@ #define MEM_EVENT_REASON_INT3 5 /* int3 was hit: gla/gfn are RIP */ #define MEM_EVENT_REASON_SINGLESTEP 6 /* single step was invoked: gla/gfn are RIP */ diff --git a/xenpaging.evict_fail_fast_forward.patch b/xenpaging.evict_fail_fast_forward.patch index 9f7f743..adbc4d3 100644 --- a/xenpaging.evict_fail_fast_forward.patch +++ b/xenpaging.evict_fail_fast_forward.patch @@ -12,11 +12,11 @@ Signed-off-by: Olaf Hering xen/arch/x86/mm/p2m.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -3036,6 +3036,7 @@ void p2m_mem_paging_populate(struct p2m_ +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -3038,6 +3038,7 @@ void p2m_mem_paging_populate(struct p2m_ p2m_type_t p2mt; p2m_access_t a; mfn_t mfn; @@ -24,7 +24,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ -@@ -3051,23 +3052,25 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3053,23 +3054,25 @@ void p2m_mem_paging_populate(struct p2m_ /* Allow only nominated or evicted pages to enter page-in path */ if ( p2m_do_populate(p2mt) ) { diff --git a/xenpaging.evict_mmap_readonly.patch b/xenpaging.evict_mmap_readonly.patch index 9be9708..2a1bbac 100644 --- a/xenpaging.evict_mmap_readonly.patch +++ b/xenpaging.evict_mmap_readonly.patch @@ -6,10 +6,8 @@ nominate/evict will not modify the page so there is no need to map the page rw. tools/xenpaging/xenpaging.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c -=================================================================== ---- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c -+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c +--- a/tools/xenpaging/xenpaging.c ++++ b/tools/xenpaging/xenpaging.c @@ -575,8 +575,7 @@ static int xenpaging_evict_page(xenpagin /* Map page to get a handle */ diff --git a/xenpaging.mem_event-use-wait_queue.patch b/xenpaging.mem_event-use-wait_queue.patch index 116e23f..d1946aa 100644 --- a/xenpaging.mem_event-use-wait_queue.patch +++ b/xenpaging.mem_event-use-wait_queue.patch @@ -53,11 +53,11 @@ Signed-off-by: Olaf Hering xen/include/xen/sched.h | 17 +++- 6 files changed, 179 insertions(+), 81 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -@@ -4038,8 +4038,8 @@ static int hvm_memory_event_traps(long p +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +@@ -4049,8 +4049,8 @@ static int hvm_memory_event_traps(long p if ( (p & HVMPME_onchangeonly) && (value == old) ) return 1; @@ -68,10 +68,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c return rc; memset(&req, 0, sizeof(req)); -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_event.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_event.c @@ -23,6 +23,7 @@ #include @@ -324,10 +324,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c } break; -Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/mem_sharing.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/mem_sharing.c @@ -292,44 +292,32 @@ static void mem_sharing_audit(void) #endif @@ -405,11 +405,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c return -ENOMEM; } -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -2988,21 +2988,13 @@ int p2m_mem_paging_evict(struct p2m_doma +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2990,21 +2990,13 @@ int p2m_mem_paging_evict(struct p2m_doma */ void p2m_mem_paging_drop_page(struct p2m_domain *p2m, unsigned long gfn) { @@ -435,7 +435,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } /** -@@ -3037,7 +3029,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3039,7 +3031,7 @@ void p2m_mem_paging_populate(struct p2m_ struct domain *d = p2m->domain; /* Check that there's space on the ring for this request */ @@ -444,7 +444,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return; memset(&req, 0, sizeof(req)); -@@ -3070,7 +3062,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3072,7 +3064,7 @@ void p2m_mem_paging_populate(struct p2m_ else if ( restored || !p2m_do_populate(p2mt) ) { /* gfn is already on its way back and vcpu is not paused */ @@ -453,7 +453,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c return; } -@@ -3210,8 +3202,8 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3212,8 +3204,8 @@ void p2m_mem_paging_resume(struct p2m_do if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) vcpu_unpause(d->vcpu[rsp.vcpu_id]); @@ -463,8 +463,8 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c + mem_event_wake_requesters(&d->mem_event->paging); } - void p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long gla, -@@ -3240,7 +3232,7 @@ void p2m_mem_access_check(unsigned long + void p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, unsigned long gla, +@@ -3242,7 +3234,7 @@ void p2m_mem_access_check(paddr_t gpa, b p2m_unlock(p2m); /* Otherwise, check if there is a memory event listener, and send the message along */ @@ -473,7 +473,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c if ( res < 0 ) { /* No listener */ -@@ -3250,7 +3242,7 @@ void p2m_mem_access_check(unsigned long +@@ -3252,7 +3244,7 @@ void p2m_mem_access_check(paddr_t gpa, b "Memory access permissions failure, no mem_event listener: pausing VCPU %d, dom %d\n", v->vcpu_id, d->domain_id); @@ -482,7 +482,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } else { -@@ -3300,9 +3292,11 @@ void p2m_mem_access_resume(struct p2m_do +@@ -3302,9 +3294,11 @@ void p2m_mem_access_resume(struct p2m_do if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) vcpu_unpause(d->vcpu[rsp.vcpu_id]); @@ -497,10 +497,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } #endif /* __x86_64__ */ -Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h +Index: xen-4.1.3-testing/xen/include/asm-x86/mem_event.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/mem_event.h -+++ xen-4.1.2-testing/xen/include/asm-x86/mem_event.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/mem_event.h ++++ xen-4.1.3-testing/xen/include/asm-x86/mem_event.h @@ -24,13 +24,13 @@ #ifndef __MEM_EVENT_H__ #define __MEM_EVENT_H__ @@ -520,10 +520,10 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec, XEN_GUEST_HANDLE(void) u_domctl); -Index: xen-4.1.2-testing/xen/include/xen/sched.h +Index: xen-4.1.3-testing/xen/include/xen/sched.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/xen/sched.h -+++ xen-4.1.2-testing/xen/include/xen/sched.h +--- xen-4.1.3-testing.orig/xen/include/xen/sched.h ++++ xen-4.1.3-testing/xen/include/xen/sched.h @@ -26,6 +26,7 @@ #include #include diff --git a/xenpaging.mmap-before-nominate.patch b/xenpaging.mmap-before-nominate.patch index c18cbd1..0b33bf6 100644 --- a/xenpaging.mmap-before-nominate.patch +++ b/xenpaging.mmap-before-nominate.patch @@ -10,8 +10,10 @@ Bump interface age. Signed-off-by: Olaf Hering ---- a/tools/xenpaging/xenpaging.c -+++ b/tools/xenpaging/xenpaging.c +Index: xen-4.1.3-testing/tools/xenpaging/xenpaging.c +=================================================================== +--- xen-4.1.3-testing.orig/tools/xenpaging/xenpaging.c ++++ xen-4.1.3-testing/tools/xenpaging/xenpaging.c @@ -573,7 +573,7 @@ static int xenpaging_evict_page(xenpagin DECLARE_DOMCTL; @@ -72,9 +74,11 @@ Signed-off-by: Olaf Hering } } while ( ret ); ---- a/xen/arch/x86/mm/p2m.c -+++ b/xen/arch/x86/mm/p2m.c -@@ -2852,7 +2852,7 @@ set_shared_p2m_entry(struct p2m_domain * +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +=================================================================== +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -2854,7 +2854,7 @@ set_shared_p2m_entry(struct p2m_domain * * - the gfn is backed by a mfn * - the p2mt of the gfn is pageable * - the mfn is not used for IO @@ -83,7 +87,7 @@ Signed-off-by: Olaf Hering * * Once the p2mt is changed the page is readonly for the guest. On success the * pager can write the page contents to disk and later evict the page. -@@ -2886,7 +2886,7 @@ int p2m_mem_paging_nominate(struct p2m_d +@@ -2888,7 +2888,7 @@ int p2m_mem_paging_nominate(struct p2m_d /* Check page count and type */ page = mfn_to_page(mfn); if ( (page->count_info & (PGC_count_mask | PGC_allocated)) != @@ -92,7 +96,7 @@ Signed-off-by: Olaf Hering goto out; if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_none ) -@@ -2914,7 +2914,7 @@ int p2m_mem_paging_nominate(struct p2m_d +@@ -2916,7 +2916,7 @@ int p2m_mem_paging_nominate(struct p2m_d * freed: * - the gfn is backed by a mfn * - the gfn was nominated @@ -101,8 +105,10 @@ Signed-off-by: Olaf Hering * * After successful nomination some other process could have mapped the page. In * this case eviction can not be done. If the gfn was populated before the pager ---- a/xen/include/public/mem_event.h -+++ b/xen/include/public/mem_event.h +Index: xen-4.1.3-testing/xen/include/public/mem_event.h +=================================================================== +--- xen-4.1.3-testing.orig/xen/include/public/mem_event.h ++++ xen-4.1.3-testing/xen/include/public/mem_event.h @@ -49,7 +49,7 @@ #define MEM_EVENT_REASON_INT3 5 /* int3 was hit: gla/gfn are RIP */ #define MEM_EVENT_REASON_SINGLESTEP 6 /* single step was invoked: gla/gfn are RIP */ diff --git a/xenpaging.p2m_is_paged.patch b/xenpaging.p2m_is_paged.patch index c38266e..2badf3c 100644 --- a/xenpaging.p2m_is_paged.patch +++ b/xenpaging.p2m_is_paged.patch @@ -30,10 +30,10 @@ Signed-off-by: Olaf Hering xen/include/asm-x86/p2m.h | 9 ++++- 9 files changed, 51 insertions(+), 60 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/emulate.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/emulate.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/emulate.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/emulate.c @@ -66,7 +66,8 @@ static int hvmemul_do_io( ram_mfn = gfn_to_mfn_unshare(p2m, ram_gfn, &p2mt, 0); if ( p2m_is_paging(p2mt) ) @@ -44,11 +44,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c return X86EMUL_RETRY; } if ( p2m_is_shared(p2mt) ) -Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -@@ -385,7 +385,8 @@ static int hvm_set_ioreq_page( +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +@@ -393,7 +393,8 @@ static int hvm_set_ioreq_page( return -EINVAL; if ( p2m_is_paging(p2mt) ) { @@ -58,7 +58,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c return -ENOENT; } if ( p2m_is_shared(p2mt) ) -@@ -1199,7 +1200,7 @@ bool_t hvm_hap_nested_page_fault(unsigne +@@ -1207,7 +1208,7 @@ bool_t hvm_hap_nested_page_fault(unsigne #ifdef __x86_64__ /* Check if the page has been paged out */ @@ -67,7 +67,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c p2m_mem_paging_populate(p2m, gfn); /* Mem sharing: unshare the page and try again */ -@@ -1687,7 +1688,8 @@ static void *__hvm_map_guest_frame(unsig +@@ -1695,7 +1696,8 @@ static void *__hvm_map_guest_frame(unsig return NULL; if ( p2m_is_paging(p2mt) ) { @@ -77,7 +77,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c return NULL; } -@@ -2145,7 +2147,8 @@ static enum hvm_copy_result __hvm_copy( +@@ -2153,7 +2155,8 @@ static enum hvm_copy_result __hvm_copy( if ( p2m_is_paging(p2mt) ) { @@ -87,7 +87,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c return HVMCOPY_gfn_paged_out; } if ( p2m_is_shared(p2mt) ) -@@ -2233,7 +2236,8 @@ static enum hvm_copy_result __hvm_clear( +@@ -2241,7 +2244,8 @@ static enum hvm_copy_result __hvm_clear( if ( p2m_is_paging(p2mt) ) { @@ -97,7 +97,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c return HVMCOPY_gfn_paged_out; } if ( p2m_is_shared(p2mt) ) -@@ -3619,7 +3623,8 @@ long do_hvm_op(unsigned long op, XEN_GUE +@@ -3630,7 +3634,8 @@ long do_hvm_op(unsigned long op, XEN_GUE mfn_t mfn = gfn_to_mfn(p2m, pfn, &t); if ( p2m_is_paging(t) ) { @@ -107,7 +107,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c rc = -EINVAL; goto param_fail3; -@@ -3716,7 +3721,8 @@ long do_hvm_op(unsigned long op, XEN_GUE +@@ -3727,7 +3732,8 @@ long do_hvm_op(unsigned long op, XEN_GUE mfn = gfn_to_mfn_unshare(p2m, pfn, &t, 0); if ( p2m_is_paging(t) ) { @@ -117,11 +117,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c rc = -EINVAL; goto param_fail4; -Index: xen-4.1.2-testing/xen/arch/x86/mm.c +Index: xen-4.1.3-testing/xen/arch/x86/mm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm.c -+++ xen-4.1.2-testing/xen/arch/x86/mm.c -@@ -3465,9 +3465,10 @@ int do_mmu_update( +--- xen-4.1.3-testing.orig/xen/arch/x86/mm.c ++++ xen-4.1.3-testing/xen/arch/x86/mm.c +@@ -3467,9 +3467,10 @@ int do_mmu_update( if ( !p2m_is_valid(p2mt) ) mfn = INVALID_MFN; @@ -134,7 +134,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c rc = -ENOENT; break; -@@ -3492,24 +3493,18 @@ int do_mmu_update( +@@ -3494,24 +3495,18 @@ int do_mmu_update( { l1_pgentry_t l1e = l1e_from_intpte(req.val); p2m_type_t l1e_p2mt; @@ -154,7 +154,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c rc = -ENOENT; break; } -- else if ( p2m_ram_paging_in_start == l1e_p2mt && +- else if ( p2m_ram_paging_in_start == l1e_p2mt && - !mfn_valid(l1emfn) ) - { - rc = -ENOENT; @@ -164,7 +164,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c /* XXX: Ugly: pull all the checks into a separate function. * Don't want to do it now, not to interfere with mem_paging * patches */ -@@ -3536,22 +3531,16 @@ int do_mmu_update( +@@ -3538,22 +3533,16 @@ int do_mmu_update( { l2_pgentry_t l2e = l2e_from_intpte(req.val); p2m_type_t l2e_p2mt; @@ -182,7 +182,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c rc = -ENOENT; break; } -- else if ( p2m_ram_paging_in_start == l2e_p2mt && +- else if ( p2m_ram_paging_in_start == l2e_p2mt && - !mfn_valid(l2emfn) ) - { - rc = -ENOENT; @@ -191,7 +191,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c else if ( p2m_ram_shared == l2e_p2mt ) { MEM_LOG("Unexpected attempt to map shared page.\n"); -@@ -3567,22 +3556,16 @@ int do_mmu_update( +@@ -3569,22 +3558,16 @@ int do_mmu_update( { l3_pgentry_t l3e = l3e_from_intpte(req.val); p2m_type_t l3e_p2mt; @@ -209,7 +209,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c rc = -ENOENT; break; } -- else if ( p2m_ram_paging_in_start == l3e_p2mt && +- else if ( p2m_ram_paging_in_start == l3e_p2mt && - !mfn_valid(l3emfn) ) - { - rc = -ENOENT; @@ -218,7 +218,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c else if ( p2m_ram_shared == l3e_p2mt ) { MEM_LOG("Unexpected attempt to map shared page.\n"); -@@ -3598,23 +3581,17 @@ int do_mmu_update( +@@ -3600,23 +3583,17 @@ int do_mmu_update( { l4_pgentry_t l4e = l4e_from_intpte(req.val); p2m_type_t l4e_p2mt; @@ -237,7 +237,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c rc = -ENOENT; break; } -- else if ( p2m_ram_paging_in_start == l4e_p2mt && +- else if ( p2m_ram_paging_in_start == l4e_p2mt && - !mfn_valid(l4emfn) ) - { - rc = -ENOENT; @@ -246,10 +246,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm.c else if ( p2m_ram_shared == l4e_p2mt ) { MEM_LOG("Unexpected attempt to map shared page.\n"); -Index: xen-4.1.2-testing/xen/arch/x86/mm/guest_walk.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/guest_walk.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/guest_walk.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/guest_walk.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/guest_walk.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/guest_walk.c @@ -96,7 +96,8 @@ static inline void *map_domain_gfn(struc *mfn = gfn_to_mfn_unshare(p2m, gfn_x(gfn), p2mt, 0); if ( p2m_is_paging(*p2mt) ) @@ -260,10 +260,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/guest_walk.c *rc = _PAGE_PAGED; return NULL; -Index: xen-4.1.2-testing/xen/arch/x86/mm/hap/guest_walk.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/hap/guest_walk.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/hap/guest_walk.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/hap/guest_walk.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/hap/guest_walk.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/hap/guest_walk.c @@ -50,7 +50,8 @@ unsigned long hap_gva_to_gfn(GUEST_PAGIN top_mfn = gfn_to_mfn_unshare(p2m, cr3 >> PAGE_SHIFT, &p2mt, 0); if ( p2m_is_paging(p2mt) ) @@ -284,10 +284,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/hap/guest_walk.c pfec[0] = PFEC_page_paged; return INVALID_GFN; -Index: xen-4.1.2-testing/xen/arch/x86/mm/hap/p2m-ept.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/hap/p2m-ept.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/hap/p2m-ept.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/hap/p2m-ept.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/hap/p2m-ept.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/hap/p2m-ept.c @@ -377,8 +377,7 @@ ept_set_entry(struct p2m_domain *p2m, un * the intermediate tables will be freed below after the ept flush */ old_entry = *ept_entry; @@ -298,11 +298,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/hap/p2m-ept.c { /* Construct the new entry, and then write it once */ new_entry.emt = epte_get_entry_emt(p2m->domain, gfn, mfn, &ipat, -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c -@@ -3049,7 +3049,7 @@ void p2m_mem_paging_populate(struct p2m_ +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c +@@ -3051,7 +3051,7 @@ void p2m_mem_paging_populate(struct p2m_ p2m_lock(p2m); mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query); /* Allow only nominated or evicted pages to enter page-in path */ @@ -311,7 +311,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c { /* Evict will fail now, tag this request for pager */ if ( p2mt == p2m_ram_paging_out ) -@@ -3067,7 +3067,7 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3069,7 +3069,7 @@ void p2m_mem_paging_populate(struct p2m_ req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED; } /* No need to inform pager if the gfn is not in the page-out path */ @@ -320,10 +320,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c { /* gfn is already on its way back and vcpu is not paused */ mem_event_put_req_producers(&d->mem_event->paging); -Index: xen-4.1.2-testing/xen/common/grant_table.c +Index: xen-4.1.3-testing/xen/common/grant_table.c =================================================================== ---- xen-4.1.2-testing.orig/xen/common/grant_table.c -+++ xen-4.1.2-testing/xen/common/grant_table.c +--- xen-4.1.3-testing.orig/xen/common/grant_table.c ++++ xen-4.1.3-testing/xen/common/grant_table.c @@ -158,7 +158,8 @@ static int __get_paged_frame(unsigned lo *frame = mfn_x(mfn); if ( p2m_is_paging(p2mt) ) @@ -334,11 +334,11 @@ Index: xen-4.1.2-testing/xen/common/grant_table.c rc = GNTST_eagain; } } else { -Index: xen-4.1.2-testing/xen/include/asm-x86/p2m.h +Index: xen-4.1.3-testing/xen/include/asm-x86/p2m.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/p2m.h -+++ xen-4.1.2-testing/xen/include/asm-x86/p2m.h -@@ -157,7 +157,11 @@ typedef enum { +--- xen-4.1.3-testing.orig/xen/include/asm-x86/p2m.h ++++ xen-4.1.3-testing/xen/include/asm-x86/p2m.h +@@ -159,7 +159,11 @@ typedef enum { | p2m_to_mask(p2m_ram_paging_in_start) \ | p2m_to_mask(p2m_ram_paging_in)) @@ -351,7 +351,7 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/p2m.h /* Shared types */ /* XXX: Sharable types could include p2m_ram_ro too, but we would need to -@@ -179,7 +183,8 @@ typedef enum { +@@ -181,7 +185,8 @@ typedef enum { #define p2m_has_emt(_t) (p2m_to_mask(_t) & (P2M_RAM_TYPES | p2m_to_mask(p2m_mmio_direct))) #define p2m_is_pageable(_t) (p2m_to_mask(_t) & P2M_PAGEABLE_TYPES) #define p2m_is_paging(_t) (p2m_to_mask(_t) & P2M_PAGING_TYPES) diff --git a/xenpaging.waitqueue-paging.patch b/xenpaging.waitqueue-paging.patch index c30e943..4ed16d6 100644 --- a/xenpaging.waitqueue-paging.patch +++ b/xenpaging.waitqueue-paging.patch @@ -34,11 +34,11 @@ Signed-off-by: Olaf Hering xen/include/asm-x86/p2m.h | 7 + 5 files changed, 205 insertions(+), 30 deletions(-) -Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c +Index: xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c -@@ -467,6 +467,8 @@ int hvm_domain_initialise(struct domain +--- xen-4.1.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.1.3-testing/xen/arch/x86/hvm/hvm.c +@@ -475,6 +475,8 @@ int hvm_domain_initialise(struct domain spin_lock_init(&d->arch.hvm_domain.irq_lock); spin_lock_init(&d->arch.hvm_domain.uc_lock); @@ -47,10 +47,10 @@ Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c INIT_LIST_HEAD(&d->arch.hvm_domain.msixtbl_list); spin_lock_init(&d->arch.hvm_domain.msixtbl_list_lock); -Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +Index: xen-4.1.3-testing/xen/arch/x86/mm/p2m.c =================================================================== ---- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c -+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c +--- xen-4.1.3-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.1.3-testing/xen/arch/x86/mm/p2m.c @@ -30,6 +30,7 @@ #include #include /* ept_p2m_init() */ @@ -59,7 +59,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c #include #include #include -@@ -2839,6 +2840,182 @@ set_shared_p2m_entry(struct p2m_domain * +@@ -2841,6 +2842,182 @@ set_shared_p2m_entry(struct p2m_domain * } #ifdef __x86_64__ @@ -242,7 +242,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /** * p2m_mem_paging_nominate - Mark a guest page as to-be-paged-out * @d: guest domain -@@ -3020,21 +3197,17 @@ void p2m_mem_paging_drop_page(struct p2m +@@ -3022,21 +3199,17 @@ void p2m_mem_paging_drop_page(struct p2m */ void p2m_mem_paging_populate(struct p2m_domain *p2m, unsigned long gfn) { @@ -266,7 +266,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c /* Fix p2m mapping */ p2m_lock(p2m); mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query); -@@ -3043,35 +3216,23 @@ void p2m_mem_paging_populate(struct p2m_ +@@ -3045,35 +3218,23 @@ void p2m_mem_paging_populate(struct p2m_ { /* Restore page state if gfn was requested before evict */ if ( p2mt == p2m_ram_paging_out && mfn_valid(mfn) ) { @@ -310,7 +310,7 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c } /** -@@ -3198,12 +3359,11 @@ void p2m_mem_paging_resume(struct p2m_do +@@ -3200,12 +3361,11 @@ void p2m_mem_paging_resume(struct p2m_do p2m_unlock(p2m); } @@ -325,11 +325,11 @@ Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c + p2m_mem_paging_wake_queue(d, rsp.gfn); } - void p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long gla, -Index: xen-4.1.2-testing/xen/common/domctl.c + void p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, unsigned long gla, +Index: xen-4.1.3-testing/xen/common/domctl.c =================================================================== ---- xen-4.1.2-testing.orig/xen/common/domctl.c -+++ xen-4.1.2-testing/xen/common/domctl.c +--- xen-4.1.3-testing.orig/xen/common/domctl.c ++++ xen-4.1.3-testing/xen/common/domctl.c @@ -536,6 +536,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc goto maxvcpu_out; } @@ -340,10 +340,10 @@ Index: xen-4.1.2-testing/xen/common/domctl.c ret = 0; maxvcpu_out: -Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/domain.h +Index: xen-4.1.3-testing/xen/include/asm-x86/hvm/domain.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/domain.h -+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/domain.h +--- xen-4.1.3-testing.orig/xen/include/asm-x86/hvm/domain.h ++++ xen-4.1.3-testing/xen/include/asm-x86/hvm/domain.h @@ -87,6 +87,9 @@ struct hvm_domain { struct viridian_domain viridian; @@ -354,11 +354,11 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/domain.h bool_t hap_enabled; bool_t mem_sharing_enabled; bool_t qemu_mapcache_invalidate; -Index: xen-4.1.2-testing/xen/include/asm-x86/p2m.h +Index: xen-4.1.3-testing/xen/include/asm-x86/p2m.h =================================================================== ---- xen-4.1.2-testing.orig/xen/include/asm-x86/p2m.h -+++ xen-4.1.2-testing/xen/include/asm-x86/p2m.h -@@ -343,6 +343,8 @@ gfn_to_mfn_type_p2m(struct p2m_domain *p +--- xen-4.1.3-testing.orig/xen/include/asm-x86/p2m.h ++++ xen-4.1.3-testing/xen/include/asm-x86/p2m.h +@@ -345,6 +345,8 @@ gfn_to_mfn_type_p2m(struct p2m_domain *p } @@ -367,7 +367,7 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/p2m.h /* General conversion function from gfn to mfn */ static inline mfn_t _gfn_to_mfn_type(struct p2m_domain *p2m, unsigned long gfn, p2m_type_t *t, -@@ -364,6 +366,9 @@ static inline mfn_t _gfn_to_mfn_type(str +@@ -366,6 +368,9 @@ static inline mfn_t _gfn_to_mfn_type(str mfn = gfn_to_mfn_type_p2m(p2m, gfn, t, q); #ifdef __x86_64__ @@ -377,7 +377,7 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/p2m.h if (unlikely((p2m_is_broken(*t)))) { /* Return invalid_mfn to avoid caller's access */ -@@ -520,6 +525,8 @@ int clear_mmio_p2m_entry(struct p2m_doma +@@ -522,6 +527,8 @@ int clear_mmio_p2m_entry(struct p2m_doma /* Modify p2m table for shared gfn */ int set_shared_p2m_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn); @@ -386,7 +386,7 @@ Index: xen-4.1.2-testing/xen/include/asm-x86/p2m.h /* Check if a nominated gfn is valid to be paged out */ int p2m_mem_paging_nominate(struct p2m_domain *p2m, unsigned long gfn); /* Evict a frame */ -@@ -533,6 +540,8 @@ int p2m_mem_paging_prep(struct p2m_domai +@@ -535,6 +542,8 @@ int p2m_mem_paging_prep(struct p2m_domai /* Resume normal operation (in case a domain was paused) */ void p2m_mem_paging_resume(struct p2m_domain *p2m); #else