Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp34544imm; Thu, 30 Aug 2018 07:44:20 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbshhkd6kqWYPLetzVj2YKfaxIu+iTooUe3G7HxUQigz5fKLa+/waq4qhfOgjps/SNgOSCY X-Received: by 2002:a17:902:344:: with SMTP id 62-v6mr6418317pld.164.1535640260924; Thu, 30 Aug 2018 07:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535640260; cv=none; d=google.com; s=arc-20160816; b=qXVUNcCa72k+TZLXRoMjZEYguRRgU2D1lG58bUHYQ2TDglaPCzlCV5f66Wbcx3e71F u6kUI3YCxIR000t83nsWPv8BSDrPsuYKOkrudY0Oc9icwEUO8jOb+AIIu44Wsou8Np7e 6/gT/uRY54unmj9WCHAGE08wMAz8a3a4riGiM1wR+ff9/msdVzGJ3EyKgDiIw67aMZc5 CmHf2xU0TR6gM2HFo6rSaddaVFPOgJOXn+EaxpMzXa0r0Wr99MVWJQtnDqG1zBr0bGIb 9C87knnLLWmT/PHYHuKpRCOyToNd1D3iILrooLCm1FU8lVlroFrm8f+I+mz73viJYOtt Witg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=NFku9iHEzzrk/KE6L1FWj11aQOyWr/lqpqJsf5EBcSg=; b=igNB7c4kOMJj2QUqwuhWfSBBgeRUVxVGpcPYGeew8o1/e8xOM3to9uVgAdia7Vl69r LzE3jegH/rbcHJXk5MP5AyNyugc5+XDn3/aPry2YEvSWMyw4kwmasHjA0+7SDVcjWKAQ QR3ktpNChN6fTz/lz9vQP32owS8XblgaLAh3f8sn9JV4ftK1RhPELVZziEiMR2JyPnRn nw1onFZ6D/z7ebjxVMaPTnfc8OSAoCV+Am3ZIF0k0VNh+drkgU6UixpknkzFmoy45+PB JjFNeNxw9jyW9z1snVqr54x1Ki9r3QaRae0C96lFKMZr7O1Bw1sC3lNBpz6xEY+U8prB QDwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Tt98Oi0Q; 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 f24-v6si6968101pgh.287.2018.08.30.07.43.58; Thu, 30 Aug 2018 07:44:20 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Tt98Oi0Q; 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 S1729432AbeH3So2 (ORCPT + 99 others); Thu, 30 Aug 2018 14:44:28 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41372 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729048AbeH3So2 (ORCPT ); Thu, 30 Aug 2018 14:44:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender: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=NFku9iHEzzrk/KE6L1FWj11aQOyWr/lqpqJsf5EBcSg=; b=Tt98Oi0QD+XMmVhifPAgmjYCd VWr/V1Tfz2D26lBFDvNblDJbaLz4zZwh1ZZEXF2995ihPOvRdcOlPz7zWpLlofQrMMZ/Xu01/dfg0 vBhBuo5qKJwBL1WApXd3am/4YVSzDOWTUpYKxpnIMYCtw9ljvZWliU0QXq5dza2VY5wEVgJdsPLt6 1hptBV/+YcK+IanWMLr+S2uKJZUgTC1d60W0kJXlKYfejkGS9Hn4jnWii/vULIzvsHGIzi3P4WeEd 1GlofwfOQ3A2AyEtCXbk4LkbOzGq6+6KpuCgIS06f17wpaH2mGxyx+7IJ1/yNtvCJ0QEqhL4crJec YNKcsyXcg==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvO8x-0007Wx-SI; Thu, 30 Aug 2018 14:41:55 +0000 Date: Thu, 30 Aug 2018 07:41:55 -0700 From: Christoph Hellwig To: Palmer Dabbelt Cc: linux-riscv@lists.infradead.org, daniel.lezcano@linaro.org, jason@lakedaemon.net, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, catalin.marinas@arm.com, dmitriy@oss-tech.org, jeremy.linton@arm.com, linux-kernel@vger.kernel.org, atish.patra@wdc.com, aou@eecs.berkeley.edu, Greg KH , tglx@linutronix.de Subject: Re: [PATCH 6/8] RISC-V: Use mmgrab() Message-ID: <20180830144155.GB27233@infradead.org> References: <20180827184243.25344-1-palmer@sifive.com> <20180827184243.25344-7-palmer@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180827184243.25344-7-palmer@sifive.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +#include > #include > #include > #include > @@ -79,8 +80,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) > * the spinning harts that they can continue the boot process. > */ > smp_mb(); > - __cpu_up_stack_pointer[cpu] = task_stack_page(tidle) + THREAD_SIZE; > - __cpu_up_task_pointer[cpu] = tidle; > + WRITE_ONCE(__cpu_up_stack_pointer[cpu], task_stack_page(tidle) + THREAD_SIZE); > + WRITE_ONCE(__cpu_up_task_pointer[cpu], tidle); This looks unrelated. > @@ -100,7 +101,7 @@ asmlinkage void __init smp_callin(void) > struct mm_struct *mm = &init_mm; > > /* All kernel threads share the same mm context. */ > - atomic_inc(&mm->mm_count); > + mmgrab(mm); > current->active_mm = mm; This part looks fine to me: Reviewed-by: Christoph Hellwig