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 A2B09C433EF for ; Thu, 30 Sep 2021 03:55:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 191596187F for ; Thu, 30 Sep 2021 03:55:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 191596187F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A7B52940081; Wed, 29 Sep 2021 23:55:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A03B194003A; Wed, 29 Sep 2021 23:55:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A431940081; Wed, 29 Sep 2021 23:55:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 76BB494003A for ; Wed, 29 Sep 2021 23:55:34 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 35812348D7 for ; Thu, 30 Sep 2021 03:55:34 +0000 (UTC) X-FDA: 78642875388.27.95C008E Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by imf12.hostedemail.com (Postfix) with ESMTP id EFC3E10003C6 for ; Thu, 30 Sep 2021 03:55:33 +0000 (UTC) Received: by mail-lf1-f48.google.com with SMTP id u18so19527328lfd.12 for ; Wed, 29 Sep 2021 20:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IJPS6zsrbHWsNjyLPU/ZEz8loyvWlYIAC7D3Kjus4wI=; b=YjPebZ0q5PidpdWfeNvzuH2+99nPTXGOHWRkng7FrDkiDsyBNwr72s82v4vvSRe4xx rv0m4mHhjIx9cgbvVrjzns/0edl/WBkZxLfPjKf1BFLYavvrcEtZnvrov4nuEx4/7JEH IBK45AImTIdDV0VLpanEItUN2rTX8mIq9uTDcH/YuEeVb4NN6UB8caxg46kYAVocdvd/ QTQBTktNNoxoGnBXZVfyDXR1CAxVlmXJplsiRClkXp5cCTpsDX5/sRc34RkJH4+bJc9b 79jc4Uz8oQkwhtrPqUYTrJuO/1RhGptjALTBIos5Wqtc0sDOPFof9eFvR9neXZCoWWLE cqLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IJPS6zsrbHWsNjyLPU/ZEz8loyvWlYIAC7D3Kjus4wI=; b=mWzIte0vIhDfOz0Jbh2S/OStRln8cVeeYt2qnzCYWI3MJ/MXy2WamFxZkhWM6a/0z7 deKzGnZb+2XroM2ztKwBZih0VI/dPSfbo9ih2X+FGtUALUhn8xKFqnRQ06NnEZ4yfRqI BH4fRyeNvg28xFumr8HkJOQG/hwkJADM7M+3qgWiX2NFh2D+bWXbmZK+ryOb+S7DZvoo jarPYo5cE55amVwbjEebThNKHu4EgBzZ3iyqd893ThYiEaIfhz+41Twmv2KKVUVJXSg1 MN7WXFFbFLfsq4VLxdvX0WiWs9t45Iu+o41t/wvcJrnSgQQaRNqTmSD3pT6e4IoprrgI CkGw== X-Gm-Message-State: AOAM5335UYGwJrRCyFNYw6LV/Axa3KhEUSeT+d+xWXQraZ0GNoCegoZj AA/7gr8GYArHZSKoln8HS35ObvaqMM038FWwkx4XEw== X-Google-Smtp-Source: ABdhPJzQpUwHrNZI+47+bpMwucbwQyrcr9cEb2tHbF6fwCa0fLlhSCubtfIoDhoT5JCiMiJc7npB8YSsvil7o96dPnw= X-Received: by 2002:a19:f515:: with SMTP id j21mr3373622lfb.125.1632974132348; Wed, 29 Sep 2021 20:55:32 -0700 (PDT) MIME-Version: 1.0 References: <20210916231325.125533-1-pasha.tatashin@soleen.com> <20210916231325.125533-9-pasha.tatashin@soleen.com> <20210929123513.GC21631@willie-the-truck> In-Reply-To: <20210929123513.GC21631@willie-the-truck> From: Pasha Tatashin Date: Wed, 29 Sep 2021 23:54:55 -0400 Message-ID: Subject: Re: [PATCH v17 08/15] arm64: kexec: configure EL2 vectors for kexec To: Will Deacon 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 Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: EFC3E10003C6 X-Stat-Signature: kpic7q5hntmpuuc7zu991hj76f78cb9a Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=YjPebZ0q; spf=pass (imf12.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.167.48 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none X-Rspamd-Server: rspam06 X-HE-Tag: 1632974133-987225 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > > +/* 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. Pasha