xen/balloon: Mark unallocated host memory as UNUSABLE
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 12 Dec 2017 20:08:21 +0000 (15:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Mar 2018 09:24:28 +0000 (10:24 +0100)
commitdef8d0ae4ac9a1dd9fb6e8a7ffe6aadf2893d848
tree596ddcd8f7207da286d599527d179a6391d19b63
parentcaca324f93736279bece65d54b6efe394d6e00d6
xen/balloon: Mark unallocated host memory as UNUSABLE

[ Upstream commit b3cf8528bb21febb650a7ecbf080d0647be40b9f ]

Commit f5775e0b6116 ("x86/xen: discard RAM regions above the maximum
reservation") left host memory not assigned to dom0 as available for
memory hotplug.

Unfortunately this also meant that those regions could be used by
others. Specifically, commit fa564ad96366 ("x86/PCI: Enable a 64bit BAR
on AMD Family 15h (Models 00-1f, 30-3f, 60-7f)") may try to map those
addresses as MMIO.

To prevent this mark unallocated host memory as E820_TYPE_UNUSABLE (thus
effectively reverting f5775e0b6116) and keep track of that region as
a hostmem resource that can be used for the hotplug.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/xen/enlighten.c
arch/x86/xen/setup.c
drivers/xen/balloon.c
include/xen/balloon.h