From nobody Thu May 2 07:04:40 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=1622772878; cv=none; d=zohomail.com; s=zohoarc; b=S8GFfEpDzF3qJBUQJfNBk6VzcPAfL2ep4aL+O81ks1QY0YD5XiQTdTfpolpKzBpLssJG3KwtHEZ82iTqNzGGYHF0v5MFaLR7InkNESFoaTv3sfEYshLP2ar9mesGQ+jxTx8/FTaQvuq+4fici4MljLVDYq+Yw/rusTWzB1msTDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622772878; 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=ZbDVJKRN1h+8ugXIRuULkaSTcePO99uJiv3nqLXkYks=; b=QzlzTiua3bvKz/Sd0pbiWcn7SH1On0ESQv6ktFw1yXEXFWaoG96tRBNfMwZL2jhB4Rlyj1F/rUBUSXf0fG6CiQLMgB7f5NzjrsPrcM7SSYtvRNWHmQ43Zc+p4iIL3PJARgdtLh9K3+MzgF1RbqwQ2ixuUNooLi7ZuGse5cayxto= 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) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1622772878127953.0092567355979; Thu, 3 Jun 2021 19:14:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.136642.253267 (Exim 4.92) (envelope-from ) id 1lozLp-0004fj-Or; Fri, 04 Jun 2021 02:14:21 +0000 Received: by outflank-mailman (output) from mailman id 136642.253267; Fri, 04 Jun 2021 02:14:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lozLp-0004fc-Ku; Fri, 04 Jun 2021 02:14:21 +0000 Received: by outflank-mailman (input) for mailman id 136642; Fri, 04 Jun 2021 02:14:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lozLp-0004Ox-2S for xen-devel@lists.xenproject.org; Fri, 04 Jun 2021 02:14:21 +0000 Received: from mail-oi1-x22c.google.com (unknown [2607:f8b0:4864:20::22c]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4b1117d1-b2ad-41e4-a745-4a9a6f0f6384; Fri, 04 Jun 2021 02:14:17 +0000 (UTC) Received: by mail-oi1-x22c.google.com with SMTP id v22so8342820oic.2 for ; Thu, 03 Jun 2021 19:14:16 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id a18sm179903oiy.24.2021.06.03.19.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 19:14:16 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4b1117d1-b2ad-41e4-a745-4a9a6f0f6384 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=ZbDVJKRN1h+8ugXIRuULkaSTcePO99uJiv3nqLXkYks=; b=mzd0yWht+bBXQ7vxyzqrmz0JSyMelxK5Wto0CHXFj8OXkamJOfCe6oXUy+EwCVeoPT VXm/5JWiHGNbOdyeAKNerGspye0XF3fzYD31uaOVdEFKUay+yJMqSleDMl6kJKczJL04 g8DJ8W4rQbF4qsT/rDwNVskkrRSZltY5Ok1LOXJIYkbR3o4EmFAJwXtcdYb6Xbx2O6tf On6/8sQpZqN9Inec651Ni/JLMtixsZDDqtOBi49sNty+Kc7CnYlfnec7unuYj5uAWNJZ cAVTJuZfRDlL6HUTiOjihJBtn4MBOJ+bOU9YFaeEIHWzhR9GWUWb6PRHOoiaOWhhrEeW cOog== 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=ZbDVJKRN1h+8ugXIRuULkaSTcePO99uJiv3nqLXkYks=; b=SX2VlmcZyult84FDjI23tZHyoewAWb5ePvfckoiRj8jaYvyeqb8f7jFFZ/6rbEtpwd cT7jBY+dr+5uXrMjCM6y/5hVWQlgmK/hnOt6W1GN4ExtTaU6oUGx+ISQm2ohHrtuQfy7 e/90RCFrRrvzP4vxflJpjf1+0K6S5shPDfXfHOVEkc5m5Nj1MsH3EYIxxjk+zbOu0P3m ulsiv4in4FyN1Hd9APHoWsRM85EuJKk+b1TlP8Lfa99KcxtVo/8fcXwcHsWfB8dlB3Jo 8Ro7lGpobWA3KwF0WYhF0/KqqGAHV+VNULPJ/fLbtw3baKSybHiIBOjeEq0so4bBVZz2 Y0Lg== X-Gm-Message-State: AOAM530P280+t+UqeSHsSLacboAZ6BMNomSIIQp9MSYDU2cTbPQQpPGz WFPseLlDFSaCpGLrCt8HvVcTIHl07dNdng== X-Google-Smtp-Source: ABdhPJz7PVplV54Nb4viAJbz2T54+ZJyAw/+03cBpvvFxv1RRXdQScjyLp6tEaVgze13BYednDvf+Q== X-Received: by 2002:aca:220b:: with SMTP id b11mr9359038oic.89.1622772856520; Thu, 03 Jun 2021 19:14:16 -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 , Alistair Francis Subject: [PATCH v8 1/2] xen/char: Default HAS_NS16550 to y only for X86 and ARM Date: Thu, 3 Jun 2021 20:14:04 -0600 Message-Id: <3886e351e8333f68462b0d2f9ecb1e243cb8b9ec.1622772299.git.connojdavis@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Alistair Francis --- 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. --=20 2.31.1 From nobody Thu May 2 07:04:40 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=1622772879; cv=none; d=zohomail.com; s=zohoarc; b=id2T0z+kxci+arLIyX87QdVFwNTNCCr2r1x4fhqEHjX9bPlLwEAQePpzRqU5i3e+tlrkOLX0CslzJSWEwE/7HXjHuiwjUqmvAzOcOF/fwrMQbsD8RrMMOZZlF4K1ynduk8Vu2KK14BepvaHxe7DtThXU0rVvbqeBkCCWjRtVvu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622772879; 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=Fz5g9/C6TUTCVwzOqiNArfaZRG1hXAbJvG6pMsvIAko=; b=WDFlTU9lgx47251NyNWb3nYfjgrLu5BYWvG8XMEFxIL3mMIwGh4hOc6HOK/vYxEiYZamiDzNxH7+h7tbt3fYA++qyv7B7j7oMYt36mU/mUXx5BDUYvk/bTkjcyNGHfN95fBP7dwQ/npxxwAOvi+OD7cTpjo/oxOxPTuqqUMzMxk= 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) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1622772879857694.3089384761712; Thu, 3 Jun 2021 19:14:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.136643.253278 (Exim 4.92) (envelope-from ) id 1lozLv-000511-5M; Fri, 04 Jun 2021 02:14:27 +0000 Received: by outflank-mailman (output) from mailman id 136643.253278; Fri, 04 Jun 2021 02:14:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lozLv-00050p-1i; Fri, 04 Jun 2021 02:14:27 +0000 Received: by outflank-mailman (input) for mailman id 136643; Fri, 04 Jun 2021 02:14:26 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lozLu-0004Ox-2Z for xen-devel@lists.xenproject.org; Fri, 04 Jun 2021 02:14:26 +0000 Received: from mail-ot1-x334.google.com (unknown [2607:f8b0:4864:20::334]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6465723d-4fd8-409f-929c-12a3680f4b0f; Fri, 04 Jun 2021 02:14:18 +0000 (UTC) Received: by mail-ot1-x334.google.com with SMTP id 66-20020a9d02c80000b02903615edf7c1aso7667299otl.13 for ; Thu, 03 Jun 2021 19:14:18 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id a18sm179903oiy.24.2021.06.03.19.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 19:14:17 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6465723d-4fd8-409f-929c-12a3680f4b0f 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=Fz5g9/C6TUTCVwzOqiNArfaZRG1hXAbJvG6pMsvIAko=; b=in3moGkktPRDAw4r2i1LfWozyIVjfbIwxNj+EJWupD6/KPAO3PjShVjqmFFboXnNwn VFB4ua7VRz9rLHqDQGvb9LJGJi9HrXSChCMjHf+DE5Eor7JzfVdWLtytYQ8jNQ4LBygn kCfMuhc7oNquajtERoVBOYKZjwwQ+HCPSPvQ4iYXTtPJcpcbQm2oCRiQduJIpQ5qKcet GKn+gzIq/1w6EDkxYjjpLaAGfNyVvaDeUknvPateVUHmIsuJEFZpBedbN0eqK0uDZhM3 qDCWqwZl8cYKewWPZWIPJmjguKIEkKSAsMDfNaKVh/NOkwCfkMQMZJSDyXooRaSOw5nH bObQ== 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=Fz5g9/C6TUTCVwzOqiNArfaZRG1hXAbJvG6pMsvIAko=; b=F8gFZjaqBgYPtzUvH5+CgriUdKfm+f99OKtkplktkkF8ww2XNouudjIjS2lpLW/loI v41CSerKKM5Hes8Zp4EFFURzKJkgFM0syZNdeZjWYwMdtD3nUlk1dRYs9MgBRgAGTV+0 lrnvrdfi3pRzmcn0vOo4sSuWtcnsA8294XZlKRyClMkAbG7gHpSITVc5Yp7iwNTsM5RC 2JDGDskeoLsC1aZmeXMtAVSPx4qjlSaB6VxZgWYkU9dXkMki6PlGjOEsFKAEsKRa7l8E +mTn0SuVTqiMnOoTkcTGLomCJ18KSj5nu9eYM7C8O5on0rZvjGWM+1/LUIoyE30HGUrT O+vQ== X-Gm-Message-State: AOAM530lBR2YtZe8jBqUKXVtAWp5WUEpcynu7hETsnS56MxaDlKu41XO I21wEL8kHONuJW/HDLgfHiZlDxwdivOIpA== X-Google-Smtp-Source: ABdhPJwbrRHwbka2i9AWbd4QsHICHVo6yA0VuVzpBjs7g4Pu1kelhvt1sGVal3w5DzXyfZMXWtV9pg== X-Received: by 2002:a9d:69c5:: with SMTP id v5mr1835711oto.108.1622772858182; Thu, 03 Jun 2021 19:14:18 -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 , Alistair Francis Subject: [PATCH v8 2/2] xen: Add files needed for minimal riscv build Date: Thu, 3 Jun 2021 20:14:05 -0600 Message-Id: <4337d3cd6891b34f534d85ca62712bd3b446edf8.1622772299.git.connojdavis@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Type: text/plain; charset="utf-8" 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=3Driscv64 SUBSYSTEMS=3Dxen -C xen tiny64_defconfig $ make XEN_TARGET_ARCH=3Driscv64 SUBSYSTEMS=3Dxen -C xen TARGET=3Driscv64/h= ead.o No other TARGET is supported at the moment. Signed-off-by: Connor Davis Reviewed-by: Alistair Francis Acked-by: Bobby Eshleman --- MAINTAINERS | 9 +++++ config/riscv64.mk | 5 +++ xen/Makefile | 8 +++-- xen/arch/riscv/Kconfig | 48 +++++++++++++++++++++++++ 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, 150 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..5a1f92422a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -456,6 +456,15 @@ F: tools/libs/light/libxl_nonetbuffer.c F: tools/hotplug/Linux/remus-netbuf-setup F: tools/hotplug/Linux/block-drbd-probe =20 +RISCV +M: Bob Eshleman +M: Alistair Francis +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 :=3D y +CONFIG_RISCV_64 :=3D y +CONFIG_RISCV_$(XEN_OS) :=3D y + +CONFIG_XEN_INSTALL_SUFFIX :=3D diff --git a/xen/Makefile b/xen/Makefile index 7ce7692354..89879fad4c 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -26,7 +26,9 @@ MAKEFLAGS +=3D -rR EFI_MOUNTPOINT ?=3D $(BOOT_DIR)/efi =20 ARCH=3D$(XEN_TARGET_ARCH) -SRCARCH=3D$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)= /arm/g') +SRCARCH=3D$(shell echo $(ARCH) | \ + sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g' \ + -e s'/riscv.*/riscv/g') =20 # 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 :=3D $(XEN_TARGET_ARCH) export TARGET_ARCH :=3D $(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') =20 # Allow someone to change their config file export KCONFIG_CONFIG ?=3D .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=3D$(ARCH) SRCAR= CH=3D$(SRCARCH) clean diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig new file mode 100644 index 0000000000..468e250c86 --- /dev/null +++ b/xen/arch/riscv/Kconfig @@ -0,0 +1,48 @@ +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" + default y + 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 Y. + +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) +=3D -mabi=3Dlp64 + +riscv-march-$(CONFIG_RISCV_ISA_RV64IMA) :=3D rv64ima +riscv-march-$(CONFIG_RISCV_ISA_C) :=3D $(riscv-march-y)c + +# Note that -mcmodel=3Dmedany is used so that Xen can be mapped +# into the upper half _or_ the lower half of the address space. +# -mcmodel=3Dmedlow would force Xen into the lower half. + +CFLAGS +=3D -march=3D$(riscv-march-y) -mstrict-align -mcmodel=3Dmedany +CFLAGS +=3D -I$(BASEDIR)/include diff --git a/xen/arch/riscv/configs/tiny64_defconfig b/xen/arch/riscv/confi= gs/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=3Dy +CONFIG_DEBUG=3Dy +CONFIG_DEBUG_INFO=3Dy +CONFIG_EXPERT=3Dy 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: + */ --=20 2.31.1