Re: [PATCH for 8.0 v2] memory: Prevent recursive memory access

2023-03-16 Thread Akihiko Odaki
On 2023/03/17 1:15, Alexander Bulekov wrote: On 230316 2124, Akihiko Odaki wrote: A guest may request ask a memory-mapped device to perform DMA. If the address specified for DMA is the device performing DMA, it will create recursion. It is very unlikely that device implementations are prepared f

Re: [PATCH for 8.0 v2] memory: Prevent recursive memory access

2023-03-16 Thread Alexander Bulekov
On 230316 2124, Akihiko Odaki wrote: > A guest may request ask a memory-mapped device to perform DMA. If the > address specified for DMA is the device performing DMA, it will create > recursion. It is very unlikely that device implementations are prepared > for such an abnormal access, which can re

Re: [PATCH for 8.0 v2] memory: Prevent recursive memory access

2023-03-16 Thread Paolo Bonzini
On 3/16/23 13:24, Akihiko Odaki wrote: +static const Object **accessed_region_owners; +static size_t accessed_region_owners_capacity; +static size_t accessed_region_owners_num; + These should be thread-local variables at least, because the memory access API is thread-safe. Paolo

[PATCH for 8.0 v2] memory: Prevent recursive memory access

2023-03-16 Thread Akihiko Odaki
A guest may request ask a memory-mapped device to perform DMA. If the address specified for DMA is the device performing DMA, it will create recursion. It is very unlikely that device implementations are prepared for such an abnormal access, which can result in unpredictable behavior. In particula