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: Thu, 30 Oct 2014 16:59:59 +0100 Message-ID: <20141030155959.GA9562@hawk.usersys.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> <1003075385.5021814.1410871383104.JavaMail.zimbra@redhat.com> <5418315B.6020201@redhat.com> <1230672875.5036288.1410872251140.JavaMail.zimbra@redhat.com> <20140926075115.GB15736@cbox> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paolo Bonzini , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, marc zyngier To: Christoffer Dall Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37041 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759739AbaJ3QAL (ORCPT ); Thu, 30 Oct 2014 12:00:11 -0400 Content-Disposition: inline In-Reply-To: <20140926075115.GB15736@cbox> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 26, 2014 at 09:51:15AM +0200, Christoffer Dall wrote: > On Tue, Sep 16, 2014 at 08:57:31AM -0400, Andrew Jones wrote: > > > > > > ----- Original Message ----- > > > Il 16/09/2014 14:43, Andrew Jones ha scritto: > > > > 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 > > > > > > Ok, I'll test and apply your patch then. > > > > > > Once you change the code to enable caches, please consider hanging on > > > spin_lock with caches disabled. > > > > Unfortunately I can't do that without changing spin_lock into a wrapper > > function. Early setup code calls functions that use spin_locks, e.g. > > puts(), and we won't want to move the cache enablement into early setup > > code, as that should be left for unit tests to turn on off as they wish. > > Thus we either need to be able to change the spin_lock implementation > > dynamically, or just leave the test/return as is. > > > My take on this whole thing is that we're doing something fundamentally > wrong. I think what we should do is to always enable the MMU for > running actual tests, bringing up multiple CPUs etc. We could have an > early_printf() that doesn't use the spinlock. I think this will just be > a more stable setup. > > Do we have clear ideas of which kinds of tests it would make sense to > run without the MMU turned on? If we can be more concrete on this > subject, perhaps a special path (or build) that doesn't enable the MMU > for running the aforementioned test cases could be added. > Finally carving out kvm-unit-tests time again and fixed this properly. A series is on the list "[kvm-unit-tests PATCH 0/6] arm: enable MMU". drew