Blame SOURCES/kvm-spapr-Correct-inverted-test-in-spapr_pc_dimm_node.patch

ae23c9
From c279e652b149621847ef38f08254569632f7ee3b Mon Sep 17 00:00:00 2001
ae23c9
From: David Gibson <dgibson@redhat.com>
ae23c9
Date: Wed, 25 Jul 2018 07:23:41 +0100
ae23c9
Subject: [PATCH 01/14] spapr: Correct inverted test in spapr_pc_dimm_node()
ae23c9
ae23c9
RH-Author: David Gibson <dgibson@redhat.com>
ae23c9
Message-id: <20180725072341.8452-1-dgibson@redhat.com>
ae23c9
Patchwork-id: 81498
ae23c9
O-Subject: [RHEL-8.0 qemu-kvm PATCH] spapr: Correct inverted test in spapr_pc_dimm_node()
ae23c9
Bugzilla: 1601671
ae23c9
RH-Acked-by: Thomas Huth <thuth@redhat.com>
ae23c9
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ae23c9
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
ae23c9
ae23c9
From: David Gibson <david@gibson.dropbear.id.au>
ae23c9
ae23c9
This function was introduced between v2.11 and v2.12 to replace obsolete
ae23c9
ways of specifying the NUMA nodes for DIMMs.  It's used to find the correct
ae23c9
node for an LMB, by locating which DIMM object it lies within.
ae23c9
ae23c9
Unfortunately, one of the checks is inverted, so we check whether the
ae23c9
address is less than two different things, rather than actually checking
ae23c9
a range.  This introduced a regression, meaning that after a reboot qemu
ae23c9
will advertise incorrect node information for memory to the guest.
ae23c9
ae23c9
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ae23c9
Reviewed-by: Greg Kurz <groug@kaod.org>
ae23c9
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
ae23c9
(cherry picked from commit ccc2cef8b3f1dedd059924eb8ec1a87eff8ef607)
ae23c9
ae23c9
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1601671
ae23c9
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=17345816
ae23c9
ae23c9
Signed-off-by: David Gibson <dgibson@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 hw/ppc/spapr.c | 2 +-
ae23c9
 1 file changed, 1 insertion(+), 1 deletion(-)
ae23c9
ae23c9
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
ae23c9
index ef00937..7de3f07 100644
ae23c9
--- a/hw/ppc/spapr.c
ae23c9
+++ b/hw/ppc/spapr.c
ae23c9
@@ -659,7 +659,7 @@ static uint32_t spapr_pc_dimm_node(MemoryDeviceInfoList *list, ram_addr_t addr)
ae23c9
         if (value && value->type == MEMORY_DEVICE_INFO_KIND_DIMM) {
ae23c9
             PCDIMMDeviceInfo *pcdimm_info = value->u.dimm.data;
ae23c9
 
ae23c9
-            if (pcdimm_info->addr >= addr &&
ae23c9
+            if (addr >= pcdimm_info->addr &&
ae23c9
                 addr < (pcdimm_info->addr + pcdimm_info->size)) {
ae23c9
                 return pcdimm_info->node;
ae23c9
             }
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9