From patchwork Wed Sep 6 16:05:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 111813 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1126847qge; Wed, 6 Sep 2017 09:14:57 -0700 (PDT) X-Received: by 10.237.34.145 with SMTP id p17mr4477356qtc.61.1504714497691; Wed, 06 Sep 2017 09:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504714497; cv=none; d=google.com; s=arc-20160816; b=XqzxvrGjy5k5XqN9CwfrNLLDlHkCiQwYuX1lO3RdZhJgGO3RGX4EofFUpE0t6pcHVW 0009vWFnmtRcFffmzdf80jhHJu1pQ/hGqrvyFV6Xy5r1X3UpGTPhnEyoqLWmTcWy+mio EB9YRmBXCg7gC0Cp403PGhBbZEaOFe4huYvU5rknyjFlKuc3s4hTLZbfAOIjdpgO97J2 0xd8sruLXenRCBfNJLJf+fJytp84rU/2+bAthBGA7LWOw/XWj+yYrFWMZiY3QF6M2mZk HIk/AS2XLtk+Y+Nhh2oK5QEXBERbb/kZyN0/MXABSeq/DzrX5iYUnzzlnf0RatVIUxs9 D0AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=1QHcEjTLfMJkurWFMJ47TbFcFe8SFh914sj8uv7xMjI=; b=YbGsWTn6BCoPlSwsT2eV6aas8vXLJ3vBb6vEcU2S7NDa6ofPxN0rpQ61/SqY0vCJEC i+FWMjSo5TRzOgkwYsIJqsnr68pAfzF9PtW3Kk5q6dxhkjLMryxMD00ZMX7BFmakkquY khgAny5uT53LYVnBxY113rVeMZcyGRUXPPU7TcTF4J07w08rXMe68IC6dBIMbVJg0l+Y mxd1jejcCN2Jgu6zhsx6XjGQlxzcU0ILr5wqV/wuzovEoFKg/7tXadamVHJgk3S7sZah bEeFyyfZ7/gQ5ktgXNOPc7uwHQxp7h7Hvwwm7gDnwn5gb61/iro0Z89YRgNAqYgeUwIV rWUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SofYr54n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h198si221669qke.124.2017.09.06.09.14.57 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 06 Sep 2017 09:14:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SofYr54n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpcyd-0007CY-69 for patch@linaro.org; Wed, 06 Sep 2017 12:14:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpcqV-0008Qv-Sa for qemu-devel@nongnu.org; Wed, 06 Sep 2017 12:06:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpcqM-0001eo-GW for qemu-devel@nongnu.org; Wed, 06 Sep 2017 12:06:31 -0400 Received: from mail-pg0-x22a.google.com ([2607:f8b0:400e:c05::22a]:33604) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpcqM-0001cE-B5 for qemu-devel@nongnu.org; Wed, 06 Sep 2017 12:06:22 -0400 Received: by mail-pg0-x22a.google.com with SMTP id t3so16077697pgt.0 for ; Wed, 06 Sep 2017 09:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1QHcEjTLfMJkurWFMJ47TbFcFe8SFh914sj8uv7xMjI=; b=SofYr54nbQCV9eS2oWNzTNAYVRZ26dCZjaHxVYWWKjaPDKn4ijjXWS1ZXHqrovUKqa Hvt0PMafPddB+nd1GkLSMwcMnYJ+iShsL2JO7tWfKJe+Ih7/y9SLsqgEd5ErFZQzUElq i+b6nswquSptT6NDSUTqjHrUZzFcSqQWEccrA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1QHcEjTLfMJkurWFMJ47TbFcFe8SFh914sj8uv7xMjI=; b=gBfTnW0MqAUrL9lRLQZ2chlkFLtYEfGgwxe+Ohap6thveDeZq3lTFnIgz4dumgtc/P xy+GUI9f/07iN5GdWdPCtgqTxgpl7ko+//itRxE5iLs5q6tcBSfKxqlDD24EPZSr3ZaK Wm30hiBALA8/ZFCXe5qDGy997vgpYSV2MbBO/YTf62XJuijJYyyEOKaOTxtEzfnWLzAv WPhBg9tHkqydzkRPLaUFi9jaX2/TsBOM4jlLzqNQvqnOhGoUavIh5qMrpHca91/QrRPV sI25crqFlZocWN4bnW4QKChLvWPRrGu012m+87ScGZ7DOR48DxfGqcxUvLeFZHS9p6mY J81Q== X-Gm-Message-State: AHPjjUiIPuU07hCuJVrYJdkCg9qS2+xl0/pZJK2q5+XAViD8rf8IUD5H DcIwUM9qISKaX9ZJb+GMTA== X-Google-Smtp-Source: ADKCNb4S7XhQ9jn9INySl5t7PFFrCW4IbZkG7YqWrkOVzuJUMoQJ6FJRIcS7D6wzFi26hHSXrDW2cQ== X-Received: by 10.99.109.142 with SMTP id i136mr8071762pgc.353.1504713981117; Wed, 06 Sep 2017 09:06:21 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-108-236.tukw.qwest.net. [97.126.108.236]) by smtp.gmail.com with ESMTPSA id t65sm262863pfk.59.2017.09.06.09.06.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Sep 2017 09:06:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 6 Sep 2017 09:05:45 -0700 Message-Id: <20170906160612.22769-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170906160612.22769-1-richard.henderson@linaro.org> References: <20170906160612.22769-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22a Subject: [Qemu-devel] [PULL 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: peter.maydell@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson 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(-) -- 2.13.5 diff --git a/target/arm/translate.c b/target/arm/translate.c index 0c39c2b996..746193eebc 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -11968,17 +11968,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) { @@ -12010,6 +11999,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