]> git.baikalelectronics.ru Git - kernel.git/commit
xen: fix p2m size in dom0 for disabled memory hotplug case
authorJuergen Gross <jgross@suse.com>
Wed, 24 Feb 2021 15:03:08 +0000 (16:03 +0100)
committerJuergen Gross <jgross@suse.com>
Wed, 3 Mar 2021 07:32:13 +0000 (08:32 +0100)
commitf5430d431da68761188bac79468860ddadcf65e0
tree17a5d1b082a1156c6fb298376703f6bbb173e809
parenta601c1d1c9387ec5a18afe093859f697104cc0a9
xen: fix p2m size in dom0 for disabled memory hotplug case

Since commit 28673476ab9e65 ("xen: add helpers to allocate unpopulated
memory") foreign mappings are using guest physical addresses allocated
via ZONE_DEVICE functionality.

This will result in problems for the case of no balloon memory hotplug
being configured, as the p2m list will only cover the initial memory
size of the domain. Any ZONE_DEVICE allocated address will be outside
the p2m range and thus a mapping can't be established with that memory
address.

Fix that by extending the p2m size for that case. At the same time add
a check for a to be created mapping to be within the p2m limits in
order to detect errors early.

While changing a comment, remove some 32-bit leftovers.

This is XSA-369.

Fixes: 28673476ab9e65 ("xen: add helpers to allocate unpopulated memory")
Cc: <stable@vger.kernel.org> # 5.9
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/x86/include/asm/xen/page.h
arch/x86/xen/p2m.c
arch/x86/xen/setup.c