Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753158AbcC3Go5 (ORCPT ); Wed, 30 Mar 2016 02:44:57 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:9970 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752576AbcC3Go4 (ORCPT ); Wed, 30 Mar 2016 02:44:56 -0400 Subject: Re: arm64: kernel v4.6-rc1 hangs on QEMU To: Yury Norov , Arnd Bergmann References: <20160329220502.GA14443@yury-N73SV> <3753214.GGjb33ZPlQ@wuerfel> <20160329222217.GA31869@yury-N73SV> <3334343.7r57EH3qRj@wuerfel> <20160329225216.GB31869@yury-N73SV> CC: , , From: Kefeng Wang Message-ID: <56FB75BF.2000401@huawei.com> Date: Wed, 30 Mar 2016 14:44:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160329225216.GB31869@yury-N73SV> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.180] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.56FB75CA.00F4,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: fd9e0276ede4c7bc9e30e539ac958ecd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1993 Lines: 59 On 2016/3/30 6:52, Yury Norov wrote: > On Wed, Mar 30, 2016 at 12:32:42AM +0200, Arnd Bergmann wrote: >> On Wednesday 30 March 2016 01:22:17 Yury Norov wrote: >>>> >>>> Undefined instruction in cpuinfo_store_boot_cpu() could be related >>>> to the SYS_ID_AA64MMFR2_EL1 access that was recently added. >>>> please use new qemu with commit e20d84c1407d43d5a2e2ac95dbb46db3b0af8f9f Author: Peter Maydell Date: Fri Feb 19 14:07:43 2016 +0000 target-arm: Make reserved ranges in ID_AA64* spaces RAZ, not UNDEF The v8 ARM ARM defines that unused spaces in the ID_AA64* system register ranges are Reserved and must RAZ, rather than being UNDEF. Implement this. In particular, ARM v8.2 adds a new feature register ID_AA64MMFR2, and newer versions of the Linux kernel will attempt to read this, which causes them not to boot up on versions of QEMU missing this fix. Since the encoding .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 6 is actually defined in ARMv8 (as ID_MMFR4), we give it an entry in the ARMCPU struct so CPUs can override it, though since none do this too will just RAZ. see https://lists.gnu.org/archive/html/qemu-devel/2016-02/msg04574.html >>>> What does the architecture say about reading unknown cpuid registers? >>>> >>>> Arnd >>> >>> ThunderX has some unimplemented system registers. AFAIR, attempt to access it >>> causes data abort. >> >> Ok, if that is the case, maybe the read_cpuid() macro can be changed >> so it contains a fixup for the trap? That should handle both data abort >> and undefinstr. >> >> Arnd > > Sounds alluring, but not clear what we'd return that way. I mean, how > we'd distinguish between correct value and error code (0, -1 or whatever). > But I think, we can do like this: > > val = read_cpuid_safe(reg, impossible_val); > if (val == impossible_val) > goto err; > > I think it will work for many cases. > > Yury. > >