Hi,
I think we also want this patch in the 5.15 stable. Without this patch,
hv_balloon() will report incorrect memory usage to hypervisor when
running on ARM64 with PAGE_SIZE > 4k. Only 5.15 needs this because ARM64
support of HyperV guests arrived in 5.15.
Upstream id b3d6dd09ff00fdcf4f7c0cb54700ffd5dd343502
Cc: <stable(a)vger.kernel.org> # 5.15.x
Thanks!
Regards,
Boqun
On Fri, Mar 25, 2022 at 10:32:11AM +0800, Boqun Feng wrote:
> DM_STATUS_REPORT expects the numbers of pages in the unit of 4k pages
> (HV_HYP_PAGE) instead of guest pages, so to make it work when guest page
> sizes are larger than 4k, convert the numbers of guest pages into the
> numbers of HV_HYP_PAGEs.
>
> Note that the numbers of guest pages are still used for tracing because
> tracing is internal to the guest kernel.
>
> Reported-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
> Signed-off-by: Boqun Feng <boqun.feng(a)gmail.com>
> Reviewed-by: Michael Kelley <mikelley(a)microsoft.com>
> ---
> drivers/hv/hv_balloon.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
> index f2d05bff4245..062156b88a87 100644
> --- a/drivers/hv/hv_balloon.c
> +++ b/drivers/hv/hv_balloon.c
> @@ -17,6 +17,7 @@
> #include <linux/slab.h>
> #include <linux/kthread.h>
> #include <linux/completion.h>
> +#include <linux/count_zeros.h>
> #include <linux/memory_hotplug.h>
> #include <linux/memory.h>
> #include <linux/notifier.h>
> @@ -1130,6 +1131,7 @@ static void post_status(struct hv_dynmem_device *dm)
> struct dm_status status;
> unsigned long now = jiffies;
> unsigned long last_post = last_post_time;
> + unsigned long num_pages_avail, num_pages_committed;
>
> if (pressure_report_delay > 0) {
> --pressure_report_delay;
> @@ -1154,16 +1156,21 @@ static void post_status(struct hv_dynmem_device *dm)
> * num_pages_onlined) as committed to the host, otherwise it can try
> * asking us to balloon them out.
> */
> - status.num_avail = si_mem_available();
> - status.num_committed = vm_memory_committed() +
> + num_pages_avail = si_mem_available();
> + num_pages_committed = vm_memory_committed() +
> dm->num_pages_ballooned +
> (dm->num_pages_added > dm->num_pages_onlined ?
> dm->num_pages_added - dm->num_pages_onlined : 0) +
> compute_balloon_floor();
>
> - trace_balloon_status(status.num_avail, status.num_committed,
> + trace_balloon_status(num_pages_avail, num_pages_committed,
> vm_memory_committed(), dm->num_pages_ballooned,
> dm->num_pages_added, dm->num_pages_onlined);
> +
> + /* Convert numbers of pages into numbers of HV_HYP_PAGEs. */
> + status.num_avail = num_pages_avail * NR_HV_HYP_PAGES_IN_PAGE;
> + status.num_committed = num_pages_committed * NR_HV_HYP_PAGES_IN_PAGE;
> +
> /*
> * If our transaction ID is no longer current, just don't
> * send the status. This can happen if we were interrupted
> --
> 2.35.1
>
The soc/fsl/dpio driver will perform a soc_device_match()
to determine the optimal cache settings for a given CPU core.
If FSL_GUTS is not enabled, this search will fail and
the driver will not configure cache stashing for the given
DPIO, and a string of "unknown SoC" messages will appear:
fsl_mc_dpio dpio.7: unknown SoC version
fsl_mc_dpio dpio.6: unknown SoC version
fsl_mc_dpio dpio.5: unknown SoC version
Signed-off-by: Mathew McBride <matt(a)traverse.com.au>
Fixes: 51da14e96e9b ("soc: fsl: dpio: configure cache stashing destination")
Cc: stable(a)vger.kernel.org
Reviewed-by: Ioana Ciornei <ioana.ciornei(a)nxp.com>
---
drivers/soc/fsl/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
index 07d52cafbb31..fcec6ed83d5e 100644
--- a/drivers/soc/fsl/Kconfig
+++ b/drivers/soc/fsl/Kconfig
@@ -24,6 +24,7 @@ config FSL_MC_DPIO
tristate "QorIQ DPAA2 DPIO driver"
depends on FSL_MC_BUS
select SOC_BUS
+ select FSL_GUTS
select DIMLIB
help
Driver for the DPAA2 DPIO object. A DPIO provides queue and
--
2.30.1
__mkroute_input() uses fib_validate_source() to trigger an icmp redirect.
My understanding is that fib_validate_source() is used to know if the src
address and the gateway address are on the same link. For that,
fib_validate_source() returns 1 (same link) or 0 (not the same network).
__mkroute_input() is the only user of these positive values, all other
callers only look if the returned value is negative.
Since the below patch, fib_validate_source() didn't return anymore 1 when
both addresses are on the same network, because the route lookup returns
RT_SCOPE_LINK instead of RT_SCOPE_HOST. But this is, in fact, right.
Let's adapat the test to return 1 again when both addresses are on the same
link.
CC: stable(a)vger.kernel.org
Fixes: 747c14307214 ("ip: fix dflt addr selection for connected nexthop")
Reported-by: kernel test robot <yujie.liu(a)intel.com>
Reported-by: Heng Qi <hengqi(a)linux.alibaba.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel(a)6wind.com>
---
This code exists since more than two decades:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/netdev-vger-cvs.git/c…
Please, feel free to comment if my analysis seems wrong.
Regards,
Nicolas
net/ipv4/fib_frontend.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index f361d3d56be2..943edf4ad4db 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -389,7 +389,7 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
dev_match = dev_match || (res.type == RTN_LOCAL &&
dev == net->loopback_dev);
if (dev_match) {
- ret = FIB_RES_NHC(res)->nhc_scope >= RT_SCOPE_HOST;
+ ret = FIB_RES_NHC(res)->nhc_scope >= RT_SCOPE_LINK;
return ret;
}
if (no_addr)
@@ -401,7 +401,7 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
ret = 0;
if (fib_lookup(net, &fl4, &res, FIB_LOOKUP_IGNORE_LINKSTATE) == 0) {
if (res.type == RTN_UNICAST)
- ret = FIB_RES_NHC(res)->nhc_scope >= RT_SCOPE_HOST;
+ ret = FIB_RES_NHC(res)->nhc_scope >= RT_SCOPE_LINK;
}
return ret;
--
2.33.0