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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF916C433EF for ; Thu, 30 Sep 2021 08:18:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B044F61528 for ; Thu, 30 Sep 2021 08:18:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B044F61528 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=aWOPnXHS8hvdOJ2/Wy8ubQhqhjOctPma1c3a2mpiKBE=; b=EyGupsxODHHQsv ydIwAsdEi73frRGniAI80O84CUCW0QC3RB4wDkNG+vSpeZ2zTRRrq0bfa9cb4iLNFt5oieloAvP4U Thm4WBl0i8+H4p0o7L3GCtEV7BGjSFe5EZ7vCa03TOwlPIn5ldf53FxGFw7tJ1rUJa4JAUl71iwUh VTp/5HHwP5A3KsZ7R4zbneGaLWKORXfzyuDPT0H28GwkTKCiQuMEubjtGID8kkgFIElIMkLnBmr6a OGxIMjBDNhPbwyLbWH2QELTPQTBeyu18N39TA4lMDyHu5qUOfW2a+GGfGDuhCiffLqsTo0oMrYUEI k71Uwn5Lua8PkGGoEJkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVrEq-00DLu3-JH; Thu, 30 Sep 2021 08:16:20 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVrEl-00DLs2-9f; Thu, 30 Sep 2021 08:16:16 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 53F5661528; Thu, 30 Sep 2021 08:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632989774; bh=IG9QanQU30BLOgTHId32QxYcNknUkvBQ+NHpixLYVRQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r/QiGQjMBdERAF+TEj/DaIlMsGCQTgzbvy1yvZpmUKkympQ2p3y9BFGXwHdhcT0tf i7M9CfaKuPQQ5RVAK+/tRVKSp+oR2mnUmmbNx/9KKdjcXdnaInSfMPDV2i+zpUYkHk 2YSCDJ1tF0tzOArcbGJQHC1iZgYfrohiAwO+vZmj7wDpKb006LxLNKtLlAtGMGL91u lRfl8gglbql1M4KFSkiqcf3NYXU6gnPHnhTfkSwySAZM1bMXmbmWK9gGiZcVkvDxyd EJgh9cWq1xivkblynxfp20eC3NbHEWZpbX9sVRWfuolWWE0ksGR0zWDHE8NEq4Z04e MkFb6pq9C3ErQ== Date: Thu, 30 Sep 2021 09:16:07 +0100 From: Will Deacon To: Pasha Tatashin Cc: James Morris , Sasha Levin , "Eric W. Biederman" , kexec mailing list , LKML , Jonathan Corbet , Catalin Marinas , Linux ARM , Marc Zyngier , James Morse , Vladimir Murzin , Matthias Brugger , linux-mm , Mark Rutland , steve.capper@arm.com, rfontana@redhat.com, Thomas Gleixner , Selin Dag , Tyler Hicks , Pingfan Liu , Andrew Morton , madvenka@linux.microsoft.com Subject: Re: [PATCH v17 08/15] arm64: kexec: configure EL2 vectors for kexec Message-ID: <20210930081607.GA23250@willie-the-truck> References: <20210916231325.125533-1-pasha.tatashin@soleen.com> <20210916231325.125533-9-pasha.tatashin@soleen.com> <20210929123513.GC21631@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20210930_011615_375418_99623B30 X-CRM114-Status: GOOD ( 21.50 ) 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 Wed, Sep 29, 2021 at 11:54:55PM -0400, Pasha Tatashin wrote: > > > +/* Allocates pages for kexec page table */ > > > +static void *kexec_page_alloc(void *arg) > > > +{ > > > + struct kimage *kimage = (struct kimage *)arg; > > > + struct page *page = kimage_alloc_control_pages(kimage, 0); > > > + > > > + if (!page) > > > + return NULL; > > > + > > > + memset(page_address(page), 0, PAGE_SIZE); > > > > Hmm, I think we might be missing barriers here to ensure that the zeroes > > are visible to the page-table walker before we plumb the page into the > > page-table. > > > > Usually, that's taken care of by the smp_wmb() in __pXX_alloc() but I > > can't see that here. Is it hiding? > > Based on the comment in __pte_alloc() that smp_wmb() is needed in > order to synchronize pte setup with other cpus prior to making it > visible to them. This is not needed here. First, by the time these > page tables are used the other cpus are offlined (kexec reboot code is > single threaded). Second, we never insert any entry into a page table > that is actively used by any cpu. I think the comment there is wrong, but the barrier is still necessary. How else do you guarantee that the page-table walker reads the zeroes from the memset? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel