qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] The reason behind block linking constraint?


From: 陳韋任
Subject: Re: [Qemu-devel] The reason behind block linking constraint?
Date: Tue, 27 Sep 2011 10:40:53 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

  O.K., now I have to make sure it's guest virtual or guest physical.
Correct me if I am wrong.

> >> - now you change the mapping of the code page that contains second piece 
> >> of code;
> >
> > ?change the mapping of the guest page which contains second piece of
> > guest binary. Mapping guest page to what? Host virtual address?
> 
> Mapping of guest physical memory to guest virtual memory. Change in
> the guest TLB. If we're talking about i386 guest that's change in the
> page table + TLB flush, for the changed page or for the whole TLB.

  guest OS might swap out a guest physical page, then it have to change
the guest page table (mapping between guest virtual and guest physical).
Here, guest TLB means env->tlb_table, right? So, how page table is changed
is left to the guest OS, and QEMU takes care of the guest TLB (env->tlb_table).
 
> >> - after that there's another code (or no code at all) at the place where 
> >> the second piece of code used to be;
> >> - but the jump to tb2 still remains in tb1.
> >
> > 慯here's another code (or no code at all) at the guest page which
> > used to contain second piece of guest binary.
> 
> At the virtual addresses of that guest page, right.

  Let's assume there is only (guest) page table first, no TLB (env->tlb_table).
When we use the virtual address of that guest page index the page table,
there should be a (guest) page fault since the (guest) physical page
is swapped out.

  Then here comes the TLB (env->tlb_table). After tracing the code, I
think the TLB is used to do GVA (guest virtual address) -> HVA (host virtual
address) translation. We'll use the virtual address of that guest page
index the TLB first, but since the guest page table change comes along
with TLB flush, it'll try to walk the guest page table then raise a
(guest) page fault.  

> > 䒷o if we execute tb2, it might have wrong memory access through
> > the mapping of guest page. Am I right?
> 
> If we execute tb2, it's not what guest would expect us to do at least.

  At least it should trigger a (guest) page fault.
 

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667



reply via email to

[Prev in Thread] Current Thread [Next in Thread]