[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 27/32] s390x/tcg: Provide probe_write_access
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH v3 27/32] s390x/tcg: Provide probe_write_access helper |
Date: |
Thu, 7 Mar 2019 15:40:07 +0100 |
On Thu, 7 Mar 2019 15:34:27 +0100
David Hildenbrand <address@hidden> wrote:
> On 07.03.19 15:10, Richard Henderson wrote:
> > On 3/7/19 4:15 AM, David Hildenbrand wrote:
> >> +void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,
> >> + uintptr_t ra)
> >> +{
> >> +#ifdef CONFIG_USER_ONLY
> >> + if (!h2g_valid(addr) || !h2g_valid(addr + len - 1)) {
> >> + s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra);
> >> + }
> >
> > You need
> >
> > || page_check_range(addr, len, PAGE_WRITE) < 0
> >
> > as well.
>
> Indeed, thanks.
>
> So it should be
>
>
> +void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,
> + uintptr_t ra)
> +{
> +#ifdef CONFIG_USER_ONLY
> + if (!h2g_valid(addr) || !h2g_valid(addr + len - 1) ||
> + page_check_range(addr, len, PAGE_WRITE) < 0) {
> + s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra);
> + }
> +#else
> + /* test the actual access, not just any access to the page due to LAP */
> + while (len) {
> + const uint64_t pagelen = -(addr | -TARGET_PAGE_MASK);
> + const uint64_t curlen = MIN(pagelen, len);
> +
> + probe_write(env, addr, curlen, cpu_mmu_index(env, false), ra);
> + addr = wrap_address(env, addr + curlen);
> + len -= curlen;
> + }
> +#endif
> +}
>
> Conny, I can resend if you don't feel like fixing up (or there is more to do).
>
If that's the only thing, I can easily fold it in.
- [Qemu-devel] [PATCH v3 20/32] s390x/tcg: Implement VECTOR PERMUTE, (continued)
- [Qemu-devel] [PATCH v3 20/32] s390x/tcg: Implement VECTOR PERMUTE, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 22/32] s390x/tcg: Implement VECTOR REPLICATE, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 23/32] s390x/tcg: Implement VECTOR REPLICATE IMMEDIATE, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 21/32] s390x/tcg: Implement VECTOR PERMUTE DOUBLEWORD IMMEDIATE, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 24/32] s390x/tcg: Implement VECTOR SCATTER ELEMENT, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 25/32] s390x/tcg: Implement VECTOR SELECT, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 26/32] s390x/tcg: Implement VECTOR SIGN EXTEND TO DOUBLEWORD, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 27/32] s390x/tcg: Provide probe_write_access helper, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 28/32] s390x/tcg: Implement VECTOR STORE, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 29/32] s390x/tcg: Implement VECTOR STORE ELEMENT, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 30/32] s390x/tcg: Implement VECTOR STORE MULTIPLE, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 31/32] s390x/tcg: Implement VECTOR STORE WITH LENGTH, David Hildenbrand, 2019/03/07
- [Qemu-devel] [PATCH v3 32/32] s390x/tcg: Implement VECTOR UNPACK *, David Hildenbrand, 2019/03/07
- Re: [Qemu-devel] [PATCH v3 00/32] s390x/tcg: Vector Instruction Support Part 1, no-reply, 2019/03/07
- Re: [Qemu-devel] [PATCH v3 00/32] s390x/tcg: Vector Instruction Support Part 1, no-reply, 2019/03/07
- Re: [Qemu-devel] [PATCH v3 00/32] s390x/tcg: Vector Instruction Support Part 1, no-reply, 2019/03/07
- Re: [Qemu-devel] [PATCH v3 00/32] s390x/tcg: Vector Instruction Support Part 1, no-reply, 2019/03/07