From patchwork Fri Feb 2 14:19:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 126714 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp687225ljc; Fri, 2 Feb 2018 06:21:53 -0800 (PST) X-Google-Smtp-Source: AH8x224l9Lx3dNss4Dc75BfRRL2qD0/oEYFwJk39kwwGuwUCLBTHFFXHxxl85DUV8w1++dSl2HlH X-Received: by 10.36.120.80 with SMTP id p77mr14356127itc.115.1517581313551; Fri, 02 Feb 2018 06:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517581313; cv=none; d=google.com; s=arc-20160816; b=NFcb8fm6hmdnQQFCeFlPTJjx6j9W2OFwPnQB5o+AYhCKB9wh6I1oBgj3CFTZ+hC1JU +QJKAD79QbdB95tEAcvh3+MnGvjSmTxoh410u4g/uice4UotGF0gFJR/cbhhpebQgFuB m28p7hMuSJFb6OFyvQg9V12YC06tCJMIsoEJ/XjEGCtJbGm1MFGmsX3FytIUI7OvXRqS JWNdd2fF8ERELKHR8jnaWNepe+kUWsJkQiGZCafH2Y/yLr/iPA4xNAv2m2WF6Mmw8ogQ Up8zzww+Kp+8Qcpt8Bt9tVrzJoI2qmMePdeWbhKSS/KtoJ2u6rHlnfsP28n4+WRYN7G/ co0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=wX19GdT5yZ6x/Tl34Zc4GmO1rsHtgC6kwsiFHAFNoqg=; b=Wx91Zn4vlk2iws+2bkZtbkt9lUe4ty97hplDaWTldgKqQzZsihaaelm7uqjZ3Oxccw qhuCeurbQj+ElYecrDF+zttDZPKTgqgd7REsFcUcEE2FgP9GN3PTNsGv3YPr4kzCzY70 OXkS24XjCndRgtoYqug15sZbMo+/zJrvlyi+kcWPDHunfyVxTXKR0Nxqz6tcOrOpZih2 d2vT+Y5POIAYAsHo/iCCCeZRB0l7/DIYfoz0h0qXjzBWdxoC2Yv2gljPnA93S4IBPxyh lzQFOX4+7NZMno5BtEMkGqDa/CtHEzbfdwR3QLVurx438hmg89tAEFNF0PjH7mGk9lnz 7/HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TIJ1ujJg; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 72si1823114ioc.86.2018.02.02.06.21.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Feb 2018 06:21:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TIJ1ujJg; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehcBi-00085g-04; Fri, 02 Feb 2018 14:19:34 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehcBh-000852-4V for xen-devel@lists.xen.org; Fri, 02 Feb 2018 14:19:33 +0000 X-Inumbo-ID: 0b55f11d-0824-11e8-ba59-bc764e045a96 Received: from mail-wr0-x242.google.com (unknown [2a00:1450:400c:c0c::242]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 0b55f11d-0824-11e8-ba59-bc764e045a96; Fri, 02 Feb 2018 15:19:14 +0100 (CET) Received: by mail-wr0-x242.google.com with SMTP id f6so21065153wra.6 for ; Fri, 02 Feb 2018 06:19:31 -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; bh=r1HGC9nH4wEeJ1OqtZl/cBav7TLlzg7REtDMZ9Vj//E=; b=TIJ1ujJgcxqOWa2XoqmVj9/6Pg0lSfXjJXD0fZZktnURKEwwtB6gzk7TxwjnwKxt2+ 6pawXd2LuIsnMuZQNXDq3a1BX33L1F4gXI4Yeh4e6222meV6ww9fTjmGpB0EitjF2g5r VO0lRkd8Q39g3TzPOp9EMmbvzsz2TZnca6Cj8= 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=r1HGC9nH4wEeJ1OqtZl/cBav7TLlzg7REtDMZ9Vj//E=; b=JgtfzhzKBtl6OpIZTv4usceMO8skJiI+tC96qVZH4W1PgQR13n1LhVokl44gIFVuy8 AFeltQf/hGb1LSV3repWWr3XT9qqLnyVExAk6hutEuaqwZUCjDaoRq2lSZMab3KWJicl 8dz2qWJMVaDF+khqnbh45UJfiajcVLVRXUemo7JxWWYcm4Z+OvWpEtvKFsUrbmLMTlF0 DioR/ndCiIj6oIlynkn/ReMMiN5Or+zdW4bzDmHZJgAiPgS6HkM1TxusC5ZyxcRHgXpi n23D7lFhWW0AX/2F9lluClI15l7xH5rMWIcGadXObbJKvXLBHcDPmAwAXaE3KbYHfqO+ 3BAw== X-Gm-Message-State: AKwxytfZg5QJvw7n7/lICeSJz7FliATseT8+W2WADveiaMAqW8QDU8Hi gcLIgqkBNw8MtnjmLeA7eBN8axYO1/8= X-Received: by 10.223.201.3 with SMTP id m3mr14889149wrh.117.1517581170290; Fri, 02 Feb 2018 06:19:30 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id u79sm3057422wma.10.2018.02.02.06.19.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Feb 2018 06:19:29 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 2 Feb 2018 14:19:21 +0000 Message-Id: <20180202141925.19387-4-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180202141925.19387-1-julien.grall@linaro.org> References: <20180202141925.19387-1-julien.grall@linaro.org> Cc: sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v4 3/7] xen/arm32: entry: Add missing trap_reset entry X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At the moment, the reset vector is defined as .word 0 (e.g andeq r0, r0, r0). This is rather unintuitive and will result to execute the trap undefined. Instead introduce trap helpers for reset and will generate an error message in the unlikely case that reset will be called. This is part of XSA-254. Signed-off-by: Julien Grall --- Changes in v2: - Replace .word 0 by trap_reset --- xen/arch/arm/arm32/entry.S | 3 ++- xen/arch/arm/arm32/traps.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S index c6490d2847..64876c1184 100644 --- a/xen/arch/arm/arm32/entry.S +++ b/xen/arch/arm/arm32/entry.S @@ -137,7 +137,7 @@ trap_##trap: \ .align 5 GLOBAL(hyp_traps_vector) - .word 0 /* 0x00 - Reset */ + b trap_reset /* 0x00 - Reset */ b trap_undefined_instruction /* 0x04 - Undefined Instruction */ b trap_hypervisor_call /* 0x08 - Hypervisor Call */ b trap_prefetch_abort /* 0x0c - Prefetch Abort */ @@ -146,6 +146,7 @@ GLOBAL(hyp_traps_vector) b trap_irq /* 0x18 - IRQ */ b trap_fiq /* 0x1c - FIQ */ +DEFINE_TRAP_ENTRY(reset) DEFINE_TRAP_ENTRY(undefined_instruction) DEFINE_TRAP_ENTRY(hypervisor_call) DEFINE_TRAP_ENTRY(prefetch_abort) diff --git a/xen/arch/arm/arm32/traps.c b/xen/arch/arm/arm32/traps.c index 705255883e..4f27543dec 100644 --- a/xen/arch/arm/arm32/traps.c +++ b/xen/arch/arm/arm32/traps.c @@ -23,6 +23,11 @@ #include +void do_trap_reset(struct cpu_user_regs *regs) +{ + do_unexpected_trap("Reset", regs); +} + void do_trap_undefined_instruction(struct cpu_user_regs *regs) { uint32_t pc = regs->pc;