qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH qemu v4 12/18] memory: Share FlatView's and disp


From: Alexey Kardashevskiy
Subject: Re: [Qemu-devel] [PATCH qemu v4 12/18] memory: Share FlatView's and dispatch trees between address spaces
Date: Thu, 21 Sep 2017 09:53:10 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 21/09/17 03:18, Paolo Bonzini wrote:
> On 20/09/2017 13:46, Alexey Kardashevskiy wrote:
>> +    QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) {
>> +        MemoryRegion *physmr = memory_region_get_flatview_root(as->root);
>> +        FlatView *new_view = g_hash_table_lookup(flat_views, physmr);
>> +
>> +        if (new_view) {
>> +            continue;
>> +        }
>> +
>> +        new_view = generate_memory_topology(physmr);
>> +        g_hash_table_insert(flat_views, physmr, new_view);
> 
> generate_memory_topology can do the g_hash_table_lookup + insert I think?

Yeah, I suppose. But rather g_hash_table_replace() if we decide to proceed
with 18/18 (or even if we do not - _replace() simply inserts if there was
no such element).


>>  static void flatview_set_to_address_space(AddressSpace *as)
>>  {
>> -    FlatView *old_view = address_space_get_flatview(as);
>> +    FlatView *old_view = address_space_to_flatview(as);
>>      MemoryRegion *physmr = memory_region_get_flatview_root(as->root);
>>      FlatView *new_view = g_hash_table_lookup(flat_views, physmr);
> 
> Rename to address_space_set_flatview?

Sure, why not :)


-- 
Alexey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]