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=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 B839EC433E0 for ; Thu, 25 Jun 2020 08:27: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 896042081A for ; Thu, 25 Jun 2020 08:27: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="OOVIOtWm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Rk2maCO/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 896042081A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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=pScSlfNKqGPXWQkvn2LXibGwgytzRkQ1RVi1CeVBPCo=; b=OOVIOtWm8rBNgL8RvmBLlkgm1 PwDrpQyPRTVg9g1OPVeVfjhaJ13TT2eBDfjgl6UvhNujUkCnaEKRdmhiTjkScR0oageuqig9puhRn pQp5uhuE0+oOXodWUT5UZobX7YKJVSO79WJwpIgoFBuWMoHBy8ZzE+niwMpF9XaVAjhrYv58mNseh u61QYDUtXK6oKr3PlxfrP83KWUdVUs7LY14WhNpp4OIFc8uDcfAuMDDhYRtkfC60gRm0a/7y4e07W p0Zouugw1sybwrugKEY9e7Jj91mSjSotYYxKIUhXWEl3b1QaYcgTpsXQBZysHiVovVdvIKby78Ghs 8/6YYi8Ww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joNCe-0001Pz-Jd; Thu, 25 Jun 2020 08:25:48 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joNCb-0001Nr-L8 for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2020 08:25:46 +0000 Received: by mail-pl1-x644.google.com with SMTP id f2so2490678plr.8 for ; Thu, 25 Jun 2020 01:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=8shbGUz09vnq5gNf7icF354v58ok08URPqfuPWDFRzQ=; b=Rk2maCO/OrlFxHe6vAWk3QLXAgquWZmsSBnIxOP9FJ+AVXIQwa6pF04oh8jTQ7cVl/ 6lX97Y/0y7ushSZ4yOtSup4hfmM3DYEafqBuYWsGZFBh7mvBI4aC/80p0yqkTpKWBXx4 UjJfZt7bM8LR/4d4qRp5G5HalUZKUwaFnb/5dknQJd5OpgqxJBuckmzjf/PLfD7ggjlj ldOJFoVB1AUFL3IGwSROD6+2hXNJMClG3JOm08cFGZgfK8lu6SI6RS5mqbjr2dlxvmaT e+CXrqyjpgIdj0FEeEa53o/0POuPMmA5nzxDcS9LLa0NO4EupAvnbBEhTkN0Wypd7ASK QhFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8shbGUz09vnq5gNf7icF354v58ok08URPqfuPWDFRzQ=; b=JBzg0Qf+ypuzkplEHg6iIet1Szui/j9gLYZSfXRDEp0VtvTbK7dPNVnSqzbl9LeqRh YB5yuA8KEFBgmciMED/D+JFQLIAk85tQpbfBs2DiF1O2BIZtZCbyjpVED+AAki10Nfxt Na0bXhdhazw2CAwZG0xzBaEtTT9rrRAppBaH1J6sd8M7IpG4iq2K5JUFpJFAuHIJedpa 64/aiCR6tmf+tSb/Omcqib8QDtInwCxvv8OQbLpoaCX36dx/OXwvlgc4oFOVoxsdJ5x5 HumxVv/xZWO3mwnp+S7VkWtH+41qhNnWkTCbzfpHWma+VMZiChRVMC+3NeFqXWSF2VQf 6vFQ== X-Gm-Message-State: AOAM531j1hWIT1NnbvhO09xLKsLJJcs3tLmBvRKGGSw42GzgtlJrr13J 00luhQczVvi2KVrTArWLANY= X-Google-Smtp-Source: ABdhPJw+RA8/j3gtWBVkEMpdmHNLD1QgL6L1iOEQXi0gn686S/8LW5mVCLCRc96o4pWcSQ1ytK5Hkw== X-Received: by 2002:a17:90a:a116:: with SMTP id s22mr2001065pjp.202.1593073543656; Thu, 25 Jun 2020 01:25:43 -0700 (PDT) Received: from gmail.com ([2601:600:9b7f:872e:a655:30fb:7373:c762]) by smtp.gmail.com with ESMTPSA id o20sm7359290pjw.19.2020.06.25.01.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 01:25:43 -0700 (PDT) Date: Thu, 25 Jun 2020 01:25:41 -0700 From: Andrei Vagin To: Christian Brauner Subject: Re: [PATCH 2/6] arm64/vdso: Zap vvar pages when switching to a time namespace Message-ID: <20200625082541.GA151695@gmail.com> References: <20200624083321.144975-1-avagin@gmail.com> <20200624083321.144975-3-avagin@gmail.com> <20200624151801.y27a5joml3mxeo4o@wittgenstein> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624151801.y27a5joml3mxeo4o@wittgenstein> 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 05:18:01PM +0200, Christian Brauner wrote: > 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. Yep. Let's do it this way. Thanks! > > 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