|
| From: | Richard Henderson |
| Subject: | Re: [PATCH v3 03/10] qemu/atomic: Add aligned_{int64,uint64}_t types |
| Date: | Tue, 20 Jul 2021 10:52:07 -1000 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 7/19/21 2:39 AM, Peter Maydell wrote:
This cast is OK, but it took me a while to verify that:
* we check that 'addr' is 8-aligned further up in this function
* we check that guest_base is at least page-aligned in
probe_guest_base(), and there's no way to avoid that function
getting called if you specify a guest-base value on the command line
Yep.
Is it worth asserting that the value we get back from g2h() really is 8-aligned before casting ?
No, I don't think so. I think the check on the guest address is sufficient, and Just Know that guest_base is not going to misalign anything.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |