diff --git a/qemu/accel/tcg/cputlb.c b/qemu/accel/tcg/cputlb.c index 0258c427..9ba57db2 100644 --- a/qemu/accel/tcg/cputlb.c +++ b/qemu/accel/tcg/cputlb.c @@ -452,6 +452,9 @@ void tlb_set_page_with_attrs(CPUState *cpu, target_ulong vaddr, } else { te->addr_write = address; } + if (prot & PAGE_WRITE_INV) { + te->addr_write |= TLB_INVALID_MASK; + } if (wp_flags & BP_MEM_WRITE) { te->addr_write |= TLB_WATCHPOINT; } diff --git a/qemu/include/exec/cpu-all.h b/qemu/include/exec/cpu-all.h index 83c141d9..59d91842 100644 --- a/qemu/include/exec/cpu-all.h +++ b/qemu/include/exec/cpu-all.h @@ -249,6 +249,9 @@ void address_space_stq_cached(MemoryRegionCache *cache, hwaddr addr, uint64_t va /* 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