Received: from eggs.gnu.org ([2001:4830:134:3::10]:53297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHvBj-00018m-QI for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:44:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHvBg-0002r7-6E for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:44:34 -0400 Received: from mail-qt0-x22e.google.com ([2607:f8b0:400d:c0d::22e]:33881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHvBf-0002r0-V3 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:44:32 -0400 Received: by mail-qt0-x22e.google.com with SMTP id m2so9429215qtd.1 for ; Tue, 28 Jun 2016 08:44:31 -0700 (PDT) Sender: Richard Henderson References: <1466442425-11885-1-git-send-email-peter.maydell@linaro.org> From: Richard Henderson Message-ID: <57461183-256f-19fd-592f-2cd2e48ffd58@twiddle.net> Date: Tue, 28 Jun 2016 08:44:28 -0700 MIME-Version: 1.0 In-Reply-To: <1466442425-11885-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] cputlb: don't cpu_abort() if guest tries to execute outside RAM or RAM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini On 06/20/2016 10:07 AM, Peter Maydell wrote: > In get_page_addr_code(), if the guest program counter turns out not to > be in ROM or RAM, we can't handle executing from it, and we call > cpu_abort(). This results in the message > qemu: fatal: Trying to execute code outside RAM or ROM at 0x08000000 > followed by a guest register dump, and then QEMU dumps core. > > This situation happens in one of two cases: > (1) a guest kernel bug, where it jumped off into nowhere > (2) a user command line mistake, where they tried to run an image for > board A on a QEMU model of board B, or where they didn't provide > an image at all, and QEMU executed through a ROM or RAM full of > NOP instructions and then fell off the end > > In either case, a core dump of QEMU itself is entirely useless, and > only confuses users into thinking that this is a bug in QEMU rather > than a bug in the guest or a problem with their command line. (This > is a variation on the general idea that we shouldn't assert() on > something the user can accidentally provoke.) > > Replace the cpu_abort() with something that explains the situation > a bit better and exits QEMU without dumping core. > > (See LP:1062220 for several examples of confused users.) > > Signed-off-by: Peter Maydell > --- Reviewed-by: Richard Henderson r~