From patchwork Mon Jul 24 20:27:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9860375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0AB7160385 for ; Mon, 24 Jul 2017 20:32:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F28AD285A3 for ; Mon, 24 Jul 2017 20:32:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E76DF285AD; Mon, 24 Jul 2017 20:32:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 99E4B28538 for ; Mon, 24 Jul 2017 20:32:20 +0000 (UTC) Received: from localhost ([::1]:56835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZk1b-0005Sw-Jm for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Jul 2017 16:32:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZjxZ-00030C-Nl for qemu-devel@nongnu.org; Mon, 24 Jul 2017 16:28:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZjxY-0000rQ-Rp for qemu-devel@nongnu.org; Mon, 24 Jul 2017 16:28:09 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:34964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZjxY-0000rA-NY for qemu-devel@nongnu.org; Mon, 24 Jul 2017 16:28:08 -0400 Received: by mail-qk0-x242.google.com with SMTP id k2so3509537qkf.2 for ; Mon, 24 Jul 2017 13:28:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VIrdsJbkqD4zu2DDnbGHTglc8nrlz1pDSwTmrxpGqOw=; b=SvkrKPlnL2C26E+ROwuA8QJJtv/sp1YNjbe5kGnEAn/z0k3D6AeeTvllMdaFnS/ic+ AlT1jSgcHaiy+33DuiWwYxEvPf1D73vnZfLxF3Xt4OzylILVcl7CoYnh0IAySAs7eBCP fwJag92eF8MECeSJlqgVaDACo1QSz7kSkb53IQyYJU+ZmRY78/hKJXcEAbfR0rrpygtq cbx4DqTBJa0wgw2yykSzPsHeYEpxR2+PM52NRHO3KNCRqbnI4M/1dlqOUqdF6smx6dud eRKqFLivmnLtSiFo0lFMszrgitE68k3B2zvTZYev4ihSnFqNVlxz2OdNZvZAr+1E5UYc KB9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VIrdsJbkqD4zu2DDnbGHTglc8nrlz1pDSwTmrxpGqOw=; b=Od/38mc+9ll1NJUZKHm1thp059VhprIA6vZ2kK6jrgf9fTqbbcNl8BEDl+QrPHYjPd g95m1HceE0LZrkJGF3exNytfcAQE8rOFoMeeGZyCSpumo5HjXK9N6SldV+mRVjhfqpjB 1LItI/vY8SO+qRv925OZhi5xrxBFQFIr00T4M1y+OXTFZUR0f1gkCWvlavUtw9kbxz7p JLBT4+6JaFDnBvJ5xh/0DX2eW9JBa2ILWp9XSS/CVOYLZRpvLyOiOw4QYA70pDglBjI0 iUoSio/fabMUsLfOrHAjKI4hhfCMFDHntM2csfddvaXru0zlctKEv0VtVmJZA3I92wfh +LhQ== X-Gm-Message-State: AIVw1114aUKpyRPUpzlAADrL1XOEdFKr9uBMJP3HEQAkiHZ3w6IllbCT oScQdJfvQx1Ra0qawpU= X-Received: by 10.233.237.132 with SMTP id c126mr22794318qkg.215.1500928087913; Mon, 24 Jul 2017 13:28:07 -0700 (PDT) Received: from bigtime.com ([71.217.194.233]) by smtp.gmail.com with ESMTPSA id p52sm9196808qtc.74.2017.07.24.13.28.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jul 2017 13:28:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 24 Jul 2017 13:27:01 -0700 Message-Id: <20170724202728.25960-6-rth@twiddle.net> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170724202728.25960-1-rth@twiddle.net> References: <20170724202728.25960-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH v15 05/32] target/arm: Delay check for magic kernel page X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org, vilanova@ac.upc.edu Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP There's nothing magic about the exception that we generate in order to execute the magic kernel page. We can and should allow gdb to set a breakpoint at this location. Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- target/arm/translate.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 2bde418ddf..a2f368bacd 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -11938,17 +11938,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) 0); num_insns++; -#ifdef CONFIG_USER_ONLY - /* Intercept jump to the magic kernel page. */ - if (dc->pc >= 0xffff0000) { - /* We always get here via a jump, so know we are not in a - conditional execution block. */ - gen_exception_internal(EXCP_KERNEL_TRAP); - dc->is_jmp = DISAS_NORETURN; - break; - } -#endif - if (unlikely(!QTAILQ_EMPTY(&cs->breakpoints))) { CPUBreakpoint *bp; QTAILQ_FOREACH(bp, &cs->breakpoints, entry) { @@ -11980,6 +11969,17 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) gen_io_start(); } +#ifdef CONFIG_USER_ONLY + /* Intercept jump to the magic kernel page. */ + if (dc->pc >= 0xffff0000) { + /* We always get here via a jump, so know we are not in a + conditional execution block. */ + gen_exception_internal(EXCP_KERNEL_TRAP); + dc->is_jmp = DISAS_NORETURN; + break; + } +#endif + if (dc->ss_active && !dc->pstate_ss) { /* Singlestep state is Active-pending. * If we're in this state at the start of a TB then either