From f73a2575a3bce8a3c487331c918d2c0f9b2e489d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 3 Aug 2011 21:02:19 +0000 Subject: pseries: More complete WIMG validation in H_ENTER code Currently our implementation of the H_ENTER hypercall, which inserts a mapping in the hash page table assumes that only ordinary memory is ever mapped, and only permits mapping attribute bits accordingly (WIMG==0010). However, we intend to start adding emulated IO to the pseries platform (and real IO with PCI passthrough on kvm) which means this simple test will no longer suffice. This patch extends the h_enter validation code to check if the given address is a RAM address. If it is it enforces WIMG==0010, otherwise it assumes that it is an IO mapping and instead enforces WIMG=010x. Signed-off-by: David Gibson Signed-off-by: Alexander Graf --- hw/spapr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/spapr.c') diff --git a/hw/spapr.c b/hw/spapr.c index 9eefef9..00aed62 100644 --- a/hw/spapr.c +++ b/hw/spapr.c @@ -336,7 +336,8 @@ static void ppc_spapr_init(ram_addr_t ram_size, } /* allocate RAM */ - ram_offset = qemu_ram_alloc(NULL, "ppc_spapr.ram", ram_size); + spapr->ram_limit = ram_size; + ram_offset = qemu_ram_alloc(NULL, "ppc_spapr.ram", spapr->ram_limit); cpu_register_physical_memory(0, ram_size, ram_offset); /* allocate hash page table. For now we always make this 16mb, -- cgit v1.1