diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2017-06-01 00:01:01 +0200 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2017-06-06 14:34:32 -0700 |
commit | 8a4719f527484a7b9940e1c93690b01dc5ca5144 (patch) | |
tree | bd550c901297ff8949d2cb8995ee39283d2a9b6e /target/s390x/mem_helper.c | |
parent | 51a718bf3dc7a4d8ae70219ffe4fef7a8dfadb24 (diff) |
target/s390x: remove some Linux assumptions from IPTE
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Message-Id: <20170531220129.27724-3-aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target/s390x/mem_helper.c')
-rw-r--r-- | target/s390x/mem_helper.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index e35571e342..0ebd65d9ab 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -1073,19 +1073,22 @@ uint32_t HELPER(mvcp)(CPUS390XState *env, uint64_t l, uint64_t a1, uint64_t a2) } /* invalidate pte */ -void HELPER(ipte)(CPUS390XState *env, uint64_t pte_addr, uint64_t vaddr) +void HELPER(ipte)(CPUS390XState *env, uint64_t pto, uint64_t vaddr) { CPUState *cs = CPU(s390_env_get_cpu(env)); uint64_t page = vaddr & TARGET_PAGE_MASK; - uint64_t pte = 0; + uint64_t pte_addr, pte; /* XXX broadcast to other CPUs */ - /* XXX Linux is nice enough to give us the exact pte address. - According to spec we'd have to find it out ourselves */ - /* XXX Linux is fine with overwriting the pte, the spec requires - us to only set the invalid bit */ - stq_phys(cs->as, pte_addr, pte | _PAGE_INVALID); + /* Compute the page table entry address */ + pte_addr = (pto & _SEGMENT_ENTRY_ORIGIN); + pte_addr += (vaddr & _VADDR_PX) >> 9; + + /* Mark the page table entry as invalid */ + pte = ldq_phys(cs->as, pte_addr); + pte |= _PAGE_INVALID; + stq_phys(cs->as, pte_addr, pte); /* XXX we exploit the fact that Linux passes the exact virtual address here - it's not obliged to! */ |