Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17893862ybl; Thu, 2 Jan 2020 14:15:12 -0800 (PST) X-Google-Smtp-Source: APXvYqy8obz+1Pn/tB0hej9Bg+jriI6qwVoalCMFScqsjLifMKUhjxihPdLnVaQT7gdem4uRtUYp X-Received: by 2002:a05:6830:1f95:: with SMTP id v21mr87981662otr.325.1578003312169; Thu, 02 Jan 2020 14:15:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003312; cv=none; d=google.com; s=arc-20160816; b=Gw6QH5xzl5UxFC7xBdaE2OMbLa/+GveNk+BeVkNBbrV+AVszacls06VVmOhdC/zWKY 4PW62niTmQ7Yoy6xujU67ehiDb9fiMjjra8lYPT0khctR/yJQnFMeA7cU4w69N1DwO8K MVul3cnMCalzGh7TZEjN8PzfRoMGbQKQWGubKV+eJ7/IHv7k4xBOQ2f2sSjejBsgD65e jvtCKNFL5CF8VNxWA7aaddonRnF/ao8CchpKADwEJXRoQO0JjLd1T1kz0AJ/qkmRmzpC vZOpa4TH2iagXomCvLfeVVNG1abR4m+7yeJNBvhXe/Qhy6zGazdKvGYo2dAkPMn6DpDK hyQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QPjODtvCG/4fqlhMm28uZDVJ29b8Afuv6/ZJGI5LGJc=; b=SyZgHFPOndjJnK1BDkinZDN4dSiyzUDBqHzK+kx7tvfv8S0WTWQt36IwWWT6lc+AqP PSeuCuQxobbh5KUK0QrYy1pzjJSOqZoBUyfqCUmarlf4vEoNgyY3SaMScVKAmgiDcfwL qPFeCOv5+fSgd/HeDOlo/uccFjaXcdJKPkn3IYrDIiagGHUyeZU0Df8w7TLCckDMEhc5 blXV6mrozrrHEw5OyUuoGjyqnPVvC711eIRUDeHTW7DpkU3egY63Ra/cPIDDwob8VLP+ 2dJC3TtHFTk2hdG52y744jizD9irOtucwlNkA/nVU19k4jnBv/77GdmtfSwlGXrSP9lz 0GWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QaDohJch; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si29372493otq.51.2020.01.02.14.15.00; Thu, 02 Jan 2020 14:15:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QaDohJch; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbgABWNt (ORCPT + 99 others); Thu, 2 Jan 2020 17:13:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:53726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727445AbgABWNn (ORCPT ); Thu, 2 Jan 2020 17:13:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 66B4C21D7D; Thu, 2 Jan 2020 22:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003222; bh=Fra8aZasCrfdjr2SqA6CMzh9DAlocZ+YwGMIgLze7jk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QaDohJchHauPpddrFOebyQ4AXMViyr72caJvi1Dd2QlRqoCa6BQAr8iGvTk8kr/MC fpYF5eipu/xJO2Ev84T6K56kTuBHcM24c6jstkFjkUMZodk8oqNrmFV+6ciyIdYYiQ 8VSxJGrfA00mKDZa7I6CwgvQKRuo214vaX0c3AwU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Aneesh Kumar K.V" , Nicholas Piggin , Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 5.4 071/191] powerpc/book3s/mm: Update Oops message to print the correct translation in use Date: Thu, 2 Jan 2020 23:05:53 +0100 Message-Id: <20200102215837.517222128@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aneesh Kumar K.V [ Upstream commit d7e02f7b7991dbe14a2acfb0e53d675cd149001c ] Avoids confusion when printing Oops message like below Faulting instruction address: 0xc00000000008bdb4 Oops: Kernel access of bad area, sig: 11 [#1] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV This was because we never clear the MMU_FTR_HPTE_TABLE feature flag even if we run with radix translation. It was discussed that we should look at this feature flag as an indication of the capability to run hash translation and we should not clear the flag even if we run in radix translation. All the code paths check for radix_enabled() check and if found true consider we are running with radix translation. Follow the same sequence for finding the MMU translation string to be used in Oops message. Signed-off-by: Aneesh Kumar K.V Acked-by: Nicholas Piggin Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20190711145814.17970-1-aneesh.kumar@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/kernel/traps.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 82f43535e686..014ff0701f24 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -250,15 +250,22 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, } NOKPROBE_SYMBOL(oops_end); +static char *get_mmu_str(void) +{ + if (early_radix_enabled()) + return " MMU=Radix"; + if (early_mmu_has_feature(MMU_FTR_HPTE_TABLE)) + return " MMU=Hash"; + return ""; +} + static int __die(const char *str, struct pt_regs *regs, long err) { printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); - printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s%s %s\n", + printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n", IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE", - PAGE_SIZE / 1024, - early_radix_enabled() ? " MMU=Radix" : "", - early_mmu_has_feature(MMU_FTR_HPTE_TABLE) ? " MMU=Hash" : "", + PAGE_SIZE / 1024, get_mmu_str(), IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", IS_ENABLED(CONFIG_SMP) ? " SMP" : "", IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "", -- 2.20.1