From nobody Mon Feb 9 01:35:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674226840; cv=none; d=zohomail.com; s=zohoarc; b=ec6evXWxuT2tfXURq1eFPajWAqTid8qW6j2pn6aIp8fXqEXA4xlrf8juMo0QiHGMva7gfpSbz35uDLBvYAl7w6TxMvkO8ZpxSBWRWN2ByEDRLuFFz+qsNFDS3T8R3ILXdUDk2v6ZNLg/3pdOEz+XrbebO9BYS8hjDjQQrrEvjYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674226840; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K0WSKOVdhD4de0NUU+Vb5gE8iDFJmgnw6gPb5txxrQY=; b=Kn4xwjLKupZr/Few6ct4r0CfrbPnyuE+VtKYBL2MK+5I2h1jdDbSeKNIyK6x5XzhNSoLYYcs/F1BgUmPSTCecZHCZyueJXxCD2YZ3JD7jI8XKOLCT93XjVzCBZvhNj8b2ESuYrDjIscMH3eVT/aTOePD/lUXYaEQyIweH/kC8Tw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1674226840672443.18181693235147; Fri, 20 Jan 2023 07:00:40 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.481863.747119 (Exim 4.92) (envelope-from ) id 1pIssN-0000SB-8j; Fri, 20 Jan 2023 15:00:19 +0000 Received: by outflank-mailman (output) from mailman id 481863.747119; Fri, 20 Jan 2023 15:00:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIssM-0000OQ-1l; Fri, 20 Jan 2023 15:00:18 +0000 Received: by outflank-mailman (input) for mailman id 481863; Fri, 20 Jan 2023 15:00:15 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIssJ-0006Kg-Bn for xen-devel@lists.xenproject.org; Fri, 20 Jan 2023 15:00:15 +0000 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [2a00:1450:4864:20::32b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 250e287b-98d3-11ed-91b6-6bf2151ebd3b; Fri, 20 Jan 2023 16:00:14 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id iv8-20020a05600c548800b003db04a0a46bso1306072wmb.0 for ; Fri, 20 Jan 2023 07:00:14 -0800 (PST) Received: from localhost.localdomain (lfbn-gre-1-240-53.w90-112.abo.wanadoo.fr. [90.112.199.53]) by smtp.gmail.com with ESMTPSA id o2-20020a5d58c2000000b002bdbead763csm25349811wrf.95.2023.01.20.07.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 07:00:13 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 250e287b-98d3-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K0WSKOVdhD4de0NUU+Vb5gE8iDFJmgnw6gPb5txxrQY=; b=e8j5MC51WuX1KTMJ4V2AqT+Klh1/1PCd2GapwqibHdga4oR6gQyn4MNcchnerhVGQy Zo0jkGlnLaxnG+ETs5b9y+DQBzK5vWxFcda1YtMY9S4BZrHoICTqFCbL1BaWa6Omqtfw SvPbOzPgha6xA4ivGfslns5gFQLiBWOk+1mYqi9Z46CL+A5FGyCz7OULzqwtx6o7YS8H qkz+kVn3FQwxufSSfukNf8iR8vbH+EPKbkJ8KZNpSJhhDMoJ4++fZeJcsZH4rYKYGPcK BijLMuxwbQ/yG3/+e/uoj6hC+UbkWPJNad5TX+Uzc4+dIOMQgEbFRqx+l3zdPaIX5/J0 xaaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K0WSKOVdhD4de0NUU+Vb5gE8iDFJmgnw6gPb5txxrQY=; b=kW0IVZ15cb8gnC1B8+qi/C3IAXdqpROwWvXzK3fnvDXKTG27mMWOsSW3l8FcAUR0mO B5+OZWKl5lxHoqB4IOEtkcpqAXbGJMaAqxd1Hlq2LjneMYtyJpXAOD9cUuS5Xr5LZFhS LQkC7VJ5EV1ebAGtX7teoSjZtHwApLAyoUXc3gvmTB1HBjYvr/M1jP9jlYCdNmNEZ5xj uH82L02b8e905xm092YkOdUJSqBxpasJ3W/56BgtHied6fCxMqpvwO2ZTWBq2X3qEoRI hnLNKq26bTMm8MFe4+mGjYIJGX/jPTEfcDbYeYO+hTYCPR/qzIaSdYs6zO3ANqYAjvN5 V7bQ== X-Gm-Message-State: AFqh2ko3t0cxle4JpI/SZT73rhHI0MFPjRxv+TFLjWshZhQK/t2t4GGv 1VQG+XGXTtz0/iFZP9iF8NE0m+jrClEHSQ== X-Google-Smtp-Source: AMrXdXuk77JOnphr6uSGPpR0kTywUv+ylWZkshdS4OpyJnEN1ImoV2Xg9Ua/LTaJTKstYoR4X1nNpQ== X-Received: by 2002:a05:600c:1e09:b0:3d1:f16d:5848 with SMTP id ay9-20020a05600c1e0900b003d1f16d5848mr14355775wmb.26.1674226813902; Fri, 20 Jan 2023 07:00:13 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 11/14] xen/riscv: introduce setup_trap_handler() Date: Fri, 20 Jan 2023 16:59:51 +0200 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1674226841540100021 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- xen/arch/riscv/setup.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index d09ffe1454..174e134c93 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -1,16 +1,27 @@ #include #include =20 +#include #include +#include =20 /* Xen stack for bringing up the first CPU. */ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE); =20 +static void setup_trap_handler(void) +{ + unsigned long addr =3D (unsigned long)&handle_exception; + csr_write(CSR_STVEC, addr); +} + void __init noreturn start_xen(void) { early_printk("Hello from C env\n"); =20 + setup_trap_handler(); + early_printk("exception handler has been setup\n"); + for ( ;; ) asm volatile ("wfi"); =20 --=20 2.39.0