From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966278AbcAZOek (ORCPT ); Tue, 26 Jan 2016 09:34:40 -0500 Received: from foss.arm.com ([217.140.101.70]:45699 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966160AbcAZOee (ORCPT ); Tue, 26 Jan 2016 09:34:34 -0500 Subject: Re: [PATCH v2 21/21] arm64: Panic when VHE and non VHE CPUs coexist To: "Suzuki K. Poulose" , Catalin Marinas , Will Deacon , Christoffer Dall References: <1453737235-16522-1-git-send-email-marc.zyngier@arm.com> <1453737235-16522-22-git-send-email-marc.zyngier@arm.com> <56A781E7.2050408@arm.com> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu From: Marc Zyngier Organization: ARM Ltd Message-ID: <56A783F7.7050301@arm.com> Date: Tue, 26 Jan 2016 14:34:31 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <56A781E7.2050408@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/01/16 14:25, Suzuki K. Poulose wrote: > On 25/01/16 15:53, Marc Zyngier wrote: >> Having both VHE and non-VHE capable CPUs in the same system >> is likely to be a recipe for disaster. > > >> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c >> index b1adc51..bc7650a 100644 >> --- a/arch/arm64/kernel/smp.c >> +++ b/arch/arm64/kernel/smp.c >> @@ -113,6 +113,9 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) >> pr_crit("CPU%u: failed to come online\n", cpu); >> ret = -EIO; >> } >> + >> + if (is_kernel_mode_mismatched()) >> + panic("CPU%u: incompatible execution level", cpu); > > > fyi, > > I have a series which tries to perform some checks for early CPU features, > like this at [1] and adds support for early CPU boot failures, passing the error > status back to the master. May be we could move this check there(once it settles), > and fail the CPU boot with CPU_PANIC_KERNEL status. > > > [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-January/401727.html Definitely, there is room for consolidation in this area... Thanks, M. -- Jazz is not dead. It just smells funny...