[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v3 1/3] memory: add depth assert in address_space_to_flatview
From: |
Peter Maydell |
Subject: |
Re: [RFC v3 1/3] memory: add depth assert in address_space_to_flatview |
Date: |
Thu, 15 Dec 2022 16:51:35 +0000 |
On Tue, 13 Dec 2022 at 13:36, Chuang Xu <xuchuangxclwt@bytedance.com> wrote:
>
> Before using any flatview, sanity check we're not during a memory
> region transaction or the map can be invalid.
>
> Signed-off-by: Chuang Xu <xuchuangxclwt@bytedance.com>
> ---
> include/exec/memory.h | 9 +++++++++
> softmmu/memory.c | 1 -
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index 91f8a2395a..b43cd46084 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -1069,8 +1069,17 @@ struct FlatView {
> MemoryRegion *root;
> };
>
> +static unsigned memory_region_transaction_depth;
This looks odd. If you define a static variable in a
header file then each .c file which directly or indirectly
includes the header will get its own private copy of the
variable. This probably isn't what you want...
thanks
-- PMM
[RFC v3 2/3] virtio: support delay of checks in virtio_load(), Chuang Xu, 2022/12/13
[RFC v3 3/3] migration: reduce time of loading non-iterable vmstate, Chuang Xu, 2022/12/13
Re: [RFC v3 0/3] migration: reduce time of loading non-iterable vmstate, Peter Xu, 2022/12/16