From nobody Sun Feb 8 21:21:24 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1579670089; cv=none; d=zohomail.com; s=zohoarc; b=bDs1bL8psRYGOBHWsF7AnK3rTeyf7vKyQaEXz0XD49yzoT5t1ZwLyjAqP7SYpP2wv4p11dxfRKuaOKCg9VKkfbXpjKgr6fYaNKb3MWwXihSV3ynFYnviZJtJf+WrGHQ5u2DW1LMNfdffngtN4L0Go4IO3WGd7YLFNw8fp99qMtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579670089; h=Content-Type: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=U1JOTML3wdNId4JqDzjs863YFsP0BBmdFbY6bUOfT7k=; b=TfVe6Mckji0LLuLGUp5Gl0CrNSrEVuT/Yog8eqeNYp3otzXT6HBuxJ8JyDftAByYNIvw5xwZMRFCOsAMf6cM8ruFs5tRhR/w5Uf31/ipDt8P+q38JSZz/7KuMVzeovmRjuuXRdlDHLBseI8Dax9h7cQCZgmLzZDwU0OlKpEkHgE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail 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 1579670089230517.7635927735784; Tue, 21 Jan 2020 21:14:49 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iu8L6-00055x-0A; Wed, 22 Jan 2020 05:14:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iu5Jn-00065O-Rs for xen-devel@lists.xenproject.org; Wed, 22 Jan 2020 02:00:31 +0000 Received: from mail-yw1-xc43.google.com (unknown [2607:f8b0:4864:20::c43]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f7af24b0-3cba-11ea-b833-bc764e2007e4; Wed, 22 Jan 2020 02:00:30 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id b186so2509683ywc.1 for ; Tue, 21 Jan 2020 18:00:30 -0800 (PST) Received: from bobbye-pc.knology.net ([216.186.244.35]) by smtp.gmail.com with ESMTPSA id q185sm17504248ywh.61.2020.01.21.18.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:00:29 -0800 (PST) X-Inumbo-ID: f7af24b0-3cba-11ea-b833-bc764e2007e4 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=voiZUaSfvGPmtwC5XIVeLRcygRog74uucrdDnZovhV4=; b=Fy4QTw99JS0KU2Gr+/eJ24WRo8/T9sU4OYuBlf2CGKFpbyqlHL9/FdnT47pqWb32+8 NkEABGy1ByP+PRnfX+plHNfx7zf8P0IZNAgdYgqRXoUt3G+9YjfYEJKMd9Ia8Rsiexma 1m3E5hX0nmXzRlKBlAuRv9CxWf7MJr4/hqKAB3yYX04pGItlMZgx+Gv5MXGLvhrtDQdC dnHvGAtGCI/pN7MoauhtrQ5X6KZap/mBn69KY71i05+mfcjQUA/Agc9ccXdyPhjVjAZq f7FZrM8RWJ9xaaNA2KV6CnwvjnMKp5P5/YxLDhEHI/A+7jkPWuJqC6qkkiVDBvL7yaG3 h3jQ== 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=voiZUaSfvGPmtwC5XIVeLRcygRog74uucrdDnZovhV4=; b=O7xIpGR3ZL51bCgvYb+U2AVqTAnvzehNi0sZVjQehtrW2Ri8QlX9nKo7fi2Xbm7uYF XY0wm7UEk5FkGGarIz8Se+LHFdIGVCOBI10AUePYV4ZAQA1Vh4OtI/iplmyV6Df5OShf RWvnAtegFGrZGNQvScjVw1JotlZl1h/DZUPZFzFg8Xj4lpXEfv8fIjqJdS1fkthZVaej Cnl+7rugSEw7Za+ewI9+kHmjXmEmXqFnzLXS7uvsrtJf2zYESHgcUtK/F//B66eAv9CC BlE5Tsa5z2EB0fvKO0DB981TLQ70cxUFdDEdsnNScv+qTkv5xhWYPgSwwyOsWPomdrM0 B3lw== X-Gm-Message-State: APjAAAXFMJlPkaaFA/K6scNL+5xE38Pz2n8IklNmtiZSoj0Les0US6Tn sLtrgTp3wivsjiXH7th5TXWhEw5NfjXzDw== X-Google-Smtp-Source: APXvYqxQsSySDYPzIBXYijRyFdN8PHHz+oO32ads2Cis18ozMd712E2Vbvddo48zND7lLRNmbln+Lw== X-Received: by 2002:a81:758a:: with SMTP id q132mr5633129ywc.162.1579658429572; Tue, 21 Jan 2020 18:00:29 -0800 (PST) From: Bobby Eshleman To: xen-devel@lists.xenproject.org Date: Tue, 21 Jan 2020 19:58:42 -0600 Message-Id: <21ccc73e8b3e536b57a43618584a796464e5bac5.1579615303.git.bobbyeshleman@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 Jan 2020 05:14:01 +0000 Subject: [Xen-devel] [RFC XEN PATCH 03/23] riscv: makefiles and Kconfig X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Bobby Eshleman , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Bobby Eshleman , Dan Robertson , Alistair Francis Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Alistair Francis Signed-off-by: Bobby Eshleman Signed-off-by: Alistair Francis --- config/riscv64.mk | 7 + xen/Makefile | 2 +- xen/Rules.mk | 2 +- xen/arch/Kconfig | 1 + xen/arch/riscv/Kconfig | 36 ++++ xen/arch/riscv/Makefile | 62 ++++++ xen/arch/riscv/Rules.mk | 55 +++++ xen/arch/riscv/configs/riscv32_defconfig | 0 xen/arch/riscv/configs/riscv64_defconfig | 0 xen/arch/riscv/platforms/Kconfig | 31 +++ xen/arch/riscv/xen.lds.S | 262 +++++++++++++++++++++++ xen/drivers/passthrough/Makefile | 1 + xen/drivers/passthrough/riscv/Makefile | 1 + 13 files changed, 458 insertions(+), 2 deletions(-) create mode 100644 config/riscv64.mk create mode 100644 xen/arch/riscv/Kconfig create mode 100644 xen/arch/riscv/Makefile create mode 100644 xen/arch/riscv/Rules.mk create mode 100644 xen/arch/riscv/configs/riscv32_defconfig create mode 100644 xen/arch/riscv/configs/riscv64_defconfig create mode 100644 xen/arch/riscv/platforms/Kconfig create mode 100644 xen/arch/riscv/xen.lds.S create mode 100644 xen/drivers/passthrough/riscv/Makefile diff --git a/config/riscv64.mk b/config/riscv64.mk new file mode 100644 index 0000000000..0ec97838f9 --- /dev/null +++ b/config/riscv64.mk @@ -0,0 +1,7 @@ +CONFIG_RISCV :=3D y +CONFIG_RISCV_64 :=3D y +CONFIG_RISCV_$(XEN_OS) :=3D y + +CONFIG_XEN_INSTALL_SUFFIX :=3D + +CFLAGS +=3D diff --git a/xen/Makefile b/xen/Makefile index f36a5bc6c0..0c47899127 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -27,7 +27,7 @@ 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\(32\|64\)/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 diff --git a/xen/Rules.mk b/xen/Rules.mk index 5aba841b0a..1556266679 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -29,7 +29,7 @@ endif # Set ARCH/SUBARCH appropriately. override TARGET_SUBARCH :=3D $(XEN_TARGET_ARCH) override TARGET_ARCH :=3D $(shell echo $(XEN_TARGET_ARCH) | \ - sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/ar= m/g') + sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/ar= m/g' -e s'/riscv\(32\|64\)/riscv/g') =20 TARGET :=3D $(BASEDIR)/xen =20 diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig index 1954d1c5c1..985c023ca6 100644 --- a/xen/arch/Kconfig +++ b/xen/arch/Kconfig @@ -7,5 +7,6 @@ config NR_CPUS default "4" if ARM && QEMU default "4" if ARM && MPSOC default "128" if ARM + default "4" if RISCV ---help--- Specifies the maximum number of physical CPUs which Xen will support. diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig new file mode 100644 index 0000000000..8bea40af60 --- /dev/null +++ b/xen/arch/riscv/Kconfig @@ -0,0 +1,36 @@ +config 64BIT + bool + default ARCH !=3D "riscv32" + help + Say yes to build a 64-bit Xen + Say no to build a 32-bit Xen + +config RISCV_32 + def_bool y + depends on !64BIT + +config RISCV_64 + def_bool y + depends on 64BIT + +config RISCV + def_bool y + select HAS_PDX + select HAS_PASSTHROUGH + +config ARCH_DEFCONFIG + string + default "arch/riscv/configs/arm32_defconfig" if RISCV_32 + default "arch/riscv/configs/arm64_defconfig" if RISCV_64 + +menu "Architecture Features" + +source "arch/Kconfig" + +endmenu + +source "arch/riscv/platforms/Kconfig" + +source "common/Kconfig" + +source "drivers/Kconfig" diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile new file mode 100644 index 0000000000..6fe20cb7bf --- /dev/null +++ b/xen/arch/riscv/Makefile @@ -0,0 +1,62 @@ +subdir-y +=3D lib + +obj-y +=3D domctl.o +obj-y +=3D domain.o +obj-y +=3D delay.o +# obj-y +=3D entry.o +obj-y +=3D guestcopy.o +obj-y +=3D irq.o +obj-y +=3D p2m.o +obj-y +=3D mm.o +obj-y +=3D percpu.o +obj-y +=3D setup.o +obj-y +=3D shutdown.o +obj-y +=3D smp.o +obj-y +=3D smpboot.o +obj-y +=3D sysctl.o +obj-y +=3D traps.o +obj-y +=3D time.o +obj-y +=3D vm_event.o + +#obj-bin-y +=3D ....o + +ALL_OBJS :=3D head.o $(ALL_OBJS) + +DEPS +=3D .head.o.d + +$(TARGET): $(TARGET)-syms + $(OBJCOPY) -O binary -S $< $@ + +prelink.o: $(ALL_OBJS) + $(LD) $(LDFLAGS) -r -o $@ $^ + +$(TARGET)-syms: prelink.o xen.lds + $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \ + $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0 + $(NM) -pa --format=3Dsysv $(@D)/.$(@F).0 \ + | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort >$(@D)/.$(@F).0.S + $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o + $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \ + $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1 + $(NM) -pa --format=3Dsysv $(@D)/.$(@F).1 \ + | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort >$(@D)/.$(@F).1.S + $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o + $(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ + $(@D)/.$(@F).1.o -o $@ + $(NM) -pa --format=3Dsysv $(@D)/$(@F) \ + | $(BASEDIR)/tools/symbols --xensyms --sysv --sort \ + >$(@D)/$(@F).map + rm -f $(@D)/.$(@F).[0-9]* + +asm-offsets.s: asm-offsets.c + $(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $< + +xen.lds: xen.lds.S + $(CC) -P -E -Ui386 $(AFLAGS) -o $@ $< + sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new + mv -f .xen.lds.d.new .xen.lds.d + +.PHONY: clean +clean:: + rm -f asm-offsets.s xen.lds + rm -f $(BASEDIR)/.xen-syms.[0-9]* \ No newline at end of file diff --git a/xen/arch/riscv/Rules.mk b/xen/arch/riscv/Rules.mk new file mode 100644 index 0000000000..c6ed2a96a1 --- /dev/null +++ b/xen/arch/riscv/Rules.mk @@ -0,0 +1,55 @@ +######################################## +# riscv-specific definitions + +# +# If you change any of these configuration options then you must +# 'make clean' before rebuilding. +# + +CFLAGS +=3D -I$(BASEDIR)/include + +$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) +$(call cc-option-add,CFLAGS,CC,-Wnested-externs) + +EARLY_PRINTK :=3D n + +ifeq ($(CONFIG_DEBUG),y) + +# See docs/misc/arm/early-printk.txt for syntax + +EARLY_PRINTK :=3D 8250,0x1c021000,2 + +ifneq ($(EARLY_PRINTK_$(CONFIG_EARLY_PRINTK)),) +EARLY_PRINTK_CFG :=3D $(subst $(comma), ,$(EARLY_PRINTK_$(CONFIG_EARLY_PRI= NTK))) +else +EARLY_PRINTK_CFG :=3D $(subst $(comma), ,$(CONFIG_EARLY_PRINTK)) +endif + +# Extract configuration from string +EARLY_PRINTK_INC :=3D $(word 1,$(EARLY_PRINTK_CFG)) +EARLY_UART_BASE_ADDRESS :=3D $(word 2,$(EARLY_PRINTK_CFG)) + +# UART specific options +ifeq ($(EARLY_PRINTK_INC),8250) +EARLY_UART_REG_SHIFT :=3D $(word 3,$(EARLY_PRINTK_CFG)) +endif + +ifneq ($(EARLY_PRINTK_INC),) +EARLY_PRINTK :=3D y +endif + +CFLAGS-$(EARLY_PRINTK) +=3D -DCONFIG_EARLY_PRINTK +CFLAGS-$(EARLY_PRINTK_INIT_UART) +=3D -DEARLY_PRINTK_INIT_UART +CFLAGS-$(EARLY_PRINTK) +=3D -DEARLY_PRINTK_INC=3D\"debug-$(EARLY_PRINTK_IN= C).inc\" +CFLAGS-$(EARLY_PRINTK) +=3D -DEARLY_PRINTK_BAUD=3D$(EARLY_PRINTK_BAUD) +CFLAGS-$(EARLY_PRINTK) +=3D -DEARLY_UART_BASE_ADDRESS=3D$(EARLY_UART_BASE_= ADDRESS) +CFLAGS-$(EARLY_PRINTK) +=3D -DEARLY_UART_REG_SHIFT=3D$(EARLY_UART_REG_SHIF= T) + +else # !CONFIG_DEBUG + +ifneq ($(CONFIG_EARLY_PRINTK),) +# Early printk is dependant on a debug build. +$(error CONFIG_EARLY_PRINTK enabled for non-debug build) +endif + +endif diff --git a/xen/arch/riscv/configs/riscv32_defconfig b/xen/arch/riscv/conf= igs/riscv32_defconfig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/xen/arch/riscv/configs/riscv64_defconfig b/xen/arch/riscv/conf= igs/riscv64_defconfig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/xen/arch/riscv/platforms/Kconfig b/xen/arch/riscv/platforms/Kc= onfig new file mode 100644 index 0000000000..6959ec35a2 --- /dev/null +++ b/xen/arch/riscv/platforms/Kconfig @@ -0,0 +1,31 @@ +choice + prompt "Platform Support" + default ALL_PLAT + ---help--- + Choose which hardware platform to enable in Xen. + + If unsure, choose ALL_PLAT. + +config ALL_PLAT + bool "All Platforms" + ---help--- + Enable support for all available hardware platforms. It doesn't + automatically select any of the related drivers. + +config QEMU + bool "QEMU RISC-V virt machine support" + depends on RISCV + select HAS_NS16550 + ---help--- + Enable all the required drivers for QEMU RISC-V virt emulated + machine. + +endchoice + +config ALL64_PLAT + bool + default (ALL_PLAT && RISCV_64) + +config ALL32_PLAT + bool + default (ALL_PLAT && RISCV_32) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S new file mode 100644 index 0000000000..37ff8cf6ee --- /dev/null +++ b/xen/arch/riscv/xen.lds.S @@ -0,0 +1,262 @@ +/** + * Copyright (c) 2018 Anup Patel. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * @file linker.ld + * @author Anup Patel (anup@brainfault.org) + * @brief CPU specific linker script + */ + +#include +#include +#undef ENTRY +#undef ALIGN + +OUTPUT_ARCH(riscv) +ENTRY(start) + +PHDRS +{ + text PT_LOAD ; +#if defined(BUILD_ID) + note PT_NOTE ; +#endif +} + +SECTIONS +{ + . =3D XEN_VIRT_START; + . =3D ALIGN(PAGE_SIZE); /* Need this to create proper sections */ + PROVIDE(_code_start =3D .); + + /* Beginning of the code section */ + + .text : + { + PROVIDE(_text_start =3D .); + _stext =3D .; /* Text section */ + *(.entry) + *(.text) + . =3D ALIGN(8); + _etext =3D .; /* End of text section */ + PROVIDE(_text_end =3D .); + } :text =3D 0x9090 + + . =3D ALIGN(PAGE_SIZE); /* Ensure next section is page aligned */ + + .init : + { + PROVIDE(_init_start =3D .); + + *(.init.text) + . =3D ALIGN(8); + + PROVIDE(__setup_start =3D .); + *(.setup.init); + PROVIDE(__setup_end =3D .); + + . =3D ALIGN(PAGE_SIZE); + *(.devtree) + . =3D ALIGN(PAGE_SIZE); + + PROVIDE(_init_end =3D .); + + . =3D ALIGN(PAGE_SIZE); + + PROVIDE(_initdata_start =3D .); + *(.init.data) + . =3D ALIGN(8); + PROVIDE(_initdata_end =3D .); + } + + . =3D ALIGN(PAGE_SIZE); /* Ensure next section is page aligned */ + + .cpuinit : + { + PROVIDE(_cpuinit_start =3D .); + *(.cpuinit.*) + . =3D ALIGN(8); + PROVIDE(_cpuinit_end =3D .); + } + + . =3D ALIGN(PAGE_SIZE); /* Ensure next section is page aligned */ + + .spinlock : + { + PROVIDE(_spinlock_start =3D .); + *(.spinlock.*) + . =3D ALIGN(8); + PROVIDE(_spinlock_end =3D .); + } + + /* End of the code sections */ + + /* Beginning of the read-only data sections */ + + . =3D ALIGN(PAGE_SIZE); /* Ensure next section is page aligned */ + + .rodata : + { + PROVIDE(_rodata_start =3D .); + *(.rodata .rodata.*) + . =3D ALIGN(8); + _srodata =3D .; + /* Bug frames table */ + __start_bug_frames =3D .; + *(.bug_frames.0) + __stop_bug_frames_0 =3D .; + *(.bug_frames.1) + __stop_bug_frames_1 =3D .; + *(.bug_frames.2) + __stop_bug_frames_2 =3D .; + *(.rodata) + *(.rodata.*) + *(.data.rel.ro) + *(.data.rel.ro.*) + + . =3D ALIGN(POINTER_ALIGN); + __param_start =3D .; + *(.data.param) + __param_end =3D .; + + __proc_info_start =3D .; + *(.proc.info) + __proc_info_end =3D .; + PROVIDE(_rodata_end =3D .); + } + + . =3D ALIGN(4); + .note.gnu.build-id : { + __note_gnu_build_id_start =3D .; + *(.note.gnu.build-id) + __note_gnu_build_id_end =3D .; + } :note :text + + /* End of the read-only data sections */ + + /* Beginning of the read-write data sections */ + + . =3D ALIGN(PAGE_SIZE); /* Ensure next section is page aligned */ + + .percpu : + { + PROVIDE(_percpu_start =3D .); + *(.percpu) + . =3D ALIGN(8); + PROVIDE(_percpu_end =3D .); + } + + . =3D ALIGN(PAGE_SIZE); /* Ensure next section is page aligned */ + + .data : + { + PROVIDE(_data_start =3D .); + + *(.data.page_aligned) + *(.data) + . =3D ALIGN(8); + __start_schedulers_array =3D .; + *(.data.schedulers) + __end_schedulers_array =3D .; + *(.data.rel) + *(.data.rel.*) + CONSTRUCTORS + + PROVIDE(_data_end =3D .); + } + + . =3D ALIGN(PAGE_SIZE); /* Init code and data */ + __init_begin =3D .; + .init.text : { + _sinittext =3D .; + *(.init.text) + _einittext =3D .; + } :text + . =3D ALIGN(PAGE_SIZE); + .init.data : { + *(.init.rodata) + *(.init.rodata.rel) + *(.init.rodata.str*) + + . =3D ALIGN(POINTER_ALIGN); + __setup_start =3D .; + *(.init.setup) + __setup_end =3D .; + + __initcall_start =3D .; + *(.initcallpresmp.init) + __presmp_initcall_end =3D .; + *(.initcall1.init) + __initcall_end =3D .; + + . =3D ALIGN(4); + __alt_instructions =3D .; + *(.altinstructions) + __alt_instructions_end =3D .; + . =3D ALIGN(4); + *(.altinstr_replacement) + + *(.init.data) + *(.init.data.rel) + *(.init.data.rel.*) + + . =3D ALIGN(8); + __ctors_start =3D .; + *(.ctors) + *(.init_array) + *(SORT(.init_array.*)) + __ctors_end =3D .; + + } :text + . =3D ALIGN(STACK_SIZE); + __init_end =3D .; + + . =3D ALIGN(PAGE_SIZE); /* Ensure next section is page aligned */ + + .bss : + { + PROVIDE(_bss_start =3D .); + *(.bss.stack_aligned) + . =3D ALIGN(PAGE_SIZE); + *(.bss.page_aligned) + *(.bss) + . =3D ALIGN(SMP_CACHE_BYTES); + __per_cpu_start =3D .; + *(.bss.percpu) + . =3D ALIGN(SMP_CACHE_BYTES); + *(.bss.percpu.read_mostly) + . =3D ALIGN(SMP_CACHE_BYTES); + __per_cpu_data_end =3D .; + PROVIDE(_bss_end =3D .); + } + + . =3D ALIGN(PAGE_SIZE); /* Ensure next section is page aligned */ + + .hvc_stack : + { + PROVIDE(_hvc_stack_start =3D .); + . =3D . + (STACK_SIZE * CONFIG_NR_CPUS); + . =3D ALIGN(8); + PROVIDE(_hvc_stack_end =3D .); + } + + /* End of the read-write data sections */ + + . =3D ALIGN(PAGE_SIZE); /* Need this to create proper pages */ + + PROVIDE(_code_end =3D .); +} diff --git a/xen/drivers/passthrough/Makefile b/xen/drivers/passthrough/Mak= efile index d50ab188c8..3c8ef68418 100644 --- a/xen/drivers/passthrough/Makefile +++ b/xen/drivers/passthrough/Makefile @@ -2,6 +2,7 @@ subdir-$(CONFIG_X86) +=3D vtd subdir-$(CONFIG_X86) +=3D amd subdir-$(CONFIG_X86) +=3D x86 subdir-$(CONFIG_ARM) +=3D arm +subdir-$(CONFIG_RISCV) +=3D riscv =20 obj-y +=3D iommu.o obj-$(CONFIG_HAS_PCI) +=3D pci.o diff --git a/xen/drivers/passthrough/riscv/Makefile b/xen/drivers/passthrou= gh/riscv/Makefile new file mode 100644 index 0000000000..0484b796b0 --- /dev/null +++ b/xen/drivers/passthrough/riscv/Makefile @@ -0,0 +1 @@ +obj-y +=3D iommu.o --=20 2.25.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel