set correct CS seg limit and flags on sipi
PATCH 1/1 set correct CS seg limit and flags on sipi
TCG works with incorrect values somehow.
hw/apic.c +1 -1
@@ -516,7 +516,7 @@ void apic_sipi(CPUState *env) env->eip =0 ;cpu_x86_load_seg_cache (env,R_CS , s->sipi_vector <<8 , s->sipi_vector <<12 , -0xffff ,0 ); + env->segs[R_CS ].limit, env->segs[R_CS ].flags); env->halted =0 ; s->wait_for_sipi =0 ; }
--
Gleb.
Quoted 1 line · Gleb Natapov
TCG works with incorrect values somehow.
TCG doesn't care about limits and has only few segment type checks.
Some link to the corresponding spec section would be nice-to-have in this commit message. I was looking for a reference what registers SIPIs actually modify and how, but there seems to be none, at least in the System Programming Guide.
Quoted 16 lines
Signed-off-by Gleb Natapov <[email protected]>hw/apic.c +1
-2@@ -516,7 +516,7 @@ void apic_sipi(CPUState *env) env->eip =0 ;cpu_x86_load_seg_cache (env,R_CS , s->sipi_vector <<8 , s->sipi_vector <<12 , -0xffff ,0 ); + env->segs[R_CS ].limit, env->segs[R_CS ].flags); env->halted =0 ; s->wait_for_sipi =0 ; } --
Quoted 1 line
Gleb.
Jan
Quoted 4 lines · Jan Kiszka
Quoted 1 line · Gleb Natapov
TCG works with incorrect values somehow.
TCG doesn't care about limits and has only few segment type checks.
I already noticed that TCG implement some non existent CPU somewhat similar to x86.
Quoted 6 lines
Some link to the corresponding spec section would be nice-to-have in this commit message. I was looking for a reference what registers SIPIs actually modify and how, but there seems to be none, at least in the System Programming Guide.
This commit just fix obvious bug that caused SIPI to put garbage into segment's flags. I don't have link to spec only common sense.
Quoted 8 lines
Quoted 8 lines
Signed-off-by Gleb Natapov <[email protected]>hw/apic.c +0
-0@@ -516,7 +516,7 @@ void apic_sipi(CPUState *env)
Quoted 13 lines
Quoted 9 lines
hw/apic.c +1
-2env->eip =0 ;cpu_x86_load_seg_cache (env,R_CS , s->sipi_vector <<8 , s->sipi_vector <<12 , -0xffff ,0 ); + env->segs[R_CS ].limit, env->segs[R_CS ].flags); env->halted =0 ; s->wait_for_sipi =0 ; } --Gleb.
Jan
--
Gleb.
Quoted 6 lines · Gleb Natapov
Quoted 3 lines · Jan Kiszka
Quoted 1 line · Gleb Natapov
TCG works with incorrect values somehow.
TCG doesn't care about limits and has only few segment type checks.
I already noticed that TCG implement some non existent CPU somewhat similar to x86.
I once posted a patch that added full limit/flags check on memory access. But it required more work and slowed down TCG quite noticeably. Meanwhile we are only using KVM and don't require this precision anymore, so this effort stalled.
Quoted 8 lines
Quoted 6 lines
Some link to the corresponding spec section would be nice-to-have in this commit message. I was looking for a reference what registers SIPIs actually modify and how, but there seems to be none, at least in the System Programming Guide.
This commit just fix obvious bug that caused SIPI to put garbage into segment's flags. I don't have link to spec only common sense.
I don't disagree. I was just wondering if it loads the specified reset values into the flags or just keeps them untouched. BTW, looks like BOCHS takes your path too (ie. don't touch them).
Jan