diff options
author | David Hildenbrand <david@redhat.com> | 2017-10-16 22:23:57 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2017-10-20 13:32:10 +0200 |
commit | f52bfb12143e29d7c8bd827bdb751aee47a9694e (patch) | |
tree | 2176cb2e9e24ed4a44f5579664fcb84a3724c56e /include/exec | |
parent | d0a5cc5bf4cf8e4d7d14597dd57be526c3e9d76f (diff) |
accel/tcg: allow to invalidate a write TLB entry immediately
Background: s390x implements Low-Address Protection (LAP). If LAP is
enabled, writing to effective addresses (before any translation)
0-511 and 4096-4607 triggers a protection exception.
So we have subpage protection on the first two pages of every address
space (where the lowcore - the CPU private data resides).
By immediately invalidating the write entry but allowing the caller to
continue, we force every write access onto these first two pages into
the slow path. we will get a tlb fault with the specific accessed
addresses and can then evaluate if protection applies or not.
We have to make sure to ignore the invalid bit if tlb_fill() succeeds.
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20171016202358.3633-2-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'include/exec')
-rw-r--r-- | include/exec/cpu-all.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 778031c3d7..0b141683f0 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -245,6 +245,9 @@ extern intptr_t qemu_host_page_mask; /* original state of the write flag (used when tracking self-modifying code */ #define PAGE_WRITE_ORG 0x0010 +/* Invalidate the TLB entry immediately, helpful for s390x + * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs() */ +#define PAGE_WRITE_INV 0x0040 #if defined(CONFIG_BSD) && defined(CONFIG_USER_ONLY) /* FIXME: Code that sets/uses this is broken and needs to go away. */ #define PAGE_RESERVED 0x0020 |