From: "Scott Parish" Subject: [patch] "flags" bits need shifting (was Re: Latest bk can NOT compile on x86_64) Date: Tue, 31 May 2005 23:28:21 +0000 Message-ID: <20050531232730.GH9951@us.ibm.com> References: <7F740D512C7C1046AB53446D3720017304201E6C@scsmsx402.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Dzs2zDY0zgkG72+7" Return-path: Content-Disposition: inline In-Reply-To: <7F740D512C7C1046AB53446D3720017304201E6C@scsmsx402.amr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Nakajima, Jun" Cc: David F Barrera , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Dzs2zDY0zgkG72+7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This patch gets me to a prompt on dom0 x86_64. Its probably not the perfect solution, but the hypercall interface is under discussion anyway. Should be pretty self explanitory--l?e_create_phys is expecting flag bits in the scruntched format, and we were passing in the unscruntched format. sRp -- Scott Parish Signed-off-by: srparish@us.ibm.com --Dzs2zDY0zgkG72+7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="reorder-flag-bits.diff" diff -rN -u -p old-xen-64-4/xen/arch/x86/mm.c new-xen-64-4/xen/arch/x86/mm.c --- old-xen-64-4/xen/arch/x86/mm.c 2005-05-31 23:14:18.000000000 +0000 +++ new-xen-64-4/xen/arch/x86/mm.c 2005-05-31 23:14:19.000000000 +0000 @@ -2029,7 +2029,7 @@ int do_mmu_update( l1_pgentry_t l1e; /* FIXME: doesn't work with PAE */ - l1e = l1e_create_phys(req.val, req.val); + l1e = l1e_create_phys(req.val, get_pte_flags(req.val)); okay = mod_l1_entry(va, l1e); if ( okay && unlikely(shadow_mode_enabled(d)) ) shadow_l1_normal_pt_update(d, req.ptr, l1e, &sh_mapcache); @@ -2044,7 +2044,7 @@ int do_mmu_update( l2_pgentry_t l2e; /* FIXME: doesn't work with PAE */ - l2e = l2e_create_phys(req.val, req.val); + l2e = l2e_create_phys(req.val, get_pte_flags(req.val)); okay = mod_l2_entry((l2_pgentry_t *)va, l2e, mfn, type_info); if ( okay && unlikely(shadow_mode_enabled(d)) ) shadow_l2_normal_pt_update(d, req.ptr, l2e, &sh_mapcache); @@ -2059,7 +2059,7 @@ int do_mmu_update( l3_pgentry_t l3e; /* FIXME: doesn't work with PAE */ - l3e = l3e_create_phys(req.val,req.val); + l3e = l3e_create_phys(req.val, get_pte_flags(req.val)); okay = mod_l3_entry(va, l3e, mfn); if ( okay && unlikely(shadow_mode_enabled(d)) ) shadow_l3_normal_pt_update(d, req.ptr, l3e, &sh_mapcache); @@ -2074,7 +2074,7 @@ int do_mmu_update( { l4_pgentry_t l4e; - l4e = l4e_create_phys(req.val,req.val); + l4e = l4e_create_phys(req.val, get_pte_flags(req.val)); okay = mod_l4_entry(va, l4e, mfn); if ( okay && unlikely(shadow_mode_enabled(d)) ) shadow_l4_normal_pt_update(d, req.ptr, l4e, &sh_mapcache); @@ -2251,7 +2251,7 @@ int do_update_va_mapping(unsigned long v unsigned long val32, unsigned long flags) { - l1_pgentry_t val = l1e_create_phys(val32,val32); + l1_pgentry_t val = l1e_create_phys(val32, get_pte_flags(val32)); struct exec_domain *ed = current; struct domain *d = ed->domain; unsigned int cpu = ed->processor; @@ -2741,7 +2741,7 @@ static int ptwr_emulated_update( } /* Check the new PTE. */ - nl1e = l1e_create_phys(val, val & ~PAGE_MASK); + nl1e = l1e_create_phys(val, get_pte_flags(val)); if ( unlikely(!get_page_from_l1e(nl1e, d)) ) return X86EMUL_UNHANDLEABLE; @@ -2749,7 +2749,7 @@ static int ptwr_emulated_update( pl1e = map_domain_mem(page_to_phys(page) + (addr & ~PAGE_MASK)); if ( do_cmpxchg ) { - ol1e = l1e_create_phys(old, old & ~PAGE_MASK); + ol1e = l1e_create_phys(old, get_pte_flags(old)); if ( cmpxchg((unsigned long *)pl1e, old, val) != old ) { unmap_domain_mem(pl1e); --Dzs2zDY0zgkG72+7 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 --Dzs2zDY0zgkG72+7--