[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 14/15] numa: Introduce ram_block_notifiers_support_resize(
From: |
Murilo Opsfelder Araújo |
Subject: |
Re: [PATCH v4 14/15] numa: Introduce ram_block_notifiers_support_resize() |
Date: |
Wed, 25 Mar 2020 12:24:28 -0300 |
On Thursday, March 5, 2020 11:29:44 AM -03 David Hildenbrand wrote:
> We want to actually use resizeable allocations in resizeable ram blocks
> (IOW, make everything between used_length and max_length inaccessible) -
> however, not all ram block notifiers can support that.
>
> Introduce a way to detect if any registered notifier does not
> support resizes - ram_block_notifiers_support_resize() - which we can later
> use to fallback to legacy handling if a registered notifier (esp., SEV and
> HAX) does not support actual resizes.
>
> Reviewed-by: Peter Xu <address@hidden>
> Cc: Richard Henderson <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Cc: "Dr. David Alan Gilbert" <address@hidden>
> Cc: Eduardo Habkost <address@hidden>
> Cc: Marcel Apfelbaum <address@hidden>
> Cc: "Michael S. Tsirkin" <address@hidden>
> Cc: Igor Mammedov <address@hidden>
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
Acked-by: Murilo Opsfelder Araujo <address@hidden>
> hw/core/numa.c | 12 ++++++++++++
> include/exec/ramlist.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/hw/core/numa.c b/hw/core/numa.c
> index 37ce175e13..1d5288c22c 100644
> --- a/hw/core/numa.c
> +++ b/hw/core/numa.c
> @@ -914,3 +914,15 @@ void ram_block_notify_resize(void *host, size_t
> old_size, size_t new_size) }
> }
> }
> +
> +bool ram_block_notifiers_support_resize(void)
> +{
> + RAMBlockNotifier *notifier;
> +
> + QLIST_FOREACH(notifier, &ram_list.ramblock_notifiers, next) {
> + if (!notifier->ram_block_resized) {
> + return false;
> + }
> + }
> + return true;
> +}
> diff --git a/include/exec/ramlist.h b/include/exec/ramlist.h
> index 293c0ddabe..ac5811be96 100644
> --- a/include/exec/ramlist.h
> +++ b/include/exec/ramlist.h
> @@ -79,6 +79,7 @@ void ram_block_notifier_remove(RAMBlockNotifier *n);
> void ram_block_notify_add(void *host, size_t size, size_t max_size);
> void ram_block_notify_remove(void *host, size_t size, size_t max_size);
> void ram_block_notify_resize(void *host, size_t old_size, size_t new_size);
> +bool ram_block_notifiers_support_resize(void);
>
> void ram_block_dump(Monitor *mon);
--
Murilo
- Re: [PATCH v4 10/15] util/mmap-alloc: Prepare for resizeable mmaps, (continued)
- [PATCH v4 11/15] util/mmap-alloc: Implement resizeable mmaps, David Hildenbrand, 2020/03/05
- [PATCH v4 07/15] util/mmap-alloc: Factor out calculation of the pagesize for the guard page, David Hildenbrand, 2020/03/05
- [PATCH v4 13/15] util: oslib: Resizeable anonymous allocations under POSIX, David Hildenbrand, 2020/03/05
- [PATCH v4 12/15] util: vfio-helpers: Implement ram_block_resized(), David Hildenbrand, 2020/03/05
- [PATCH v4 14/15] numa: Introduce ram_block_notifiers_support_resize(), David Hildenbrand, 2020/03/05
- Re: [PATCH v4 14/15] numa: Introduce ram_block_notifiers_support_resize(),
Murilo Opsfelder Araújo <=
- [PATCH v4 15/15] exec: Ram blocks with resizeable anonymous allocations under POSIX, David Hildenbrand, 2020/03/05