From: Paolo Bonzini Subject: Re: [PATCH] kvm: initialize SVM spinlock Date: Tue, 24 Jan 2017 12:40:00 +0100 Message-ID: References: <20170122090453.88101-1-dvyukov@google.com> <7692da5b-b9f0-9038-dde6-d49bba55029b@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: joro@8bytes.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , KVM list , syzkaller To: David Hildenbrand , Dmitry Vyukov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750802AbdAXLkE (ORCPT ); Tue, 24 Jan 2017 06:40:04 -0500 In-Reply-To: <7692da5b-b9f0-9038-dde6-d49bba55029b@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 23/01/2017 17:09, David Hildenbrand wrote: >> @@ -1382,6 +1383,9 @@ static void avic_vm_destroy(struct kvm *kvm) >> unsigned long flags; >> struct kvm_arch *vm_data = &kvm->arch; >> >> + if (!avic) >> + return 0; >> + >> avic_free_vm_id(vm_data->avic_vm_id); >> >> if (vm_data->avic_logical_id_table_page) >> >> >> Unfortunately I don't remember how I managed to trigger this warning >> because I don't have any SVM-capable hardware... >> But I remember that I did not do anything special besides just >> enabling spinlock checks and then doing something trivial. >> Could somebody try to use SVM with the spinlock checks enabled? I >> don't feel comfortable sending a non-trivial patch without testing >> it... >> > Or stick to your initial patch and simply remove the previous > initialization (sounds clean to me). But we'd better double check if > that additional check in avic_vm_destroy() is also reasonable (maybe > something else is touched that shouldn't be). Yes, that second patch is the right one. David, if you wish to submit a patch to simplify the initialization, I'll apply that too. Thanks, Paolo