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

357786
From 300af272a7b1546ccd40face0c3f6d325f81aa49 Mon Sep 17 00:00:00 2001
357786
From: David Gibson <dgibson@redhat.com>
357786
Date: Tue, 17 Jul 2018 01:36:38 +0200
357786
Subject: [PATCH 46/89] spapr: Correct inverted test in spapr_pc_dimm_node()
357786
357786
RH-Author: David Gibson <dgibson@redhat.com>
357786
Message-id: <20180717013638.11012-1-dgibson@redhat.com>
357786
Patchwork-id: 81371
357786
O-Subject: [RHEL7.6 qemu-kvm-rhev PATCH] spapr: Correct inverted test in spapr_pc_dimm_node()
357786
Bugzilla: 1598287
357786
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
357786
RH-Acked-by: Thomas Huth <thuth@redhat.com>
357786
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
357786
357786
From: David Gibson <david@gibson.dropbear.id.au>
357786
357786
This function was introduced between v2.11 and v2.12 to replace obsolete
357786
ways of specifying the NUMA nodes for DIMMs.  It's used to find the correct
357786
node for an LMB, by locating which DIMM object it lies within.
357786
357786
Unfortunately, one of the checks is inverted, so we check whether the
357786
address is less than two different things, rather than actually checking
357786
a range.  This introduced a regression, meaning that after a reboot qemu
357786
will advertise incorrect node information for memory to the guest.
357786
357786
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
357786
Reviewed-by: Greg Kurz <groug@kaod.org>
357786
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
357786
(cherry picked from commit ccc2cef8b3f1dedd059924eb8ec1a87eff8ef607)
357786
357786
Signed-off-by: David Gibson <dgibson@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 hw/ppc/spapr.c | 2 +-
357786
 1 file changed, 1 insertion(+), 1 deletion(-)
357786
357786
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
357786
index a580334..5f26aea 100644
357786
--- a/hw/ppc/spapr.c
357786
+++ b/hw/ppc/spapr.c
357786
@@ -659,7 +659,7 @@ static uint32_t spapr_pc_dimm_node(MemoryDeviceInfoList *list, ram_addr_t addr)
357786
         if (value && value->type == MEMORY_DEVICE_INFO_KIND_DIMM) {
357786
             PCDIMMDeviceInfo *pcdimm_info = value->u.dimm.data;
357786
 
357786
-            if (pcdimm_info->addr >= addr &&
357786
+            if (addr >= pcdimm_info->addr &&
357786
                 addr < (pcdimm_info->addr + pcdimm_info->size)) {
357786
                 return pcdimm_info->node;
357786
             }
357786
-- 
357786
1.8.3.1
357786