From: Alex Williamson Subject: [xen-3.1-testing] ia64 updates Date: Thu, 06 Dec 2007 12:51:53 -0700 Message-ID: <1196970713.29493.70.camel@bling> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-AOyNQ6/DM2TFSKg5+QUe" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel , Kouya SHIMURA List-Id: xen-devel@lists.xenproject.org --=-AOyNQ6/DM2TFSKg5+QUe Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Keir, Attached are a couple more cherry picked patches from xen-unstable that we'd like to get in for the next 3.1.x release. The first fixes an issue seen when trying to build our guest firmware image in an HVM domain. The second fixes a potential hang with Windows HVM guests. Please add these to the queue for the next release. Thanks, Alex -- Alex Williamson HP Open Source & Linux Org. --=-AOyNQ6/DM2TFSKg5+QUe Content-Disposition: attachment; filename=16042-2d1b8ae1548d Content-Type: text/plain; name=16042-2d1b8ae1548d; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User Alex Williamson # Date 1191254270 21600 # Node ID 2d1b8ae1548d139f9f8532c90a1e61fc199a3394 # Parent 3874bdc782044e5fe9e4181a411b07f2a4bc0155 [IA64] Fix wrong insertion of TLB entry in region 0 On PV domain with metaphysical mode, emulation of itc.d in region 0 doesn't work well and inserts an wrong TC entry. Because set_one_rr() doesn't set the machine region register. i.e. metaphyisical_rr0 is used instead of guest's rr[0]. This bug causes Dom0/U crash when an application uses region 0. Actually I met the crash when I was building open GFW (java uses region 0). Signed-off-by: Kouya Shimura xen-unstable changeset: 16042:2d1b8ae1548d139f9f8532c90a1e61fc199a3394 xen-unstable date: Mon Oct 01 09:57:50 2007 -0600 diff -r 3874bdc78204 -r 2d1b8ae1548d xen/arch/ia64/xen/regionreg.c --- a/xen/arch/ia64/xen/regionreg.c Mon Oct 01 09:53:48 2007 -0600 +++ b/xen/arch/ia64/xen/regionreg.c Mon Oct 01 09:57:50 2007 -0600 @@ -271,8 +271,16 @@ int set_one_rr(unsigned long rr, unsigne return 1; } +void set_virtual_rr0(void) +{ + struct vcpu *v = current; + + ia64_set_rr(0, v->arch.metaphysical_saved_rr0); + ia64_srlz_d(); +} + // set rr0 to the passed rid (for metaphysical mode so don't use domain offset -int set_metaphysical_rr0(void) +void set_metaphysical_rr0(void) { struct vcpu *v = current; // ia64_rr rrv; @@ -280,7 +288,6 @@ int set_metaphysical_rr0(void) // rrv.ve = 1; FIXME: TURN ME BACK ON WHEN VHPT IS WORKING ia64_set_rr(0, v->arch.metaphysical_rid_dt); ia64_srlz_d(); - return 1; } void init_all_rr(struct vcpu *v) diff -r 3874bdc78204 -r 2d1b8ae1548d xen/arch/ia64/xen/vcpu.c --- a/xen/arch/ia64/xen/vcpu.c Mon Oct 01 09:53:48 2007 -0600 +++ b/xen/arch/ia64/xen/vcpu.c Mon Oct 01 09:57:50 2007 -0600 @@ -280,7 +280,7 @@ static void vcpu_pkr_set_psr_handling(VC VCPU processor status register access routines **************************************************************************/ -void vcpu_set_metaphysical_mode(VCPU * vcpu, BOOLEAN newmode) +static void vcpu_set_metaphysical_mode(VCPU * vcpu, BOOLEAN newmode) { /* only do something if mode changes */ if (!!newmode ^ !!PSCB(vcpu, metaphysical_mode)) { @@ -288,7 +288,7 @@ void vcpu_set_metaphysical_mode(VCPU * v if (newmode) set_metaphysical_rr0(); else if (PSCB(vcpu, rrs[0]) != -1) - set_one_rr(0, PSCB(vcpu, rrs[0])); + set_virtual_rr0(); } } @@ -1635,7 +1635,7 @@ vcpu_get_domain_bundle(VCPU * vcpu, REGS // This may cause tlb miss. see vcpu_translate(). Be careful! swap_rr0 = (!region && PSCB(vcpu, metaphysical_mode)); if (swap_rr0) { - set_one_rr(0x0, PSCB(vcpu, rrs[0])); + set_virtual_rr0(); } *bundle = __get_domain_bundle(gip); if (swap_rr0) { @@ -2368,7 +2368,7 @@ IA64FAULT vcpu_itc_d(VCPU * vcpu, u64 pt if (!pteval) return IA64_ILLOP_FAULT; if (swap_rr0) - set_one_rr(0x0, PSCB(vcpu, rrs[0])); + set_virtual_rr0(); vcpu_itc_no_srlz(vcpu, 2, ifa, pteval, pte, logps, &entry); if (swap_rr0) set_metaphysical_rr0(); @@ -2396,7 +2396,7 @@ IA64FAULT vcpu_itc_i(VCPU * vcpu, u64 pt if (!pteval) return IA64_ILLOP_FAULT; if (swap_rr0) - set_one_rr(0x0, PSCB(vcpu, rrs[0])); + set_virtual_rr0(); vcpu_itc_no_srlz(vcpu, 1, ifa, pteval, pte, logps, &entry); if (swap_rr0) set_metaphysical_rr0(); diff -r 3874bdc78204 -r 2d1b8ae1548d xen/include/asm-ia64/regionreg.h --- a/xen/include/asm-ia64/regionreg.h Mon Oct 01 09:53:48 2007 -0600 +++ b/xen/include/asm-ia64/regionreg.h Mon Oct 01 09:57:50 2007 -0600 @@ -80,7 +80,8 @@ struct vcpu; struct vcpu; extern void init_all_rr(struct vcpu *v); -extern int set_metaphysical_rr0(void); +extern void set_virtual_rr0(void); +extern void set_metaphysical_rr0(void); extern void load_region_regs(struct vcpu *v); --=-AOyNQ6/DM2TFSKg5+QUe Content-Disposition: attachment; filename=16177-52d9f5028397 Content-Type: text/plain; name=16177-52d9f5028397; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User Alex Williamson # Date 1192222177 21600 # Node ID 52d9f5028397081990791e633aa12e112bfe2677 # Parent 4e45ba84a1faf22ef59a4dc3389a3e0424a48724 [IA64] Fix TLB insertion for subpaging Without this patch, Longhorn is sure to hang up. .NET application might hit this bug. itc.i instruction is repeated forever, because TLB entry with smaller page size is volatile. Signed-off-by: Kouya Shimura xen-unstable changeset: 16177:52d9f5028397081990791e633aa12e112bfe2677 xen-unstable date: Fri Oct 12 14:49:37 2007 -0600 diff -r 4e45ba84a1fa -r 52d9f5028397 xen/arch/ia64/vmx/vtlb.c --- a/xen/arch/ia64/vmx/vtlb.c Fri Oct 12 14:36:37 2007 -0600 +++ b/xen/arch/ia64/vmx/vtlb.c Fri Oct 12 14:49:37 2007 -0600 @@ -572,13 +572,16 @@ int thash_purge_and_insert(VCPU *v, u64 } else { u64 psr; - phy_pte &= ~PAGE_FLAGS_RV_MASK; - psr = ia64_clear_ic(); - ia64_itc(type + 1, ifa, phy_pte, ps); - ia64_set_psr(psr); - ia64_srlz_i(); - // ps < mrr.ps, this is not supported - // panic_domain(NULL, "%s: ps (%lx) < mrr.ps \n", __func__, ps); + + vtlb_insert(v, pte, itir, ifa); + vcpu_quick_region_set(PSCBX(v, tc_regions), ifa); + if (!(pte & VTLB_PTE_IO)) { + phy_pte &= ~PAGE_FLAGS_RV_MASK; + psr = ia64_clear_ic(); + ia64_itc(type + 1, ifa, phy_pte, ps); + ia64_set_psr(psr); + ia64_srlz_i(); + } } } else{ --=-AOyNQ6/DM2TFSKg5+QUe Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-AOyNQ6/DM2TFSKg5+QUe--