All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size
@ 2018-07-27 14:50 Igor Mammedov
  2018-07-27 21:52 ` Eduardo Habkost
  2018-07-30 11:04 ` Igor Mammedov
  0 siblings, 2 replies; 5+ messages in thread
From: Igor Mammedov @ 2018-07-27 14:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: ehabkost, mst

Commit 848a1cc1e (hw/acpi-build: build SRAT memory affinity structures for DIMM devices)
broke the first dimm hotplug in following cases:

 1: there is no coldplugged dimm in the last numa node
    but there is a coldplugged dimm in another node

  -m 4096,slots=4,maxmem=32G               \
  -object memory-backend-ram,size=2G,id=m0 \
  -device pc-dimm,memdev=m0,node=1         \
  -object memory-backend-ram,id=m1,size=2G \
  -device pc-dimm,memdev=m1,node=0         \
  -numa node,nodeid=0                      \
  -numa node,nodeid=1

 2: if order of dimms on CLI is:
       1st plugged dimm in node1
       2nd plugged dimm in node0

  -m 4096,slots=4,maxmem=32G               \
  -object memory-backend-ram,id=m1,size=2G \
  -device pc-dimm,memdev=m1,node=0         \
  -numa node,nodeid=0                      \
  -numa node,nodeid=1

(qemu) object_add memory-backend-ram,id=m1,size=1G
(qemu) device_add pc-dimm,id=d1,memdev=m1,node=0

the first DIMM hotplug to any node except the last one
fails (Windows is unable to online it).

Length reduction of stub hotplug memory SRAT entry,
fixes issue for some reason.

RHBZ: 1609234

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
NOTE TO MAINTAINER: UPDATE REFERRENCE APCI TABLE BLOBS IN TESTS

