Received: from eggs.gnu.org ([208.118.235.92]:54028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaMpD-0002I2-Fz for qemu-devel@nongnu.org; Fri, 01 Jun 2012 04:03:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SaMp3-0004Um-BO for qemu-devel@nongnu.org; Fri, 01 Jun 2012 04:03:11 -0400 Received: from nm12-vm1.bullet.mail.tp2.yahoo.com ([203.188.200.96]:33514) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SaMp2-0004Ty-10 for qemu-devel@nongnu.org; Fri, 01 Jun 2012 04:03:01 -0400 Message-ID: <1338537775.19363.YahooMailClassic@web92404.mail.cnh.yahoo.com> Date: Fri, 1 Jun 2012 16:02:55 +0800 (CST) From: =?utf-8?B?5ZC05pmT55CzICA=?= MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="70963397-964270123-1338537775=:19363" Subject: [Qemu-devel] =?utf-8?b?6L2s5Y+ROiBSZTogIGdlbmVyYWwgcXVlc3Rpb24=?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --70963397-964270123-1338537775=:19363 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --- 12=E5=B9=B46=E6=9C=881=E6=97=A5=EF=BC=8C=E5=91=A8=E4=BA=94, =E5=90=B4= =E6=99=93=E7=90=B3 =E5=86=99=E9=81=93=EF=BC=9A =E5=8F=91=E4=BB=B6=E4=BA=BA: =E5=90=B4=E6=99=93=E7=90=B3 =E4=B8=BB=E9=A2=98: Re: [Qemu-devel] general question =E6=94=B6=E4=BB=B6=E4=BA=BA: chenwj@iis.sinica.edu.tw =E6=8A=84=E9=80=81: jcmvbkbc@gmail.com, qemu-devel@nongnu.org =E6=97=A5=E6=9C=9F: 2012=E5=B9=B46=E6=9C=881=E6=97=A5,=E5=91=A8=E4=BA=94,= =E4=B8=8B=E5=8D=883:11 My code calls the following macro, but nothing happens. #define invlpg_asm(pageaddr) do{\=09asm volatile("invlpg %0\n\t" \=09=09=09= :\=09=09=09:"m"(pageaddr)); \}while(0) pageaddr is the virtual address that needs to be invalidated. It is said that cup before i486 does not support "invlpg", how can I know t= he cupmodel of my emulator. Does my code go wrong, or the cpu of my emulator fail to support this instr= uction?=C2=A0 --- 12=E5=B9=B45=E6=9C=8831=E6=97=A5=EF=BC=8C=E5=91=A8=E5=9B=9B, =E9=99=B3= =E9=9F=8B=E4=BB=BB (Wei-Ren Chen)=0A =E5=86=99= =E9=81=93=EF=BC=9A =E5=8F=91=E4=BB=B6=E4=BA=BA: =E9=99=B3=E9=9F=8B=E4=BB=BB (Wei-Ren Chen) =E4=B8=BB=E9=A2=98: Re: [Qemu-devel] general question =E6=94=B6=E4=BB=B6=E4=BA=BA: "Max Filippov" =E6=8A=84=E9=80=81: "=EF=BF=BD=EF=BF=BD=EF=BF=BDf=E4=BB=BB (Wei-Ren Chen)" = , "=E5=90=B4=E6=99=93=E7=90=B3" , qemu-devel@nongnu.org =E6=97=A5=E6=9C=9F: 2012=E5=B9=B45=E6=9C=8831=E6=97=A5,=E5=91=A8=E5=9B=9B,= =E4=B8=8B=E5=8D=885:21 > Hmmm, does it? >=20 > void helper_invlpg(target_ulong addr) > { >=C2=A0 =C2=A0=C2=A0=C2=A0helper_svm_check_intercept_param(SVM_EXIT_INVLPG,= 0); >=C2=A0 =C2=A0=C2=A0=C2=A0tlb_flush_page(env, addr); > } =C2=A0 I would be wrong, so let the code speak. ;) --- void tlb_flush_page(CPUArchState *env, target_ulong addr) { =C2=A0 =C2=A0 if ((addr &=0A env->tlb_flush_mask) =3D=3D env->tlb_flush_add= r) { =C2=A0 =C2=A0 =C2=A0 =C2=A0 tlb_flush(env, 1); --- (1) =C2=A0 =C2=A0 =C2=A0 =C2=A0 return; =C2=A0 =C2=A0 } =C2=A0 =C2=A0 ... snip ... =C2=A0 =C2=A0 addr &=3D TARGET_PAGE_MASK; =C2=A0 =C2=A0 i =3D (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); =C2=A0 =C2=A0 for (mmu_idx =3D 0; mmu_idx < NB_MMU_MODES; mmu_idx++) { =C2=A0 =C2=A0 =C2=A0 =C2=A0 tlb_flush_entry(&env->tlb_table[mmu_idx][i], ad= dr); =C2=A0 =C2=A0 } =C2=A0 =C2=A0 tb_flush_jmp_cache(env, addr); } --- =C2=A0 The comment of tlb_flush (1) says, =C2=A0 =C2=A0 QEMU doesn't currently implement a global/not-global flag =C2=A0 =C2=A0 for tlb entries, at the moment tlb_flush() will also flush al= l =C2=A0 =C2=A0 tlb entries in the flush_global =3D=3D false case. That's why I get impression on QEMU flush the entire tlb. So it could flush particular tlb entry in=0A tlb_flush_entry? Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj --70963397-964270123-1338537775=:19363 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable =


--- 12=E5=B9=B46=E6=9C=881=E6=97= =A5=EF=BC=8C=E5=91=A8=E4=BA=94, =E5=90=B4=E6=99=93=E7=90=B3 <venusrob= o@yahoo.cn> =E5=86=99=E9=81=93=EF=BC=9A

=E5=8F=91=E4=BB=B6=E4=BA=BA: =E5=90=B4=E6=99=93=E7=90=B3 <venusr= obo@yahoo.cn>
=E4=B8=BB=E9=A2=98: Re: [Qemu-devel] general question=E6=94=B6=E4=BB=B6=E4=BA=BA: chenwj@iis.sinica.edu.tw
=E6=8A=84=E9=80= =81: jcmvbkbc@gmail.com, qemu-devel@nongnu.org
=E6=97=A5=E6=9C=9F: 2012= =E5=B9=B46=E6=9C=881=E6=97=A5,=E5=91=A8=E4=BA=94,=E4=B8=8B=E5=8D=883:11
=
My code cal= ls the following macro, but nothing happens.

#defin= e invlpg_asm(pageaddr) do{\
=09asm volatile("invlpg %0\n\t" \
=09=09 =09:\
=09=09=09:"m"(pageaddr)); \
}while(0)

