From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off Date: Tue, 16 Sep 2014 08:43:03 -0400 (EDT) Message-ID: <1003075385.5021814.1410871383104.JavaMail.zimbra@redhat.com> References: <1410833175-25547-1-git-send-email-drjones@redhat.com> <5417F159.1050501@redhat.com> <198129286.4990140.1410869523048.JavaMail.zimbra@redhat.com> <54182D09.9000700@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, christoffer dall , marc zyngier To: Paolo Bonzini Return-path: Received: from mx4-phx2.redhat.com ([209.132.183.25]:44290 "EHLO mx4-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752662AbaIPMnI (ORCPT ); Tue, 16 Sep 2014 08:43:08 -0400 In-Reply-To: <54182D09.9000700@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: ----- Original Message ----- > Il 16/09/2014 14:12, Andrew Jones ha scritto: > >> > Should it at least write 1 to the spinlock? > > I thought about that. So on one hand we might get a somewhat functional > > synchronization mechanism, which may be enough for some unit test that > > doesn't enable caches, but still needs it. On the other hand, we know > > its broken, so we don't really want any unit tests that need > > synchronization > > and don't enable caches. I chose to not write a 1 in the hope that if > > a unit test introduces a race, that that race will be easier to expose > > and fix. That said, I'm not strongly biased, as we'd still have a race, > > which may or may not be easy to expose, either way. So if the majority > > prefers a best effort approach, then I'll spin a v2. > > The case I was thinking about was something like > > spin_lock() > enable caches > start other processors > spin_unlock() > > I'm not sure if it makes sense though. :) I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't require any synchronization. So we should be able to do enable caches spin_lock start other processors spin_unlock drew > > Paolo >