From patchwork Wed Jan 31 16:53:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 126374 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp906255ljc; Wed, 31 Jan 2018 08:56:17 -0800 (PST) X-Google-Smtp-Source: AH8x225qUVQy/dAmQ+B25qSgmKhTosr7h5P1RQRQh9tSQn7UJljWZKey9h0wFPaSsStRQ+SnRH6K X-Received: by 10.36.189.15 with SMTP id x15mr13776022ite.6.1517417777461; Wed, 31 Jan 2018 08:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517417777; cv=none; d=google.com; s=arc-20160816; b=Ji4RaKNpIUaoY2Opbquc52NU0WwyEFK8/4R+ROoZgItIQ4cksAioAOAbhlf7NXkxpT srp4xI0o8C6OHQuJ1vc7PTQNxl2w65FDlzQZr2Vu+GvR1GCAIg1zq1E4+IWxj8xgzvIQ ODXXaaq/u0zUD5qvrOGwxWK0dbAVOLsrIsuRDcR2VWCIXQzYOtRSzq3SxifNbzDTMWY8 vr0AjmkZjt2mSWKX8YUhcxIpqd0A0mmDAbGmHoACJhtMxq840SZNXWwQ1mF2QTf+Kgcs sqdfWNT6lqsQaTu+k+HFhT7MIggWmidrWuugXgu0OCwkzu5rGsryWeBJZ9s82jpHgrFJ An4A== 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=sPLSRkNjdIhFoSWCfk9OtqE8y9CiPg7VdUFmxoi6b3s=; b=myUP39bul5j4Zgpctl5LcQPnM/Keo8E3/xwCTI7n3IO0mF4IsQfjNYXwhDtC2pjpiF iM1ZqWjznb9Rih4A+HkT8ZDM+JSRnmgjKXXBSSnDqSb753UUrRKkAVhCXr4THdEIy6Rz jycR2Be9aQ6uWulekeswuLcKkiqX+Y3SafivkEvpaCJPsnwYUrsxznXPQPPsej6au7FG MNBv+Y8ganiCl3tY7uiu8022NZInFEH1/YFh7QDBcYl6UXJSkMCnpNIfzcRa6cV8/4tl /PZxY1vzbE+Mlb8AVsmocpiJvfCDilYHpvAqAAUu9GaRgwVG6guIDw6G+eIpBIxBkona lWJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VHyQ/HB6; 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 16si91661itw.142.2018.01.31.08.56.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 08:56:17 -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=VHyQ/HB6; 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 1egvdq-00042Y-T6; Wed, 31 Jan 2018 16:53:46 +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 1egvdp-00041y-4u for xen-devel@lists.xen.org; Wed, 31 Jan 2018 16:53:45 +0000 X-Inumbo-ID: 42c3e152-06a7-11e8-ba59-bc764e045a96 Received: from mail-wm0-x241.google.com (unknown [2a00:1450:400c:c09::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 42c3e152-06a7-11e8-ba59-bc764e045a96; Wed, 31 Jan 2018 17:53:29 +0100 (CET) Received: by mail-wm0-x241.google.com with SMTP id j21so9319365wmh.1 for ; Wed, 31 Jan 2018 08:53:43 -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=bh/6mSgwEGAYt2ZhvNGW17XpxXkL+MIvvqEdQRHyL0I=; b=VHyQ/HB6tBjEEpin/DL0C57nPqvYObMtoSMHuH7QX2UK2ChsZnCFVtFGbRUlzemEi5 ds3oGzoq/2PHbao8+BBXmAPp4I8MXu62NKHEMzDIfMJSszGUBlrmDhfj2F5Mjscad4ln 8b/ln0xlHA8680shXU103hdckPanIpNT4uLfs= 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=bh/6mSgwEGAYt2ZhvNGW17XpxXkL+MIvvqEdQRHyL0I=; b=VpLSjWOlxv87rDitseZBBYjbDCPtyfzQ6V4TKKZOgtp2CjjDjCSLHEoGL/YPQxQrSQ /qED8TFR2eBxVj1j+NWkk7AqBPuqyuTTHqTmfaKUNwIjELw3uD+wN8rpND/4Zlf+vMPf 3tvr/oTtzLt8ztlToVOoaHzneoEMws2JEsEe7DuV1UUaqa6eNM9w4l4BQoVTcFnXXFe/ viPg5qSU/IZM3AFszG330OGf2sm5nv7jZFMLeMn2Fyk8hzmwjeRxaTjnUXE/cybmWPG5 mw/aJWHurhi3oH6usd8kTs6mWHMbGRT2DKKVcizCxeZl3HIFOSJj9V93Ojozy2uFP1Xt o1wA== X-Gm-Message-State: AKwxytcTteA2a9qyeE7DxJKrqjpZtBZf8VE0BwYpSVerkeGCD9YPO5PT TB1QIKsfwttd13+aDxrkUBwb7a6h6JQ= X-Received: by 10.28.139.66 with SMTP id n63mr24506911wmd.101.1517417622111; Wed, 31 Jan 2018 08:53:42 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id h194sm223745wma.8.2018.01.31.08.53.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 08:53:41 -0800 (PST) From: Julien Grall X-Google-Original-From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 31 Jan 2018 16:53:30 +0000 Message-Id: <20180131165334.23175-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180131165334.23175-1-julien.grall@arm.com> References: <20180131165334.23175-1-julien.grall@arm.com> Cc: sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v2 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" From: Julien Grall 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 Reviewed-by: Stefano Stabellini --- 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;