[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 19/31] linux-user: Handle tags in lock_user/unlock_user
From: |
Richard Henderson |
Subject: |
Re: [PATCH v5 19/31] linux-user: Handle tags in lock_user/unlock_user |
Date: |
Mon, 8 Feb 2021 09:32:30 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 2/8/21 5:57 AM, Peter Maydell wrote:
>> void unlock_user(void *host_ptr, abi_ulong guest_addr, size_t len);
....
>> - if (len > 0) {
>> - memcpy(g2h_untagged(guest_addr), host_ptr, len);
>> + if (len != 0) {
>> + memcpy(host_ptr_conv, host_ptr, len);
>> }
>
> Why the change from checking >0 to checking !=0 ? I'd rather not
> have to go through and audit all the callsites to confirm none
> of them pass a "length-or-negative-errno" value here...
The comparison change should have happened with the type change to unsigned in
the previous patch.
r~
- Re: [PATCH v5 13/31] linux-user: Explicitly untag memory management syscalls, (continued)
- [PATCH v5 16/31] linux-user: Use cpu_untagged_addr in access_ok; split out *_untagged, Richard Henderson, 2021/02/03
- [PATCH v5 17/31] linux-user: Move lock_user et al out of line, Richard Henderson, 2021/02/03
- [PATCH v5 18/31] linux-user: Fix types in uaccess.c, Richard Henderson, 2021/02/03
- [PATCH v5 19/31] linux-user: Handle tags in lock_user/unlock_user, Richard Henderson, 2021/02/03
- [PATCH v5 20/31] linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE, Richard Henderson, 2021/02/03
- [PATCH v5 22/31] target/arm: Use the proper TBI settings for linux-user, Richard Henderson, 2021/02/03
- [PATCH v5 21/31] target/arm: Improve gen_top_byte_ignore, Richard Henderson, 2021/02/03
- [PATCH v5 26/31] linux-user/aarch64: Pass syndrome to EXC_*_ABORT, Richard Henderson, 2021/02/03
- [PATCH v5 23/31] linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG, Richard Henderson, 2021/02/03
- [PATCH v5 25/31] target/arm: Split out syndrome.h from internals.h, Richard Henderson, 2021/02/03
- [PATCH v5 24/31] linux-user/aarch64: Implement PROT_MTE, Richard Henderson, 2021/02/03
- [PATCH v5 29/31] target/arm: Add allocation tag storage for user mode, Richard Henderson, 2021/02/03
- [PATCH v5 30/31] target/arm: Enable MTE for user-only, Richard Henderson, 2021/02/03
- [PATCH v5 31/31] tests/tcg/aarch64: Add mte smoke tests, Richard Henderson, 2021/02/03