xen: add patch to fix a regression with OP-TEE
Adds a patch to revert a Xen commit [1] which causes a regression with
OP-TEE. There is no more logs to the secure console after these lines:
I/TC: Added guest 1
D/TC:2 tee_entry_exchange_capabilities:100 Asynchronous notifications are disabled
D/TC:2 tee_entry_exchange_capabilities:109 Dynamic shared memory is enabled
...and TAs fail to open sessions with TEEC_ERROR_COMMUNICATION.
This is to prepare building Xen with Buildroot. The version of Xen
pulled by $(ROOT)/buildroot/package/xen is 4.14.3 and is affected by this
issue while the one we are currently using in $(ROOT)/xen is 4.14.1
and doesn't have the regression.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/br-ext/patches/xen/0001-Revert-xen-arm-Restrict-the-amount-of-memory-that-do.patch b/br-ext/patches/xen/0001-Revert-xen-arm-Restrict-the-amount-of-memory-that-do.patch
new file mode 100644
index 0000000..75083a6
--- /dev/null
+++ b/br-ext/patches/xen/0001-Revert-xen-arm-Restrict-the-amount-of-memory-that-do.patch
@@ -0,0 +1,37 @@
+From 82a8e6a916f1a7bb3910c365197319b37085d58c Mon Sep 17 00:00:00 2001
+From: Jerome Forissier <jerome.forissier@linaro.org>
+Date: Fri, 6 May 2022 17:28:28 +0200
+Subject: [PATCH] Revert "xen/arm: Restrict the amount of memory that dom0less
+ domU and dom0 can allocate"
+
+This reverts commit c439f5e97b0229851ba76249ccb224695a1baa29.
+---
+ xen/arch/arm/domain_build.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
+index f49dbf1ca1..b07461f5d3 100644
+--- a/xen/arch/arm/domain_build.c
++++ b/xen/arch/arm/domain_build.c
+@@ -2439,8 +2439,7 @@ static int __init construct_domU(struct domain *d,
+
+ if ( vcpu_create(d, 0) == NULL )
+ return -ENOMEM;
+-
+- d->max_pages = ((paddr_t)mem * SZ_1K) >> PAGE_SHIFT;
++ d->max_pages = ~0U;
+
+ kinfo.d = d;
+
+@@ -2541,7 +2540,7 @@ int __init construct_dom0(struct domain *d)
+
+ iommu_hwdom_init(d);
+
+- d->max_pages = dom0_mem >> PAGE_SHIFT;
++ d->max_pages = ~0U;
+
+ kinfo.unassigned_mem = dom0_mem;
+ kinfo.d = d;
+--
+2.34.1
+