Re: [Qemu-devel] Question about the block linking limitation

2012-04-14 Thread Max Filippov
On 04/14/2012 03:44 PM, 陳韋任 wrote: >> I've made a test from the grub multiboot sample, you may find it here: >> http://jcmvbkbc.spb.ru/git/?p=dumb/qemu-test-kernel.git;a=summary >> >> With it I see that an attempt to execute a TB that spans two pages causes >> an exception when the second page is

Re: [Qemu-devel] Question about the block linking limitation

2012-04-14 Thread 陳韋任
> I've made a test from the grub multiboot sample, you may find it here: > http://jcmvbkbc.spb.ru/git/?p=dumb/qemu-test-kernel.git;a=summary > > With it I see that an attempt to execute a TB that spans two pages causes > an exception when the second page is unmapped. It happens because both > tlb_f

Re: [Qemu-devel] Question about the block linking limitation

2012-04-12 Thread Max Filippov
>>  Doesn't a tb spanning guest pages have above problem? I mean what if the >> guest page 2 is changed? In this case, the execution flow jump from tb.a to >> tb.b. It seems it may have the same problem as above to me. > > I agree. I see that only i386 and m68k TBs may cross page boundary. > Maybe

Re: [Qemu-devel] Question about the block linking limitation

2012-04-11 Thread Max Filippov
On Thu, Apr 12, 2012 at 1:04 AM, Peter Maydell wrote: > On 11 April 2012 22:00, Max Filippov wrote: >> 陳韋任 : >>>  Doesn't a tb spanning guest pages have above problem? I mean what if the >>> guest page 2 is changed? In this case, the execution flow jump from tb.a to >>> tb.b. It seems it may have

Re: [Qemu-devel] Question about the block linking limitation

2012-04-11 Thread Peter Maydell
On 11 April 2012 22:00, Max Filippov wrote: > 陳韋任 : >>  Doesn't a tb spanning guest pages have above problem? I mean what if the >> guest page 2 is changed? In this case, the execution flow jump from tb.a to >> tb.b. It seems it may have the same problem as above to me. > > I agree. I see that onl

Re: [Qemu-devel] Question about the block linking limitation

2012-04-11 Thread Max Filippov
>> s->pc is updated each time a byte of code is fetched, when an instruction >> is fully decoded s->pc points to the first byte of the next instruction. I >> see >> that it only makes difference when a branching instruction ends exactly at >> a page boundary. In this case (s->pc - 1) prevents from

Re: [Qemu-devel] Question about the block linking limitation

2012-04-11 Thread 陳韋任
> s->pc is updated each time a byte of code is fetched, when an instruction > is fully decoded s->pc points to the first byte of the next instruction. I see > that it only makes difference when a branching instruction ends exactly at > a page boundary. In this case (s->pc - 1) prevents from linking

Re: [Qemu-devel] Question about the block linking limitation

2012-04-10 Thread Max Filippov
>  Could someone help me to confirm that I understand how the QEMU cross page > boundary checking correctly or not? Below is the source code I am looking at, > > static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) > { > >    if ((pc & TARGET_PAGE_MASK) == (tb->pc & TARGET_

[Qemu-devel] Question about the block linking limitation

2012-04-10 Thread 陳韋任
Hi all, Could someone help me to confirm that I understand how the QEMU cross page boundary checking correctly or not? Below is the source code I am looking at, static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) { if ((pc & TARGET_PAGE_MASK) == (tb->pc & TARGET_