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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60EE2C433DF for ; Wed, 24 Jun 2020 15:21:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 3079020B1F for ; Wed, 24 Jun 2020 15:21:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2kXSk2I/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3079020B1F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ubuntu.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=caImO+BDE2xi1trksbJYvlr0MfkBPBe7U788npbOlb8=; b=2kXSk2I/nWrCSY2elK7gilMtt 2EcaMsVbVjS1h384ak8HRtj6Vu+ERLWgkj7ffC36wNBPyPVEIYx+PQ+T9FL4nPVMd7N8ZOQe/s5Am L0O4jNN80lbkDiULtHaLKSyvJgbK/433ho+jBeLvGZkNl0w6pF5un/4li36KGpd61brwlHbvtvS3N qXcZadxHIpVsIMmyEd9QREM6aF0ZkS/3Y4YFDTWcBT2HQEOz+0Cy0ZyMMHnNZLxiVyKAcGwSC5Xki XEfRTx0MFtHuOulQOs2fylGB5pfm9tWRwqAIkw4EYT4AaVSfXI8kPBujjakTUTR0HtYsMyShvRBCt nxgF/s0eg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo7At-0002YE-E8; Wed, 24 Jun 2020 15:18:55 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo7AA-0002Mi-AD for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 15:18:20 +0000 Received: from ip5f5af08c.dynamic.kabel-deutschland.de ([95.90.240.140] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jo7A1-000119-Uz; Wed, 24 Jun 2020 15:18:02 +0000 Date: Wed, 24 Jun 2020 17:18:01 +0200 From: Christian Brauner To: Andrei Vagin Subject: Re: [PATCH 2/6] arm64/vdso: Zap vvar pages when switching to a time namespace Message-ID: <20200624151801.y27a5joml3mxeo4o@wittgenstein> References: <20200624083321.144975-1-avagin@gmail.com> <20200624083321.144975-3-avagin@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624083321.144975-3-avagin@gmail.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Dmitry Safonov , Catalin Marinas , linux-kernel@vger.kernel.org, Thomas Gleixner , Vincenzo Frascino , Will Deacon , linux-arm-kernel@lists.infradead.org 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, Jun 24, 2020 at 01:33:17AM -0700, Andrei Vagin wrote: > The order of vvar pages depends on whether a task belongs to the root > time namespace or not. In the root time namespace, a task doesn't have a > per-namespace page. In a non-root namespace, the VVAR page which contains > the system-wide VDSO data is replaced with a namespace specific page > that contains clock offsets. > > Whenever a task changes its namespace, the VVAR page tables are cleared > and then they will be re-faulted with a corresponding layout. > > A task can switch its time namespace only if its ->mm isn't shared with > another task. > > Reviewed-by: Vincenzo Frascino > Reviewed-by: Dmitry Safonov > Signed-off-by: Andrei Vagin > --- > arch/arm64/kernel/vdso.c | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c > index 7c4620451fa5..bdf492a17dff 100644 > --- a/arch/arm64/kernel/vdso.c > +++ b/arch/arm64/kernel/vdso.c > @@ -124,6 +124,37 @@ static int __vdso_init(enum vdso_abi abi) > return 0; > } > > +#ifdef CONFIG_TIME_NS > +/* > + * The vvar mapping contains data for a specific time namespace, so when a task > + * changes namespace we must unmap its vvar data for the old namespace. > + * Subsequent faults will map in data for the new namespace. > + * > + * For more details see timens_setup_vdso_data(). > + */ > +int vdso_join_timens(struct task_struct *task, struct time_namespace *ns) > +{ > + struct mm_struct *mm = task->mm; > + struct vm_area_struct *vma; > + > + mmap_read_lock(mm); Perfect, thanks! I'll adapt my patches so that my change and this change don't conflict and can go in together. Once they're landed we can simply turn int vdso_join_timens() into void vdso_join_timens() everywhere. Reviewed-by: Christian Brauner Thanks! Christian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel