pseries: More complete WIMG validation in H_ENTER code
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 3 Aug 2011 21:02:19 +0000 (21:02 +0000)
committerAlexander Graf <agraf@suse.de>
Thu, 6 Oct 2011 07:48:03 +0000 (09:48 +0200)
commitf25377f30459a1c546673be4f7104d0f49939070
tree0c999928e4a3dd0088f5cc2bef0a1d982ad747c3
parentddc64b3b2bf44f9f4653cbd819b0ff506e503f9b
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 <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/spapr.c
hw/spapr.h
hw/spapr_hcall.c