qemu-devel
[Top][All Lists]
Advanced

[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~


Attachment: z
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]