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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90207EB64D9 for ; Tue, 4 Jul 2023 20:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=6LVUaD1fOLky6o6X3daN3H6trKJwgmAdSW+gGoiqfsc=; b=Yh/+5ax5PeZS1R cdxJFf5DiGVr0sUyMIHeR3TTijDQuHFwtRSEK8KyMWFbE9k8hcijk+nSd93aAb21L3bgJeIBYwJl7 TyQ9MbkgYw5kNfFIVDZDNTO0BBg/jOFXxslaV2DUmp3/LSiB+2LqA6+fgyn5rVVUYsCYe3pJ6oDQS poPcS4hkKkftDmpLLIWN+5K4ORCjkJWzqJI783VCJ1XL57kHQn4GnDoSdo/c3NHblDL/UlmXX+Pif R9wAS66s4JzAkv8zTv6zu0X315QW6QBFHd3NCrTiGMujasN1LocDPO8PHRvXNyvYYEhX//gMPSh5C N8LDDfGDkdvFG/DnXSdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qGn1s-00ECBt-1f; Tue, 04 Jul 2023 20:53:44 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qGn1o-00ECB2-1x for linux-arm-kernel@lists.infradead.org; Tue, 04 Jul 2023 20:53:42 +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=9B1FJRHFENVUHEwrGs3I6ElbBGkJhnDO5f5eSeVCv0U=; b=t51YI6LX68F3gT9YBXTt5SS9Ji 7etRlTW0VrYO3KQBGfsRPzsVWFajTkmCGas0kpzt0R+LCPzzUPTMzI3sNNCT6j79Ld+Amrp1/nvzm HZQ692VnDrdWaRPMBxJZoH725PymgR5qa9ARew5qPdTt95S7RrqkJAtm3Y9533DZoZHbNMTgYr1+Z sr4rjm8KYFNErWAWgbgNN1xg+c5nv7uLrfyyn9prxQ4XCbOMjRzbbrjEqpYcaCbS2Gamq03n63/AL w/nBdZqB82TJzPpoyIGcivUY15iZNqOyKNYswiVcDwWyHpez6W6INCd2bV9H1vGLWiBIZ3bEtvYjW l1zMpH5Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:46700) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qGn1i-0007v2-1J; Tue, 04 Jul 2023 21:53:34 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qGn1g-00054Z-6S; Tue, 04 Jul 2023 21:53:32 +0100 Date: Tue, 4 Jul 2023 21:53:32 +0100 From: "Russell King (Oracle)" To: Amr Bekhit Cc: linux-arm-kernel@lists.infradead.org Subject: Re: kexec on arm fails, possibly due to memdup_user Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230704_135340_948935_D65841AE X-CRM114-Status: GOOD ( 21.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On Tue, Jul 04, 2023 at 06:48:26PM +0100, Amr Bekhit wrote: > > It could be: > > > > /* > > * Validate that if the current HW supports SMP, then the SW supports > > * and implements CPU hotplug for the current HW. If not, we won't be > > * able to kexec reliably, so fail the prepare operation. > > */ > > if (num_possible_cpus() > 1 && platform_can_secondary_boot() && > > !platform_can_cpu_hotplug()) > > return -EINVAL; > > Thanks - this was exactly the issue. memdup_user was a red herring > caused by some missing printk's due to me not adding newlines. It's > now clear that for my CPU (IPQ4019), the cpu_kill function is not > implemented in the smp_operations struct. > > Looking online, I was able to see that kexec does work on my cpu as > long as nr_cpus=1 is specified in the kernel command line (see > https://patchwork.kernel.org/project/linux-arm-msm/patch/CAAGQ2nQNQ-aFkcrQHNA6H5TZ1tTovtfO_0Ohfndn9jXy13Hc6A@mail.gmail.com/#22064531). > > I've tried this myself, and indeed setting this option allows the > kexec load to perform successfully. However, when I run kexec -e, > after the "Bye!" message the system just hangs and reboots after a > while, presumably due to a watchdog timeout: > > ~ # kexec -d --dtb=/data/image-qcom-ipq4019-nerd.dtb -l /data/zImage-openwrt ... > Any pointers as to what could be wrong at this point? Try without --dtb -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps 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