[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e457190-8ebc-2234-5a14-79cab89b393f@redhat.com>
Date: Wed, 28 Sep 2022 19:18:27 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Emanuele Giuseppe Esposito <eesposit@...hat.com>,
kvm@...r.kernel.org
Cc: Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
David Hildenbrand <david@...hat.com>,
Maxim Levitsky <mlevitsk@...hat.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 7/9] kvm_main.c: duplicate invalid memslot also in
inactive list
On 9/9/22 12:45, Emanuele Giuseppe Esposito wrote:
> /*
> - * if change is DELETE or MOVE, invalid is in active memslots
> - * and old in inactive, so replace old with new.
> + * if change is DELETE or MOVE, invalid is in both active and inactive
> + * memslot list. This means that we don't need old anymore, and
> + * we should replace invalid with new.
> */
> - kvm_replace_memslot(kvm, batch->old, batch->new);
> + if (batch->change == KVM_MR_DELETE || batch->change == KVM_MR_MOVE)
> + kvm_replace_memslot(kvm, batch->invalid, batch->new);
> + else
> + kvm_replace_memslot(kvm, batch->old, batch->new);
This is also
kvm_replace_memslot(kvm, batch->invalid ?: batch->old,
batch->new);
with no need to look at batch->change.
Paolo
Powered by blists - more mailing lists