Skip to contentSkip to conversation

Question on block chaining

Qemu-devel 陳韋任 1 participant 1 message Sep 19, 2011

lore
Share & tools
lore

陳韋任

author
#0 lore raw

Hi, all

I am tracing how block linking is done in QEMU. I find
there is a comment in struct TranslationBlock says,

    /* list of TBs jumping to this one. This is a circular list using
       the two least significant bits of the pointers to tell what is
       the next pointer: 0 = jmp_next[0], 1 = jmp_next[1], 2 =
       jmp_first */
    struct TranslationBlock *jmp_next[2];
    struct TranslationBlock *jmp_first;

But after tracing the code, I think the comment might be wrong. For example, if we want to link tb1 to tb2, i.e., tb1 -> tb2. Then roughly speaking, tb1->jmp_next[n] should be tb2, and tb2->jmp_first should be tb1. So the comment "list of TBs jumping to this one" looks weird to me. Do I misunderstand how the block chaining is done?

Thanks!

Regards,
chenwj

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