[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/11] target/hppa: add TLB protection id check
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 09/11] target/hppa: add TLB protection id check |
Date: |
Mon, 11 Mar 2019 20:23:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 3/11/19 12:16 PM, Sven Schnelle wrote:
> + /* access_id == 0 means public page and no check is performed */
> + if ((env->psw & PSW_P) && ent->access_id) {
> + wd = 1;
> +
> + if (ent->access_id == (env->cr[CR_PID1] >> 1)) {
> + wd &= env->cr[CR_PID1];
> + }
> +
> + if (ent->access_id == (env->cr[CR_PID2] >> 1)) {
> + wd &= env->cr[CR_PID2];
> + }
> +
> + if (ent->access_id == (env->cr[CR_PID3] >> 1)) {
> + wd &= env->cr[CR_PID3];
> + }
> +
> + if (ent->access_id == (env->cr[CR_PID4] >> 1)) {
> + wd &= env->cr[CR_PID4];
> + }
> +
> + if (wd && (type & w_prot)) {
> + ret = EXCP_DMPI;
> + goto egress;
> + }
> + }
This is insufficient.
(1) The softmmu tlb much be flushed when PSW_P,
or any of the PID registers change.
(2) If type != PAGE_WRITE, you need to remove PAGE_WRITE
from prot so that the next write doesn't see wrong permissions.
I'll be testing something like the following.
r~
z
Description: Text document
- [Qemu-devel] [PATCH 00/11] target/hppa patches, Sven Schnelle, 2019/03/11
- [Qemu-devel] [PATCH 11/11] target/hppa: call eval_interrupt() after ssm, Sven Schnelle, 2019/03/11
- [Qemu-devel] [PATCH 09/11] target/hppa: add TLB protection id check, Sven Schnelle, 2019/03/11
- Re: [Qemu-devel] [PATCH 09/11] target/hppa: add TLB protection id check,
Richard Henderson <=
- [Qemu-devel] [PATCH 06/11] target/hppa: ignore DIAG opcode, Sven Schnelle, 2019/03/11
- [Qemu-devel] [PATCH 10/11] target/hppa: exit TB if either Data or Instruction TLB changes, Sven Schnelle, 2019/03/11
- [Qemu-devel] [PATCH 07/11] target/hppa: fix b,gate instruction, Sven Schnelle, 2019/03/11
- [Qemu-devel] [PATCH 05/11] target/hppa: remove PSW I/R/Q bit check, Sven Schnelle, 2019/03/11
- [Qemu-devel] [PATCH 01/11] target/hppa: fix overwriting source reg in addb, Sven Schnelle, 2019/03/11