From patchwork Fri Jan 19 13:40:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 125399 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1098931ljf; Mon, 22 Jan 2018 03:20:00 -0800 (PST) X-Google-Smtp-Source: AH8x224lDxje05fatYkz+qbcnO2VcEQTFRMvbbIeiOkqVbilk6AF1k1KASRktPzbwUJSsGD+5WA8 X-Received: by 10.107.35.84 with SMTP id j81mr459242ioj.226.1516620000477; Mon, 22 Jan 2018 03:20:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516620000; cv=none; d=google.com; s=arc-20160816; b=cvnRGkaL+VIVId/fhFl6vaQVjgzzyTf1AKNd/YseukXmClGMTvlI318qzfB0RMxV1t hC0u2Q5CgIBP4cKmeq1heS5ihDhl2vkAIcBmBFXZoXAGSEu0tBk0+phnuiKeAwwbBOgW 7IQEVQFERlxAZSZd2419XtWjI2BKZ/eHrPSWmhRbyzve41e6PKiUjviJgyfEAzFnnfWd Iv2a/RM0XjDKTGAgGZ1rP7x8rGZJ/tvC4xsbD4XAWRV/S3d1vavPfVBkCGf2I8qKE0TO i1u/dLrdjKRfW2Q0wjIZyZamIl92GdrcoYc3uGsX+A9BWPTIPwW7TtKFQXxAXadQBv0s 14BQ== 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=4MfQhhnzk08RdQQvjlXdrA22hqK2LxvLIPmfT2u0J+s=; b=Qcsgy++c33vEATB/R2Vhy+vFJupiHbaWoP8I3KYGLmKW5zt/PDp5kWvPlK1QlyXDgX D1cOh6LdMP5AanUonpDNXYBty46KfFtsl3x8jKPlU7f/yroVZmHfBma0XSQ+LSu7cyoF E1O2YGqKj06ssWj8rdAvUQPv7zofd1tl0KpvmBXiD9d6tqepzM6StRS9KTsAWcLYk5fD D1FRa+2wuhYSSoqbq1HlchbpoupU0wCxKz7+lYizaURpFi7Rz4CKEgPiBSttLr8oFSXO RxpdIeYefbQxlSAy0a1f5logM1XdOXYpIIyOKPXQgKrKK7aqxg1c4Q6L8Hfu2b+N0L5B UXgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Hhu3m6lW; 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 b2si12458593iog.275.2018.01.22.03.20.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 03:20:00 -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=Hhu3m6lW; 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 1eda5q-0002Vf-Vz; Mon, 22 Jan 2018 11:16:50 +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 1eda5p-0002VZ-HA for xen-devel@lists.xen.org; Mon, 22 Jan 2018 11:16:49 +0000 X-Inumbo-ID: bb51af38-ff65-11e7-ba59-bc764e045a96 Received: from mail-wm0-x242.google.com (unknown [2a00:1450:400c:c09::242]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id bb51af38-ff65-11e7-ba59-bc764e045a96; Mon, 22 Jan 2018 12:16:46 +0100 (CET) Received: by mail-wm0-x242.google.com with SMTP id b21so16048186wme.4 for ; Mon, 22 Jan 2018 03:16:46 -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=V8wYS3VQq+eHn1NICfBSQ7OtxcmmRfydgdVHXdYrqOA=; b=Hhu3m6lWSF8UTwDXQloHz9GX6CifzR2uI31T47s8+mF4djgOQrwhqtnw5Or3S7HK2D ohjM9MLXUSNEdlRvlT4tOJVU/qcQLRrufhxees8nkLwb1y06LtAFXX4Majkt8mC3reEp xsPETcsO5M3cJ67aDOjY8KBn1/6kopKFB0IHE= 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=V8wYS3VQq+eHn1NICfBSQ7OtxcmmRfydgdVHXdYrqOA=; b=WlR2oQ5JZXIB05l0ZxMbIluYXtysXBffALI2uV7RKiuylnvKHZu0ArisL/2MVlyLMM I0IAVtOvuOCjuq27hste9VBiK8b/vNmwgmqiFvLlqwxRHb/NtGFrcAXds1wqrnTJupoD al1EpdVogH10wARNKS/OM2/VnxipGDdOptF8R5/Kve49czF0pWPhnsXkuNmBzp0ehOcV war3n3RjND5Klneq7jssuqO9uft6vQw9U63EmLxmCtopjXolwRyoTEFFoewmXMVhD4EJ WJZ5utVA1TWf3kaG79VmscPl5mecXggE4xGsPcQxZO6MwoFoSIlRpJHsk94VNYkOC5SC P1ew== X-Gm-Message-State: AKwxyteKQ//xHytQUf/4Bm9bCFdIS85/9TOd+NabXo7/btWQTb1/OFbs wlJ7deAT/Ml/ozWn+KY6OvMxkKM/DXI= X-Received: by 10.28.105.193 with SMTP id z62mr7407729wmh.77.1516369267987; Fri, 19 Jan 2018 05:41:07 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id s44sm5113642wrc.64.2018.01.19.05.41.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 05:41:07 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 19 Jan 2018 13:40:59 +0000 Message-Id: <20180119134103.3390-4-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180119134103.3390-1-julien.grall@linaro.org> References: <20180119134103.3390-1-julien.grall@linaro.org> Cc: sstabellini@kernel.org, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH 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 --- xen/arch/arm/arm32/entry.S | 1 + xen/arch/arm/arm32/traps.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S index c6490d2847..c2fad5fe9b 100644 --- a/xen/arch/arm/arm32/entry.S +++ b/xen/arch/arm/arm32/entry.S @@ -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;