From: David Hildenbrand <david@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
KVM <kvm@vger.kernel.org>
Cc: Cornelia Huck <cohuck@redhat.com>,
linux-s390 <linux-s390@vger.kernel.org>,
Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Subject: Re: [PATCH 0/2] KVM: s390: fixups for cmma migration (kvm/master)
Date: Thu, 21 Dec 2017 13:03:01 +0100 [thread overview]
Message-ID: <36afdadb-994b-22b8-70fd-ff99efb859a3@redhat.com> (raw)
In-Reply-To: <bcf68339-9e90-8d5a-0e77-2a0b72fbbc6c@redhat.com>
On 21.12.2017 12:57, David Hildenbrand wrote:
> On 21.12.2017 10:04, Christian Borntraeger wrote:
>> This is targetted as minimal fixups. Claudio is reworking this
>> to handle this better in general (e.g. memory wholes).
>>
>> I will wait for a review for patch2 (which is new) and then spin
>> a pull request as we now have 2 patches for master
>>
>> Christian Borntraeger (2):
>> KVM: s390: fix cmma migration for multiple memory slots
>> KVM: s390: prevent buffer overrun on memory hotplug during migration
>>
>> arch/s390/kvm/kvm-s390.c | 9 +++++----
>> arch/s390/kvm/priv.c | 2 +-
>> 2 files changed, 6 insertions(+), 5 deletions(-)
>>
>
> [waking up from vacation mode]
>
> Sorry to say, but I guess there is more.
>
> do_essa() can race with
> kvm_s390_vm_set_migration(KVM_S390_VM_MIGRATION_STOP).
>
> CPU0: handle_essa()
> -> vcpu->kvm->arch.migration_state == true
> -> do_essa()
> CPU1: kvm_s390_vm_set_migration(KVM_S390_VM_MIGRATION_STOP)
> -> vcpu->kvm->arch.migration_state = false;
> -> vfree(mgs->pgste_bitmap)
> CPU0: test_and_set_bit(gfn, ms->pgste_bitmap)
> -> access to freed data structure
>
> The kvm_s390_sync_request_broadcast(kvm, KVM_REQ_STOP_MIGRATION) will
> only make sure that all CPUs have left SIE mode, not that the request
> has been processed.
>
> Does that make sense?
>
> [going back to vacation mode]
>
FWIW, doesn't apply the same thing to kvm_s390_get_cmma_bits(), too? I
can't find locking while quickly glimpsing over it. But I might be wrong.
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2017-12-21 12:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 9:04 [PATCH 0/2] KVM: s390: fixups for cmma migration (kvm/master) Christian Borntraeger
2017-12-21 9:04 ` [PATCH 1/2] KVM: s390: fix cmma migration for multiple memory slots Christian Borntraeger
2017-12-21 9:04 ` [PATCH 2/2] KVM: s390: prevent buffer overrun on memory hotplug during migration Christian Borntraeger
2017-12-21 9:36 ` Cornelia Huck
2017-12-21 11:50 ` David Hildenbrand
2017-12-21 11:57 ` [PATCH 0/2] KVM: s390: fixups for cmma migration (kvm/master) David Hildenbrand
2017-12-21 12:03 ` David Hildenbrand [this message]
2017-12-21 12:12 ` Christian Borntraeger
2017-12-21 12:26 ` Christian Borntraeger
2017-12-21 16:43 ` Cornelia Huck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=36afdadb-994b-22b8-70fd-ff99efb859a3@redhat.com \
--to=david@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=imbrenda@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).