---
 hw/i386/acpi-build.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 9e8350c..b52fdb2 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2269,7 +2269,16 @@ static void build_srat_hotpluggable_memory(GArray *table_data, uint64_t base,
         numamem = acpi_data_push(table_data, sizeof *numamem);
 
         if (!info) {
-            build_srat_memory(numamem, cur, end - cur, default_node,
+            /*
+             * Entry is required for Windows to enable memory hotplug in OS
+             * and for Linux to enable SWIOTLB when booted with less than
+             * 4G of RAM. Windows works better if the entry sets proximity
+             * to the highest NUMA node in the machine at the end of the
+             * reserved space.
+             * Memory devices may override proximity set by this entry,
+             * providing _PXM method if necessary.
+             */
+            build_srat_memory(numamem, end - 1, 1, default_node,
                               MEM_AFFINITY_HOTPLUGGABLE | MEM_AFFINITY_ENABLED);
             break;
         }
@@ -2402,14 +2411,6 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
         build_srat_memory(numamem, 0, 0, 0, MEM_AFFINITY_NOFLAGS);
     }
 
-    /*
-     * Entry is required for Windows to enable memory hotplug in OS
-     * and for Linux to enable SWIOTLB when booted with less than
-     * 4G of RAM. Windows works better if the entry sets proximity
-     * to the highest NUMA node in the machine.
-     * Memory devices may override proximity set by this entry,
-     * providing _PXM method if necessary.
-     */
     if (hotplugabble_address_space_size) {
         build_srat_hotpluggable_memory(table_data, machine->device_memory->base,
                                        hotplugabble_address_space_size,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size
  2018-07-27 14:50 [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size Igor Mammedov
@ 2018-07-27 21:52 ` Eduardo Habkost
  2018-07-28 21:09   ` Michael S. Tsirkin
  2018-07-30 11:04 ` Igor Mammedov
  1 sibling, 1 reply; 5+ messages in thread
From: Eduardo Habkost @ 2018-07-27 21:52 UTC (permalink / raw)
  To: Igor Mammedov; +Cc: qemu-devel, mst

On Fri, Jul 27, 2018 at 04:50:31PM +0200, Igor Mammedov wrote:
[...]
> NOTE TO MAINTAINER: UPDATE REFERRENCE APCI TABLE BLOBS IN TESTS

Why this needs to be done manually?  Can't the ACPI table update
be included in the e-mailed patch?

-- 
Eduardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size
  2018-07-27 21:52 ` Eduardo Habkost
@ 2018-07-28 21:09   ` Michael S. Tsirkin
  2018-07-30  7:49     ` Igor Mammedov
  0 siblings, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2018-07-28 21:09 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: Igor Mammedov, qemu-devel

On Fri, Jul 27, 2018 at 06:52:40PM -0300, Eduardo Habkost wrote:
> On Fri, Jul 27, 2018 at 04:50:31PM +0200, Igor Mammedov wrote:
> [...]
> > NOTE TO MAINTAINER: UPDATE REFERRENCE APCI TABLE BLOBS IN TESTS
> 
> Why this needs to be done manually?  Can't the ACPI table update
> be included in the e-mailed patch?

Yes but then there's no guarantee it will apply to my tree:
binary diff conflicts can't be resolved.

> -- 
> Eduardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size
  2018-07-28 21:09   ` Michael S. Tsirkin
@ 2018-07-30  7:49     ` Igor Mammedov
  0 siblings, 0 replies; 5+ messages in thread
From: Igor Mammedov @ 2018-07-30  7:49 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Eduardo Habkost, qemu-devel

On Sun, 29 Jul 2018 00:09:58 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Fri, Jul 27, 2018 at 06:52:40PM -0300, Eduardo Habkost wrote:
> > On Fri, Jul 27, 2018 at 04:50:31PM +0200, Igor Mammedov wrote:
> > [...]  
> > > NOTE TO MAINTAINER: UPDATE REFERRENCE APCI TABLE BLOBS IN TESTS  
> > 
> > Why this needs to be done manually?  Can't the ACPI table update
> > be included in the e-mailed patch? 
additional reason is that we can't really review the binary part,
hence we came up with this reminder policy
 
> Yes but then there's no guarantee it will apply to my tree:
> binary diff conflicts can't be resolved.
> 
> > -- 
> > Eduardo  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size
  2018-07-27 14:50 [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size Igor Mammedov
  2018-07-27 21:52 ` Eduardo Habkost
@ 2018-07-30 11:04 ` Igor Mammedov
  1 sibling, 0 replies; 5+ messages in thread
From: Igor Mammedov @ 2018-07-30 11:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: ehabkost, mst

On Fri, 27 Jul 2018 16:50:31 +0200
Igor Mammedov <imammedo@redhat.com> wrote:

> Commit 848a1cc1e (hw/acpi-build: build SRAT memory affinity structures for DIMM devices)
> broke the first dimm hotplug in following cases:
> 
>  1: there is no coldplugged dimm in the last numa node
>     but there is a coldplugged dimm in another node
> 
>   -m 4096,slots=4,maxmem=32G               \
>   -object memory-backend-ram,size=2G,id=m0 \
>   -device pc-dimm,memdev=m0,node=1         \
>   -object memory-backend-ram,id=m1,size=2G \
>   -device pc-dimm,memdev=m1,node=0         \
>   -numa node,nodeid=0                      \
>   -numa node,nodeid=1
> 
>  2: if order of dimms on CLI is:
>        1st plugged dimm in node1
>        2nd plugged dimm in node0
> 
>   -m 4096,slots=4,maxmem=32G               \
>   -object memory-backend-ram,id=m1,size=2G \
>   -device pc-dimm,memdev=m1,node=0         \
>   -numa node,nodeid=0                      \
>   -numa node,nodeid=1
> 

self-NACK on this one,
I've mixed up examples in commit message, it should have been other way around.
I've just posted v2 with fixed commit message


[...]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-30 11:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 14:50 [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size Igor Mammedov
2018-07-27 21:52 ` Eduardo Habkost
2018-07-28 21:09   ` Michael S. Tsirkin
2018-07-30  7:49     ` Igor Mammedov
2018-07-30 11:04 ` Igor Mammedov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.