From patchwork Thu Nov 8 16:33:26 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: 150531 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1034826ljp; Thu, 8 Nov 2018 08:34:22 -0800 (PST) X-Google-Smtp-Source: AJdET5c+D4YrZZaqtpKgtncFNCv6StzJYY0kN4yq8Uok99/zxjFVKJ1HRzt/s7jC+PEkTBkB+K9Q X-Received: by 2002:a37:9886:: with SMTP id a128mr4952018qke.156.1541694862462; Thu, 08 Nov 2018 08:34:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541694862; cv=none; d=google.com; s=arc-20160816; b=IuSdapZJ/aNv3BpMlEbb+RSW/LCHRrMkdYHzJuHWeQuALyf3PJ2o1atVx+GA0IWKVh bJQTV4eOOP+U/ogyidU6glLBE0YMH59S61SlvIBJlzL3jVycLwkQmkI6NyFli3GNHNl9 B9Mbx1wNHeRByEceVVjVJP0M9RTPTW8H3c4eJwcvuYz/uy3zTC++KFsueunpyn5tdeVr 3AAUMEx4XKc/Q2GAERl8JwAPXGOWezp2FGy25f/XirjcFCRbNZPHe65JvwtzH1sb4mY8 55GiSnJaApLPlvHpgQAT6zClXrArLP7DXwznEPqyFSFqTUohojDVc6DwA1nG/pp/ENpM k2xA== 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=c4V6kImoCE275rdFisv3w+l9mFW+volNA+l5l+8FYus=; b=fnWT8fXWTo/sLudCGAsShWkoe9ZAtb3cfJmuF1keZq04NT7eDn/GNwDmnYsg8h8HKT T27acGaKaiBnD3UUm6sMYpbbywG43qGV/d1Mv/IHmUgBHo/MaIxfOKuSXPEFXHJbWE8j sgjbXWcnE0khnvwuYpMg0T3+gZmQkajfUirBA1hMUD6v2ElTrt83XqIZ0dRrYmyXBYr9 fFYG3Iy2HxulXbqlZFlLz3rN6ki8Be8C4gaw78hp36y6Nc6TimOydc58jDDMKW4+gti2 x8kpXfLpiPdxA4fKVMAiesECeNm8FlVZ1/7Os2DQ6f5COc/6ZJ4QeaL4YG/DLsyQSP3Y n8aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WUttG8TL; 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 u19si1118945qvj.152.2018.11.08.08.34.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 08 Nov 2018 08:34:22 -0800 (PST) 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=WUttG8TL; 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]:57812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKnG9-00085j-QG for patch@linaro.org; Thu, 08 Nov 2018 11:34:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKnFf-00083G-ET for qemu-devel@nongnu.org; Thu, 08 Nov 2018 11:33:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKnFe-0004uA-24 for qemu-devel@nongnu.org; Thu, 08 Nov 2018 11:33:51 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gKnFd-0004hq-HZ for qemu-devel@nongnu.org; Thu, 08 Nov 2018 11:33:49 -0500 Received: by mail-wr1-x441.google.com with SMTP id y15-v6so21922421wru.9 for ; Thu, 08 Nov 2018 08:33:35 -0800 (PST) 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=c4V6kImoCE275rdFisv3w+l9mFW+volNA+l5l+8FYus=; b=WUttG8TLum+3d0kNMbCfC3VErS3eLtbeP1uDYWCb3lh/grsuvzNRrH0DcBtS/kSd8R B0yq6ZGbfOedrDr/Bp4zn7oeNWChI40bglfPbQQQ0hh2OTC2///IbBXy0q3VmouWjeZS 5Jr+evyeKVnGR94BtTx232t3/hc8+mKl6PaBc= 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=c4V6kImoCE275rdFisv3w+l9mFW+volNA+l5l+8FYus=; b=f5+kbZyJ+DS8FJ0azR1vk92+jjLlHMyRt73S1N+Lu+TQNULZRwYEzxPWkkmsBanbMa ZTKrS2ERJu3rLkf5zzI8o7Onc+0q1AkxxVnhRG4BWyJd/ArABmOtsY7fgP+onLI8G2Pv t0Mqhlv2fr6xOeVj+roNppTUCrqlZ9SyUrK01Kr5gzBPUw5lcaSgjVzZCwoR+wuaSE0s 8xO58coq5eXVgnzdztDZJgltrzjx68G0i5UXnF6Ldw0WixBDwGPZxQ2eeBNN/jYhysqd 0EKyJARtG/kimzrskukLMq3avxnT2ryaLMQ65SghdPvFYC6pbJroJp0bfGLWcQAoK4yX LfXw== X-Gm-Message-State: AGRZ1gLgtC/KW1+9Rz9mOnVMzxygBK/i+uDQPZq/zHjFWsnorc2G0e3I zkyBhqQcPl+mCe81obtaJip67A== X-Received: by 2002:a5d:4b05:: with SMTP id v5-v6mr4610710wrq.5.1541694813967; Thu, 08 Nov 2018 08:33:33 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o130-v6sm7213212wmd.11.2018.11.08.08.33.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 08:33:32 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 22F1C3E04A5; Thu, 8 Nov 2018 16:33:30 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 8 Nov 2018 16:33:26 +0000 Message-Id: <20181108163329.19940-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181108163329.19940-1-alex.bennee@linaro.org> References: <20181108163329.19940-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::441 Subject: [Qemu-devel] [PATCH v2 3/6] 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: peter.maydell@linaro.org, qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When we are debugging the guest all exceptions come our way but might be for the guest's own debug exceptions. We use the ->do_interrupt() infrastructure to inject the exception into the guest. However, we are missing a full setup of the exception structure, causing an assert later down the line. Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell --- v2 - tweak commit msg for grammar --- target/arm/kvm64.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 Reviewed-by: Richard Henderson diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 03b0f78831..bf7824d862 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -1000,6 +1000,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();