From patchwork Wed Jun 2 23:20:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Davis X-Patchwork-Id: 12295809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 838C5C4708F for ; Wed, 2 Jun 2021 23:21:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 401BC613EA for ; Wed, 2 Jun 2021 23:21:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 401BC613EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.136250.252708 (Exim 4.92) (envelope-from ) id 1loaAU-0002Qm-Dw; Wed, 02 Jun 2021 23:20:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 136250.252708; Wed, 02 Jun 2021 23:20:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1loaAU-0002Qf-9p; Wed, 02 Jun 2021 23:20:58 +0000 Received: by outflank-mailman (input) for mailman id 136250; Wed, 02 Jun 2021 23:20:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1loaAT-00029h-21 for xen-devel@lists.xenproject.org; Wed, 02 Jun 2021 23:20:57 +0000 Received: from mail-ot1-x332.google.com (unknown [2607:f8b0:4864:20::332]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id de30167b-aaaf-48cc-8052-2ad81dfe9267; Wed, 02 Jun 2021 23:20:54 +0000 (UTC) Received: by mail-ot1-x332.google.com with SMTP id i12-20020a05683033ecb02903346fa0f74dso4014343otu.10 for ; Wed, 02 Jun 2021 16:20:54 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id h7sm306175oib.49.2021.06.02.16.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 16:20:53 -0700 (PDT) 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: de30167b-aaaf-48cc-8052-2ad81dfe9267 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XGumMjGtg94IhtORkgOv43FTexceLATJry4J5HfIX+U=; b=GJUKuWulbkk8SiS+7y0Ky1aZjFcBJhMGZhbVX0fOShDv4f/+h8ysaXfiB2J6V6FK/5 i8Rr74urSUQYipKjCAPone16N6EfHWJcTHx1bIWW8Q8jP8Ki2osR6fI+vPFHXpILT42V z9l3rHbAEYdPSvt0VC/TKvFA9Uq5kAgzxKO9mYZ+IGoaeqCLoHMes96tSD9/va3MN1iR LtO9FyrU2SozQvgzNLk55wr6cULy8QYbrBaoBUqKmWYqK91VVmQmeiNrPmBr173nKZiN pVlomKcGqqjx7ZfL+U6wa8G6b+jUeEqdyNiDONT24imy2TBMm8GrOvTUZ28IoRhVK4V2 goog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XGumMjGtg94IhtORkgOv43FTexceLATJry4J5HfIX+U=; b=i8I+tUNyQsptqLBF/OnvTxZZEDIsJbZncgL7QgB8B1XMwvnTWC32UEg1DnKJppN+hy PbOXRftYF0zfJUkmCLjW2JTka8bx1GTqtSXH0Fb6fru2LbwJvobutVTUvtdMjPC/j25+ Oyrkz7ubOTCVkFbqagChqHRVALe48xx54pUrCQ+lGz6Q/qwQOrNYw+2oWJdQSPxYg+jU OZY3kObl2xiW+a+VKNpIaiCXX2jUAnP2QNTXlKuWQqgwOpGvxYbfhPCqs/3c5hpqwwcC WkiTC3T+TpjiRkPABlY3DfnS/k7CIqgGP5T89XhtJs2j5LEIqL6GTPMTlz8amoD9MOSx xIkw== X-Gm-Message-State: AOAM530+KT+T2JPPvGpqCox8YFvy/FZ5cu8iUBGu+xK0SyM+Z3rVgJE6 4k7rlYRaU5+cACbxYcccxlYJXzMNHxAx+A== X-Google-Smtp-Source: ABdhPJzkjPITBzNC90Mrf5dLPcyf/H6/h4Eur+atA8GPWeyJqE0uLWrj/FCfRNDEiW/2Noi/J9FIwg== X-Received: by 2002:a9d:1ec6:: with SMTP id n64mr28337289otn.3.1622676053680; Wed, 02 Jun 2021 16:20:53 -0700 (PDT) From: Connor Davis To: xen-devel@lists.xenproject.org Cc: Bobby Eshleman , Alistair Francis , Connor Davis , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v6 1/2] xen/char: Default HAS_NS16550 to y only for X86 and ARM Date: Wed, 2 Jun 2021 17:20:44 -0600 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Defaulting to yes only for X86 and ARM reduces the requirements for a minimal build when porting new architectures. Signed-off-by: Connor Davis Acked-by: Jan Beulich --- xen/drivers/char/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig index b572305657..2ff5b288e2 100644 --- a/xen/drivers/char/Kconfig +++ b/xen/drivers/char/Kconfig @@ -1,5 +1,6 @@ config HAS_NS16550 bool "NS16550 UART driver" if ARM + default n if RISCV default y help This selects the 16550-series UART support. For most systems, say Y. From patchwork Wed Jun 2 23:20:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Davis X-Patchwork-Id: 12295813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C340FC47083 for ; Wed, 2 Jun 2021 23:21:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6AB82613E9 for ; Wed, 2 Jun 2021 23:21:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AB82613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.136251.252718 (Exim 4.92) (envelope-from ) id 1loaAZ-0002mV-LT; Wed, 02 Jun 2021 23:21:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 136251.252718; Wed, 02 Jun 2021 23:21:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1loaAZ-0002mG-HQ; Wed, 02 Jun 2021 23:21:03 +0000 Received: by outflank-mailman (input) for mailman id 136251; Wed, 02 Jun 2021 23:21:02 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1loaAY-00029h-2H for xen-devel@lists.xenproject.org; Wed, 02 Jun 2021 23:21:02 +0000 Received: from mail-oi1-x22d.google.com (unknown [2607:f8b0:4864:20::22d]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 25796a31-9b0a-47e9-a6cc-203c639555f1; Wed, 02 Jun 2021 23:20:57 +0000 (UTC) Received: by mail-oi1-x22d.google.com with SMTP id d21so4371888oic.11 for ; Wed, 02 Jun 2021 16:20:57 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id h7sm306175oib.49.2021.06.02.16.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 16:20:54 -0700 (PDT) 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: 25796a31-9b0a-47e9-a6cc-203c639555f1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y7wXnoCWLDx7IQREahGv6BGDyqktjGf6yjBgrAWmplI=; b=qL6T+IYDMnlwaO6MHJMHo1K3ijLdkUlVWUNRLQ1Hx3tzI+2KdOKpsCnzfwEBsmPsXa zZk2BCSF9Ln6qIj/1q2nwHbgjGkXUG2GRXesrIas/ZSyY7atVraGlmtmQFGBBwrHXziN mk7aHJwQfcik+zsvd9EyKwZIwxYoHpH0TnFMD1rWdB4cHB7BSw3W2F2g7lBirT0QF0Wf 5zmo1p1uQJhecYR4r1vrva4OG86jHlegM0IXRtGDD/e6gqKsIF9isQRKwd3GsiPcDUB8 9YObQTfuYz7D4W1gP6f9GYSvDMRbe0afKEg7kTN4glgIMe44vGeFWep3nV+TlpUvtmMi Du8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y7wXnoCWLDx7IQREahGv6BGDyqktjGf6yjBgrAWmplI=; b=Q2zlAF4K7oKIEIPj9Xh2z5vGHcqs83lAt6EQFl6m0zVp/osPNaY41VHwawrPV7bqN7 j6A40wtqxEKLuBkV02FIXRLPRQBqrYdxVZ6xJTC9iLfO+fdMhPkJnEg6tfHmPLPe+g0B yiu3lSyJtQ3dCBoY8+54joaOyUIsqdke/LwR6opmT1u0I9XQnhROpLA6XSoIwQb3YZ6W EoTMMoyHnE1/qULxUj7TyrEeb39YK9E1TfiTn8jM2DAYDiDXHPOuJOe0FLlvqArSMJOQ eXRmdEo420rvXzpU1DpRl0vy4HOFiuu6sAO8KTFvbiyd96G3QsUPaueYkpD4FzPfiaii LfYQ== X-Gm-Message-State: AOAM531tiILK77KuefvUUJL5EsPsx77ctU9tHfc0IUtM6w2cYEJAUSl+ SilBqTbf7+18IcSXmh8fPSwgn5iPS0kXQg== X-Google-Smtp-Source: ABdhPJy7jQErJRgEkVXaKlWUxYobW+5eP2rkRPBWtrMLLLKUzN59zPAkpOiVmuQR+WnVUVjYAIJlMA== X-Received: by 2002:aca:f455:: with SMTP id s82mr11834239oih.85.1622676055185; Wed, 02 Jun 2021 16:20:55 -0700 (PDT) From: Connor Davis To: xen-devel@lists.xenproject.org Cc: Bobby Eshleman , Alistair Francis , Connor Davis , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v6 2/2] xen: Add files needed for minimal riscv build Date: Wed, 2 Jun 2021 17:20:45 -0600 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Add arch-specific makefiles and configs needed to build for riscv. Also add a minimal head.S that is a simple infinite loop. head.o can be built with $ make XEN_TARGET_ARCH=riscv64 SUBSYSTEMS=xen -C xen tiny64_defconfig $ make XEN_TARGET_ARCH=riscv64 SUBSYSTEMS=xen -C xen TARGET=riscv64/head.o No other TARGET is supported at the moment. Signed-off-by: Connor Davis --- Bob: I moved back to XEN_TARGET_ARCH=riscv64 because supplying just XEN_TARGET_ARCH=riscv causes TARGET_ARCH == TARGET_SUBARCH, and that broke the build after the recent commit b6ecd5c8bc "build: centralize / unify asm-offsets generation". It also deviates from how x86 and arm work now, so I think this change is for the best for now. That commit is also why the PHONY include target is added in the riscv/Makefile. --- MAINTAINERS | 8 +++++ config/riscv64.mk | 5 +++ xen/Makefile | 8 +++-- xen/arch/riscv/Kconfig | 47 +++++++++++++++++++++++++ xen/arch/riscv/Kconfig.debug | 0 xen/arch/riscv/Makefile | 2 ++ xen/arch/riscv/Rules.mk | 0 xen/arch/riscv/arch.mk | 14 ++++++++ xen/arch/riscv/configs/tiny64_defconfig | 13 +++++++ xen/arch/riscv/riscv64/asm-offsets.c | 0 xen/arch/riscv/riscv64/head.S | 6 ++++ xen/include/asm-riscv/config.h | 47 +++++++++++++++++++++++++ 12 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 config/riscv64.mk create mode 100644 xen/arch/riscv/Kconfig create mode 100644 xen/arch/riscv/Kconfig.debug create mode 100644 xen/arch/riscv/Makefile create mode 100644 xen/arch/riscv/Rules.mk create mode 100644 xen/arch/riscv/arch.mk create mode 100644 xen/arch/riscv/configs/tiny64_defconfig create mode 100644 xen/arch/riscv/riscv64/asm-offsets.c create mode 100644 xen/arch/riscv/riscv64/head.S create mode 100644 xen/include/asm-riscv/config.h diff --git a/MAINTAINERS b/MAINTAINERS index d46b08a0d2..956e71220d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -456,6 +456,14 @@ F: tools/libs/light/libxl_nonetbuffer.c F: tools/hotplug/Linux/remus-netbuf-setup F: tools/hotplug/Linux/block-drbd-probe +RISCV +M: Bob Eshleman +R: Connor Davis +S: Supported +F: config/riscv64.mk +F: xen/arch/riscv/ +F: xen/include/asm-riscv/ + RTDS SCHEDULER M: Dario Faggioli M: Meng Xu diff --git a/config/riscv64.mk b/config/riscv64.mk new file mode 100644 index 0000000000..a5a21e5fa2 --- /dev/null +++ b/config/riscv64.mk @@ -0,0 +1,5 @@ +CONFIG_RISCV := y +CONFIG_RISCV_64 := y +CONFIG_RISCV_$(XEN_OS) := y + +CONFIG_XEN_INSTALL_SUFFIX := diff --git a/xen/Makefile b/xen/Makefile index 7ce7692354..89879fad4c 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -26,7 +26,9 @@ MAKEFLAGS += -rR EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi ARCH=$(XEN_TARGET_ARCH) -SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g') +SRCARCH=$(shell echo $(ARCH) | \ + sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g' \ + -e s'/riscv.*/riscv/g') # Don't break if the build process wasn't called from the top level # we need XEN_TARGET_ARCH to generate the proper config @@ -35,7 +37,8 @@ include $(XEN_ROOT)/Config.mk # Set ARCH/SUBARCH appropriately. export TARGET_SUBARCH := $(XEN_TARGET_ARCH) export TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \ - sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g') + sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g' \ + -e s'/riscv.*/riscv/g') # Allow someone to change their config file export KCONFIG_CONFIG ?= .config @@ -335,6 +338,7 @@ _clean: delete-unfresh-files $(MAKE) $(clean) xsm $(MAKE) $(clean) crypto $(MAKE) $(clean) arch/arm + $(MAKE) $(clean) arch/riscv $(MAKE) $(clean) arch/x86 $(MAKE) $(clean) test $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig new file mode 100644 index 0000000000..bd8381c5e0 --- /dev/null +++ b/xen/arch/riscv/Kconfig @@ -0,0 +1,47 @@ +config RISCV + def_bool y + +config RISCV_64 + def_bool y + select 64BIT + +config ARCH_DEFCONFIG + string + default "arch/riscv/configs/tiny64_defconfig" + +menu "Architecture Features" + +source "arch/Kconfig" + +endmenu + +menu "ISA Selection" + +choice + prompt "Base ISA" + default RISCV_ISA_RV64IMA if RISCV_64 + help + This selects the base ISA extensions that Xen will target. + +config RISCV_ISA_RV64IMA + bool "RV64IMA" + help + Use the RV64I base ISA, plus the "M" and "A" extensions + for integer multiply/divide and atomic instructions, respectively. + +endchoice + +config RISCV_ISA_C + bool "Compressed extension" + help + Add "C" to the ISA subsets that the toolchain is allowed to + emit when building Xen, which results in compressed instructions + in the Xen binary. + + If unsure, say N. + +endmenu + +source "common/Kconfig" + +source "drivers/Kconfig" diff --git a/xen/arch/riscv/Kconfig.debug b/xen/arch/riscv/Kconfig.debug new file mode 100644 index 0000000000..e69de29bb2 diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile new file mode 100644 index 0000000000..942e4ffbc1 --- /dev/null +++ b/xen/arch/riscv/Makefile @@ -0,0 +1,2 @@ +.PHONY: include +include: diff --git a/xen/arch/riscv/Rules.mk b/xen/arch/riscv/Rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/xen/arch/riscv/arch.mk b/xen/arch/riscv/arch.mk new file mode 100644 index 0000000000..53dadb8975 --- /dev/null +++ b/xen/arch/riscv/arch.mk @@ -0,0 +1,14 @@ +######################################## +# RISCV-specific definitions + +CFLAGS-$(CONFIG_RISCV_64) += -mabi=lp64 + +riscv-march-$(CONFIG_RISCV_ISA_RV64IMA) := rv64ima +riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c + +# Note that -mcmodel=medany is used so that Xen can be mapped +# into the upper half _or_ the lower half of the address space. +# -mcmodel=medlow would force Xen into the lower half. + +CFLAGS += -march=$(riscv-march-y) -mstrict-align -mcmodel=medany +CFLAGS += -I$(BASEDIR)/include diff --git a/xen/arch/riscv/configs/tiny64_defconfig b/xen/arch/riscv/configs/tiny64_defconfig new file mode 100644 index 0000000000..3c9a2ff941 --- /dev/null +++ b/xen/arch/riscv/configs/tiny64_defconfig @@ -0,0 +1,13 @@ +# CONFIG_SCHED_CREDIT is not set +# CONFIG_SCHED_RTDS is not set +# CONFIG_SCHED_NULL is not set +# CONFIG_SCHED_ARINC653 is not set +# CONFIG_TRACEBUFFER is not set +# CONFIG_HYPFS is not set +# CONFIG_GRANT_TABLE is not set +# CONFIG_SPECULATIVE_HARDEN_ARRAY is not set + +CONFIG_RISCV_64=y +CONFIG_DEBUG=y +CONFIG_DEBUG_INFO=y +CONFIG_EXPERT=y diff --git a/xen/arch/riscv/riscv64/asm-offsets.c b/xen/arch/riscv/riscv64/asm-offsets.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S new file mode 100644 index 0000000000..0dbc27ba75 --- /dev/null +++ b/xen/arch/riscv/riscv64/head.S @@ -0,0 +1,6 @@ +#include + + .text + +ENTRY(start) + j start diff --git a/xen/include/asm-riscv/config.h b/xen/include/asm-riscv/config.h new file mode 100644 index 0000000000..e2ae21de61 --- /dev/null +++ b/xen/include/asm-riscv/config.h @@ -0,0 +1,47 @@ +#ifndef __RISCV_CONFIG_H__ +#define __RISCV_CONFIG_H__ + +#if defined(CONFIG_RISCV_64) +# define LONG_BYTEORDER 3 +# define ELFSIZE 64 +# define MAX_VIRT_CPUS 128u +#else +# error "Unsupported RISCV variant" +#endif + +#define BYTES_PER_LONG (1 << LONG_BYTEORDER) +#define BITS_PER_LONG (BYTES_PER_LONG << 3) +#define POINTER_ALIGN BYTES_PER_LONG + +#define BITS_PER_LLONG 64 + +/* xen_ulong_t is always 64 bits */ +#define BITS_PER_XEN_ULONG 64 + +#define CONFIG_RISCV_L1_CACHE_SHIFT 6 +#define CONFIG_PAGEALLOC_MAX_ORDER 18 +#define CONFIG_DOMU_MAX_ORDER 9 +#define CONFIG_HWDOM_MAX_ORDER 10 + +#define OPT_CONSOLE_STR "dtuart" +#define INVALID_VCPU_ID MAX_VIRT_CPUS + +/* Linkage for RISCV */ +#ifdef __ASSEMBLY__ +#define ALIGN .align 2 + +#define ENTRY(name) \ + .globl name; \ + ALIGN; \ + name: +#endif + +#endif /* __RISCV_CONFIG_H__ */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */