From nobody Sat May 4 15:22:01 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=1675774175; cv=none; d=zohomail.com; s=zohoarc; b=dB8ZF6UaH3yBLJIjSDg1mWklukmEb9LgF7rwatx8DSU3UzlhQeci3F0zEDyVbvPOPK7WmmVTPFu4nYna/bmAEKWjmx3964Pa61lDeOxh4CA6EDOqQKQpgDg5aHmBbxfJhVMyhmajXFbg6xt8JvDk3BkiYG2v/1pmoi2J2Dlu6Tw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675774175; 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=dQfYQAH/vtqOvI/GxwDEsygPxurjtVig+mWnpoag/DE=; b=eKA0/osUlhg9wNRCnvVFORs/j7D98Zj++IkPgMk4cDR6CAysFEQXeX2xzoNFQt+6/HSEgy8tAxPltOENdc2f3ewH4t4CwE7YImKibbPTvzaHk0Tim3By/xKbDd+ZdlHOGF4dhSQf2n+IRXo5z28pfhE/FowjHemV7mLXNcF02J8= 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 1675774175336471.3035423276672; Tue, 7 Feb 2023 04:49:35 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.491102.760074 (Exim 4.92) (envelope-from ) id 1pPNPP-0003a5-Q1; Tue, 07 Feb 2023 12:49:15 +0000 Received: by outflank-mailman (output) from mailman id 491102.760074; Tue, 07 Feb 2023 12:49:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pPNPP-0003Zy-Ms; Tue, 07 Feb 2023 12:49:15 +0000 Received: by outflank-mailman (input) for mailman id 491102; Tue, 07 Feb 2023 12:49:13 +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 1pPNPN-0003Jc-OW for xen-devel@lists.xenproject.org; Tue, 07 Feb 2023 12:49:13 +0000 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [2a00:1450:4864:20::42b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d298f1ab-a6e5-11ed-933c-83870f6b2ba8; Tue, 07 Feb 2023 13:49:13 +0100 (CET) Received: by mail-wr1-x42b.google.com with SMTP id y1so13453593wru.2 for ; Tue, 07 Feb 2023 04:49:13 -0800 (PST) Received: from 34-6F-24-FC-D2-65.. (46.204.109.85.nat.umts.dynamic.t-mobile.pl. [46.204.109.85]) by smtp.gmail.com with ESMTPSA id p10-20020a5d59aa000000b002be5401ef5fsm11468388wrr.39.2023.02.07.04.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 04:49:12 -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: d298f1ab-a6e5-11ed-933c-83870f6b2ba8 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=dQfYQAH/vtqOvI/GxwDEsygPxurjtVig+mWnpoag/DE=; b=m8Yb+st4y9Hj54obFB6mNuAk/JsAkM+nJsdBB4aRDGQn6L0yxEMANmx56PoAE1064u vk3WzXYrk0rqYO4sHnAxET5/NcjyqZKRpfXO2YCFkwOjXWkVi+qjxD5m9O7rDmxOAKXV RD7Kc+eomFQFQ9tyFBs/wk4nZd4XL0kCUqenvRSo2D4FB0sqI5SaXvN+kWMM/CValrOA +9pegrO+cv5UVa3eOIcAMXIm+B1QehzDu/koMbDpNhlFz02I7L70I2WDSuyMAar/rjjD kAbw0oLBZzQuGs49adnuo8/CPsNUa4tBJzRp1gHCqFsDrO6zEcQgTnquIhvedGoBHbeG srwg== 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=dQfYQAH/vtqOvI/GxwDEsygPxurjtVig+mWnpoag/DE=; b=shL+/q0bO7xd2iGMs8mjGPJszBYub+YyoKRdb5ij9WbrfgvchRNaphZ7dE0Iwn6eeK h8ABxg7Iz1lBpFONFZyftwq/L50wMW+iAoinjbnZfOE8D0rZmlk//wTZw2hxGlpIbn0W THPnFoLypScVO7enK8PMQKMHmOS0uTuBmRREi68m+4i+oAWuu980ekPoy6/s+plzCFSZ TFBCEepkJZreqGIePnW7pPv9091chXFI9JotHeRDxqzZkUs+r6EuYtVf3DMbY+t+51Je iSQnNsNcePDfLN78qnPVCNPuha/nSIiW+aQZHYY94M/fth8Vt4/fNq1v4L7tiF9DkpE4 eSww== X-Gm-Message-State: AO0yUKWXDbk2Jhpwqxqib+bwE0y3vMsnyBhKxqO+jOt13H795nfiuUQL d0K4dWliNqJheYtyaKr/N93LGScbdms= X-Google-Smtp-Source: AK7set9AZVnmhxwKoONs8lAr2Wqo/5905kHTVilAQJnoJrvaQgnDPcG1vZerf5YHa44yrjbuo3ZmCQ== X-Received: by 2002:adf:df84:0:b0:2bf:b7e3:6d62 with SMTP id z4-20020adfdf84000000b002bfb7e36d62mr2945922wrl.5.1675774152401; Tue, 07 Feb 2023 04:49:12 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis , Bobby Eshleman Subject: [PATCH v10 1/2] xen/riscv: introduce early_printk basic stuff Date: Tue, 7 Feb 2023 14:49:05 +0200 Message-Id: <15e29bb67e9dc0a24811c02c8ef6965523dac27e.1675773832.git.oleksii.kurochko@gmail.com> 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: 1675774176128100001 Content-Type: text/plain; charset="utf-8" Because printk() relies on a serial driver (like the ns16550 driver) and drivers require working virtual memory (ioremap()) there is not print functionality early in Xen boot. The patch introduces the basic stuff of early_printk functionality which will be enough to print 'hello from C environment". Originally early_printk.{c,h} was introduced by Bobby Eshleman (https://github.com/glg-rv/xen/commit/a3c9916bbdff7ad6030055bbee7e53d1aab71= 384) but some functionality was changed: early_printk() function was changed in comparison with the original as common isn't being built now so there is no vscnprintf. This commit adds early printk implementation built on the putc SBI call. As sbi_console_putchar() is already being planned for deprecation it is used temporarily now and will be removed or reworked after real uart will be ready. Signed-off-by: Bobby Eshleman Signed-off-by: Oleksii Kurochko Reviewed-by: Bobby Eshleman Reviewed-by: Alistair Francis --- Changes in V10: - Miss to add the check in V9 so add it in V10 --- Changes in V9: - Bring "cmodel=3Dmedany" check back to be sure that C function is safe= to be called in early boot when MMU is off ( e.g. VA !=3D PA )=20 --- Changes in V8: - Nothing was changed --- Changes in V7: - Nothing was changed --- Changes in V6: - Remove __riscv_cmodel_medany check from early_printk.c --- Changes in V5: - Code style fixes - Change an error message of #error in case of __riscv_cmodel_medany isn't defined --- Changes in V4: - Remove "depends on RISCV*" from Kconfig.debug as it is located in arch specific folder so by default RISCV configs should be ebabled. - Add "ifdef __riscv_cmodel_medany" to be sure that PC-relative address= ing is used as early_*() functions can be called from head.S with MMU-off= and before relocation (if it would be needed at all for RISC-V) - fix code style --- Changes in V3: - reorder headers in alphabetical order - merge changes related to start_xen() function from "[PATCH v2 7/8] xen/riscv: print hello message from C env" to this patch - remove unneeded parentheses in definition of STACK_SIZE --- Changes in V2: - introduce STACK_SIZE define. - use consistent padding between instruction mnemonic and operand(s) --- xen/arch/riscv/Kconfig.debug | 5 +++ xen/arch/riscv/Makefile | 1 + xen/arch/riscv/early_printk.c | 44 +++++++++++++++++++++++ xen/arch/riscv/include/asm/early_printk.h | 12 +++++++ xen/arch/riscv/setup.c | 4 +++ 5 files changed, 66 insertions(+) create mode 100644 xen/arch/riscv/early_printk.c create mode 100644 xen/arch/riscv/include/asm/early_printk.h diff --git a/xen/arch/riscv/Kconfig.debug b/xen/arch/riscv/Kconfig.debug index e69de29bb2..608c9ff832 100644 --- a/xen/arch/riscv/Kconfig.debug +++ b/xen/arch/riscv/Kconfig.debug @@ -0,0 +1,5 @@ +config EARLY_PRINTK + bool "Enable early printk" + default DEBUG + help + Enables early printk debug messages diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile index fd916e1004..1a4f1a6015 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.o obj-$(CONFIG_RISCV_64) +=3D riscv64/ obj-y +=3D sbi.o obj-y +=3D setup.o diff --git a/xen/arch/riscv/early_printk.c b/xen/arch/riscv/early_printk.c new file mode 100644 index 0000000000..dfe4ad77e2 --- /dev/null +++ b/xen/arch/riscv/early_printk.c @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * RISC-V early printk using SBI + * + * Copyright (C) 2021 Bobby Eshleman + */ +#include +#include + +/* + * When the MMU is off during early boot, any C function called has to + * use PC-relative rather than absolute address because the physical addre= ss + * may not match the virtual address. + * + * To guarantee PC-relative address cmodel=3Dmedany should be used + */ +#ifndef __riscv_cmodel_medany +#error "early_*() can be called from head.S with MMU-off" +#endif + +/* + * TODO: + * sbi_console_putchar is already planned for deprecation + * so it should be reworked to use UART directly. +*/ +void early_puts(const char *s, size_t nr) +{ + while ( nr-- > 0 ) + { + if ( *s =3D=3D '\n' ) + sbi_console_putchar('\r'); + sbi_console_putchar(*s); + s++; + } +} + +void early_printk(const char *str) +{ + while ( *str ) + { + early_puts(str, 1); + str++; + } +} diff --git a/xen/arch/riscv/include/asm/early_printk.h b/xen/arch/riscv/inc= lude/asm/early_printk.h new file mode 100644 index 0000000000..05106e160d --- /dev/null +++ b/xen/arch/riscv/include/asm/early_printk.h @@ -0,0 +1,12 @@ +#ifndef __EARLY_PRINTK_H__ +#define __EARLY_PRINTK_H__ + +#include + +#ifdef CONFIG_EARLY_PRINTK +void early_printk(const char *str); +#else +static inline void early_printk(const char *s) {}; +#endif + +#endif /* __EARLY_PRINTK_H__ */ diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 13e24e2fe1..d09ffe1454 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -1,12 +1,16 @@ #include #include =20 +#include + /* Xen stack for bringing up the first CPU. */ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE); =20 void __init noreturn start_xen(void) { + early_printk("Hello from C env\n"); + for ( ;; ) asm volatile ("wfi"); =20 --=20 2.39.0 From nobody Sat May 4 15:22:01 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=1675774190; cv=none; d=zohomail.com; s=zohoarc; b=etvzuV+Gpln1MqMnNEfQiVRw2NcI3JTSCCVE37YpphoDPriGHEbFj5/jZjdavD/mwX1ekifq2TMFMzupZg3GdvYICs5VdKVWO4i1AhkzUcp0F7eIj0U6MEmcwp6bp+xE8fV/7rZMTXexEgRiCaV9G8E2goSLJLzTX2bgE2tdX98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675774190; 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=MP+WeNW2jc2Ok92hlipZzRTFVcDRlzwQA/TTq4v+O/I=; b=Qf614NBEaX4DXY08SiWBA4wpgT71WD0fV6NcmNkczs2qA2G9C8xQ/bW3Iy9e6iTNVklIa/zdeBcXVuuwjjaWIiFibTsSaUJdk23Qxn3T3jSGUv6MfJYEs+JPfVYK/cYhmsYjvjbbstZuRlFVB9O3FbyB8G/NwfWqvahUM3CC4m0= 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 1675774189966647.9609564469521; Tue, 7 Feb 2023 04:49:49 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.491104.760085 (Exim 4.92) (envelope-from ) id 1pPNPj-00048Q-23; Tue, 07 Feb 2023 12:49:35 +0000 Received: by outflank-mailman (output) from mailman id 491104.760085; Tue, 07 Feb 2023 12:49:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pPNPi-00048J-Uy; Tue, 07 Feb 2023 12:49:34 +0000 Received: by outflank-mailman (input) for mailman id 491104; Tue, 07 Feb 2023 12:49:33 +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 1pPNPh-00046W-Ip for xen-devel@lists.xenproject.org; Tue, 07 Feb 2023 12:49:33 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d3771746-a6e5-11ed-93b5-47a8fe42b414; Tue, 07 Feb 2023 13:49:14 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id m14so13402669wrg.13 for ; Tue, 07 Feb 2023 04:49:14 -0800 (PST) Received: from 34-6F-24-FC-D2-65.. (46.204.109.85.nat.umts.dynamic.t-mobile.pl. [46.204.109.85]) by smtp.gmail.com with ESMTPSA id p10-20020a5d59aa000000b002be5401ef5fsm11468388wrr.39.2023.02.07.04.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 04:49: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: d3771746-a6e5-11ed-93b5-47a8fe42b414 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=MP+WeNW2jc2Ok92hlipZzRTFVcDRlzwQA/TTq4v+O/I=; b=ijge2m1L8mXGIjmudIc0kU36fafmyR/aA+gnU75YYhci+1GJAh2iHTGPrsfB9PCgQR qA0oY29GZS/BkzZrhDfh1iPudMganyHhPN56pW1cm9SFN4g+ThZEcdLKf9R3rnQ66lCp 8/dFSjHslmPOB6k1i+RdkVDcNjgg7ds4dKSA1eWyespJtmO4mRSCeDlI2uB9zb16WR9F yyAcbiqWih2kTKVSJTAevIzRC1xTyQi2gmwqnPV4mUeW5dKkBr4KoVLyyOlMP96F3ZRj sdShClQl/CPXEGeLfFxD1leWexz6Du2OWR9NA8ZiwKOvMOyenAYjeZh9TUzysaoWkiq5 7Q+w== 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=MP+WeNW2jc2Ok92hlipZzRTFVcDRlzwQA/TTq4v+O/I=; b=lBq47cpoHFZSEW1JZxxZ8jbLLdxyMJRtf2fd+blOIQq2uum3SeSVgmxF4twd934tzi ZrhW8uu8L3+94O338FFg8GYXEZgayw/nz+rwZQ2cKyNEEpClznw9IVYu/ISXnxUoR1Mj oryHHzm8Hyr48AvqHSSvPDL/CtOta1TJYf/8tcW/hkQpNf5BhiwDQT8jYeWGRubbj1c5 c2+qtpDaH1RiqF01nAT3ootz+3hXR2uGDjAPSx1H0vk07g7uha7Z3Hoj5gY5q03RM2zE /fSlBDYxGr4RccPwU915wFCQ5NpDHi/ocXBrmrcmEMn979HCgXd+CGqtSCxOHOpSmQb/ gIrA== X-Gm-Message-State: AO0yUKWWlLk0QddQnE37/txi00zkdPszbnZIRB6RTsYMn3WSJEFWYJ1t 2N9Fo/1cnxM30Cd8fNU0kgzPGE1LzZo= X-Google-Smtp-Source: AK7set+kc0WyAA33aAL78wgvE70Jl4mTk0DiCw/XKoqzJFSDdDbHgAgdleQvK2l+g3dGOc4T6IKK6w== X-Received: by 2002:adf:f5cd:0:b0:2c3:eff9:292e with SMTP id k13-20020adff5cd000000b002c3eff9292emr2757817wrp.22.1675774153845; Tue, 07 Feb 2023 04:49:13 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Doug Goldstein , Alistair Francis Subject: [PATCH v10 2/2] automation: add RISC-V smoke test Date: Tue, 7 Feb 2023 14:49:06 +0200 Message-Id: <50fb97738c628108c2304856cc9755a83860fde9.1675773832.git.oleksii.kurochko@gmail.com> 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: 1675774191929100001 Content-Type: text/plain; charset="utf-8" Add check if there is a message 'Hello from C env' presents in log file to be sure that stack is set and C part of early printk is working. Signed-off-by: Oleksii Kurochko Acked-by: Stefano Stabellini Reviewed-by: Alistair Francis --- Changes in V10: - Nothing changed --- Changes in V9: - Nothing changed --- Changes in V8: - Set "needs: archlinux-current-gcc-riscv64-debug" in test.yaml for RISCV job as CONFIG_EARLY_PRINTK is available only when CONFIG_DEBUG is available. --- Changes in V7: - Fix dependecy for qemu-smoke-riscv64-gcc job --- Changes in V6: - Rename container name in test.yaml for .qemu-riscv64. --- Changes in V5: - Nothing changed --- Changes in V4: - Nothing changed --- Changes in V3: - Nothing changed - All mentioned comments by Stefano in Xen mailing list will be fixed as a separate patch out of this patch series. --- automation/gitlab-ci/test.yaml | 20 ++++++++++++++++++++ automation/scripts/qemu-smoke-riscv64.sh | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 automation/scripts/qemu-smoke-riscv64.sh diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index afd80adfe1..ce543ef5c0 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -54,6 +54,19 @@ tags: - x86_64 =20 +.qemu-riscv64: + extends: .test-jobs-common + variables: + CONTAINER: archlinux:current-riscv64 + LOGFILE: qemu-smoke-riscv64.log + artifacts: + paths: + - smoke.serial + - '*.log' + when: always + tags: + - x86_64 + .yocto-test: extends: .test-jobs-common script: @@ -234,6 +247,13 @@ qemu-smoke-x86-64-clang-pvh: needs: - debian-unstable-clang-debug =20 +qemu-smoke-riscv64-gcc: + extends: .qemu-riscv64 + script: + - ./automation/scripts/qemu-smoke-riscv64.sh 2>&1 | tee ${LOGFILE} + needs: + - archlinux-current-gcc-riscv64-debug + # Yocto test jobs yocto-qemuarm64: extends: .yocto-test-arm64 diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/= qemu-smoke-riscv64.sh new file mode 100755 index 0000000000..e0f06360bc --- /dev/null +++ b/automation/scripts/qemu-smoke-riscv64.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -ex + +# Run the test +rm -f smoke.serial +set +e + +timeout -k 1 2 \ +qemu-system-riscv64 \ + -M virt \ + -smp 1 \ + -nographic \ + -m 2g \ + -kernel binaries/xen \ + |& tee smoke.serial + +set -e +(grep -q "Hello from C env" smoke.serial) || exit 1 +exit 0 --=20 2.39.0