Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6232414imm; Mon, 27 Aug 2018 12:00:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZDnBabTMNSQuneD+DmI3uK6UZVBwAcWtf7F79tef8ZaO5Tka7W/1H0vMPDNexgB82BTkUE X-Received: by 2002:a62:843:: with SMTP id c64-v6mr15632549pfd.14.1535396449306; Mon, 27 Aug 2018 12:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535396449; cv=none; d=google.com; s=arc-20160816; b=wWigTpg6Zd2RHNZ+m2uT/5NiCWX8u2+WpHGeZGdbIAmiqSh3gytUUWHAINIgbhueKO k4xBjwcoF5QvtBm9mPo/D/e7lGHPnxCtx9waktEvRpK1Ru1gygfrnt8MLCWtYdG0GpWj CEExD1LAaokpdk3cttWlOEYAK8HUS87FfREuLK7W2BmKwxFxjrt/Q5/dBiKnchR0f8dH sd1KVA7d6/kekcXsJh5jCU6gNU0YY89ZcWMBYZG6sqoyIi2a2xb/SHNP9fzNh6Jkyym1 88IuwCvVWzQMdarwKbrtNTbWp5oGAxwEdHnMlAOtt8IH3d4rCIu3TqNrhRZ/zZHQ46j0 QdNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:from:cc:references:in-reply-to :message-id:date:subject:dkim-signature:arc-authentication-results; bh=MuJPMK4gtkcReeLE8Pey7LehoFRXSmm0PHZ8jD8PPRQ=; b=gPTfm+RsHZen254PkUDrvPNgm3EpVEnZxstFgTibQ/JqABZSjMsorGTy7nURMalfpG UdNP1L/dd3nhJt427nJpnHBFMCjHaOX25FurHi1gE3Vq7p/5ZqAYM22IUeaBJFGXOnGa 3BfJQLFnhdOiVeRnrCU3I5s4BkEEXGsbIYJELwSLC5pq94Zc4uUsm/fLkRV/pMV7AsUj PpLFEYUgKDZg0z3LKZgcJ+81bLr+SO6pXKe4XRyuwSW3KegdNUCQcW/vZcefmxRJKowN gKpD7fKwebDD/E8wDrgbou7bxQx9weTQ+DtxiHzek8qIlrWZxw90W0GFUNY36zB6OCwm Df4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="gGA/STc7"; 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 z2-v6si13693693pgp.681.2018.08.27.12.00.34; Mon, 27 Aug 2018 12:00:49 -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=pass header.i=@sifive.com header.s=google header.b="gGA/STc7"; 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 S1728028AbeH0Wql (ORCPT + 99 others); Mon, 27 Aug 2018 18:46:41 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34778 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbeH0Wqk (ORCPT ); Mon, 27 Aug 2018 18:46:40 -0400 Received: by mail-pg1-f194.google.com with SMTP id u10-v6so16576pgr.1 for ; Mon, 27 Aug 2018 11:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:in-reply-to:references:cc:from:to; bh=MuJPMK4gtkcReeLE8Pey7LehoFRXSmm0PHZ8jD8PPRQ=; b=gGA/STc70VHtNte4UJbLcbYY1w3uej4OzWVZZYkSI2fIWx82Gb3TkiuyyidnPa1qHi z7ijI/F08rJMRGYRLHRJa4K0alFbKCtBKR1md60mBvBCLNrxioj0vMEEfbTo5kvhDIW5 HTog8bT0QzJP0KEe4fsQ0pyBPsmOfBgTtHRQL+mLZovrJhFRP7oJRwScPDoADHWnJ6Mo ieYdcw5eC6V34EqvzDH834DlV6t0frL0uhGPkv0hpjoSjSJhgwE8p9SM0BiFsHehEQV6 HktY3yWKp8XYasGY7T8hYmXeUKz6Ug6HEiXszVlTiTRkSYGLgXMMg6gT3zOUVfy0ofS3 tDDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :cc:from:to; bh=MuJPMK4gtkcReeLE8Pey7LehoFRXSmm0PHZ8jD8PPRQ=; b=W7sfAtUzZunNZ7zwIc+RQiQPW6MZ44ZMCNsHhpdaTBXIgK9V7o6d4icxIP5sTDsGCk R9kreqFYh6LDCUsnGjg9eW16x7vJcC+4o9vosDiiJ9VTFV1b9jLlvkesJrT8JozCXtKL IhQsmtVU3qNuiZV6BNiG0MgMx3QaK2NrEZcDUgsi/9mVIaO6txt77iEC7or3BbLabVCF qIoXUokzj3pv4m6FUu/OswuEbCIq3ys3V0jv01kBxEd4GkbCYdeh6Ynd2kkSf8SWKwae kIyM37QyNO5Y+D0j/LcRF7ABBejbVqa/wvj5mBDK50b7mHUdt6vbDzX64JhAiM0K+efP o7WQ== X-Gm-Message-State: APzg51D9WY3X15NFGDfvnvApBrA1l4Hoqporqp6CLfQ+KSDjlb/Qelqq avI3HGzV96g5+2XJALptyumIBQ== X-Received: by 2002:a65:6292:: with SMTP id f18-v6mr13183581pgv.85.1535396330577; Mon, 27 Aug 2018 11:58:50 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id j15-v6sm9758pfn.52.2018.08.27.11.58.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 11:58:49 -0700 (PDT) Subject: [PATCH 6/8] RISC-V: Use mmgrab() Date: Mon, 27 Aug 2018 11:42:41 -0700 Message-Id: <20180827184243.25344-7-palmer@sifive.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180827184243.25344-1-palmer@sifive.com> References: <20180827184243.25344-1-palmer@sifive.com> Cc: Palmer Dabbelt , aou@eecs.berkeley.edu, daniel.lezcano@linaro.org, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, atish.patra@wdc.com, dmitriy@oss-tech.org, catalin.marinas@arm.com, ard.biesheuvel@linaro.org, Greg KH , jeremy.linton@arm.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: linux-riscv@lists.infradead.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org f1f1007644ff ("mm: add new mmgrab() helper") added a helper that we missed out on. Signed-off-by: Palmer Dabbelt --- arch/riscv/kernel/smpboot.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index e1f6a5ad0416..5437a04babcd 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -30,6 +30,7 @@ #include #include #include +#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); while (!cpu_online(cpu)) cpu_relax(); @@ -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; trap_init(); -- 2.16.4