From patchwork Fri Jan 20 14:59:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii X-Patchwork-Id: 13110074 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F2CCC27C7C for ; Fri, 20 Jan 2023 15:00:28 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.481864.747128 (Exim 4.92) (envelope-from ) id 1pIssO-0000lp-AV; Fri, 20 Jan 2023 15:00:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 481864.747128; Fri, 20 Jan 2023 15:00:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIssN-0000hO-C7; Fri, 20 Jan 2023 15:00:19 +0000 Received: by outflank-mailman (input) for mailman id 481864; Fri, 20 Jan 2023 15:00:17 +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 1pIssK-0006Kg-SR for xen-devel@lists.xenproject.org; Fri, 20 Jan 2023 15:00:16 +0000 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [2a00:1450:4864:20::42d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 26156ae8-98d3-11ed-91b6-6bf2151ebd3b; Fri, 20 Jan 2023 16:00:16 +0100 (CET) Received: by mail-wr1-x42d.google.com with SMTP id d14so1414359wrr.9 for ; Fri, 20 Jan 2023 07:00:16 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 07:00:15 -0800 (PST) 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: 26156ae8-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=SUG1QTMGPWyaQd+Wzg6VRLvIzEpGSEc+bJIbP4HX+Ac=; b=BUzCp98P2KOhLr2xTPj8dfCxehOuf8RpFf/IIH+m9Dvk9buBG26N+OEouINtD4tWKx BNBHn3E1J49dz8d0SE+6SOV+Ayp1vswtlZkrdE5xMNuCXjuSnY8RiiIOs0DZuvnmuBc+ Q9eIjCj72Ol/NRq0g1hsjBCH5mi9pY4gWd9YowkeNaAExQHiRc4iajd1+mmyatXi4E5N 2cohliapAgw23gsVY9tNQJakdH2QxVGKwHn2xxsE5z59y1F9l7kHgg0JaAM2+1yYkOCx 6sGxWGLM5b+Ly0ebXvTRuPl5q5q6jhrAEk66iQ3rO09Rk9Ocsvn6qw8gXlKal6KAuY1h LhPQ== 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=SUG1QTMGPWyaQd+Wzg6VRLvIzEpGSEc+bJIbP4HX+Ac=; b=YTpzHGPDRO3dNEmqY+gP1aEiMdwHjc7UazK1yP54ZTp5PqzxnO1LOL89s+13o2OS2K zxHiYyTVXQOsGo79S/L9o9MhPHPX819NubQdU196b/lSj+m3hZ8/b0T1Ql92s9aEgjRw JH+JLCC11vOyDy+3L3SkLPKVnfoAM0xXxxsPPUIMhbxv2QkVaJ5CLdyrE8yVFTchVo4C 738e+9NtOZtHu89tPS0fxE480BbNe0vb77Disg6T9gt999k8LQDrSXOBIfBdgYoyDk2s YR+alN04O2Cs2bcRlI1e6SBWNFft5cyuR3A/Oq82jLntZVk2zh5gCTbX/qZBoQksGqlA woKw== X-Gm-Message-State: AFqh2kptdI9njuhyWkhtLSVy9w5gLkKHKRH+Vt3Cd666IqFTAh0ulaoz VR+idJ2TauhA18uUrA08TvB9qOxXmx7GPA== X-Google-Smtp-Source: AMrXdXsikABfoFsOfWXV3DcSlpLN++qeOfD9vBk6m7CYBLT/K/Rzbxd8OY/6qrcT/YvP8Yw90QI3Ew== X-Received: by 2002:a5d:68c9:0:b0:24f:11eb:2988 with SMTP id p9-20020a5d68c9000000b0024f11eb2988mr14058938wrw.71.1674226815692; Fri, 20 Jan 2023 07:00:15 -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 13/14] xen/riscv: test basic handling stuff Date: Fri, 20 Jan 2023 16:59:53 +0200 Message-Id: <10254478415a1417872a5c89cba1811b6483fd78.1674226563.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/setup.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 174e134c93..35ab9d25c6 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -1,6 +1,7 @@ #include #include +#include #include #include #include @@ -15,12 +16,27 @@ static void setup_trap_handler(void) csr_write(CSR_STVEC, addr); } +static void test_run_in_exception(struct cpu_user_regs *regs) +{ + early_printk("If you see this message, "); + early_printk("run_in_exception_handler is most likely working\n"); +} + +static void test_macros_from_bug_h(void) +{ + run_in_exception_handler(test_run_in_exception); + WARN(); + early_printk("If you see this message, "); + early_printk("WARN is most likely working\n"); +} + void __init noreturn start_xen(void) { early_printk("Hello from C env\n"); setup_trap_handler(); - early_printk("exception handler has been setup\n"); + + test_macros_from_bug_h(); for ( ;; ) asm volatile ("wfi");