WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel] [PATCH] implemented vcpu_ptc_l()

To: "Dong, Eddie" <eddie.dong@xxxxxxxxx>
Subject: Re: [Xen-ia64-devel] [PATCH] implemented vcpu_ptc_l()
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Wed, 7 Dec 2005 14:30:59 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 07 Dec 2005 05:31:20 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <26F44F810A51DF42A127BC2A06BE185E02D57A24@pdsmsx404>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <26F44F810A51DF42A127BC2A06BE185E02D57A24@pdsmsx404>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
On Wed, Dec 07, 2005 at 12:35:26PM +0800, Dong, Eddie wrote:
>       vhpt_flush also needs to be metaphysical rr safe.

Yes. Sorry that I'm too careless.


Signed-off-by Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

vcpu_ptc_l() and vcpu_ptc_ga() should be aware of metaphysical mode.


--- xen-ia64-unstable.hg/xen/arch/ia64/xen/vcpu.c.orig  2005-12-07 
12:08:03.000000000 +0900
+++ xen-ia64-unstable.hg/xen/arch/ia64/xen/vcpu.c       2005-12-07 
14:04:39.000000000 +0900
@@ -1828,16 +1828,20 @@ IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 
 IA64FAULT vcpu_ptc_l(VCPU *vcpu, UINT64 vadr, UINT64 addr_range)
 {
        extern void ia64_local_tlb_purge (unsigned long start, unsigned long 
end, unsigned long nbits);
+       BOOLEAN swap_rr0 = (!(vadr >> VRN_SHIFT) &&
+                           PSCB(vcpu, metaphysical_mode));
 
        //XXX FIXME: validate not flushing Xen addresses
        if (IS_VMM_ADDRESS(vadr)) {
                return IA64_ILLOP_FAULT;
        }
        
+       if (swap_rr0) set_one_rr(0x0, PSCB(vcpu, rrs[0]));
 #ifdef VHPT_GLOBAL
        vhpt_flush_address(vadr, addr_range);
 #endif
        ia64_local_tlb_purge(vadr, vadr + addr_range, PAGE_SHIFT);
+       if (swap_rr0) set_metaphysical_rr0();
        vcpu_purge_tr_entry(&PSCBX(vcpu, dtlb));
        vcpu_purge_tr_entry(&PSCBX(vcpu, itlb));
        return IA64_NO_FAULT;
@@ -1891,14 +1895,19 @@ IA64FAULT vcpu_ptc_g(VCPU *vcpu, UINT64 
 IA64FAULT vcpu_ptc_ga(VCPU *vcpu,UINT64 vadr,UINT64 addr_range)
 {
        extern ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits);
+       BOOLEAN swap_rr0 = (!(vadr >> VRN_SHIFT) &&
+                           PSCB(vcpu, metaphysical_mode));
+
        // FIXME: validate not flushing Xen addresses
        // if (Xen address) return(IA64_ILLOP_FAULT);
        // FIXME: ??breaks if domain PAGE_SIZE < Xen PAGE_SIZE
 //printf("######## vcpu_ptc_ga(%p,%p) ##############\n",vadr,addr_range);
+       if (swap_rr0) set_one_rr(0x0,PSCB(vcpu,rrs[0]));
 #ifdef VHPT_GLOBAL
        vhpt_flush_address(vadr,addr_range);
 #endif
        ia64_global_tlb_purge(vadr,vadr+addr_range,PAGE_SHIFT);
+       if (swap_rr0) set_metaphysical_rr0();
        vcpu_purge_tr_entry(&PSCBX(vcpu,dtlb));
        vcpu_purge_tr_entry(&PSCBX(vcpu,itlb));
        return IA64_NO_FAULT;


-- 
yamahata

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel