From nobody Sun May 5 11:16:13 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=1621018471; cv=none; d=zohomail.com; s=zohoarc; b=bXncvD++cgLKpF4hbPDwTfIuXeVPgHbtCoLjz0jh4eTMORy/44P6Ngo2DhklRhDJ00NaacowRG4aKMiArts/qkSKYXkjpE5I0ZSYRKmGqD/oxzNrz4DugoTszR7dR6ZNBtmsqhcg5YK6emFGJh5PtUxWl0rYkRVvdEm4EPlcBos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621018471; 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=3ZyiRnb9WVtOr1miy5zSjmis6+BOGxMggG62SA/umH8=; b=kQQ47/O6TIsQ83+Ypdw3S39UV0XarLCKDYb2Zwun892T5nnb69lHK01cBJtguxc8gMCVh8ZVxEP8tdnOCzZM2117SmXzGWSBOZXLkD2QdWkMv7AUw2MjWRUoWT8Ye9T9Y+j2Hvfs8Brfd3RpVWUszr1tkT7LQ5buyaOQ4q0w0sc= 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 1621018471059894.3523737033722; Fri, 14 May 2021 11:54:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.127485.239606 (Exim 4.92) (envelope-from ) id 1lhcwt-0001jx-CR; Fri, 14 May 2021 18:54:11 +0000 Received: by outflank-mailman (output) from mailman id 127485.239606; Fri, 14 May 2021 18:54:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcwt-0001jq-8G; Fri, 14 May 2021 18:54:11 +0000 Received: by outflank-mailman (input) for mailman id 127485; Fri, 14 May 2021 18:54:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcwr-0001R5-ID for xen-devel@lists.xenproject.org; Fri, 14 May 2021 18:54:09 +0000 Received: from mail-il1-x130.google.com (unknown [2607:f8b0:4864:20::130]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 31d89682-3904-4638-b714-9e0170676e68; Fri, 14 May 2021 18:54:05 +0000 (UTC) Received: by mail-il1-x130.google.com with SMTP id r5so625109ilb.2 for ; Fri, 14 May 2021 11:54:05 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id d81sm2815190iof.26.2021.05.14.11.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 11:54:04 -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: 31d89682-3904-4638-b714-9e0170676e68 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=3ZyiRnb9WVtOr1miy5zSjmis6+BOGxMggG62SA/umH8=; b=eJGco2a1tomoj6gw/zyZjjfGUagfbHQEckqHj6YRKZQbiYMoK9bCjFDBqZgAztQktc Hkd6n5m8LtxCtw4q8UY7hrru5QsaZ8FHT32W5bsmJPHY+zIzmvHIaKwiLaSKCmMcehv1 qcIMb1uUuImTwGfHO6QNlR/2dmbwJGj8c24PQ79p8xnUANJvdG3YskahyT3dEaQY/Xaw vafYkHMjhp3knJhThf1q92mxfWPKmudE+y1Vq7NNatoRZrKEYDbWB+IKQ1G9zsaQdRpN 2UWS1tQ4C+xdpm0hcp2aEjNkrDK4tnLtk6MZ0K1F3CP2m6FONzQ3x3HQxSEh9rrOpcaK GSNg== 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=3ZyiRnb9WVtOr1miy5zSjmis6+BOGxMggG62SA/umH8=; b=jDxpHxMmIE5qwWUJ6KfkBG4cKXofC6qmArFR46RLOUf8jvNOLR3D8G2kbvNuqgWAnc 6qpjW+wrREepsc+t/S6mNznyTe0rCvha5HraWxuIGXMGRQPDLuquYvir2e0nzMuzbKke UNSVy2PXRNQvO+QWkn9TAwt4QhfDBZMwCIHtA/l0uvphhUP6VM3qExM/fjVap/F4TbjE gTjOkLgn4aDDh1dOwJu1cdTeIUd9Pc84Nvd24WhntqJ7sZud65doWclQFgScKDGkFLIk JZw2o9+f34OUdNmPpkdK65Ii1cAreW8Z0h0sHe/Hdr+QwHN9PrsxXR0lccsPFGA16fTo cmUQ== X-Gm-Message-State: AOAM533M2BKZLp0dNgvcFm63/9qM2VoQkQLWabXNPP+uHXe0/cGGSsQN gN5o4kyVVunduYbSf3/alrgZRU3wjF8Z7w== X-Google-Smtp-Source: ABdhPJxORXVTkCb9xQ/n10JtvuniniP2lgIXzB4QiGFKmbPlpndKtHWiUIW2Wfn+lytSZAbzUlQEog== X-Received: by 2002:a05:6e02:1545:: with SMTP id j5mr11038056ilu.35.1621018444806; Fri, 14 May 2021 11:54:04 -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 v3 1/5] xen/char: Default HAS_NS16550 to y only for X86 and ARM Date: Fri, 14 May 2021 12:53:21 -0600 Message-Id: <3960a676376e0163d97ac02f968966cdfaccbf75.1621017334.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 Reviewed-by: Alistair Francis --- xen/drivers/char/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig index b572305657..b15b0c8d6a 100644 --- a/xen/drivers/char/Kconfig +++ b/xen/drivers/char/Kconfig @@ -1,6 +1,6 @@ config HAS_NS16550 bool "NS16550 UART driver" if ARM - default y + default y if (ARM || X86) help This selects the 16550-series UART support. For most systems, say Y. =20 --=20 2.31.1 From nobody Sun May 5 11:16:13 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=1621018470; cv=none; d=zohomail.com; s=zohoarc; b=U7y2G8+m3ogNARoS4SWLPjcCmTfTUB0YVma+I6w5QzVFOOL+QGuOxWK1nNAg4jTW/COQ/TRpDrO2VbGiRhjEjZ90MkfnUP00fn7j6ikQbSBA+vIYlZGscfewchum4XsZGZY5mZS6po1Hd8eHA8gL9ry/XBLM4FjfraZ+GvR+Dhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621018470; 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=iluLvhPa3OY2DopHKBkR7Xvis99pDwru79D3Q8FxEio=; b=CiyMWLN3kZr9dfIGVncYw2pb5nWebvdZ0Iq1kPjJSScUbB7CXIvf6mYBHm5fKzL8/waCDIUc3Xl9t2/l8wzxE7OZabKG4r7fGYL/gk7dg9HR036+BIEiyBCWqKjElSxrbYMIXgtauhGjRUdwRiKcYGYncXO/khlMGnD1sqV4adI= 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 162101847049141.80601842631472; Fri, 14 May 2021 11:54:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.127486.239617 (Exim 4.92) (envelope-from ) id 1lhcwx-00023K-Le; Fri, 14 May 2021 18:54:15 +0000 Received: by outflank-mailman (output) from mailman id 127486.239617; Fri, 14 May 2021 18:54:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcwx-000239-GP; Fri, 14 May 2021 18:54:15 +0000 Received: by outflank-mailman (input) for mailman id 127486; Fri, 14 May 2021 18:54:14 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcww-0001R5-IA for xen-devel@lists.xenproject.org; Fri, 14 May 2021 18:54:14 +0000 Received: from mail-io1-xd33.google.com (unknown [2607:f8b0:4864:20::d33]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e627cd2f-e916-46be-afea-f98f6f0457e1; Fri, 14 May 2021 18:54:06 +0000 (UTC) Received: by mail-io1-xd33.google.com with SMTP id d24so19102570ios.2 for ; Fri, 14 May 2021 11:54:06 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id d81sm2815190iof.26.2021.05.14.11.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 11:54:05 -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: e627cd2f-e916-46be-afea-f98f6f0457e1 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=iluLvhPa3OY2DopHKBkR7Xvis99pDwru79D3Q8FxEio=; b=ZqAPjMz81sQ6Mja0yWmqh4jyQlLNIZ6DIOXrf1dXTRs2Aesv50iF5gqFQcS4dqxtb9 9DzeKF17eajqevL3qqo8FyrGEV3cm0PUl+td/fSDUZCWwDIzlTn3q8xAFAY9QlznRr3K O15sPo9MmEWSmk6DAaB8u8dNonz/ik14TIaUtRm8OL66VlsjR+UagJZOOUYXxYeeEEGW ct4kupLtSalUduJQyWWW8YmMG6vxx5vG6vFXpocP1BWiMt1I5o9MN5X6q7QXmwMHwSxG KiTO71g1zqbQXUm0juxkq7JJ6MLivyehc5flXDdLjrsK1fqVRro5pznnOoO+V/bC5dJm frIQ== 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=iluLvhPa3OY2DopHKBkR7Xvis99pDwru79D3Q8FxEio=; b=PlXX8wf0llHDacIErUL37NWlkI4UBEZOJdKElVWKPuMyugaV1ngYyngKQQmT7kZoCk 4Mx7/Uk5uRi0WgDxantP+55Ta7QwNdgYEaPAYoe3WBRqomaZcReTJm59f+8Gy6K6ygPZ no+njcBN/ieA0aZpHz0xWSXXDWPOx6yKW1rhktyyX+Cv/wA6UqWqTSvEJW9ijGkiST4R 9tvAmGN42J6R2MZ1FyuT4npkj4z1x6LJ556Z+EE+feTfu/Wzrndm7Kz4qCvF5zto3+Dm n7FvlM84SELv6IQmauPSDS5wBc2w+dCs4gQ6zinD/G0ZTaBPykj/esCAtrF6Zer3UKrp LcQQ== X-Gm-Message-State: AOAM530NiuEEV2YG4VoTQAi3xXCXdUzOOKzx9EQjNOZqhkwgHburyF9f HrmcaIbGND7Cs0EkgrbgSmtM3+tE51cWBw== X-Google-Smtp-Source: ABdhPJzSTRWnJ9GQzEmknI4HLkg5i5QpjvFzfYDGmQBZXIxyQH47g0uQBH3YteEv1TAPUbYAPf0zQw== X-Received: by 2002:a05:6638:3ab:: with SMTP id z11mr44310166jap.58.1621018446053; Fri, 14 May 2021 11:54:06 -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 , Paul Durrant Subject: [PATCH v3 2/5] xen/common: Guard iommu symbols with CONFIG_HAS_PASSTHROUGH Date: Fri, 14 May 2021 12:53:22 -0600 Message-Id: <1156cb116da19ef64323e472bb6b6e87c6c73d77.1621017334.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" The variables iommu_enabled and iommu_dont_flush_iotlb are defined in drivers/passthrough/iommu.c and are referenced in common code, which causes the link to fail when !CONFIG_HAS_PASSTHROUGH. Guard references to these variables in common code so that xen builds when !CONFIG_HAS_PASSTHROUGH. Signed-off-by: Connor Davis --- xen/common/memory.c | 10 ++++++++++ xen/include/xen/iommu.h | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/xen/common/memory.c b/xen/common/memory.c index b5c70c4b85..72a6b70cb5 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -294,7 +294,9 @@ int guest_remove_page(struct domain *d, unsigned long g= mfn) p2m_type_t p2mt; #endif mfn_t mfn; +#ifdef CONFIG_HAS_PASSTHROUGH bool *dont_flush_p, dont_flush; +#endif int rc; =20 #ifdef CONFIG_X86 @@ -385,13 +387,17 @@ int guest_remove_page(struct domain *d, unsigned long= gmfn) * Since we're likely to free the page below, we need to suspend * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes. */ +#ifdef CONFIG_HAS_PASSTHROUGH dont_flush_p =3D &this_cpu(iommu_dont_flush_iotlb); dont_flush =3D *dont_flush_p; *dont_flush_p =3D false; +#endif =20 rc =3D guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0); =20 +#ifdef CONFIG_HAS_PASSTHROUGH *dont_flush_p =3D dont_flush; +#endif =20 /* * With the lack of an IOMMU on some platforms, domains with DMA-capab= le @@ -839,11 +845,13 @@ int xenmem_add_to_physmap(struct domain *d, struct xe= n_add_to_physmap *xatp, xatp->gpfn +=3D start; xatp->size -=3D start; =20 +#ifdef CONFIG_HAS_PASSTHROUGH if ( is_iommu_enabled(d) ) { this_cpu(iommu_dont_flush_iotlb) =3D 1; extra.ppage =3D &pages[0]; } +#endif =20 while ( xatp->size > done ) { @@ -868,6 +876,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_= add_to_physmap *xatp, } } =20 +#ifdef CONFIG_HAS_PASSTHROUGH if ( is_iommu_enabled(d) ) { int ret; @@ -894,6 +903,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_= add_to_physmap *xatp, if ( unlikely(ret) && rc >=3D 0 ) rc =3D ret; } +#endif =20 return rc; } diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 460755df29..d878a93269 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -51,9 +51,15 @@ static inline bool_t dfn_eq(dfn_t x, dfn_t y) return dfn_x(x) =3D=3D dfn_x(y); } =20 -extern bool_t iommu_enable, iommu_enabled; +extern bool_t iommu_enable; extern bool force_iommu, iommu_quarantine, iommu_verbose; =20 +#ifdef CONFIG_HAS_PASSTHROUGH +extern bool_t iommu_enabled; +#else +#define iommu_enabled false +#endif + #ifdef CONFIG_X86 extern enum __packed iommu_intremap { /* --=20 2.31.1 From nobody Sun May 5 11:16:13 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=1621018473; cv=none; d=zohomail.com; s=zohoarc; b=cuWqVsi4QxOzI73le8M4R2C8lSck2pseLkZPDm7vi7yaRYW7h4LW+4CrblwU5215YUqOwNtQnTMQGJJUdyjtVCev1sXSL5pV6ZKwrQ2TsLdrCpe9ZqO55dlmDyyT/N41rQUgAdY/iLDwnJfmvLUi8HUm/RhhQD+0rgmuVsixbGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621018473; 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=aZUcLbAyYZr/mu1DuUlZ6kf0uoeQ0LVDzaRiHOP28GY=; b=a+WWRzH6OQACmBa2xCpJD5nT+cyBx5kCWA77asG/aRD/QI7q4W/PXQ0Yy8BhB83a8M9oj8zhcMHt002OAQZwQdU4SoJKm3m54xo5HlRbhlO6PE7B1+JUD0bZqD2oeeq2qZ1oR0IG8S6lFnY31uy/iM2K6tQjQKu93OGjASgVx2Y= 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 1621018473538134.7248230090131; Fri, 14 May 2021 11:54:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.127488.239628 (Exim 4.92) (envelope-from ) id 1lhcx2-0002Rk-UG; Fri, 14 May 2021 18:54:20 +0000 Received: by outflank-mailman (output) from mailman id 127488.239628; Fri, 14 May 2021 18:54:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcx2-0002Rd-QS; Fri, 14 May 2021 18:54:20 +0000 Received: by outflank-mailman (input) for mailman id 127488; Fri, 14 May 2021 18:54:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcx1-0001R5-IN for xen-devel@lists.xenproject.org; Fri, 14 May 2021 18:54:19 +0000 Received: from mail-il1-x12e.google.com (unknown [2607:f8b0:4864:20::12e]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ee43060e-79e4-409b-8d3d-c3c59584781e; Fri, 14 May 2021 18:54:07 +0000 (UTC) Received: by mail-il1-x12e.google.com with SMTP id h11so584625ili.9 for ; Fri, 14 May 2021 11:54:07 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id d81sm2815190iof.26.2021.05.14.11.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 11:54:07 -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: ee43060e-79e4-409b-8d3d-c3c59584781e 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=aZUcLbAyYZr/mu1DuUlZ6kf0uoeQ0LVDzaRiHOP28GY=; b=P0jc2FBfxZxHsaAQlVSO1k1XLOGOTzpFWKon1uh24SlEm7rgvPi0dGmXN8P1vTKrYo JCoU/XWcVqogkukVPvDqyIQyBfwwPiPfIbS7n9Oc2QLx9OEbpbcLPuIEmwkW5/J9UCPj VMlgHhs/4fcQyURanvKpXtXLUY66Ll2KfjSJVUoO1iOOBC/qLHLsKOV6mcBtgdWeSIMY BywEHROGml2C1EKy8JNaStusibZw+VJt8b6Y0xRWSuqy0AM+6ORcRw9J/w3zTy/KdzDb 61tuLiYKe4NjmqA+DnvL0q/v6cLTZ7w3NvHL8LtJ3dSJAubQFIkMXXAMP/3buFA0xNkB YqCA== 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=aZUcLbAyYZr/mu1DuUlZ6kf0uoeQ0LVDzaRiHOP28GY=; b=s9JSW9r8U6u01ulnO69RlmDt1hCgQFE7WKMU1X3RNkxzLw/Z7hrkobb6W5r83zJ4A+ PhJEXz74fhgfvUBtxVJ6hbB53e6fKWAm6b3ppqSHUA3jawbBphzDmlgtSEtJJ947xTsw DQfBT7Y8rBxStIGLdKTOjtT2EZY/8zbyrHgdSPrefnTc8eecdU0GjYpP4cI6I8oiL6ER Em8HF+gYPkYcvIKvYou2J8UOSpvJ/+8bB9MAEjNwIrXoVWZnAW8HMM1WRzl8adDoA9+R ioxJC+4fL6GIhDsv1RZFJUaV+pc0CZcnmeCOO0HO0GYygbO4vEO4qJzXGrI2lyxbi+2Z 4pjg== X-Gm-Message-State: AOAM533fGlDmhCXotb1trhpGAIvX2rAV7DKmN4Z831vMZtwsu6t+yJQa wnw5ozPYBGl8G1revIwW2+tFk7EUDm/nkw== X-Google-Smtp-Source: ABdhPJxbZQD1P9VmTwcBwo83IVE6LpSFxrPkfj+tOB1A88tB10+Ieq3hahvnTcEANQtwwQz06xYqvQ== X-Received: by 2002:a05:6e02:1be8:: with SMTP id y8mr2239039ilv.52.1621018447314; Fri, 14 May 2021 11:54:07 -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 v3 3/5] xen: Fix build when !CONFIG_GRANT_TABLE Date: Fri, 14 May 2021 12:53:23 -0600 Message-Id: <834f7995ae80a3b37b6d508d1c989b4ee391f61b.1621017334.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" Move struct grant_table; in grant_table.h above ifdef CONFIG_GRANT_TABLE. This fixes the following: /build/xen/include/xen/grant_table.h:84:50: error: 'struct grant_table' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] 84 | static inline int mem_sharing_gref_to_gfn(struct grant_table *gt, | Signed-off-by: Connor Davis Acked-by: Jan Beulich --- xen/include/xen/grant_table.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h index 63b6dc78f4..9f8b7e66c1 100644 --- a/xen/include/xen/grant_table.h +++ b/xen/include/xen/grant_table.h @@ -28,9 +28,10 @@ #include #include =20 -#ifdef CONFIG_GRANT_TABLE struct grant_table; =20 +#ifdef CONFIG_GRANT_TABLE + extern unsigned int opt_max_grant_frames; =20 /* Create/destroy per-domain grant table context. */ --=20 2.31.1 From nobody Sun May 5 11:16:13 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=1621018478; cv=none; d=zohomail.com; s=zohoarc; b=jj4fMjuAPFC7/2QclMV328P23Q///pJqQOSyrpDn2moIJwJaVN5ux1bOQ2SUKl/J8SnF8QqIc4LQQC4/8PJfLQitevip+/Nd/hos/mml7LtZaXRQBFKqc+jFIl6G24Jd6zeDSW2eHQlsK7eZW2VHWGCUjtPLQO/m9VnwJs6d3YQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621018478; 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=zIAC1xDVnT0fSpVJ2YCItiTMjfHRx3z5TUS+XXT8py4=; b=dOFAjEkbLV5NxkT99zNPHNpZ3BXdbq2tKn7HnWvBt8BQgE9UjGWy+BA4Uqus1WPhH8LIYTfCGlXeyOk0Vid6NnOJYQMcnEaxrb/M6W+JDz3bQzCC7Ia1q5vhKjJe9uUyxdVShg2ZPuxez5XzUKCvB470SiIrxuro9tjz9vvflh4= 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 1621018478463783.6983821308571; Fri, 14 May 2021 11:54:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.127490.239639 (Exim 4.92) (envelope-from ) id 1lhcx8-00032K-8V; Fri, 14 May 2021 18:54:26 +0000 Received: by outflank-mailman (output) from mailman id 127490.239639; Fri, 14 May 2021 18:54:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcx8-000328-4h; Fri, 14 May 2021 18:54:26 +0000 Received: by outflank-mailman (input) for mailman id 127490; Fri, 14 May 2021 18:54:24 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcx6-0001R5-IQ for xen-devel@lists.xenproject.org; Fri, 14 May 2021 18:54:24 +0000 Received: from mail-il1-x12b.google.com (unknown [2607:f8b0:4864:20::12b]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1cdc3d92-352d-4bb1-a4c9-206b3234064f; Fri, 14 May 2021 18:54:09 +0000 (UTC) Received: by mail-il1-x12b.google.com with SMTP id p15so617921iln.3 for ; Fri, 14 May 2021 11:54:09 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id d81sm2815190iof.26.2021.05.14.11.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 11:54:08 -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: 1cdc3d92-352d-4bb1-a4c9-206b3234064f 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=zIAC1xDVnT0fSpVJ2YCItiTMjfHRx3z5TUS+XXT8py4=; b=SHx4dDseUJs48OcZHLFxbEPAs0NXzTtBpoMGJJh8LN9ACY41pUxnOiSaL2RlP9GLHf x9VJXeoYaq8ZgC//KRQqIRKWtm/gyH7kqTuMf/MT0YSo8FlTKgJJfUKuGPftvTdFyKP9 qPy91+zeECVbVSQiqSX60ahLxwR21Y5sF53fPxIo3QWjONQ9xWvmWfBEuxarh2iwvL5z aodttAL7pj0rwHejpLmZaBBYU2O6+OvV5eHDpbvS22UTFHAFb4JwQduPkE5W+GUIKtPs g2e+GiGVWsmG0tFNVwG+7+ZN/X/W1fMmABiFM4B45RQOU8mAT11ert1NrEVNJdMSTzbs slGw== 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=zIAC1xDVnT0fSpVJ2YCItiTMjfHRx3z5TUS+XXT8py4=; b=QGOx4peHazxNy/deSuSmWf3GlHF4B2xFQ4z+xr79c9isFLVeOufgTqxSIx+KQnkasJ to0fY0C7ou2ZkWIucx+nDM5T1WVWJfIhn5mEirdeD6Ypj369H1bbYa6Lg3lnC2SDwXJQ Mlr2OQsVd/cBTfoqZVqYu8l4V874WNiS8YGD9EnAzEqjXIktgbYP2iGOGWDTkvcKoZwV yPC6nJyXiC3+dhoCVF1TOk3IgNan/xuK2Oxk4zOQ2+mSQusSQYa13i+PrATLXH+umHSw 4exa+inglhmdpAg81dsmd/gME50CY9lirGZ6WK9bHYnncOWbQyHri1hEWjGMtlyIJOtA 47vQ== X-Gm-Message-State: AOAM53252RUeh8v/yuvJQZZSzNtit+cJ1Y9PduwxSCa050TnGODBV7at UCR+fy/9F8Qc2eRn1xjk4Xs5y2NOuukoPA== X-Google-Smtp-Source: ABdhPJyE0Ge3YTrYbl06lpF4QsFq/fv7XLOHq2YIzGyA33haC3A+jAD9yRkfi1RApvOFQeKqy1FNSw== X-Received: by 2002:a92:4a0a:: with SMTP id m10mr6156291ilf.118.1621018448468; Fri, 14 May 2021 11:54:08 -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 v3 4/5] xen: Add files needed for minimal riscv build Date: Fri, 14 May 2021 12:53:24 -0600 Message-Id: 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 riscv64. 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 TARGET=3Dhead.o No other TARGET is supported at the moment. Signed-off-by: Connor Davis --- config/riscv64.mk | 5 ++ xen/Makefile | 8 +- xen/arch/riscv/Kconfig | 52 +++++++++++ xen/arch/riscv/Kconfig.debug | 0 xen/arch/riscv/Makefile | 0 xen/arch/riscv/Rules.mk | 0 xen/arch/riscv/arch.mk | 16 ++++ xen/arch/riscv/asm-offsets.c | 0 xen/arch/riscv/configs/riscv64_defconfig | 12 +++ xen/arch/riscv/head.S | 6 ++ xen/include/asm-riscv/config.h | 110 +++++++++++++++++++++++ 11 files changed, 207 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/asm-offsets.c create mode 100644 xen/arch/riscv/configs/riscv64_defconfig create mode 100644 xen/arch/riscv/head.S create mode 100644 xen/include/asm-riscv/config.h 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 9f3be7766d..60de4cc6cd 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..d4bbd4294e --- /dev/null +++ b/xen/arch/riscv/Kconfig @@ -0,0 +1,52 @@ +config 64BIT + bool + +config RISCV_64 + bool + depends on 64BIT + +config RISCV + def_bool y + +config ARCH_DEFCONFIG + string + default "arch/riscv/configs/riscv64_defconfig" if RISCV_64 + +menu "Architecture Features" + +source "arch/Kconfig" + +endmenu + +menu "ISA Selection" + +choice + prompt "Base ISA" + default RISCV_ISA_RV64IMA + help + This selects the base ISA extensions that Xen will target. + +config RISCV_ISA_RV64IMA + bool "RV64IMA" + select 64BIT + select RISCV_64 + help + Use the RV64I base ISA, plus the "M" and "A" extensions + for integer multiply/divide and atomic instructions, respective= ly. + +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..e69de29bb2 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..10229c5440 --- /dev/null +++ b/xen/arch/riscv/arch.mk @@ -0,0 +1,16 @@ +######################################## +# RISCV-specific definitions + +ifeq ($(CONFIG_RISCV_64),y) + CFLAGS +=3D -mabi=3Dlp64 +endif + +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/asm-offsets.c b/xen/arch/riscv/asm-offsets.c 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..664a5d2378 --- /dev/null +++ b/xen/arch/riscv/configs/riscv64_defconfig @@ -0,0 +1,12 @@ +# 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_DEBUG is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_HYPFS is not set +# CONFIG_GRANT_TABLE is not set +# CONFIG_SPECULATIVE_HARDEN_ARRAY is not set + +CONFIG_EXPERT=3Dy diff --git a/xen/arch/riscv/head.S b/xen/arch/riscv/head.S new file mode 100644 index 0000000000..0dbc27ba75 --- /dev/null +++ b/xen/arch/riscv/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..84cb436dc1 --- /dev/null +++ b/xen/include/asm-riscv/config.h @@ -0,0 +1,110 @@ +/*************************************************************************= ***** + * config.h + * + * A Linux-style configuration list. + */ + +#ifndef __RISCV_CONFIG_H__ +#define __RISCV_CONFIG_H__ + +#if defined(CONFIG_RISCV_64) +# define LONG_BYTEORDER 3 +# define ELFSIZE 64 +#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 1 +#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" + +#ifdef CONFIG_RISCV_64 +#define MAX_VIRT_CPUS 128u +#else +#error "Unsupported RISCV variant" +#endif + +#define INVALID_VCPU_ID MAX_VIRT_CPUS + +/* Linkage for RISCV */ +#ifdef __ASSEMBLY__ +#define ALIGN .align 2 + +#define ENTRY(name) \ + .globl name; \ + ALIGN; \ + name: +#endif + +#include + +#ifdef CONFIG_RISCV_64 + +/* + * RISC-V Layout: + * 0x0000000000000000 - 0x0000003fffffffff (256GB, L2 slots [0-255]) + * Unmapped + * 0x0000004000000000 - 0xffffffbfffffffff + * Inaccessible: sv39 only supports 39-bit sign-extended VAs. + * 0xffffffc000000000 - 0xffffffc0001fffff (2MB, L2 slot [256]) + * Unmapped + * 0xffffffc000200000 - 0xffffffc0003fffff (2MB, L2 slot [256]) + * Xen text, data, bss + * 0xffffffc000400000 - 0xffffffc0005fffff (2MB, L2 slot [256]) + * Fixmap: special-purpose 4K mapping slots + * 0xffffffc000600000 - 0xffffffc0009fffff (4MB, L2 slot [256]) + * Early boot mapping of FDT + * 0xffffffc000a00000 - 0xffffffc000bfffff (2MB, L2 slot [256]) + * Early relocation address, used when relocating Xen and later + * for livepatch vmap (if compiled in) + * 0xffffffc040000000 - 0xffffffc07fffffff (1GB, L2 slot [257]) + * VMAP: ioremap and early_ioremap + * 0xffffffc080000000 - 0xffffffc13fffffff (3GB, L2 slots [258..260]) + * Unmapped + * 0xffffffc140000000 - 0xffffffc1bfffffff (2GB, L2 slots [261..262]) + * Frametable: 48 bytes per page for 133GB of RAM + * 0xffffffc1c0000000 - 0xffffffe1bfffffff (128GB, L2 slots [263..390]) + * 1:1 direct mapping of RAM + * 0xffffffe1c0000000 - 0xffffffffffffffff (121GB, L2 slots [391..511]) + * Unmapped + */ + +#define L2_ENTRY_BITS 30 +#define L2_ENTRY_BYTES (_AC(1,UL) << L2_ENTRY_BITS) +#define L2_ADDR(_slot) \ + (((_AC(_slot, UL) >> 8) * _AC(0xffffff8000000000,UL)) | \ + (_AC(_slot, UL) << L2_ENTRY_BITS)) + +#define XEN_VIRT_START _AT(vaddr_t, L2_ADDR(256) + MB(2)) +#define HYPERVISOR_VIRT_START XEN_VIRT_START + +#define FRAMETABLE_VIRT_START _AT(vaddr_t, L2_ADDR(261)) + +#endif /* CONFIG_RISCV_64 */ + +#define STACK_ORDER 3 +#define STACK_SIZE (PAGE_SIZE << STACK_ORDER) + +#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 From nobody Sun May 5 11:16:13 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=1621018484; cv=none; d=zohomail.com; s=zohoarc; b=Rqd+IyxVwSszC3W+l70Mpta3zPS7d4RzmGG/oqLZhb7QA54qQj1e3e/EQv4nzh9jrRT7iHPIOohIz1m/ZSgPtfrEHQdTs63wyjVXYtFpcMTGFfUaEjatbsPuM0VE6WK4UJXEKJZpWZr9Tti7V+Her3Tr2nkZRdU41pRBL+LIvec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621018484; 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=dKx3kHJenx3C/CwPtUUrPl3dcyda2vxTcbUQPlrKK/I=; b=Xq5qZzQ1wgvdcx1s0PObL8tCrkiHbvW2XbnzkWyR4Jm0GhmYysbRDBTQ2+SDJLQlCVnBOIzLKMM33TpwyxgCbP4pr4C+xHhGk0y5hdTPqWH0jVX9fw2Q+lFIURdzyRWeM3MDRBwDvq2HkvByD8ToQKRG8TYCKpkNyR29OwLKs/w= 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 1621018484750601.63967513244; Fri, 14 May 2021 11:54:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.127494.239649 (Exim 4.92) (envelope-from ) id 1lhcxD-0003XE-Ic; Fri, 14 May 2021 18:54:31 +0000 Received: by outflank-mailman (output) from mailman id 127494.239649; Fri, 14 May 2021 18:54:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcxD-0003X7-E7; Fri, 14 May 2021 18:54:31 +0000 Received: by outflank-mailman (input) for mailman id 127494; Fri, 14 May 2021 18:54:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhcxB-0001R5-IY for xen-devel@lists.xenproject.org; Fri, 14 May 2021 18:54:29 +0000 Received: from mail-il1-x132.google.com (unknown [2607:f8b0:4864:20::132]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d41a3445-4e51-4fca-b306-9e1ab418212c; Fri, 14 May 2021 18:54:10 +0000 (UTC) Received: by mail-il1-x132.google.com with SMTP id j20so581131ilo.10 for ; Fri, 14 May 2021 11:54:10 -0700 (PDT) Received: from localhost.localdomain (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id d81sm2815190iof.26.2021.05.14.11.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 11:54:09 -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: d41a3445-4e51-4fca-b306-9e1ab418212c 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=dKx3kHJenx3C/CwPtUUrPl3dcyda2vxTcbUQPlrKK/I=; b=u+78FH0Vr3aWOovk/6ndFCwcIoD4RYH9MU6CT9zrTY7IgYS7bRgUP/VgaR98+UBOvF 8SlAnc9z2PHpbvanxUea/ViSfW8w04eQ2laQdvzDIQBGah0W57NX9WwzJUzjD8HGJPzm b3POupSVCma7wnpV/aIQdm7dlFq1NF1y98qwbs1Q4NYo/iQx2TNYHh0GBDmiplI6Tcjr vVBVAsxMF/sXfn/dThp/VV+7SnaTKVVIXmJltiGQGZpr2nXQuh2MLqQbBd1T6OO9dUmn 97ybZZHlQVXK4XyRjxmRkAnJ1qQt+jF0V/7NlX4p6J/XghYfACuA6bAk1+Z8BhbvZckQ 0ZaA== 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=dKx3kHJenx3C/CwPtUUrPl3dcyda2vxTcbUQPlrKK/I=; b=ZGeMNVXgCpqAV4Qs1BFS+OPSL3FDnS2seeLuIyYQVpHnY+U4ap7W9AWJoburwlZ+EN opFc+HZTyJUc7z7hbz+w92DTobueCVhWjSdU+eNZ9ZgDBHtTDAZ2XWsXXPeFEbjlC2nC 2KnE9x5gA1u9q2fJcoNHJ49OCQsDccJuupwDi61qVeZq8ovYa9nLWxgwIYX3k5+EoLbw RJ+ftCms3fVfhn4+/SD5zxtl3oiz93r7o8K1yCh0psos9mtza2j4Kpuu4YJVJENp7Jx8 LFuCQT0ClL1vK/AlPn4IIkXyMu7LcVUt49VyVvwz4iRx7ipVDnYPKxHPgX8HS8RxtZbD pi9g== X-Gm-Message-State: AOAM533f/6rhaFmbycdbmyfcZAGybdgnB7uhG4PJWFMDsX2g1haAQ5a/ bWtIngVCTuqycr2j/wivDZzidCRSOmavmA== X-Google-Smtp-Source: ABdhPJxtvP4iLSoWwduNkKcEriM6cSfd2KJ6iN8SoZ/MqzVNFqk2QN6vVu89CSHckxRX7gIVfd6Baw== X-Received: by 2002:a92:c569:: with SMTP id b9mr28228572ilj.117.1621018449545; Fri, 14 May 2021 11:54:09 -0700 (PDT) From: Connor Davis To: xen-devel@lists.xenproject.org Cc: Bobby Eshleman , Alistair Francis , Connor Davis , Doug Goldstein Subject: [PATCH v3 5/5] automation: Add container for riscv64 builds Date: Fri, 14 May 2021 12:53:25 -0600 Message-Id: <5a78ff425e45588da5c97c68e94275b649346012.1621017334.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 a container for cross-compiling xen to riscv64. This just includes the cross-compiler and necessary packages for building xen itself (packages for tools, stubdoms, etc., can be added later). Signed-off-by: Connor Davis --- automation/build/archlinux/riscv64.dockerfile | 33 +++++++++++++++++++ automation/scripts/containerize | 1 + 2 files changed, 34 insertions(+) create mode 100644 automation/build/archlinux/riscv64.dockerfile diff --git a/automation/build/archlinux/riscv64.dockerfile b/automation/bui= ld/archlinux/riscv64.dockerfile new file mode 100644 index 0000000000..505b623c01 --- /dev/null +++ b/automation/build/archlinux/riscv64.dockerfile @@ -0,0 +1,33 @@ +FROM archlinux +LABEL maintainer.name=3D"The Xen Project" \ + maintainer.email=3D"xen-devel@lists.xenproject.org" + +# Packages needed for the build +RUN pacman --noconfirm --needed -Syu \ + base-devel \ + gcc \ + git + +# Packages needed for QEMU +RUN pacman --noconfirm --needed -Syu \ + pixman \ + python \ + sh + +# There is a regression in GDB that causes an assertion error +# when setting breakpoints, use this commit until it is fixed! +RUN git clone --recursive -j$(nproc) --progress https://github.com/riscv/r= iscv-gnu-toolchain && \ + cd riscv-gnu-toolchain/riscv-gdb && \ + git checkout 1dd588507782591478882a891f64945af9e2b86c && \ + cd .. && \ + ./configure --prefix=3D/opt/riscv && \ + make linux -j$(nproc) && \ + rm -R /riscv-gnu-toolchain + +# Add compiler path +ENV PATH=3D/opt/riscv/bin/:${PATH} +ENV CROSS_COMPILE=3Driscv64-unknown-linux-gnu- + +RUN useradd --create-home user +USER user +WORKDIR /build diff --git a/automation/scripts/containerize b/automation/scripts/container= ize index b7c81559fb..59edf0ba40 100755 --- a/automation/scripts/containerize +++ b/automation/scripts/containerize @@ -26,6 +26,7 @@ BASE=3D"registry.gitlab.com/xen-project/xen" case "_${CONTAINER}" in _alpine) CONTAINER=3D"${BASE}/alpine:3.12" ;; _archlinux|_arch) CONTAINER=3D"${BASE}/archlinux:current" ;; + _riscv64) CONTAINER=3D"${BASE}/archlinux:riscv64" ;; _centos7) CONTAINER=3D"${BASE}/centos:7" ;; _centos72) CONTAINER=3D"${BASE}/centos:7.2" ;; _fedora) CONTAINER=3D"${BASE}/fedora:29";; --=20 2.31.1