From patchwork Wed Sep 26 11:20:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 147565 Delivered-To: patch@linaro.org Received: by 2002:aa7:da13:0:0:0:0:0 with SMTP id r19-v6csp656659eds; Wed, 26 Sep 2018 04:35:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV60FjUjo9PcGU151/e+7lX9nXxP6lOGupM7mAgBdlthmaM7OVwr2Fzt/wX2c+gqRzrpxxI0G X-Received: by 2002:ac8:2b1a:: with SMTP id 26-v6mr4030632qtu.119.1537961714661; Wed, 26 Sep 2018 04:35:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537961714; cv=none; d=google.com; s=arc-20160816; b=dA1+F9FSN0rxxcF7e8QAl+u61qQZGEuMOovA1Pgx6R+p1xOm3rpu7v5OFvxon9vqxF 04+nGkOieiuYl8gtKHQHSOufNp0RNcpBJ15tWZbfr3FXN/uhJCgxsX2kmiAm2MDsTG8B dUOJYZwg/GZ4Y49T1xIdkUwxbxaz0greuFZCogRX8KZ0uvOazNm1eassx1fbHNCLdJ4n BytjJjIds5MzyCZQSW6rzW/x/LVQSjNikmRUsw6xwXZaWYDASTQlo8QxQZdpHcgTHguG H1QuzA4qCyvEgUEEk9JF/rAnfbAdA3hK/NHpif93773bdz6GiJ7mAdqiyAf0dxsV6QWJ SSMg== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=c1TtMpNWiIdsGsSiS7XKTtv5r1DIlenBS3nmVtddTDY=; b=F4oPmEpgHfPeRc0jUMZ+XGAyV3txvLWB9joF07nZ1Wzxr4oD3GR/qqCQGqBoUONf4f XRpCdCiie1iHPzmjwjS+2qdydJFt+HAV/Rl9fn4clTxT185cVa0ofTBNLWJpwbNrQb6k ykTnhIAyS7NKrQfBNgRqbD6g9TfmV6ZYF0b1wwnfi5NPQ5jB2pp+EVarzno154h9oSXW qUr0WVJlbQHdpc44lrG2VnfCRbeNyjZJsJdVxmAyerWIBb6e9rNy3v/zNxYp0LR2MUop a7XkjvQaqocnR76dmo9/1kB9+IpAmJrFoZR+CD1QZyWc/qxgOL8jHJ5yauTXOAIdDy22 NXyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Nu1+DBc0; 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 i5-v6si1084641qvq.227.2018.09.26.04.35.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 26 Sep 2018 04:35:14 -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=Nu1+DBc0; 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]:57741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5866-0001gW-6A for patch@linaro.org; Wed, 26 Sep 2018 07:35:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g582d-0006Gz-Pm for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g57sC-00015S-F3 for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:20:55 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39973) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g57sC-00013v-4C for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:20:52 -0400 Received: by mail-wr1-x431.google.com with SMTP id y8-v6so22955437wrh.7 for ; Wed, 26 Sep 2018 04:20:52 -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 :mime-version:content-transfer-encoding; bh=c1TtMpNWiIdsGsSiS7XKTtv5r1DIlenBS3nmVtddTDY=; b=Nu1+DBc09obYKqxblu255CGzYSMdR92Hcrlr/M+lr6MoXRnH6RNNjALBhhnQZbmDYp my3li9UK5Uqhw9piLn2wKBEbfes54ppnexkkUnJXTtibW2Cmy0TFSDUs2uXHGNx3IdXo NkZ8E9THwklJB/ky2fxk8PiXYOOwuISqtz+Io= 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:mime-version:content-transfer-encoding; bh=c1TtMpNWiIdsGsSiS7XKTtv5r1DIlenBS3nmVtddTDY=; b=cG9JP8h7yMH8jhYkHjgjivzAUL+vQaRHwl0MJSaC7fBM6Gjj7PPrGSRHQqdCwcnxha dJEv6uS3tZjdEIyzGMmU/HCWam2Xe/kfEwzQqMun0C9XQEtT1iGxUgZVrAenwJ3KltnD wY4JOVHWOFL2pfDqNrWk3nlqEsQ3bJ9KoNN+TuWzQxWLRcqGbixKEwotdJ/q2YbStlIj 79R0ItGSRKvR5Kczle4Frc2zLfkI62TlPtoj0AbSDKds/emoDmV7yCJSx8NzkdYeBuL5 W//H1eB26VW2a75uAD/a/OpcQf61nAYh1X48naO1YIEJECNWlEN2Dz394qLJGna4lgTt Irag== X-Gm-Message-State: ABuFfohM9ougNYoUoH06tBI7kDsSa+nFsI/Kr3Vf3tvxk/WeQfub+D28 u8a81NapdgbgoRjyscdRC0xxSw== X-Received: by 2002:adf:a41c:: with SMTP id d28-v6mr4498326wra.121.1537960850702; Wed, 26 Sep 2018 04:20:50 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x16-v6sm3506705wro.84.2018.09.26.04.20.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 04:20:49 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A89AA3E0403; Wed, 26 Sep 2018 12:20:48 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 12:20:45 +0100 Message-Id: <20180926112048.17778-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926112048.17778-1-alex.bennee@linaro.org> References: <20180926112048.17778-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 Subject: [Qemu-devel] [PATCH v1 1/4] target/arm64: properly handle DBGVR RESS bits 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: ard.biesheuvel@linaro.org, Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , omair.javaid@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This only fails with some (broken) versions of gdb but we should treat the top bits of DBGBVR as RESS. As the hardware may have IMPDEF approaches to writes to this register we apply the sign extension when checking breakpoints. Signed-off-by: Alex Bennée --- target/arm/kvm64.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index e0b8246283..80ad07ed0c 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -356,13 +356,23 @@ bool kvm_arm_hw_debug_active(CPUState *cs) return ((cur_hw_wps > 0) || (cur_hw_bps > 0)); } +/* + * We shouldn't rely on gdb correctly setting the top bits of DBGBVR + * and the HW lists the top bits a RESS - sign-extending the top bit + * of the VA address. As it is IMPDEF if the write is either a sign + * extension or kept as is we might fix it up before we compare with + * the correctly reported and sign extended address. + */ + static bool find_hw_breakpoint(CPUState *cpu, target_ulong pc) { int i; for (i = 0; i < cur_hw_bps; i++) { HWBreakpoint *bp = get_hw_bp(i); - if (bp->bvr == pc) { + target_ulong bvr = bp->bvr; + bvr |= extract64(bvr, 52, 1) ? MAKE_64BIT_MASK(53, 11) : 0; + if (bvr == pc) { return true; } } From patchwork Wed Sep 26 11:20:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 147564 Delivered-To: patch@linaro.org Received: by 2002:aa7:da13:0:0:0:0:0 with SMTP id r19-v6csp654074eds; Wed, 26 Sep 2018 04:32:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV60d3iyzJBKUbGJkRGfAGrnAKVGm6F9388YtUfaM4FyavS8VqjMQbplbpCY1K1d6UZ1y0fKN X-Received: by 2002:ac8:376c:: with SMTP id p41-v6mr4041220qtb.225.1537961560980; Wed, 26 Sep 2018 04:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537961560; cv=none; d=google.com; s=arc-20160816; b=NqUlTF/Qi/zY1IBuHQdnRNZO8X1BhaDNbHMSDvuytiCOgV11kXUc5wFywTH3sT/NgM rnmf1vFPsT6mcD39Z/flahZDzLKNenWj8XxnITck+e4uBKIMtjCBrcOxndo6d5V4+i9l jprtbOBvlPDcuDcjvra9ihwAGyvgCgElYX/4xENF9Ha11gymdqFEK+KhM0EZ5MTvFEM8 1NKSZ+srfr2wHbLt+sVNPdf01m3t9KqMID1dczSow4vfL7V+Ua5RLhkohpSojOBmoeyc /DN2TJJvNGYKs1NOnqSqYQzEz3BoiM4xgB9wbdGv2z1M3FED3zWTOHOyr0EBi5SzPdfY t8ZA== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=hvcbVe1lmx2/vFZx9MUhWU5Mc+LZnSeTTBY8pimf380=; b=L56hc5ogWCAOw8laHl87oXfgqjcjgwfeRgiEFzmbjozuELkBSLSrK7CGRfVRJLG13x AqR+Gv4BGxnnM25tX7gzDDYZxC45s5NCcOyFa8RzLu7LgVc0rZx5GUd7bFnwIQwcG/Te R9/JsU90kjUHA+/UY1Hkqf77o1zkx+y9IBq70EgLfNhdugNf9XIvvXL6eU5J3gFU7jVH DR5eQwJW8Gi30NnLZ92Ry/IC2wmldJNa5Iux2XRHjwNlLQyUPEObejMJ+YXZNny3LL6/ LmpeibXCkTFfOivMxNF5EdlKJJ99DwbFoVd6PlXhSvGhJAYe9YI0kST4LBRYwQA60gOT 4FPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XNz983fT; 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 i92-v6si3839861qva.15.2018.09.26.04.32.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 26 Sep 2018 04:32:40 -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=XNz983fT; 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]:57723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g583c-0006nS-Cn for patch@linaro.org; Wed, 26 Sep 2018 07:32:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g582a-0006IA-VJ for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g57sD-00016S-34 for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:20:55 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:53050) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g57sC-00014t-S8 for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:20:53 -0400 Received: by mail-wm1-x329.google.com with SMTP id l7-v6so1858372wme.2 for ; Wed, 26 Sep 2018 04:20:52 -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 :mime-version:content-transfer-encoding; bh=hvcbVe1lmx2/vFZx9MUhWU5Mc+LZnSeTTBY8pimf380=; b=XNz983fT2OZXd2Cx42GZrN3TMAsNfPNP8YiC1Yx5QZnlXcjSMeT8dnxUjcyQsQ0/IA GOhatbXF3ypfIiZ4uhPrtZHosCub++7DLDmIZ2XseeraKPc1UqpFy+do2Idsk2fIdsuN B6yaZakY1D2b9/a0u4fhpSR/tasRhGiRxFcDA= 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:mime-version:content-transfer-encoding; bh=hvcbVe1lmx2/vFZx9MUhWU5Mc+LZnSeTTBY8pimf380=; b=bLfN67MLgJC5xr6FP3r1zfn1CRIu/46yn5LVZytHYasm27DQYGgn5xKEkggsz90faZ A6Lwx68K4qm2w3OPImXvWEdbRxT6X3Md5orhGNppf5HpqYYEr1ypR67fe7zAv2V0zTl4 C1F7roOcvwewFzKRPELoTtOhW6fR3xx+IeHbmYvVW6HEyLXngjPVqNwY9B3I0yL373i8 cJWKfw1W21K0EYK+BMpM521W2/V1bEcXX4ioN2fnsoWaF4CLMNF0Bz8BuzHO1DgTIR55 awIJnty9CklWUN6s+nLMHZ5H8fw3UZ6p/ERHtGrkbt6cyF+Eu96IElr981gysglgnx2T Y+gA== X-Gm-Message-State: ABuFfohOJyAx/ilAFwzjk2IOEkKlCT9cNZydIs+Lx9T94ZKHjLDZH/fI xs8hHaeC5UCD+UZfGM9avmE+qQ== X-Received: by 2002:a1c:3351:: with SMTP id z78-v6mr4100123wmz.23.1537960851447; Wed, 26 Sep 2018 04:20:51 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y128-v6sm5013297wmy.26.2018.09.26.04.20.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 04:20:49 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id BBFF43E0442; Wed, 26 Sep 2018 12:20:48 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 12:20:46 +0100 Message-Id: <20180926112048.17778-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926112048.17778-1-alex.bennee@linaro.org> References: <20180926112048.17778-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 Subject: [Qemu-devel] [PATCH v1 2/4] target/arm64: hold BQL when calling do_interrupt() 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: ard.biesheuvel@linaro.org, Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , omair.javaid@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Fix the assertion failure when running interrupts. Signed-off-by: Alex Bennée --- target/arm/kvm64.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 80ad07ed0c..346e1f1a73 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -984,7 +984,9 @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit) cs->exception_index = EXCP_BKPT; env->exception.syndrome = debug_exit->hsr; env->exception.vaddress = debug_exit->far; + qemu_mutex_lock_iothread(); cc->do_interrupt(cs); + qemu_mutex_unlock_iothread(); return false; } From patchwork Wed Sep 26 11:20:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 147568 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp604602lji; Wed, 26 Sep 2018 04:37:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV61bubYsZESbn+MNxpsEglfaI0N2SzpiW92cB6vwVB7EMySQe0fQ5z5laCmTyukKJ8xOX66j X-Received: by 2002:ac8:7145:: with SMTP id h5-v6mr4152468qtp.270.1537961858685; Wed, 26 Sep 2018 04:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537961858; cv=none; d=google.com; s=arc-20160816; b=vCw0RyvzLMA9laKfYxLMS6Tg0p0fk6RRN5pWWhWSfGtJ7P9wfXh8lWIuXMREME6d6Q bywXEL65onUeR7e3YIK8FLhi1p9iclJeBva/9RzrQK3QfoWAeHM00nuSr3XvNcpixFA4 uwkiLmubPay9vOM/1djbT1Gmsg/Tx0HzwlBwkNyyedds1E/mCspbdLTo/UCtoaGzwwSn V4PntcliSwG9ZiM7kyjsRvgDiO3ymBbGSzlY1UNDogOnw16Put6EJmIzx/tzJGeEGzor 34eQ2+M6rdoXQVRbzsH/mGlZWxhFjFj6238Lrr4mDwEU4RgTYqwxSEjDBh6wUw01/Bkg ErNg== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=fj5xCb/gmUTk4UnTjYc00kyhkvcZJIju6oudisUoi/w=; b=MV13x33Ufn4LfjGXZkkfXrvg2471IBnVoRkcknjfM2AoTud87a8+Z6wEOi18Xt1RCk vOHlQgVeDN+POjTtW5eqlwPZi9q6cGeSnih2ix2q+bUF3dBNbFdWLMynaO+3qQ5p5C2S 5JmWEEv9dq6CXw27KBmnyj4T24UhXmrwhWiSGw7dlHEwMHf58UbOBBZEUtFZAFY1wk+H bkH9WUi8qgi4mOXfCCD7jjWG7FYJL2VrkF9KufZlQRWj4iDUiPAszU5CG1Pz/uOlKjXc xjfwcj+blSicrlqjN3V6NHP2FQuB6RwrZAfXDJk1QUqwWnhduNdU9x8889K0vbL0yP0s 9hKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iyFuw28d; 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 g28-v6si589589qta.395.2018.09.26.04.37.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 26 Sep 2018 04:37:38 -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=iyFuw28d; 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]:57756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g588Q-0003Bu-4m for patch@linaro.org; Wed, 26 Sep 2018 07:37:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g582a-0006Gr-G7 for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g57sD-000173-Kh for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:20:55 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:53054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g57sD-00015o-Ar for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:20:53 -0400 Received: by mail-wm1-x32d.google.com with SMTP id l7-v6so1858408wme.2 for ; Wed, 26 Sep 2018 04:20:53 -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 :mime-version:content-transfer-encoding; bh=fj5xCb/gmUTk4UnTjYc00kyhkvcZJIju6oudisUoi/w=; b=iyFuw28dx9Hu903wsLhHW0U1YTHAkPvbFxLUPGYMtrNcOd+uGDvpsinAyX+3d9ppgC MPxsPW2lIrKX3EcbowooBouHpleML0lmE6JzjKWyE8bwJXQ4zjOOgyrV4DnbqOY008jZ 2OiExnBAeVUVIWT8udRLQfa8QklitYbi/2clQ= 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:mime-version:content-transfer-encoding; bh=fj5xCb/gmUTk4UnTjYc00kyhkvcZJIju6oudisUoi/w=; b=p4wKBVIiV1LloHycvUIVEXVxqCzvkxO0TP/HK6sK36puowve/axWzr/yQDpvXch8Xe r35Yk1UgUJFD1TvSsa5k3odfqihNPxD2ORY7zoRzzTEcysQ+K+metgQc+dvvZJL65H61 oRMF2TKcJnlwLMZmd2MuI2TyO8e9TFq2rZ0zLqLJKdBs9bCdwkirOcjBGWbroyvxPrju pNUKyopH+rS+OD7EnnhsPlf6CMnnZKFiHN/kupIYUCIiMrF7UUxqKb2v3+6tJqH0I4b6 2YLXx4rldkhtDnDm+dvToVtxtxQ99JcVjE6m2JZzdnSegAaitrdw0W8cwcBiJr+lmxkS +dSQ== X-Gm-Message-State: ABuFfojX1rQhaPTIayhOQeyHqVk9IrWfPHWOfHZqipzJ8zv0+/ebr1yw iW8jqRt9KDmn/KIIsn8NK+gBCA== X-Received: by 2002:a1c:5f54:: with SMTP id t81-v6mr4180726wmb.67.1537960852270; Wed, 26 Sep 2018 04:20:52 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j27-v6sm6139787wmc.17.2018.09.26.04.20.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 04:20:49 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id CEDC73E0489; Wed, 26 Sep 2018 12:20:48 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 12:20:47 +0100 Message-Id: <20180926112048.17778-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926112048.17778-1-alex.bennee@linaro.org> References: <20180926112048.17778-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d Subject: [Qemu-devel] [PATCH v1 3/4] target/arm64: kvm debug set target_el when passing exception to guest 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: ard.biesheuvel@linaro.org, Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , omair.javaid@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When we are debugging the guest all exception come our way but might be for the guests own debug exceptions. We use the ->do_interrupt() infrastructure to do this however we are missing a full setup of the exception structure causing an assert later down the line. Signed-off-by: Alex Bennée --- target/arm/kvm64.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 346e1f1a73..9ceff1884c 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -984,6 +984,7 @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit) cs->exception_index = EXCP_BKPT; env->exception.syndrome = debug_exit->hsr; env->exception.vaddress = debug_exit->far; + env->exception.target_el = 1; qemu_mutex_lock_iothread(); cc->do_interrupt(cs); qemu_mutex_unlock_iothread(); From patchwork Wed Sep 26 11:20:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 147567 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp603966lji; Wed, 26 Sep 2018 04:37:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV60sUD+gkek9w/Z0C893un17AZzXngxIxTiahaEjyAdCR5AmOgQ1q4Q9cSBvzi92TNl4Xu9W X-Received: by 2002:a37:6e82:: with SMTP id j124-v6mr3796122qkc.179.1537961820697; Wed, 26 Sep 2018 04:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537961820; cv=none; d=google.com; s=arc-20160816; b=ZC6xIwLkEAW4gK0+M5kLth/jkzsqMiutkKxzYZh2aLDAROKer+iWyVjHOMw1rMKSQ+ jykZDkHgIE57yMkVghJRQOnxPO6c6OocOzniHd7DmWScwMYK6+KilKTkaeV1wu5Kq1ti W16zTDbrozLsHRqXRClvRYYez/Q6VlcPDqV9hGrnSA9lfuYE9/WBcIQdY2bhF4/fTDYU uprnXXZW45XBi6qzlYsGAvRUrb023mi+4V3sJNNRq3w43fZodjDtCJhbWGOv9xWro/N2 DYlqDoE8nmy1DBR0TtvmgEW2ROKIohMIK7ggqYjn2MX6CWymgBrPQhwhtD/uuX3A/ihL nkdA== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=3OekAxObBHpTrOsSKqBZXC3Oh8VuN0JddNwe5XXDZoE=; b=JHmVDtpER0FFf6MSmALhJhnjJA2KYWkWfBLcJ95kfGdWrJx4PEQGDLbXg67WpFjRLB oqOO8a2UbD6a+1O7e1K0Qm7TdxAyvrXi5fKGRcY3XGn5ZSKKU316sK1z+R+gKDdvduMc 5lWrL9yEJbQ64byHK4/XpvXqFw6J5fkUU8vaPYuzKA+B9ly88ejKBO8XEcVzK7nCqK0M A1iGAirrH8iDSVPskqFfQZEBsXBKCZS4oo7kgip809vxvW9lXfuz6DlzVcrxa5BFsy8h NdF0vNvjApd7dcXnwdZC5WuQQn+vM922+qFYMpjwi7uDL9vIFul+ddD+nI9bF1SaqwEe uuwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DcdLK8oh; 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 22-v6si3881251qkx.183.2018.09.26.04.37.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 26 Sep 2018 04:37:00 -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=DcdLK8oh; 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]:57753 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g587o-0002rR-4v for patch@linaro.org; Wed, 26 Sep 2018 07:37:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g582a-0006Gn-Np for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g57sE-00018K-9D for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:20:55 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:40568) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g57sE-00016l-1K for qemu-devel@nongnu.org; Wed, 26 Sep 2018 07:20:54 -0400 Received: by mail-wm1-x32a.google.com with SMTP id o2-v6so1869858wmh.5 for ; Wed, 26 Sep 2018 04:20:53 -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 :mime-version:content-transfer-encoding; bh=3OekAxObBHpTrOsSKqBZXC3Oh8VuN0JddNwe5XXDZoE=; b=DcdLK8ohy5qBS6wmW0HJ36dmS9V6ZoK4D2UhU+roiNL5hJO8PrCNlmls8CuDo8sYwU nHSKjHURc1EfWThJPu3a9U5ftCzuekRu/XwxnIA9HNRvhIgJ5umJ4+gB4bndRAgXpAHB ab6JZWMqgWqGlWfIAGOZKwRFXO7Mg1vmVAGy0= 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:mime-version:content-transfer-encoding; bh=3OekAxObBHpTrOsSKqBZXC3Oh8VuN0JddNwe5XXDZoE=; b=Wz1sZJIG5urmZh/KiXq0GiyZyA1vgZz1yj8YeqYI99LmqIOUfznsya4i8U1WjZvLb4 t5z747nFEMbmqxlSfwPp1kt9wks1peDMgwVQ49UwncXv0QY4PVGl6VtLIsJfC3fZlyTx osmO2bAkMZL1DYxpPkm/w0Py2P2srEqhaRn+iFLJykmm6Gfynh6nmFU/eUoEaqjm60i0 epFj0Ss3Dk/vtAJPsTOn1i52ZvnFhFIwOczjqtxvhWw4nQNIKIndhh4s1vnWo5Y+ahUT B367GVo/RlK1D5l34x4MCreJ75YT+D9QI/8gfd54wXOPqV3EyBaq/+VYcich82Q62A2m jsFA== X-Gm-Message-State: ABuFfohIP2wRYc5rCJ/eAFZha+5QWJKnxv3eTzGMFQSGEr1uTXidVs0m eAenVyMD4gdHGkkrEVkIvl1QZA== X-Received: by 2002:a1c:ef15:: with SMTP id n21-v6mr2625706wmh.151.1537960852952; Wed, 26 Sep 2018 04:20:52 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b74-v6sm6238027wma.8.2018.09.26.04.20.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 04:20:49 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E10203E0504; Wed, 26 Sep 2018 12:20:48 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 12:20:48 +0100 Message-Id: <20180926112048.17778-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926112048.17778-1-alex.bennee@linaro.org> References: <20180926112048.17778-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a Subject: [Qemu-devel] [PATCH v1 4/4] tests/guest-debug: fix scoping of failcount 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: ard.biesheuvel@linaro.org, qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , omair.javaid@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" You should declare you are using a global version of a variable before you attempt to modify it in a function. Signed-off-by: Alex Bennée --- tests/guest-debug/test-gdbstub.py | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/tests/guest-debug/test-gdbstub.py b/tests/guest-debug/test-gdbstub.py index 474d2c5c65..7bfc95b187 100644 --- a/tests/guest-debug/test-gdbstub.py +++ b/tests/guest-debug/test-gdbstub.py @@ -16,6 +16,7 @@ def report(cond, msg): print ("PASS: %s" % (msg)) else: print ("FAIL: %s" % (msg)) + global failcount failcount += 1