From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D303CC433E0 for ; Mon, 1 Feb 2021 11:38:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E44664DDB for ; Mon, 1 Feb 2021 11:38:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E44664DDB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NCSG9u6Z665GgREGd49ap4+3Yrq0qfXIx09nG5J+FSU=; b=Ofjon9ixhgjyknwi2zYVOGHNH blwZDWaXaTIpuQEVT7K/YPDCIBMjr9Fk8A962/A92bhOYauv0L8cIhOWIgwSRSgMDHIY/A4Uddx+c dvkJCvt39wSaC0LiKIEWjCy4hyWMqbpenJ135Av1hywCgdKa3441f7x+s8/qaoktq3P6r0aCIQAXW 8NBLrB1D5cjnbqXP4CtPl+dpx0ukufl4nmYtVrnLHIClR/YZy/kTZuCVnHb/YL5bFe3ckesHlHY4P +5rp6vfzvKk97BNOdulz9N1xGwGAq+aj7YgTeVBuiV68Ii2lJ1kln/prl6gISdXfPjh6Jfm5eniZQ 8tnT/TY6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6XWb-0001Va-Im; Mon, 01 Feb 2021 11:37:45 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6XWZ-0001E5-2B for linux-arm-kernel@lists.infradead.org; Mon, 01 Feb 2021 11:37:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=TbkJ5lHaa5UNXXcGQEY9HkpxkXaSF9a600yXDUg3OPc=; b=a/E0syQGtT4kG/vw0P3RfxInR JQ2oM7Y+ynbZxFYsWbY/KxKAA7BCB6VQkpdwIC8Cn4b01nTH1Mi4P/tG45e23YoyQTO0slnClCCCG +Gt3GN0HIk+UtEmrQxhsYwD3AXjyYZQgOQJPw9TkgsQRgLJo2pxCV3ij0zamsBl2xLAM8cUoF2YAT De9f/DKLjtyi5hkqcWWgIDXL0JtkznbnYxr9GLLZ1ZiF7ICak8kRKsQrskXTuvqw8+MCSrKV066z5 jOEHic+G7pp9sBEtP++bJvFwVQo9D39Q7zbPf38UNLEtetGinaGPVDrku8R0wCr7rqShypZu1GuDM m57/pXjQA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:37726) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6XTZ-0003Ec-O5; Mon, 01 Feb 2021 11:34:37 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1l6XTY-0001xl-8x; Mon, 01 Feb 2021 11:34:36 +0000 Date: Mon, 1 Feb 2021 11:34:36 +0000 From: Russell King - ARM Linux admin To: Giancarlo Ferrari Subject: Re: [PATCH] ARM: kexec: Fix panic after TLB are invalidated Message-ID: <20210201113436.GE1463@shell.armlinux.org.uk> References: <1612140296-12546-1-git-send-email-giancarlo.ferrari89@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1612140296-12546-1-git-send-email-giancarlo.ferrari89@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210201_063743_143435_020FC18D X-CRM114-Status: GOOD ( 15.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, penberg@kernel.org, geert@linux-m68k.org, linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, rppt@kernel.org, giancarlo.ferrari@nokia.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I wish others who know this code would get involved, and such stuff wasn't left to me to research and work out whether a patch is correct or not. On Mon, Feb 01, 2021 at 12:44:56AM +0000, Giancarlo Ferrari wrote: > machine_kexec() need to set rw permission in text and rodata sections > to assign some variables (e.g. kexec_start_address). To do that at > the end (after flushing pdm in memory, etc.) it needs to invalidate > TLB [section] entries. > > If during the TLB invalidation an interrupt occours, which might cause > a context switch, there is the risk to inject invalid TLBs, with ro > permissions. > > When trying to assign .text labels, this lead to the following: > > Unable to handle kernel paging request at virtual address 80112f38 > pgd = fd7ef03e > [80112f38] *pgd=0001141e(bad) > Internal error: Oops: 80d [#1] PREEMPT SMP ARM > ... > > Signed-off-by: Giancarlo Ferrari I don't know this code very well, but I don't think this patch is correct. What happens if we have CRASH_DUMP enabled, and we enter this function with IRQs already disabled? Should we really be re-enabling IRQs? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel