From ebd40c8ccb51bce439aec10bd59d325c257c0229 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Thu, 28 Apr 2022 15:05:16 +0000 Subject: [PATCH] Use new memory layout for pVM firmware. Moved data memory to just above pVM firmware image, rather than an arbitrary location higher in RAM. Bug: 223166344 Test: ran with patched crosvm Change-Id: I4fc92edf7752352bc962169b009d052ddd07479d --- pvmfw/idmap.S | 8 ++++---- pvmfw/image.ld | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pvmfw/idmap.S b/pvmfw/idmap.S index 62555f9c..ec3ceaf2 100644 --- a/pvmfw/idmap.S +++ b/pvmfw/idmap.S @@ -44,9 +44,9 @@ idmap: .fill 509, 8, 0x0 // 509 GB of remaining VA space /* level 2 */ -0: .fill 511, 8, 0x0 - .quad .L_BLOCK_MEM_XIP | 0x7fe00000 // pVM firmware image +0: .fill 510, 8, 0x0 + .quad .L_BLOCK_MEM_XIP | 0x7fc00000 // pVM firmware image + .quad .L_BLOCK_MEM | 0x7fe00000 // Writable memory for stack, heap &c. 1: .quad .L_BLOCK_RO | 0x80000000 // DT provided by VMM .quad .L_BLOCK_RO | 0x80200000 // 2 MB of DRAM containing payload image - .quad .L_BLOCK_MEM | 0x80400000 // Writable memory for stack, heap &c. - .fill 509, 8, 0x0 + .fill 510, 8, 0x0 diff --git a/pvmfw/image.ld b/pvmfw/image.ld index aeb50460..18bb3ba0 100644 --- a/pvmfw/image.ld +++ b/pvmfw/image.ld @@ -16,7 +16,7 @@ MEMORY { - image : ORIGIN = 0x7fe00000, LENGTH = 2M + image : ORIGIN = 0x7fc00000, LENGTH = 2M + writable_data : ORIGIN = 0x7fe00000, LENGTH = 2M dtb_region : ORIGIN = 0x80000000, LENGTH = 2M - writable_data : ORIGIN = 0x80400000, LENGTH = 2M }