From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FhzBW-0004I4-Kj for qemu-devel@nongnu.org; Sun, 21 May 2006 21:26:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FhzBU-0004HN-RV for qemu-devel@nongnu.org; Sun, 21 May 2006 21:26:14 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FhzBU-0004HJ-K3 for qemu-devel@nongnu.org; Sun, 21 May 2006 21:26:12 -0400 Received: from [67.19.185.178] (helo=elpaso.ezoshosting.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FhzFN-0004Wz-FT for qemu-devel@nongnu.org; Sun, 21 May 2006 21:30:13 -0400 Received: from [86.70.223.229] (helo=PC4) by elpaso.ezoshosting.com with esmtpa (Exim 4.52) id 1FhzBI-0007vk-W8 for qemu-devel@nongnu.org; Sun, 21 May 2006 20:26:01 -0500 Message-ID: <00b401c67d3e$b01d9190$0100a8c0@PC4> From: "Sylvain Dupont" Date: Mon, 22 May 2006 03:25:59 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Problem with non 4gb CS and TSS Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, I hope it's the good place to post this. We've been developping a small OS for a school assignment. There seems to be a problem if you switch tss on a non 4GB segment. It gives a General protection fault exception (0D) I traced the exception in GDB and it appears to be raised here in switch_tss (helper.c) : /* check that EIP is in the CS segment limits */ if (new_eip > env->segs[R_CS].limit) { /* XXX: different exception if CALL ? */ raise_exception_err(EXCP0D_GPF, 0); } Shouldnt that be something like : if (new_eip < env->segs[R_CS].base || new_eip > env->segs[R_CS].base + env->segs[R_CS].limit) ? When limit is 4gb and base is 0, no problem (usually the case). But as soon as you use a EIP that is greater than the limit, the problem appears. Is it normal or a bug ? Thanks Regards Sylvain Dupont