From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmnbS-0001EF-ET for qemu-devel@nongnu.org; Sun, 13 Sep 2009 07:50:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmnbO-0001Da-RT for qemu-devel@nongnu.org; Sun, 13 Sep 2009 07:50:46 -0400 Received: from [199.232.76.173] (port=41369 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmnbO-0001DX-P2 for qemu-devel@nongnu.org; Sun, 13 Sep 2009 07:50:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32894) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmnbO-0001Ei-B1 for qemu-devel@nongnu.org; Sun, 13 Sep 2009 07:50:42 -0400 Date: Sun, 13 Sep 2009 14:50:39 +0300 From: Gleb Natapov Message-ID: <20090913115039.GP22885@redhat.com> References: <20090913081951.GO22885@redhat.com> <4AACD8A9.8090201@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AACD8A9.8090201@web.de> Subject: [Qemu-devel] Re: [PATCH] set correct CS seg limit and flags on sipi List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On Sun, Sep 13, 2009 at 01:34:01PM +0200, Jan Kiszka wrote: > Gleb Natapov wrote: > > 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. > > 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. > > > > Signed-off-by: Gleb Natapov > > diff --git a/hw/apic.c b/hw/apic.c > > index 2c414c1..c89008e 100644 > > --- a/hw/apic.c > > +++ b/hw/apic.c > > @@ -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. > > Jan > > -- Gleb.