[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/6] exec.c: remove an unnecessary assert on PHY
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/6] exec.c: remove an unnecessary assert on PHYS_MAP_NODE_NIL in phys_map_node_alloc() |
Date: |
Thu, 22 Aug 2019 12:24:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 21/03/19 09:25, Wei Yang wrote:
> PHYS_MAP_NODE_NIL is assigned to PhysPageEntry.ptr in case this is not a
> leaf entry, while map->nodes_nb range in [0, nodes_nb_alloc).
>
> Seems we are asserting on two different things, just remove it.
The assertion checks that this "if" is not entered incorrectly:
if (lp->skip && lp->ptr == PHYS_MAP_NODE_NIL) {
lp->ptr = phys_map_node_alloc(map, level == 0);
}
Paolo
> Signed-off-by: Wei Yang <address@hidden>
> ---
> exec.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/exec.c b/exec.c
> index 98ebd0dd1d..8e8b6bb1f9 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -242,7 +242,6 @@ static uint32_t phys_map_node_alloc(PhysPageMap *map,
> bool leaf)
>
> ret = map->nodes_nb++;
> p = map->nodes[ret];
> - assert(ret != PHYS_MAP_NODE_NIL);
> assert(ret != map->nodes_nb_alloc);
>
> e.skip = leaf ? 0 : 1;
>
- Re: [Qemu-devel] [PATCH 2/6] exec.c: remove an unnecessary assert on PHYS_MAP_NODE_NIL in phys_map_node_alloc(),
Paolo Bonzini <=