From nobody Tue Apr 30 07:59:28 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=1673880003; cv=none; d=zohomail.com; s=zohoarc; b=R3naZFspONKfMXlvC5WALzHPetDyQaGgxqIkhGTzLgaqLBVYJ3Ix1g8RcWMvpSC6O0vLKw4LlqgnIMU/wx5U79PrDHA9mYJS2/1wMOUurQ0ktozwHfDKDxEvWubh6EakWaJRzidgmyY7TYWdSHdnqGL9lrtjpNpZj5QgoThk+cQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673880003; 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=acnYUtdnwYpIYk/Tnrxms/hajM4oUKDgrFUUijudygw=; b=JjBlYPU3cQ5C4dUIHwEkGm5jUA7IgorD1ddPBsrSHPH7hKGthKdvXh0Nvwr2Kk01ILxB3H3Z3Dkf2fbka0YCw3u0rJK0XKQ+qN0buxHDNdDAo9DApw5E4dNgWmPFr6CauhmPTCdil5aoMrtRY0+xRrw8wpf2TnGDbhVlOgxBb+A= 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 1673880003861471.142425240169; Mon, 16 Jan 2023 06:40:03 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.478689.742064 (Exim 4.92) (envelope-from ) id 1pHQeI-0007Yd-Dk; Mon, 16 Jan 2023 14:39:46 +0000 Received: by outflank-mailman (output) from mailman id 478689.742064; Mon, 16 Jan 2023 14:39:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHQeI-0007Xz-9P; Mon, 16 Jan 2023 14:39:46 +0000 Received: by outflank-mailman (input) for mailman id 478689; Mon, 16 Jan 2023 14:39:44 +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 1pHQeG-0007HD-D8 for xen-devel@lists.xenproject.org; Mon, 16 Jan 2023 14:39:44 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9cc0f7fb-95ab-11ed-b8d0-410ff93cb8f0; Mon, 16 Jan 2023 15:39:42 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id k8so13185874wrc.9 for ; Mon, 16 Jan 2023 06:39:42 -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 m13-20020adfe94d000000b002714b3d2348sm26543406wrn.25.2023.01.16.06.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 06:39:41 -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: 9cc0f7fb-95ab-11ed-b8d0-410ff93cb8f0 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=acnYUtdnwYpIYk/Tnrxms/hajM4oUKDgrFUUijudygw=; b=cxG7BbmW5EXJNbhiyxD1yAxapzKZ7gMV68sns7gJQCN7WUJtlGmCflt02xwBi9E0QU XCIqlfgCTJnf4u4w2jNqppDx69EZXTos4ebt4L9RLfOxVmPXm37+o7y4ktUebM1POWh6 KC4wk9Y48hgQE831bQnbOTNvib59wbUtidFC+Yacqyi45gxRMuUkoWUXXrkUCgYc3dxY CVs6Nxsl9lR3bgfbjXAf3RQYRa7XzbPOLswZ5Ugfneb7lBKQVNVzzMZ1uVBR2/EMAO41 QD7pFAFYZ/6BXKTgxcWSqOgZgjWVhI4etdmBWh5iuBbmDKIH1rcd9hVmIBHlFncraUgP NHMw== 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=acnYUtdnwYpIYk/Tnrxms/hajM4oUKDgrFUUijudygw=; b=Arsk2hssVlloOF4NHyut+t9M30sZ3xOrQuxNN4GiDwSI6FdPSLbsQNUJIk4LUIU0yG dN64qWJg2jshCG7DWaShK/IxcLRc58cr4BvUwXlmt1j+Vlp/BmLmL0kZgqbiL1YwqpOV JWD1roRqUQXBpigZn2JN7vev1Jewm9z+6aURUNwcYwQ8u9BAeKia389Jf5PDq8NqJ0TF pCIlPSmZKbWajamDM3t4Xk2p35SQOoTGTKPiMa27geoOMzPfjY8ZF1cBtdNd/sb30yTr Q10zAkrJ4+lW0QyLvQKxMJ9nWh5gk7AR/gcCvcjPWWa3VHjWJPlKq6zcYhBhhzx1GCdQ yCHg== X-Gm-Message-State: AFqh2ko5wWDaVU7VfmOmxl0zPEKf5Rc7vFw7pRymxiLbcDAAWaIr80iB JYCeRREueqh92Qe+qqv4so7siOzq20JClQ== X-Google-Smtp-Source: AMrXdXvPGgIAD4uUIPtpMwYIG4Gu4t19pJZkcwzDCMxf2+lAo8E2HMSDR2iuZ9/T3wbfqQKphEZZZw== X-Received: by 2002:a05:6000:1c09:b0:2bd:eb6b:173a with SMTP id ba9-20020a0560001c0900b002bdeb6b173amr8447699wrb.36.1673879981399; Mon, 16 Jan 2023 06:39:41 -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 Subject: [PATCH v4 1/4] xen/riscv: introduce asm/types.h header file Date: Mon, 16 Jan 2023 16:39:29 +0200 Message-Id: <2ce57f95f8445a4880e0992668a48ffe7c2f9732.1673877778.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: 1673880004207100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko --- Changes in V4: - Clean up types in and remain only necessary. The following types was removed as they are defined in : {__|}{u|s}{8|16|32|64} --- Changes in V3: - Nothing changed --- Changes in V2: - Remove unneeded now types from --- xen/arch/riscv/include/asm/types.h | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 xen/arch/riscv/include/asm/types.h diff --git a/xen/arch/riscv/include/asm/types.h b/xen/arch/riscv/include/as= m/types.h new file mode 100644 index 0000000000..9e55bcf776 --- /dev/null +++ b/xen/arch/riscv/include/asm/types.h @@ -0,0 +1,43 @@ +#ifndef __RISCV_TYPES_H__ +#define __RISCV_TYPES_H__ + +#ifndef __ASSEMBLY__ + +#if defined(CONFIG_RISCV_32) +typedef unsigned long long u64; +typedef unsigned int u32; +typedef u32 vaddr_t; +#define PRIvaddr PRIx32 +typedef u64 paddr_t; +#define INVALID_PADDR (~0ULL) +#define PRIpaddr "016llx" +typedef u32 register_t; +#define PRIregister "x" +#elif defined (CONFIG_RISCV_64) +typedef unsigned long u64; +typedef u64 vaddr_t; +#define PRIvaddr PRIx64 +typedef u64 paddr_t; +#define INVALID_PADDR (~0UL) +#define PRIpaddr "016lx" +typedef u64 register_t; +#define PRIregister "lx" +#endif + +#if defined(__SIZE_TYPE__) +typedef __SIZE_TYPE__ size_t; +#else +typedef unsigned long size_t; +#endif + +#endif /* __ASSEMBLY__ */ + +#endif /* __RISCV_TYPES_H__ */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.39.0 From nobody Tue Apr 30 07:59:28 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=1673880001; cv=none; d=zohomail.com; s=zohoarc; b=UTP8iLCsXpz10J4Qs/T+uRFiix3rgfm1B4vnZwwVepJggEG/+equa8g9UolKvqSRTytZZBQC8vhWYtuhv1R9QhcHV5eXtYg3pDj/z1+dOmGZWXNDgBW2+5NARi+Q/ybk1lmB/Xkk4SlWRd4arjcVsC+eQpX3i7hpocUzHGq5TQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673880001; 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=nGpYf6LxU4uEJy+Cdd6qu2fGfvSKVdNlp4dIm9FxUs4=; b=QUwGwfJIzXOw1yyR8EL4pCdZWCvjUgkF9EEAmo4OZDfQ58xTKlHrMYAnJFXrfsxfrIpOelEiC7QzuJ4NQj1w24SMi3WttgFqAi4EndYH+kaeFXkjwGaqP2AjWcdEKUVK9TJJYId4EDkUxhE2QSi2oHIItW+fESJmJRwZovlpjx4= 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 1673880001962752.8720527709731; Mon, 16 Jan 2023 06:40:01 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.478688.742059 (Exim 4.92) (envelope-from ) id 1pHQeI-0007VI-3z; Mon, 16 Jan 2023 14:39:46 +0000 Received: by outflank-mailman (output) from mailman id 478688.742059; Mon, 16 Jan 2023 14:39:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHQeI-0007V9-0g; Mon, 16 Jan 2023 14:39:46 +0000 Received: by outflank-mailman (input) for mailman id 478688; Mon, 16 Jan 2023 14:39:44 +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 1pHQeF-0006p7-UJ for xen-devel@lists.xenproject.org; Mon, 16 Jan 2023 14:39:44 +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 9d50a2de-95ab-11ed-91b6-6bf2151ebd3b; Mon, 16 Jan 2023 15:39:43 +0100 (CET) Received: by mail-wr1-x42b.google.com with SMTP id h16so27672263wrz.12 for ; Mon, 16 Jan 2023 06:39:43 -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 m13-20020adfe94d000000b002714b3d2348sm26543406wrn.25.2023.01.16.06.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 06:39:42 -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: 9d50a2de-95ab-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=nGpYf6LxU4uEJy+Cdd6qu2fGfvSKVdNlp4dIm9FxUs4=; b=T8N0GA/dysWRLj7Ko3Fnf/XQRj681w1L3btZUpvFKOxateDpVbT1wEzj0MIk5x+jg0 MxpV5VnHEwrQamsNLZ66Ba83jhvmWNHGG+Tvd2ktj8LRH6XrR/dnVvQpdfxCWYjrgy4P DckrxAUVgvbqB+67oQLgShv0bDxrqb0Nlb8PUXDcsmNOtc2EM+65GJdF24rAKmj/aEuO 5w2Fx+Fe1PiDWAYKzmn4wabadfqqb0UgC5WORpQhAN/Hm/hweF6QBgu8AOW2BBdeoy/6 VUBL0jBlQ1s+Lh6jz0Ss5SwhloXBVbOQgLxXt+99P8cUfVBwzrDCHQ1KHN9Btr9/59oi E/HA== 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=nGpYf6LxU4uEJy+Cdd6qu2fGfvSKVdNlp4dIm9FxUs4=; b=gVPuprxeab9m5zCp4JhqVVAdj9TNV3YIXmq3Pa7JSsBlQLLUx6L4YFEZIhWA0QllaQ E9/FWUf+NIM9r0YBqhU1dW/DZFL8UVotdtxby8/GIopTzu/vu1Z6N3Z58t1ZRyhTAqmI MNG0up05M+SRrFLYxYH7lNYYbu8irsMgYW3a9YRo/tXdxLtJ1tcCYNpxfH3/QOgeen2A rDrR7a7qclkyVX7uqKFwgxhyBaeiZlI+n705d7Ll5JhaTnkLVGyhCjArPBWC4in9YGIb D9Bki49ij5AMNPeZccXhdNQDJ33If0Eryot7VRnvz+vKzb7bgwdRHNEVANhKIduPLMZ8 Xreg== X-Gm-Message-State: AFqh2kqv5wmoIdc9diRPTrLmhqipkHAMheEfuHIlH1IlYPC1yOD/dh1k 2P3zzUN7w5TNB43eXb6nqhYOGCjQpZi5yFI1 X-Google-Smtp-Source: AMrXdXt35P4U71YQyf2Eybb0C5+zogQ54iq2A107z2uodb0OvOYzUUJqxYGryK9RlyjBSFhwzidJgw== X-Received: by 2002:a5d:6784:0:b0:2bc:7f48:4cf0 with SMTP id v4-20020a5d6784000000b002bc7f484cf0mr17942914wru.63.1673879982332; Mon, 16 Jan 2023 06:39:42 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Bobby Eshleman , Bob Eshleman , Alistair Francis , Connor Davis , Oleksii Kurochko Subject: [PATCH v4 2/4] xen/riscv: introduce sbi call to putchar to console Date: Mon, 16 Jan 2023 16:39:30 +0200 Message-Id: <06ad9f6c8cbc87284ef4ecd4b85d9c7df33bd2c1.1673877778.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: 1673880002172100001 Content-Type: text/plain; charset="utf-8" From: Bobby Eshleman Originally SBI implementation for Xen was introduced by Bobby Eshleman but it was removed all the stuff for simplicity except SBI call for putting character to console. The patch introduces sbi_putchar() SBI call which is necessary to implement initial early_printk. Signed-off-by: Bobby Eshleman Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis Reviewed-by: Bobby Eshleman --- Changes in V4: - Nothing changed --- Changes in V3: - update copyright's year - rename definition of __CPU_SBI_H__ to __ASM_RISCV_SBI_H__ - fix identations - change an author of the commit --- Changes in V2: - add an explanatory comment about sbi_console_putchar() function. - order the files alphabetically in Makefile --- xen/arch/riscv/Makefile | 1 + xen/arch/riscv/include/asm/sbi.h | 34 ++++++++++++++++++++++++ xen/arch/riscv/sbi.c | 45 ++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 xen/arch/riscv/include/asm/sbi.h create mode 100644 xen/arch/riscv/sbi.c diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile index 5a67a3f493..fd916e1004 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_RISCV_64) +=3D riscv64/ +obj-y +=3D sbi.o obj-y +=3D setup.o =20 $(TARGET): $(TARGET)-syms diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/= sbi.h new file mode 100644 index 0000000000..0e6820a4ed --- /dev/null +++ b/xen/arch/riscv/include/asm/sbi.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: (GPL-2.0-or-later) */ +/* + * Copyright (c) 2021-2023 Vates SAS. + * + * Taken from xvisor, modified by Bobby Eshleman (bobby.eshleman@gmail.com= ). + * + * Taken/modified from Xvisor project with the following copyright: + * + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + */ + +#ifndef __ASM_RISCV_SBI_H__ +#define __ASM_RISCV_SBI_H__ + +#define SBI_EXT_0_1_CONSOLE_PUTCHAR 0x1 + +struct sbiret { + long error; + long value; +}; + +struct sbiret sbi_ecall(unsigned long ext, unsigned long fid, + unsigned long arg0, unsigned long arg1, + unsigned long arg2, unsigned long arg3, + unsigned long arg4, unsigned long arg5); + +/** + * Writes given character to the console device. + * + * @param ch The data to be written to the console. + */ +void sbi_console_putchar(int ch); + +#endif /* __ASM_RISCV_SBI_H__ */ diff --git a/xen/arch/riscv/sbi.c b/xen/arch/riscv/sbi.c new file mode 100644 index 0000000000..dc0eb44bc6 --- /dev/null +++ b/xen/arch/riscv/sbi.c @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Taken and modified from the xvisor project with the copyright Copyright= (c) + * 2019 Western Digital Corporation or its affiliates and author Anup Patel + * (anup.patel@wdc.com). + * + * Modified by Bobby Eshleman (bobby.eshleman@gmail.com). + * + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + * Copyright (c) 2021-2023 Vates SAS. + */ + +#include +#include + +struct sbiret sbi_ecall(unsigned long ext, unsigned long fid, + unsigned long arg0, unsigned long arg1, + unsigned long arg2, unsigned long arg3, + unsigned long arg4, unsigned long arg5) +{ + struct sbiret ret; + + register unsigned long a0 asm ("a0") =3D arg0; + register unsigned long a1 asm ("a1") =3D arg1; + register unsigned long a2 asm ("a2") =3D arg2; + register unsigned long a3 asm ("a3") =3D arg3; + register unsigned long a4 asm ("a4") =3D arg4; + register unsigned long a5 asm ("a5") =3D arg5; + register unsigned long a6 asm ("a6") =3D fid; + register unsigned long a7 asm ("a7") =3D ext; + + asm volatile ("ecall" + : "+r" (a0), "+r" (a1) + : "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), "r" (a7) + : "memory"); + ret.error =3D a0; + ret.value =3D a1; + + return ret; +} + +void sbi_console_putchar(int ch) +{ + sbi_ecall(SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, ch, 0, 0, 0, 0, 0); +} --=20 2.39.0 From nobody Tue Apr 30 07:59:28 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=1673880005; cv=none; d=zohomail.com; s=zohoarc; b=a1AplCNPwDyMUCoU+N9iyNUOMiDjHLEQwDi6YEFs4kURjCV01ziJ3yoCDEuHJbz4L8H20XgjP9LNHG02tGT/5cZaAnHyzQaZDt2NN8jtELHJUO8SxrmApl5oFDKgtQVZg7yEGuvta2Cq61/3HgX9lk64dZL3SQN4CEoxAOZZE8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673880005; 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=ht+yXJXCQ416rH9qG+XVpEx3bPoAaETeI1O2ZSFKNnE=; b=JNf07u3z0dXDvPcRr60N/5K3gnQg/rD9AyadinQwTGLLODqk01wP8/Wf9qw9IRmEPQ1CXMQ+mGP6IxPufyNTdrqgMmYrTbHne6c73C0eZIRST/Dw/uMo/k5Bg+ie/qdeRbbUJB9gVLH6wqiDxwDu+Yh0Aj85049xYAuLfpLE/p0= 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 1673880005503802.3146598025436; Mon, 16 Jan 2023 06:40:05 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.478690.742081 (Exim 4.92) (envelope-from ) id 1pHQeJ-0007zX-Sw; Mon, 16 Jan 2023 14:39:47 +0000 Received: by outflank-mailman (output) from mailman id 478690.742081; Mon, 16 Jan 2023 14:39:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHQeJ-0007xu-OA; Mon, 16 Jan 2023 14:39:47 +0000 Received: by outflank-mailman (input) for mailman id 478690; Mon, 16 Jan 2023 14:39:46 +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 1pHQeI-0007HD-73 for xen-devel@lists.xenproject.org; Mon, 16 Jan 2023 14:39:46 +0000 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [2a00:1450:4864:20::430]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9de12272-95ab-11ed-b8d0-410ff93cb8f0; Mon, 16 Jan 2023 15:39:44 +0100 (CET) Received: by mail-wr1-x430.google.com with SMTP id r2so27680620wrv.7 for ; Mon, 16 Jan 2023 06:39:44 -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 m13-20020adfe94d000000b002714b3d2348sm26543406wrn.25.2023.01.16.06.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 06:39:42 -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: 9de12272-95ab-11ed-b8d0-410ff93cb8f0 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=ht+yXJXCQ416rH9qG+XVpEx3bPoAaETeI1O2ZSFKNnE=; b=UUWnka02cSQQtVrEyziF41obENY8bhSj51iQ0Vz9CybDkAIVsGwYXjCoPHEw5Gm3UK KCGUaN1F0fm5awItPipqA2tyhtE+TR9dIk4eF4BueY4cVQccLzydc8sRP4429zPpza3c eujOg9PFQsdpSEpDhBnfwUu7HNshJ5dD+OmretWGFmLUh+9csJ+oP/WR4b4VZZp8kcU5 NoaVIsK6rvzUMwEvS4ptp0pkOUbzPewNTRLRAuOHxvlOa4kiS4kTJISBJ2XUyci810qK qIBVaT4FWAuyyfUgjjQmJMEaaV/2JR3O7SKY/wxWjgrclt2VXzNaepIWjUDVHDbxblB3 fTwg== 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=ht+yXJXCQ416rH9qG+XVpEx3bPoAaETeI1O2ZSFKNnE=; b=G9sLeWvFdacIgrlLAGK61Olwtntt+RAWNk2oxpgbbNWxUSOcGQgTuomcTehOVkhb7T bFH4uWDBL9t4UObMDMN7qCDHeda06qOtC73wyhQ6J/oOkpXygmqUEAkQAosiaZddEpFR U+PhXFneddAs+uD0bmkTB6ubj3w3gaMPFGk9ipi/aBvaU00l3uPBEXKfmxx9P8XeXm2D LW621bcfONjCguan9F4ekGRKBH1TvCLLZjY6fbr3pTfslrakt3K82TDkQEc5aU1dqkKA l/k6d2GNjt2LuzVhgt6Gl+DouRhdAWWYMwILmNmJ9h8qTJ0iQnpXEM80mDaab41UICOA /Mqw== X-Gm-Message-State: AFqh2koiA44E6V0uedxT4TtF1rDtNZ/Eu4zIC8zFUxDy4Ce8GA5qZvuk 4fB2rWjWg1nbcRpBDpWqiqL3o4TY3DjB8Q== X-Google-Smtp-Source: AMrXdXuvKN+KpsWx1NAJ0UyAmvRb8fksqDc6ChVgzirE65cUacUYQ5kZPsvDdu2nCkr3QoIszEBDnA== X-Received: by 2002:a05:6000:a0e:b0:2bd:fdd8:2d0a with SMTP id co14-20020a0560000a0e00b002bdfdd82d0amr5175166wrb.40.1673879983306; Mon, 16 Jan 2023 06:39:43 -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 v4 3/4] xen/riscv: introduce early_printk basic stuff Date: Mon, 16 Jan 2023 16:39:31 +0200 Message-Id: <915bd184c6648a1a3bf0ac6a79b5274972bb33dd.1673877778.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: 1673880006216100007 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 --- 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 | 6 +++ xen/arch/riscv/Makefile | 1 + xen/arch/riscv/early_printk.c | 45 +++++++++++++++++++++++ xen/arch/riscv/include/asm/early_printk.h | 12 ++++++ xen/arch/riscv/setup.c | 6 ++- 5 files changed, 69 insertions(+), 1 deletion(-) 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..e139e44873 100644 --- a/xen/arch/riscv/Kconfig.debug +++ b/xen/arch/riscv/Kconfig.debug @@ -0,0 +1,6 @@ +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..6bc29a1942 --- /dev/null +++ b/xen/arch/riscv/early_printk.c @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * RISC-V early printk using SBI + * + * Copyright (C) 2021 Bobby Eshleman + */ +#include +#include + +/* + * early_*() can be called from head.S with MMU-off. + * + * The following requiremets should be honoured for early_*() to + * work correctly: + * It should use PC-relative addressing for accessing symbols. + * To achieve that GCC cmodel=3Dmedany should be used. + */ +#ifndef __riscv_cmodel_medany +#error "early_*() can be called from head.S before relocate so it should n= ot use absolute addressing." +#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..9c9412152a 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -1,13 +1,17 @@ #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) { - for ( ;; ) + early_printk("Hello from C env\n"); + + for ( ; ; ) asm volatile ("wfi"); =20 unreachable(); --=20 2.39.0 From nobody Tue Apr 30 07:59:28 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=1673880006; cv=none; d=zohomail.com; s=zohoarc; b=mDiP8ozmPLW9Iy+/q2CI5l+Ljh0DyBxGiUasXM4kFRaHP5Ge15iKp2OXBeFzXnb3leOHPbg7emQE/hjTcbwrl45Ob59/Qbz6PP+DxZdnSl873Env5QIincaRIIq5Rm8tnBOPGYA7ay82WfYAF5T4j+FfogXGZsKMjmcaqJ1D1Q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673880006; 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=ctVbfTUMTOLN4KM620LAPIxTZt2tk9IeJCHpD6YNn4Y=; b=EqU/aS9TLQJs9S/zn40kSNqWmW4yXiZNiy3u/R//LtwcQ6hcF80/LY0WyLaOL3ozkHeqwza7gHz+fwndgvjP7Llj2HgweT78NhqXNZDKl2WC8RG07GZmhXHjuvIj5bonSvb0gZ3wpOnXeGRgbSZGJfRAJI3rZxJdq1R5nHF5mCs= 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 1673880006762561.7777689202403; Mon, 16 Jan 2023 06:40:06 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.478691.742085 (Exim 4.92) (envelope-from ) id 1pHQeK-000873-BN; Mon, 16 Jan 2023 14:39:48 +0000 Received: by outflank-mailman (output) from mailman id 478691.742085; Mon, 16 Jan 2023 14:39:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHQeK-00085M-5G; Mon, 16 Jan 2023 14:39:48 +0000 Received: by outflank-mailman (input) for mailman id 478691; Mon, 16 Jan 2023 14:39:46 +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 1pHQeI-0007HD-Py for xen-devel@lists.xenproject.org; Mon, 16 Jan 2023 14:39:46 +0000 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [2a00:1450:4864:20::435]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9e641c21-95ab-11ed-b8d0-410ff93cb8f0; Mon, 16 Jan 2023 15:39:44 +0100 (CET) Received: by mail-wr1-x435.google.com with SMTP id r2so27680660wrv.7 for ; Mon, 16 Jan 2023 06:39:44 -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 m13-20020adfe94d000000b002714b3d2348sm26543406wrn.25.2023.01.16.06.39.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 06:39:43 -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: 9e641c21-95ab-11ed-b8d0-410ff93cb8f0 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=ctVbfTUMTOLN4KM620LAPIxTZt2tk9IeJCHpD6YNn4Y=; b=au2GRLGAWzB4NTiOMuF6peJns9v9FtsJ7/vNiy2ohSvXtl/YXaQaHxIte82snMoQeT q/0DzAUSwsggzsN5BxQIADDMQrbkICIWQnoziFZDZBIPPH7ZHDyXzRThtDnZarSLIfZ6 3w4xkvX1nQAmi47lGm5re5B72ZP+dz9KwYRaMP/2HfHwHdlx+GcsP3+R2b+tCCQ6zutW EfP3e/qS8YXhQJ19wItDmI8U/WAzyHvBkH5cKzls4pKQWVgB1mdxAf7fN2waKLo1z+Le ySIoywsxmov7eLs/Wkp1HwlGn0J5SppWvNmIFS37K///E11mTfWAaxryHPXmvhxAr0bu 7ctg== 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=ctVbfTUMTOLN4KM620LAPIxTZt2tk9IeJCHpD6YNn4Y=; b=gtLiaK2FKlVsMmaP+bRPPiIB64SyyHUk1QfBMn9QfFd+YcGxaF2fPLYPb0pZzWA7Mz Qi3X93IateaM1wHvA2PmVxE3eQmwZIZ7Y9gDF9JVVOCQz7CsgHDiTKHQw1SNYGGJWAxC xLdFSbyIBmDkZ2Es8T/N7ZNhBXGM7Ji1zpFq800S2fuGuLLLB92DveZQkRwb1Bt2ZwnK FWpyKhjwzQJDYEPEslT/cfks//vk0QkNSiCh+1zzpDO1GGAyC5n4NAEGyyfGPWCGLrjr hFcem1GVh1ySkMCpVtcKQn1HYOlZXLDCv56z/4LeMmKkei3WRAe8Wg/gED4JHvmDh8ER yJNg== X-Gm-Message-State: AFqh2koNO1GlsmzpaAQIrcL8XgVdXEpN8I+ObEqJbNRAPnE3QKsCxdb+ gktvLGDKQ3WFCCrXVM16+3pxtlUVbraolA== X-Google-Smtp-Source: AMrXdXv30T+VZFurwDb3EsXFT8D5iQtuvT08anQ4bGLUGXwDowZg4hrvyQx4T+1SlvSSXi6sWKCO+A== X-Received: by 2002:a5d:51c2:0:b0:2bd:e007:c54f with SMTP id n2-20020a5d51c2000000b002bde007c54fmr9822705wrv.57.1673879984230; Mon, 16 Jan 2023 06:39:44 -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 Subject: [PATCH v4 4/4] automation: add RISC-V smoke test Date: Mon, 16 Jan 2023 16:39:32 +0200 Message-Id: <216c21039a5552a329178b4376ff53ba16cf6104.1673877778.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: 1673880008248100009 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 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..64f47a0ab9 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: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: + - riscv64-cross-gcc + # 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