pageaddr is the virtual address that needs to be inv= alidated.

It is said that cup before i486 does not= support "invlpg", how can I know the cup
model of my emulator.

Does my code go wrong, or the cpu of my emulator fa= il to support this instruction? 



--- = 12=E5=B9=B45=E6=9C=8831=E6=97=A5=EF=BC=8C=E5=91=A8=E5=9B=9B, =E9=99=B3= =E9=9F=8B=E4=BB=BB (Wei-Ren Chen)=0A <chenwj@iis.sinica.edu.tw> =E5=86=99=E9=81=93=EF=BC=9A

=E5=8F=91=E4= =BB=B6=E4=BA=BA: =E9=99=B3=E9=9F=8B=E4=BB=BB (Wei-Ren Chen) <chenwj@iis.= sinica.edu.tw>
=E4=B8=BB=E9=A2=98: Re: [Qemu-devel] general question<= br>=E6=94=B6=E4=BB=B6=E4=BA=BA: "Max Filippov" <jcmvbkbc@gmail.com>=E6=8A=84=E9=80=81: "=EF=BF=BD=EF=BF=BD=EF=BF=BDf=E4=BB=BB (Wei-Ren Chen)= " <chenwj@iis.sinica.edu.tw>, "=E5=90=B4=E6=99=93=E7=90=B3" <venus= robo@yahoo.cn>, qemu-devel@nongnu.org
=E6=97=A5=E6=9C=9F: 2012=E5=B9= =B45=E6=9C=8831=E6=97=A5,=E5=91=A8=E5=9B=9B,=E4=B8=8B=E5=8D=885:21

<= div class=3D"yiv305393308plainMail">> Hmmm, does it?
>
> vo= id helper_invlpg(target_ulong addr)
> {
>    &nb= sp;helper_svm_check_intercept_param(SVM_EXIT_INVLPG, 0);
>  &nbs= p;  tlb_flush_page(env, addr);
> }

  I would be= wrong, so let the code speak. ;)

---
void tlb_flush_page(CPUArch= State *env, target_ulong addr)
{
    if ((addr &=0A env= ->tlb_flush_mask) =3D=3D env->tlb_flush_addr) {
    &nbs= p;   tlb_flush(env, 1); --- (1)
        return;=
    }

    ... snip ...

    = addr &=3D TARGET_PAGE_MASK;
    i =3D (addr >> TARGE= T_PAGE_BITS) & (CPU_TLB_SIZE - 1);
    for (mmu_idx =3D 0;= mmu_idx < NB_MMU_MODES; mmu_idx++) {
        tlb= _flush_entry(&env->tlb_table[mmu_idx][i], addr);
    }<= br>
    tb_flush_jmp_cache(env, addr);
}
---

&nbs= p; The comment of tlb_flush (1) says,

    QEMU doesn't cur= rently implement a global/not-global flag
    for tlb entries,= at the moment tlb_flush() will also flush all
    tlb entries= in the flush_global =3D=3D false case.

That's why I get impression = on QEMU flush the entire tlb. So it could flush
particular tlb entry in= =0A tlb_flush_entry?

Regards,
chenwj

--
Wei-Ren Chen (= =E9=99=B3=E9=9F=8B=E4=BB=BB)
Computer Systems Lab, Institute of Informat= ion Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #16= 67
Homepage: http://people.cs.nctu.edu.tw/~chenwj
=
--70963397-964270123-1338537775=:19363--