From patchwork Thu Jan 19 14:07:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13108078 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 E395AC004D4 for ; Thu, 19 Jan 2023 14:07:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.481130.745827 (Exim 4.92) (envelope-from ) id 1pIVZp-000316-39; Thu, 19 Jan 2023 14:07:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 481130.745827; Thu, 19 Jan 2023 14:07:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIVZo-00030Y-VG; Thu, 19 Jan 2023 14:07:36 +0000 Received: by outflank-mailman (input) for mailman id 481130; Thu, 19 Jan 2023 14:07:36 +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 1pIVZn-0002xN-Vk for xen-devel@lists.xenproject.org; Thu, 19 Jan 2023 14:07:35 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9f1c5990-9802-11ed-91b6-6bf2151ebd3b; Thu, 19 Jan 2023 15:07:34 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id g10so1638897wmo.1 for ; Thu, 19 Jan 2023 06:07:34 -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 m27-20020a05600c3b1b00b003db012d49b7sm7710178wms.2.2023.01.19.06.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 06:07:33 -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: 9f1c5990-9802-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=jw5z92GdwkOpMq67zyGgBHYZBK1yWuFbI322wDA/UW4=; b=hVoM7hPlhAeqWlT93JqTd1mxy1MsnUUU2u7L66yRzLAxRgy3fbB0xK+Ag+jaWpnEDQ j6ywgy3AsgCY15Olqg4eeG3ajTdinCyRgbXyzl4ZPnlqt1qaAF4l8OpzF9jcSuISSoTR IreTmWgq5OF9q2BJm9ukVHDDobwpxr2asdhajUwIqOZlwwq4m5bOGUnlwoGbUbPA1D8h HX4yybvyxMcOg8jOGpaRFFxCtqGczcFADQNCgGVOVajY2bhlmpsZ/FcZMSaNPatd8N5I XFrm/DijyCg3WfBwhZR5Lp5fLybIFNWjIqK3dbuwwMgz3e/Ydgyzkks3VhvpkuAGnEaQ MQGw== 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=jw5z92GdwkOpMq67zyGgBHYZBK1yWuFbI322wDA/UW4=; b=uFnbbl64H+rY3aBw7/DIauJk/rkR3UKaUBSeHDvlaaFRHz8ZsM43dKoCmje7v2bs/v EmNLLtB6hmc4F4yjUFPisKuE5TJMS77PzBC2pwLNXqS6orIO0+fLfbydGmtzC1Fo8TZx Q7NGkmHALquyvQ8AFrCdMiZvB4n91DMFfMWUfOo8LATud6NLkxIWAKuGG9QS8qqE6Nfh Q9icGju/2CwE0ObrL8/qvrWSlcKu6J5TENLPRucPRzK7zED1jGHop7lLGG/qctxLIVh1 jCdxav/vny/305bBeUqSMBUkMqAEhfLWaFM10pl+OaKVsy3TkUQ6vffRo+3k/ClaPKNr Mq8Q== X-Gm-Message-State: AFqh2kpDsA00YhHJDxDRECanh0O3TJQj1iZIlS4M0qBQk1K+TVS8G3Os rFLLG4L8l23jt5AMCZivxoSo0VuhkMz0gQ== X-Google-Smtp-Source: AMrXdXso+VlLck+nuGDxhZ6lIwyeNuE6ySJ/rTv+sX03C0sCknM9MJ3l9n8n5yvH8oVtgULUxe12vA== X-Received: by 2002:a05:600c:3d06:b0:3da:f945:2354 with SMTP id bh6-20020a05600c3d0600b003daf9452354mr10404349wmb.41.1674137253886; Thu, 19 Jan 2023 06:07:33 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , George Dunlap , Wei Liu Subject: [PATCH v5 1/5] xen/include: Change to Date: Thu, 19 Jan 2023 16:07:18 +0200 Message-Id: <916d01663e76a3a0acad93f6c234834deaa2dd72.1674131459.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 In the patch "include/types: move stddef.h-kind types to common header" [1] size_t was moved from to so early_printk should be updated correspondingly. [1] https://lore.kernel.org/xen-devel/5a0a9e2a-c116-21b5-8081-db75fe4178d7@suse.com/ Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- xen/include/xen/early_printk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/early_printk.h b/xen/include/xen/early_printk.h index abb34687da..5d72293793 100644 --- a/xen/include/xen/early_printk.h +++ b/xen/include/xen/early_printk.h @@ -4,7 +4,7 @@ #ifndef __XEN_EARLY_PRINTK_H__ #define __XEN_EARLY_PRINTK_H__ -#include +#include #ifdef CONFIG_EARLY_PRINTK void early_puts(const char *s, size_t nr); From patchwork Thu Jan 19 14:07:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13108080 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 DEB73C6379F for ; Thu, 19 Jan 2023 14:07:53 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.481131.745841 (Exim 4.92) (envelope-from ) id 1pIVZq-0003Sf-Dd; Thu, 19 Jan 2023 14:07:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 481131.745841; Thu, 19 Jan 2023 14:07:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIVZq-0003SU-9F; Thu, 19 Jan 2023 14:07:38 +0000 Received: by outflank-mailman (input) for mailman id 481131; Thu, 19 Jan 2023 14:07:37 +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 1pIVZo-0002xN-Vm for xen-devel@lists.xenproject.org; Thu, 19 Jan 2023 14:07:37 +0000 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [2a00:1450:4864:20::32b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9fa18b36-9802-11ed-91b6-6bf2151ebd3b; Thu, 19 Jan 2023 15:07:35 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id k16so1634377wms.2 for ; Thu, 19 Jan 2023 06:07:35 -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 m27-20020a05600c3b1b00b003db012d49b7sm7710178wms.2.2023.01.19.06.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 06:07:34 -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: 9fa18b36-9802-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=o8pOiu1yPNSj0fET51Dhdg4Hqst86W5gYJV+0AgZfn8=; b=ii88x7Zl7GGceAEXg9iarLk3km8FnYT72UZRcKT2fhJpYkTI/1yTzFl4YkJcicHD65 KWK+1UfNupnjdr/cs5hc4vWblf5XrbdVWV6uLn27qz5hC7oJSjzs9dipdiCXtQFPIxxQ AaH8jH1u6Mdi/wqVY8BDDBrLr5y80aTzr0OspQjc1reoua6HeM6dNS9+MIFD0vkVtT4x oJcWWnOAMmr0FE82y2IzoUA4iYLCjH8JAzmM+e14A085e2kO9Z15tn/47qtUbxhqYBYP mW9qMII/B24ilbyiE4AZfDOS5TmgbLjgzZkb6DWP8vg5gz9o19b4nyPUIa5iuXMo0GxU Gujw== 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=o8pOiu1yPNSj0fET51Dhdg4Hqst86W5gYJV+0AgZfn8=; b=T3bSgFhVQeIEOVoArsjVuDA8aAoIr0vfmbVotFDW10qbGnXxAdBKHSwU7aWzWpEMUZ c0PBdPYQHyhlcv+7Yd918O2KaFtvqslmwMaPT+z/+uXtycpFmPmOFBiTg3gX+4ut4JPI +e26IWS60PBz0jJPW6FWn/N/lNwQ3p7sPfUsZ111fhJNjjhouCnTp6YItgZHeqmfZ5V2 zL0oY62RYLxkJJmTC6++8jZPmaIckMENZPXNDXuCuiZj68P4MmPtrP+RpWpX4XyEYl68 iy+HA+WBoSe70lEtgPS6ONR3mVtD3a1Co21J0LIY93B2JvMpJF6QIVewzyAvTSd973Si GCAw== X-Gm-Message-State: AFqh2koZfHa4owGicX8+mMRKbJqbDJPDk3AtXLZDdgu6tQWqDxEhoD5f XiOqYLjeiUSV2mOCgKgTbedLDm8eKO2V9A== X-Google-Smtp-Source: AMrXdXu2jRTRlqhR6G4xk/Yl7264yLf/lnMngbJTPksZ+MSKGQzblfXCAWUVVp4mip3kSMfYY9K4qg== X-Received: by 2002:a05:600c:6014:b0:3db:127e:403 with SMTP id az20-20020a05600c601400b003db127e0403mr5688209wmb.37.1674137254807; Thu, 19 Jan 2023 06:07:34 -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 v5 2/5] xen/riscv: introduce asm/types.h header file Date: Thu, 19 Jan 2023 16:07:19 +0200 Message-Id: <851a3fa74defe5174335646e2a79096bd8d432f8.1674131459.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 Reviewed-by: Alistair Francis --- Changes in V5: - Remove size_t from asm/types after rebase on top of the patch "include/types: move stddef.h-kind types to common header" [1]. - All other types were back as they are used in and in xen/common. --- 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 | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 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/asm/types.h new file mode 100644 index 0000000000..64976f118d --- /dev/null +++ b/xen/arch/riscv/include/asm/types.h @@ -0,0 +1,70 @@ +#ifndef __RISCV_TYPES_H__ +#define __RISCV_TYPES_H__ + +#ifndef __ASSEMBLY__ + +typedef __signed__ char __s8; +typedef unsigned char __u8; + +typedef __signed__ short __s16; +typedef unsigned short __u16; + +typedef __signed__ int __s32; +typedef unsigned int __u32; + +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#if defined(CONFIG_RISCV_32) +typedef __signed__ long long __s64; +typedef unsigned long long __u64; +#elif defined (CONFIG_RISCV_64) +typedef __signed__ long __s64; +typedef unsigned long __u64; +#endif +#endif + +typedef signed char s8; +typedef unsigned char u8; + +typedef signed short s16; +typedef unsigned short u16; + +typedef signed int s32; +typedef unsigned int u32; + +#if defined(CONFIG_RISCV_32) + +typedef signed long long s64; +typedef unsigned long long u64; +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 signed long s64; +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 + +#endif /* __ASSEMBLY__ */ + +#endif /* __RISCV_TYPES_H__ */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Thu Jan 19 14:07:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13108079 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 25AFEC00A5A for ; Thu, 19 Jan 2023 14:07:53 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.481132.745850 (Exim 4.92) (envelope-from ) id 1pIVZr-0003iH-J1; Thu, 19 Jan 2023 14:07:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 481132.745850; Thu, 19 Jan 2023 14:07:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIVZr-0003i6-G9; Thu, 19 Jan 2023 14:07:39 +0000 Received: by outflank-mailman (input) for mailman id 481132; Thu, 19 Jan 2023 14:07:38 +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 1pIVZp-0002xN-W3 for xen-devel@lists.xenproject.org; Thu, 19 Jan 2023 14:07:38 +0000 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [2a00:1450:4864:20::32a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a046e46b-9802-11ed-91b6-6bf2151ebd3b; Thu, 19 Jan 2023 15:07:36 +0100 (CET) Received: by mail-wm1-x32a.google.com with SMTP id e19-20020a05600c439300b003db1cac0c1fso2162869wmn.5 for ; Thu, 19 Jan 2023 06:07:36 -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 m27-20020a05600c3b1b00b003db012d49b7sm7710178wms.2.2023.01.19.06.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 06:07:35 -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: a046e46b-9802-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=Tsdz6F+oqCP32pi0Y4PzeZgzGGVRy5nzjQ8KxHS3U8s=; b=QoDowLQ9oNmt9UToXQ5EhBk73Rk5/X07w3PCpvOjHjLvXLUq+MQz/5ono9jm+/m4IX HdSIsNHWHv9WltmeWYfN9QuDNW7liN1dJw47o8bATpGcH48T8KZPrLMI4zby2HFCHWhe c4L35wSnkIYFfdpKC7LENNHSIlp1yNjinw3DtioM9ZUA5t/x6HwHPrSnCWyXT4jDj05o nFXIJlZkpmrvlEGWaIdu8JWI7kgbAuRCD1xMZdVdbLivgtp3nrgXClU3xlOCfMFm9mk4 imntnLj92ONKr2mGtjSumGXJWIgEv89p7/+qzmsJZ1y79fQcixPosrYUoFE6De7A4W1Z X3/A== 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=Tsdz6F+oqCP32pi0Y4PzeZgzGGVRy5nzjQ8KxHS3U8s=; b=irRJJaRPsqVMKRHQHWZOwwGylcG1oerpvyxZYQiT9xSwM0ET72OZV/nyqIPB1LQtRF wSh3kSkF+DJ5+61WL4/zmQjurTFQGCFrD6JmULf+2zx2X7OA5VWodN0ze2T1XhMhEJxs 9au/61bKyCR9GFphCBOnxTjNesZ6VcMQuUS7kqUCyjosiOAdxrXcm+XZqBZK9uOb+R4t kgTSqHSoEWyIG1/LZXbehOnjIM/D9qd97dh/eNgbtMLEceAa83rTXW62DgZ5KKlqRcyk WIgdf4GnkvKFnieARnjGJr7fWOyxP564I1Ui1Zop3R0iU6wEwngmBjr+iie8lkdb4Aoi DIjQ== X-Gm-Message-State: AFqh2kr4h125Wld5o+X9SHPw53YJpYyA7og9pGsO4TAA9wsaz5osTtPF kyJzWtZIDoFJ3V++jRaeft+WoOcWAFVRIg== X-Google-Smtp-Source: AMrXdXstIsFAEQtSpFTIpJ/n6HPwHMdgmnbHPoJSD1pVXXFWpAqU8gy1MiaUh3RjqUtDH/zLZDcoaA== X-Received: by 2002:a05:600c:5390:b0:3d9:a145:4d1a with SMTP id hg16-20020a05600c539000b003d9a1454d1amr6509329wmb.34.1674137255851; Thu, 19 Jan 2023 06:07:35 -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 v5 3/5] xen/riscv: introduce sbi call to putchar to console Date: Thu, 19 Jan 2023 16:07:20 +0200 Message-Id: <7f92b9f801058835237f05f16e2b03b93a9cfdf8.1674131459.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 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: Bobby Eshleman Reviewed-by: Alistair Francis --- Changes in V5: - Nothing critical was changed - Code style fixes - Remove unneeded from sbi.c --- 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 | 44 ++++++++++++++++++++++++++++++++ 3 files changed, 79 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) += riscv64/ +obj-y += sbi.o obj-y += setup.o $(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..0ae166c861 --- /dev/null +++ b/xen/arch/riscv/sbi.c @@ -0,0 +1,44 @@ +/* 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 + +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") = arg0; + register unsigned long a1 asm ("a1") = arg1; + register unsigned long a2 asm ("a2") = arg2; + register unsigned long a3 asm ("a3") = arg3; + register unsigned long a4 asm ("a4") = arg4; + register unsigned long a5 asm ("a5") = arg5; + register unsigned long a6 asm ("a6") = fid; + register unsigned long a7 asm ("a7") = ext; + + asm volatile ( "ecall" + : "+r" (a0), "+r" (a1) + : "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), "r" (a7) + : "memory"); + ret.error = a0; + ret.value = a1; + + return ret; +} + +void sbi_console_putchar(int ch) +{ + sbi_ecall(SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, ch, 0, 0, 0, 0, 0); +} From patchwork Thu Jan 19 14:07:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13108082 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 E52CFC678D6 for ; Thu, 19 Jan 2023 14:07:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.481133.745856 (Exim 4.92) (envelope-from ) id 1pIVZr-0003lE-Vb; Thu, 19 Jan 2023 14:07:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 481133.745856; Thu, 19 Jan 2023 14:07:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIVZr-0003ka-OI; Thu, 19 Jan 2023 14:07:39 +0000 Received: by outflank-mailman (input) for mailman id 481133; Thu, 19 Jan 2023 14:07:39 +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 1pIVZq-0002xN-W7 for xen-devel@lists.xenproject.org; Thu, 19 Jan 2023 14:07:39 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a102b8a4-9802-11ed-91b6-6bf2151ebd3b; Thu, 19 Jan 2023 15:07:37 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id g10so1639048wmo.1 for ; Thu, 19 Jan 2023 06:07:37 -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 m27-20020a05600c3b1b00b003db012d49b7sm7710178wms.2.2023.01.19.06.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 06:07:36 -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: a102b8a4-9802-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=2bpQpEYSVqIRvMUSgTqd/R7B3iBoaJSFfEYHAexvgXQ=; b=FTuaF5IYor28Xsozkz6YQQyBsE1Slr/BSxLxhMi+Jy9pwosQMQb4IA7DE0NfZGX6Uz 9HrrB9odaeYINTaZkASuGzmomMD07QL4ksm1d13asd43XZ8zUhp6LcwN+cBUAg0LovN4 toHzKI7L5YxWVtcPTpA/Dk3BH10ycx9B5ToIfZobr3fISppysZFeLIJOTcKjb3Nj9Fmc akA8TqFNV6IkM338y2BMqXQhBJASYFdHxe9PonSCeD60dLEZbL3lTrF2eQ5XQq6ywSdw tP/bSDQoW8MlNTByl+kpWgW890CLLm8k/5G+k8jv7tCaW9Kv99ytP+gIdIlY01+Ls2AW Ch6A== 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=2bpQpEYSVqIRvMUSgTqd/R7B3iBoaJSFfEYHAexvgXQ=; b=ujjEIAOQNEyUjY479RRs9YxDUe+6R5TcbAZAgBi+/Fnn52DIqVSzv/8/9dnh5GXbob hpXmxAIZrPdWK0g6FZjwVt5LEcJt1EKzd7AcmeMziTzDWIiPG+q01KtEYAJ6yxmhj7H+ yIN5u1MlCGyggIKoBqb16NPqP+Ss9KluxY8/G9yBfdBF1xT37a1BrKx+nE9GbfhVAVOK YWRTn+rUdm8A7860DUOfmKbxklmJGPHzjlZ1S0hN0AaqMnapmpeR8ac5IFIvayFc4xEO wLh6MD5MAbu9xE2ceuoMLs12UVO/K29+cP6gpAPUlHvEKuY+uKBQVXjR7DHO33Ivll6k nmbQ== X-Gm-Message-State: AFqh2kqaqneSfSJUGT/eHjc/ud4YINxUtE5ddkV0H55lOF3qEztzeRix yHeuI5jwiS57rraNmO80TqUF/qyJrefcRA== X-Google-Smtp-Source: AMrXdXt8YeiWkTkoAfXK64LbdpGPwTEH/3KqNB2IDsh2Zn/Gr2P+/TU5azWqoiDeF991/LQPqlmqTg== X-Received: by 2002:a05:600c:1c1b:b0:3d9:ebf9:7004 with SMTP id j27-20020a05600c1c1b00b003d9ebf97004mr10028924wms.29.1674137257016; Thu, 19 Jan 2023 06:07:37 -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 v5 4/5] xen/riscv: introduce early_printk basic stuff Date: Thu, 19 Jan 2023 16:07:21 +0200 Message-Id: <8d7ac0dc51a6331d3efa7fcda433616670b46700.1674131459.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 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/a3c9916bbdff7ad6030055bbee7e53d1aab71384) 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 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 addressing 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 | 45 +++++++++++++++++++++++ xen/arch/riscv/include/asm/early_printk.h | 12 ++++++ xen/arch/riscv/setup.c | 4 ++ 5 files changed, 67 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) += early_printk.o obj-$(CONFIG_RISCV_64) += riscv64/ obj-y += sbi.o obj-y += setup.o diff --git a/xen/arch/riscv/early_printk.c b/xen/arch/riscv/early_printk.c new file mode 100644 index 0000000000..6f590e712b --- /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=medany 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 == '\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/include/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 +#include + /* Xen stack for bringing up the first CPU. */ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE); void __init noreturn start_xen(void) { + early_printk("Hello from C env\n"); + for ( ;; ) asm volatile ("wfi"); From patchwork Thu Jan 19 14:07:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13108081 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 680D6C46467 for ; Thu, 19 Jan 2023 14:07:53 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.481134.745871 (Exim 4.92) (envelope-from ) id 1pIVZt-0004Ce-DG; Thu, 19 Jan 2023 14:07:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 481134.745871; Thu, 19 Jan 2023 14:07:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIVZt-0004BO-44; Thu, 19 Jan 2023 14:07:41 +0000 Received: by outflank-mailman (input) for mailman id 481134; Thu, 19 Jan 2023 14:07:40 +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 1pIVZs-0002xN-01 for xen-devel@lists.xenproject.org; Thu, 19 Jan 2023 14:07:40 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a16bad09-9802-11ed-91b6-6bf2151ebd3b; Thu, 19 Jan 2023 15:07:38 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id fl11-20020a05600c0b8b00b003daf72fc844so3680726wmb.0 for ; Thu, 19 Jan 2023 06:07:38 -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 m27-20020a05600c3b1b00b003db012d49b7sm7710178wms.2.2023.01.19.06.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 06:07:37 -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: a16bad09-9802-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=YgsH/CzG/dU21eVLxWuw+pTYHwBhlSsBbVXpHvXre8w=; b=GG8lkNuDJ7IxD/6TF5mKdV3iyZ6bOAtHF4yjOOg5H44I6mKGQ6itZNWInZe4nILewy pLQIUAV0nznuHRLIupof4W9e81l50QnzJlWOUbGtSqlGX1F86TS0IMrfhB849i6VjdYI Bs/Prj8aBnYpsVIrZuCoX5h0ex7xbiQC9cUf4eYCTjkiLTitfjjkfpMOuP5+B6B9NFGu HG06zMMMH1246nYKAW7PFSoSUkuqnaPpBaaC2Qb/0/aYmMU/VHF578sYaJqZ28ybEgK1 5vWMwsDnlH9wfh7hctSq73eq/H+tvvFEdK4raFfkTkHITC8xdSsII5LrWmXQZUvYrYcU J5AQ== 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=YgsH/CzG/dU21eVLxWuw+pTYHwBhlSsBbVXpHvXre8w=; b=LUJ2zM+B9/ws+lH+82cDpsfV8vV7wuSzBCEs4IuXvwgE6s0MAq4KmHDsht82omsLiT FafgGPuLPNM367gGu+4X5B0KEy620UoaUzb7eIDcvxlLxfGj0RQFPKGm1W07k6tkKEMN XFh42Ql0qTeFYTNGf6NPf6EgEsn1nIDTazYzZ7Bh906XadDGPuxBi3K2M/XGo+MIPfb7 xgGcd1tENZHW6h8t0Z7o31uAIfhhCRNpkD0c/2C9nIIz/bXNO9RDn9mTY6akWUevqr/Z aKj/mCDQmEnR61edjAi7aL9x+wq7hnk+5rDVZxBy8TjrSbnUSPRU7ckWfMpU2+2Ta35Z z5Ug== X-Gm-Message-State: AFqh2ko9gvSv2ZLuaiGndav9WwW+RiGEvEgEN9FRectKXXRisrghTJ5r yslt046vTZQ7/U8A2GqKeWM8NLAA26rh7Q== X-Google-Smtp-Source: AMrXdXu4wpk3TxRlzYdGxqTT7WSP1h04pgt7CCuwHlR6P4mC5Mye9uRcbBcbSLiVBz7lKXsxgvXLPw== X-Received: by 2002:a7b:c4d0:0:b0:3d1:f6b3:2ce3 with SMTP id g16-20020a7bc4d0000000b003d1f6b32ce3mr10842359wmk.35.1674137257840; Thu, 19 Jan 2023 06:07:37 -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 v5 5/5] automation: add RISC-V smoke test Date: Thu, 19 Jan 2023 16:07:22 +0200 Message-Id: <30727cdc63dfaad22f0781d35205646da130e4fa.1674131459.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 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 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..64f47a0ab9 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -54,6 +54,19 @@ tags: - x86_64 +.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 +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