get memory size from fwcfg
Upstream test device does not implement port 0xd1.
Reviewed-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/x86/rmap_chain.c b/x86/rmap_chain.c
index 9add9b8..0df1bcb 100644
--- a/x86/rmap_chain.c
+++ b/x86/rmap_chain.c
@@ -1,6 +1,7 @@
/* test long rmap chains */
#include "libcflat.h"
+#include "fwcfg.h"
#include "vm.h"
#include "smp.h"
@@ -21,7 +22,7 @@
setup_vm();
- nr_pages = inl(0xd1) / PAGE_SIZE;
+ nr_pages = fwcfg_get_u64(FW_CFG_RAM_SIZE) / PAGE_SIZE;
nr_pages -= 1000;
target_page = alloc_page();