From nobody Fri Oct 18 08:28:50 2024 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=1720801159; cv=none; d=zohomail.com; s=zohoarc; b=KR3iX05AhtZPKj0IrBf0eBNvRDSxlkNsuDQyqujNgtICzRHlF4s5VXlMEUrkxeJ3la+nG592oIBshffOxIQ8mASgd23ayMttL31fMYd/kGO5xbsnwZC1e1sLUt7dkInWtpuqPW22EPb/MMK1ayjCShW2VVh5LstEOYDFwtpAv9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720801159; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tzcJTvhB72zFgLJxMtKt5ug3KrGpNPrgBrt3gVVkNwk=; b=BweLega6ieyhDSLXR6pFMsHT9YEFWO2JK/ITV7ll4vjwGTzLqFCrTntDZi84cdGfWMB8ytKvWZkk8e8uKFASOQ/BzDv7wP7JocwIDoVeXPg7RyHOGjId9jW2ckZTPWnQQDpNgX+uYUbsOA+sg07MlkU0IRDltbZC6hG26gn7f80= 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 1720801159423745.6340015083682; Fri, 12 Jul 2024 09:19:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.758150.1167510 (Exim 4.92) (envelope-from ) id 1sSIzA-0005AG-IZ; Fri, 12 Jul 2024 16:19:04 +0000 Received: by outflank-mailman (output) from mailman id 758150.1167510; Fri, 12 Jul 2024 16:19:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sSIzA-00059M-E5; Fri, 12 Jul 2024 16:19:04 +0000 Received: by outflank-mailman (input) for mailman id 758150; Fri, 12 Jul 2024 16:19:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sSIz9-00040X-Cw for xen-devel@lists.xenproject.org; Fri, 12 Jul 2024 16:19:03 +0000 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [2a00:1450:4864:20::52b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 735fa3bc-406a-11ef-8776-851b0ebba9a2; Fri, 12 Jul 2024 18:19:01 +0200 (CEST) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-57cf8880f95so2742624a12.3 for ; Fri, 12 Jul 2024 09:19:01 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-594bb9604f7sm4669169a12.15.2024.07.12.09.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 09:19:00 -0700 (PDT) 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: 735fa3bc-406a-11ef-8776-851b0ebba9a2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720801141; x=1721405941; darn=lists.xenproject.org; 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=tzcJTvhB72zFgLJxMtKt5ug3KrGpNPrgBrt3gVVkNwk=; b=UhqBj/IRC72ZvK1Ztt8doi9NeFNUeYS98PlZ8Hf6Poo+QZ9ctfk83AGU8J+8Gn88uV 0+rqfjnI9gqKwL+wlqCTUR/dn0laMLBNuoqAHRbIENBK4X5aTBB/zWti6TBN19CGEckt igyaHVTkvuGN3QFfPo6Y7x2PBBAyuCL0U6uGoUD1tRQfxJKkY66RloD1PTUg0dh0e1ap sUcnesfWoGYiVZQUpq02f24bnYMP9dl6pJPJi5+FGeMw4c7T6Ow34kVqU1Po75QhxadN Baph5uH1bVQjThqjci7R/LRG+05+IRuk+oXu/GpgivtGZlG5e+YK5McyJS0HCmZDCwUV sYug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720801141; x=1721405941; 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=tzcJTvhB72zFgLJxMtKt5ug3KrGpNPrgBrt3gVVkNwk=; b=o/vS0Tvnrz0sBeTEgy8XoyoOSYcyfq0OEDqPW/umqZvxODqUEG3+sr7mAYgu6yBL94 5PTLHkkOoSBWjjUFxPLpX9hipGAEnAxY3RvVJcLF0MpHsxJG4623qVe6BrG/cODTzYL3 gFXcOy4dNH7fXgrZjtUP3qyy49IHTL6GQB85m5sktoeLwtGgBJ7ol9l1rcBPuWzzpXlC ZFFl2ab7VrfzJKXugj8eFQ4OsJEANDGfvolTCj4VjXXnWoxRMrJZPYp7s9vg27gBDkB+ 6OrHOiVx3SEoOXREWLaeGQRljTVlbLwIColc5X3C8vZnNl991T0fVBZGBUtC9bb64Xus QmiA== X-Gm-Message-State: AOJu0YzLd9uF/d6iYZlLVyEOw6t6aG+yqU4n5wiIVFoTOwhd8/ahT/Ux E3NstFmXRL1uZOiRFADXgRRpo6vymTdrz2kwOva7O2Yl7sikA42TT2btmMWc X-Google-Smtp-Source: AGHT+IGPk9Dj8IhkgQmwNMU228dzBkvUapztG9fYL4a5yBBNhHL8kZxeHuVtgxzxK5Q9AvEqbtZSlA== X-Received: by 2002:a05:6402:33d5:b0:57d:3ea:3862 with SMTP id 4fb4d7f45d1cf-594bc7c9133mr7535849a12.27.1720801141130; Fri, 12 Jul 2024 09:19:01 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v10 5/5] xen/riscv: test basic exception handling stuff Date: Fri, 12 Jul 2024 18:18:54 +0200 Message-ID: <17ee34d97af4bebc87facf8576cee519ca26bf12.1720799487.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1720801161520116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V10: - wrap test_macros_from_bug_h() under "#ifdef CONFIG_SELF_TESTS" - update the commit title to: "xen/riscv: test basic exception handling st= uff" --- Changes in V9: - s/early_printk/printk as common code is now available --- Changes in V8: - Nothing changed. Only rebase. --- Changes in V6: - Nothing changed. Only rebase. --- Changes in V6: - Nothing changed --- Changes in V5: - Nothing changed --- Changes in V4: - Add Acked-by: Alistair Francis --- Changes in V3: - Nothing changed --- Changes in V2: - Nothing changed --- xen/arch/riscv/setup.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index a6a29a1508..4defad68f4 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -19,6 +19,22 @@ void arch_get_xen_caps(xen_capabilities_info_t *info) unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE); =20 +#ifdef CONFIG_SELF_TESTS +static void test_run_in_exception(const struct cpu_user_regs *regs) +{ + printk("If you see this message, "); + 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(); + printk("If you see this message, "); + printk("WARN is most likely working\n"); +} +#endif + void __init noreturn start_xen(unsigned long bootcpu_id, paddr_t dtb_addr) { @@ -26,6 +42,10 @@ void __init noreturn start_xen(unsigned long bootcpu_id, =20 trap_init(); =20 +#ifdef CONFIG_SELF_TESTS + test_macros_from_bug_h(); +#endif + printk("All set up\n"); =20 for ( ;; ) --=20 2.45.2