[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH v2 15/28] s390x/tcg: Fault-safe mem
From: |
David Hildenbrand |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH v2 15/28] s390x/tcg: Fault-safe memset |
Date: |
Wed, 11 Sep 2019 18:18:27 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 11.09.19 17:29, Richard Henderson wrote:
> On 9/6/19 3:57 AM, David Hildenbrand wrote:
>> + if (likely(desta.haddr1)) {
>> + memset(desta.haddr1, byte, desta.size1);
>> + } else {
>> + for (i = 0; i < desta.size1; i++) {
>> + helper_ret_stb_mmu(env, desta.vaddr1 + i, byte, oi, ra);
>> + }
>
> The only thing perhaps that we could do better here is to re-check
> tlb_vaddr_to_host after a singe access. This would handle NOTDIRTY with a
> single iotlb access and then fall back to memset, without re-checking host
> address for real mmio after every store.
Yes - also thought about that :) - but I didn't find a clean way to do
that without uglifying that code (and especially access_memmove() and
friends).
>
>> + if (likely(desta.haddr2)) {
>> + memset(desta.haddr2, byte, desta.size2);
>
> Indentation.
>
>> + } else {
>> + for (i = 0; i < desta.size2; i++) {
>> + helper_ret_stb_mmu(env, desta.vaddr2 + i, byte, oi, ra);
>> }
>
> Likewise wrt NOTDIRTY, which suggests a subroutine to handle a single page?
I'll try to see if this turns out okay-ish. Maybe I'll add via a
separate patch on top.
>
> That said, what's here looks correct so
> Reviewed-by: Richard Henderson <address@hidden>
>
Thanks!
--
Thanks,
David / dhildenb
- Re: [qemu-s390x] [Qemu-devel] [PATCH v2 11/28] s390x/tcg: MVCS/MVCP: Properly wrap the length, (continued)
- [qemu-s390x] [PATCH v2 12/28] s390x/tcg: MVST: Check for specification exceptions, David Hildenbrand, 2019/09/06
- [qemu-s390x] [PATCH v2 13/28] s390x/tcg: MVST: Fix storing back the addresses to registers, David Hildenbrand, 2019/09/06
- [qemu-s390x] [PATCH v2 14/28] s390x/tcg: Always use MMU_USER_IDX for CONFIG_USER_ONLY, David Hildenbrand, 2019/09/06
- [qemu-s390x] [PATCH v2 15/28] s390x/tcg: Fault-safe memset, David Hildenbrand, 2019/09/06
- [qemu-s390x] [PATCH v2 17/28] s390x/tcg: MVCS/MVCP: Use access_memmove_idx(), David Hildenbrand, 2019/09/06
- [qemu-s390x] [PATCH v2 16/28] s390x/tcg: Fault-safe memmove, David Hildenbrand, 2019/09/06
- [qemu-s390x] [PATCH v2 18/28] s390x/tcg: MVC: Fault-safe handling on destructive overlaps, David Hildenbrand, 2019/09/06
- [qemu-s390x] [PATCH v2 19/28] s390x/tcg: MVCLU: Fault-safe handling, David Hildenbrand, 2019/09/06