From: Greg Kroah-Hartman Date: Mon, 29 Mar 2021 07:04:35 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v5.11.11~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2363d7fb1aa2c04a135571b26597a236db76b87;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: revert-net-bonding-fix-error-return-code-of-bond_neigh_init.patch revert-xen-fix-p2m-size-in-dom0-for-disabled-memory-hotplug-case.patch --- diff --git a/queue-5.10/revert-net-bonding-fix-error-return-code-of-bond_neigh_init.patch b/queue-5.10/revert-net-bonding-fix-error-return-code-of-bond_neigh_init.patch new file mode 100644 index 00000000000..aea820b1cab --- /dev/null +++ b/queue-5.10/revert-net-bonding-fix-error-return-code-of-bond_neigh_init.patch @@ -0,0 +1,41 @@ +From 080bfa1e6d928a5d1f185cc44e5f3c251df06df5 Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Fri, 12 Mar 2021 12:15:03 -0800 +Subject: Revert "net: bonding: fix error return code of bond_neigh_init()" + +From: David S. Miller + +commit 080bfa1e6d928a5d1f185cc44e5f3c251df06df5 upstream. + +This reverts commit 2055a99da8a253a357bdfd359b3338ef3375a26c. + +This change rejects legitimate configurations. + +A slave doesn't need to exist nor implement ndo_slave_setup. + +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/bonding/bond_main.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -3918,15 +3918,11 @@ static int bond_neigh_init(struct neighb + + rcu_read_lock(); + slave = bond_first_slave_rcu(bond); +- if (!slave) { +- ret = -EINVAL; ++ if (!slave) + goto out; +- } + slave_ops = slave->dev->netdev_ops; +- if (!slave_ops->ndo_neigh_setup) { +- ret = -EINVAL; ++ if (!slave_ops->ndo_neigh_setup) + goto out; +- } + + /* TODO: find another way [1] to implement this. + * Passing a zeroed structure is fragile, diff --git a/queue-5.10/revert-xen-fix-p2m-size-in-dom0-for-disabled-memory-hotplug-case.patch b/queue-5.10/revert-xen-fix-p2m-size-in-dom0-for-disabled-memory-hotplug-case.patch new file mode 100644 index 00000000000..18ec62daabc --- /dev/null +++ b/queue-5.10/revert-xen-fix-p2m-size-in-dom0-for-disabled-memory-hotplug-case.patch @@ -0,0 +1,109 @@ +From af44a387e743ab7aa39d3fb5e29c0a973cf91bdc Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Wed, 24 Mar 2021 13:24:24 +0100 +Subject: Revert "xen: fix p2m size in dom0 for disabled memory hotplug case" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Roger Pau Monne + +commit af44a387e743ab7aa39d3fb5e29c0a973cf91bdc upstream. + +This partially reverts commit 882213990d32 ("xen: fix p2m size in dom0 +for disabled memory hotplug case") + +There's no need to special case XEN_UNPOPULATED_ALLOC anymore in order +to correctly size the p2m. The generic memory hotplug option has +already been tied together with the Xen hotplug limit, so enabling +memory hotplug should already trigger a properly sized p2m on Xen PV. + +Note that XEN_UNPOPULATED_ALLOC depends on ZONE_DEVICE which pulls in +MEMORY_HOTPLUG. + +Leave the check added to __set_phys_to_machine and the adjusted +comment about EXTRA_MEM_RATIO. + +Signed-off-by: Roger Pau Monné +Reviewed-by: Boris Ostrovsky +Link: https://lore.kernel.org/r/20210324122424.58685-3-roger.pau@citrix.com +Signed-off-by: Greg Kroah-Hartman + +[boris: fixed formatting issues] +Signed-off-by: Boris Ostrovsky +--- + arch/x86/include/asm/xen/page.h | 12 ------------ + arch/x86/xen/p2m.c | 3 --- + arch/x86/xen/setup.c | 16 ++++++++++++++-- + 3 files changed, 14 insertions(+), 17 deletions(-) + +--- a/arch/x86/include/asm/xen/page.h ++++ b/arch/x86/include/asm/xen/page.h +@@ -87,18 +87,6 @@ clear_foreign_p2m_mapping(struct gnttab_ + #endif + + /* +- * The maximum amount of extra memory compared to the base size. The +- * main scaling factor is the size of struct page. At extreme ratios +- * of base:extra, all the base memory can be filled with page +- * structures for the extra memory, leaving no space for anything +- * else. +- * +- * 10x seems like a reasonable balance between scaling flexibility and +- * leaving a practically usable system. +- */ +-#define XEN_EXTRA_MEM_RATIO (10) +- +-/* + * Helper functions to write or read unsigned long values to/from + * memory, when the access may fault. + */ +--- a/arch/x86/xen/p2m.c ++++ b/arch/x86/xen/p2m.c +@@ -416,9 +416,6 @@ void __init xen_vmalloc_p2m_tree(void) + xen_p2m_last_pfn = xen_max_p2m_pfn; + + p2m_limit = (phys_addr_t)P2M_LIMIT * 1024 * 1024 * 1024 / PAGE_SIZE; +- if (!p2m_limit && IS_ENABLED(CONFIG_XEN_UNPOPULATED_ALLOC)) +- p2m_limit = xen_start_info->nr_pages * XEN_EXTRA_MEM_RATIO; +- + vm.flags = VM_ALLOC; + vm.size = ALIGN(sizeof(unsigned long) * max(xen_max_p2m_pfn, p2m_limit), + PMD_SIZE * PMDS_PER_MID_PAGE); +--- a/arch/x86/xen/setup.c ++++ b/arch/x86/xen/setup.c +@@ -59,6 +59,18 @@ static struct { + } xen_remap_buf __initdata __aligned(PAGE_SIZE); + static unsigned long xen_remap_mfn __initdata = INVALID_P2M_ENTRY; + ++/* ++ * The maximum amount of extra memory compared to the base size. The ++ * main scaling factor is the size of struct page. At extreme ratios ++ * of base:extra, all the base memory can be filled with page ++ * structures for the extra memory, leaving no space for anything ++ * else. ++ * ++ * 10x seems like a reasonable balance between scaling flexibility and ++ * leaving a practically usable system. ++ */ ++#define EXTRA_MEM_RATIO (10) ++ + static bool xen_512gb_limit __initdata = IS_ENABLED(CONFIG_XEN_512GB); + + static void __init xen_parse_512gb(void) +@@ -778,13 +790,13 @@ char * __init xen_memory_setup(void) + extra_pages += max_pages - max_pfn; + + /* +- * Clamp the amount of extra memory to a XEN_EXTRA_MEM_RATIO ++ * Clamp the amount of extra memory to a EXTRA_MEM_RATIO + * factor the base size. + * + * Make sure we have no memory above max_pages, as this area + * isn't handled by the p2m management. + */ +- extra_pages = min3(XEN_EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)), ++ extra_pages = min3(EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)), + extra_pages, max_pages - max_pfn); + i = 0; + addr = xen_e820_table.entries[0].addr; diff --git a/queue-5.10/series b/queue-5.10/series index ac217a09e01..a72a9a5684e 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -215,3 +215,5 @@ net-dsa-b53-vlan-filtering-is-global-to-all-users.patch mac80211-fix-double-free-in-ibss_leave.patch ext4-add-reclaim-checks-to-xattr-code.patch fs-ext4-fix-integer-overflow-in-s_log_groups_per_flex.patch +revert-xen-fix-p2m-size-in-dom0-for-disabled-memory-hotplug-case.patch +revert-net-bonding-fix-error-return-code-of-bond_neigh_init.patch