On Wed, Sep 12, 2007 at 06:08:30PM +0900, SUZUKI Kazuhiro wrote:
> Hi Simon,
>
> I have some comments.
>
> > 1. Make all calls to GET_THIS_PADDR before purging the DTR for PERCPU.
> > This is because the kernel registers are saved in per_cpu data to allow
> > the real kernel registers to be used by domains.
>
> I did not notice that ia64_do_tlb_purge is called from ia64_jump_to_sal.
> SET_PER_CPU_DATA() is called in ia64_os_mca_dispatch that calls
> ia64_do_tlb_purge, because SET_PER_CPU_DATA() has to be called once.
Thanks for pointing this out. Originally I had the code setup as
desribed in point 1. above. But latter you pointed out to me that
I should just call SET_PER_CPU_DATA(). I now make that all in
ia64_do_tlb_purge, and everything seems fine. I will update
the comment accordingly.
> > 2. Wrap the purging of the DTR for PERCPU in #ifdef XEN as Linux
> > doesn't seem to do this (any more?)
>
> The following lines are found in Linux tree.
>
> arch/ia64/kernel/mca_asm.S:
> 104 // 2. Purge DTR for PERCPU data.
> 105 movl r16=PERCPU_ADDR
> 106 mov r18=PERCPU_PAGE_SHIFT<<2
> 107 ;;
> 108 ptr.d r16,r18
> 109 ;;
> 110 srlz.d
> 111 ;;
>
> Isn't it such a meaning?
Indeed. It seems that the code is present in 2.6.18 - which Xen is
currently based on - but not ~2.6.22, which I was looking at.
I have removed this portion of the patch.
> > 4. Fix VHPT purging code to treat what is at the IA64_DOMAIN_FLAGS_OFFSET
> > offset as a litteral value (flag) rather than a pointer to a literal.
>
> Suppose that,
>
> struct domain *dom = 0xf000000007ccc080;
> IA64_DOMAIN_FLAGS_OFFSET = 0x688
>
> And I show how the value of r3 becomes since each instruction is executed.
>
> @@ -289,25 +304,24 @@ ia64_do_tlb_purge:
> ld8 r3=[r3];; // r3=0xf000000007ccc080 virtual address of dom
> dep r3=0,r3,60,4;; // r3=0x0000000007ccc080 physical address of dom
> add r3=IA64_DOMAIN_FLAGS_OFFSET,r3;; // r3=0x0000000007ccc708 physical
> address of dom->arch.flags
> ld8 r3=[r3];; // r3=2 load the value of domain->arch.flags
>
> So 'r3=[r3]' is necessary.
Understood. I am pretty sure that this was causing a problem.
I will look into it again.
--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|