From nobody Fri Oct 18 06:23:27 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=1721835115; cv=none; d=zohomail.com; s=zohoarc; b=FQ4lhbLm3hhY31DbkFhmsN1kmjL6LBmvHei1LUwVMGupje3+JXgNwJGdzquUTSgDvb2XUIMf73FE2cy1e9O50MrYdD3QFiBUz1NgqFdU1d2QQd0FzSpXcKAx5AmmqFjAjW8W0XoYTHt42G6x6JXE3TZq4W6P7xNljztPsEsZc/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721835115; 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=4O/hwQwHF6rfJLVATnZjtAz9ttGqfT93bsxm/gvlyso=; b=lrxqi5xLTw/6hkhJaBInqE781bR5Y7MXgUP3VNKJSigcM0uA6CUUFu2CWfASgMqAXME6BLe2yNhRLAhPf1wZXotsVFziOzCfHfRBGfmNCPnDbxDnk/LT2yGkQIB5E3mJLVx0DSBuC+GQYKlrfmXd3FfAcft91M8pAcdIjVVrGns= 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 1721835115518361.7161168489496; Wed, 24 Jul 2024 08:31:55 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.764287.1174697 (Exim 4.92) (envelope-from ) id 1sWdxi-0006aZ-Ro; Wed, 24 Jul 2024 15:31:30 +0000 Received: by outflank-mailman (output) from mailman id 764287.1174697; Wed, 24 Jul 2024 15:31:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sWdxi-0006aS-Mp; Wed, 24 Jul 2024 15:31:30 +0000 Received: by outflank-mailman (input) for mailman id 764287; Wed, 24 Jul 2024 15:31:29 +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 1sWdxg-0005Od-Vc for xen-devel@lists.xenproject.org; Wed, 24 Jul 2024 15:31:28 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ca1b5c54-49d1-11ef-8776-851b0ebba9a2; Wed, 24 Jul 2024 17:31:26 +0200 (CEST) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ee910d6a9eso10077391fa.1 for ; Wed, 24 Jul 2024 08:31:26 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ef26f1bc4asm14240491fa.40.2024.07.24.08.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 08:31:24 -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: ca1b5c54-49d1-11ef-8776-851b0ebba9a2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721835085; x=1722439885; 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=4O/hwQwHF6rfJLVATnZjtAz9ttGqfT93bsxm/gvlyso=; b=Fx02EhSWbV36Y2XPEQJhk4I3PD1/abDRG4Axwf3C9J3R/UkDK8tM/L+K3sUM/qJnoj 2cYjw9B0lFsfi6HHaSccH8iJPwnHGFfInCHQjXcV6QECpZcCXeOC6Yu79HiUEU/6V0zz InFMCYbtJo8u9E1MjZ6BYIXxZ9CxbEhDuZlj18yxZowyrvUzuUBWzVR6jWBVINSCa6jM ORjmyMccpUlUmVMFtOQOZQJm2wNE/QwtCcWr+z8UseqSSXNuSYkte8/K6kelchcMIAED eWOAht0WGh0PJ0N2mY2hMfj+vRB3GH75JIz8B8ZPSiUdIa85hyxt+kTK1QZYCNriU10U ecww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721835085; x=1722439885; 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=4O/hwQwHF6rfJLVATnZjtAz9ttGqfT93bsxm/gvlyso=; b=f99J9Kf15C1th2Qn3XXy0rtTCxAWAPYcCD6B3WyjnTQqlhbdAp6bUppC8J3goWHNWp BtBlIRV9e5UItRUZ5rtVZ7d0/S1CHFZkyKk/UU3fSl4MeT2DN0IEnIYr4qOFmodyqT6q ZbgQPJI5bneRzMp3zMX+1diU3jEZ3YFZ/mRB547yuqjKSNow2Lo1PzE12yhu9dJoQqQJ 2/++dH0GnL/RmMnAtiOBO/Lhb+RdygL4FXWmoZYw/8krYtHYc8Js1lRMJPWLmr+xA1VX t7tCNUj47xzUkaORzIeR0j9KZsvi5AbBmGY8goUq2TdOCRxTi+9XLzt6HLb9SwJ7l6kd tz8w== X-Gm-Message-State: AOJu0YyHQZ4ecA450fmPIePkzd6G5ZqePwoESKD8GAnfMS1quueliCfp x8SUNLMzPa9fCDbk+yJTPus49+FpfsuPbm3+VKJ8y76J/QKjO4wXuAbNrRxN X-Google-Smtp-Source: AGHT+IFwW9NRyjYW7BQrQYvv6ZlUZAHMK5dZdh4otNlSjFLdBd76AEtDTO4J0u1G65gJH33NGBAHAg== X-Received: by 2002:a2e:a4cd:0:b0:2ee:7c35:d892 with SMTP id 38308e7fff4ca-2f032d43da6mr6452101fa.17.1721835085036; Wed, 24 Jul 2024 08:31:25 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis Subject: [PATCH v11 5/5] xen/riscv: test basic exception handling stuff Date: Wed, 24 Jul 2024 17:31:19 +0200 Message-ID: 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: 1721835117221116600 Content-Type: text/plain; charset="utf-8" Introduces testing of some macros from . Also wraps this testing into SELF_TESTS config to not produce a noise in the log related to functionality testing ( in the current case, it is macros from xen/bug.h ) when CONFIG_SELF_TESTS is disabled. Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- 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