From e3d5eb3ef162a79bda9727c55ec60365655393b0 Mon Sep 17 00:00:00 2001 From: royger Date: Thu, 28 May 2020 08:18:34 +0000 Subject: [PATCH] xenpv: do not use low 1MB for Xen mappings on i386 On amd64 we already avoid using memory below 4GB in order to prevent clashes with MMIO regions, but i386 was allowed to use any hole in the physical memory map in order to map Xen pages. Limit this to memory above the 1MB boundary on i386 in order to avoid clashes with the MMIO holes in that area. Sponsored by: Citrix Systems R&D MFC after: 1 week --- sys/x86/xen/xenpv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/x86/xen/xenpv.c b/sys/x86/xen/xenpv.c index 587ced913e0a..d9db10b7005d 100644 --- a/sys/x86/xen/xenpv.c +++ b/sys/x86/xen/xenpv.c @@ -54,12 +54,14 @@ __FBSDID("$FreeBSD$"); * prevent clashes with MMIO/ACPI regions. * * Since this is not possible on i386 just use any available memory - * chunk and hope we don't clash with anything else. + * chunk above 1MB and hope we don't clash with anything else. */ #ifdef __amd64__ #define LOW_MEM_LIMIT 0x100000000ul +#elif defined(__i386__) +#define LOW_MEM_LIMIT 0x100000ul #else -#define LOW_MEM_LIMIT 0 +#error "Unsupported architecture" #endif static devclass_t xenpv_devclass;