From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VozUR-0007T2-Ik for qemu-devel@nongnu.org; Fri, 06 Dec 2013 12:47:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VozUL-0001Gd-6i for qemu-devel@nongnu.org; Fri, 06 Dec 2013 12:46:59 -0500 Received: from mail-yh0-x22b.google.com ([2607:f8b0:4002:c01::22b]:60773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VozUK-0001Fw-VA for qemu-devel@nongnu.org; Fri, 06 Dec 2013 12:46:53 -0500 Received: by mail-yh0-f43.google.com with SMTP id a41so705969yho.30 for ; Fri, 06 Dec 2013 09:46:52 -0800 (PST) Sender: Richard Henderson Message-ID: <52A20D86.8050300@twiddle.net> Date: Sat, 07 Dec 2013 06:46:46 +1300 From: Richard Henderson MIME-Version: 1.0 References: <1386334344-24620-1-git-send-email-agraf@suse.de> In-Reply-To: <1386334344-24620-1-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] x86: only allow real mode to access 32bit without LMA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , QEMU Developers Cc: Michael Tokarev On 12/07/2013 01:52 AM, Alexander Graf wrote: > When we're running in non-64bit mode with qemu-system-x86_64 we can > still end up with virtual addresses that are above the 32bit boundary > if a segment offset is set up. > > GNU Hurd does exactly that. It sets the segment offset to 0x80000000 and > puts its EIP value to 0x8xxxxxxx to access low memory. > > This doesn't hit us when we enable paging, as there we just mask away the > unused bits. But with real mode, we assume that vaddr == paddr which is > wrong in this case. Real hardware wraps the virtual address around at the > 32bit boundary. So let's do the same. > > This fixes booting GNU Hurd in qemu-system-x86_64 for me. > > Reported-by: Michael Tokarev > Signed-off-by: Alexander Graf > --- > target-i386/helper.c | 6 ++++++ > 1 file changed, 6 insertions(+) Reviewed-by: Richard Henderson r~