Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp269160pxf; Wed, 31 Mar 2021 03:01:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqEeP6C801ZWnE2I8MvAFwUdCE8V8i57nE6uuVx75eYnlRtbWPpNTll7ueAlfXg/R77WK8 X-Received: by 2002:a17:907:3e21:: with SMTP id hp33mr2567757ejc.313.1617184871943; Wed, 31 Mar 2021 03:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617184871; cv=none; d=google.com; s=arc-20160816; b=VATxAX628kapD6UHaFPwA0vMC2JFt2ct9UoFLNOIKSS7WU0uLmqiKgM9t8q08fDrG/ rEAutzBmLVsUBmlyxytqWRa/zV5Ds4IXdEKpfcB5pbRzsMgyKCinyG8QhTPqyELyWMbP nDhSns3aAgENPtWfyLla62MTYQQ+uIMpEbpZ4pOLoKx2r4B2rlTlJdq3MIQq5rL52P3Q LIUzD66PmaAx9wvGI4scMcApyF5YatFJ3oujX2eyG/HVriUfoaPJvL3kpk+c/wq8SqnO GcsLbgVW/96Ohw101MtFvFmHIGAoWLyfZZF0AK+bwRChf8zLk6yeuB7jVHWZDWslJULe WOkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=3BGCebbW1Bb1ny9vEBXmNzSvkJSdoSjm1M0jGoPQG7I=; b=vvWEmh84D7HnONIjJBjHEghYbC+Olgwk2TiTXZ7ifIrVxozq1qkdA4vp1VbuWWJxQu witwh+RyL+pLhMMpMdAWzc5rk4qW0szwysvjzy5svnJK6rNwZQxCRJeR2JFHLqisqVMo kpZMkr9zDxi7ycF4Hx799/nGs7qRCiGDUhBuoytR5Yn3gKLnAOytQ23bOHcfx5dzDL2y bvWtM7BbS/FmrcMJ/CwIJRJnqKEq43xSfTyjrLsKpP9Cd07nWWJriCzpZ7J/oJsgw78N nheb8cV9DAhlC2VDGdbRl4nsSW1P5emr+4NLY03aGEMXIl0txBz1vsNxiHAzHrTPkFxY Oc1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=E1HW2jvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds7si1490138ejc.534.2021.03.31.03.00.48; Wed, 31 Mar 2021 03:01:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=E1HW2jvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234923AbhCaJ7s (ORCPT + 99 others); Wed, 31 Mar 2021 05:59:48 -0400 Received: from ozlabs.org ([203.11.71.1]:45529 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234792AbhCaJ7S (ORCPT ); Wed, 31 Mar 2021 05:59:18 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4F9MGr5TPpz9sWQ; Wed, 31 Mar 2021 20:59:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1617184757; bh=p3haphj09CDXdLzCL9waMMLLTSGpd53eETzf7Pujz3c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=E1HW2jvQHKUIpNfeEsD0pCF2UnBDNvnOcHPByIEebrOXqFdoJXcpfLEJT0z9Ml8Si h+m5huudFzCU+jqanSEb0XEtdOPCbEjeiaGFutoGPNrm5xEa3JullVhXanp3sJ5fpW tl+YqHFLnA3otpgJ0ewWDhWzYkTTsbzjYMEwfFYLJDxi3SjALPR2IFVzlIV8pdmHsm UO6j5SJXJZE7xM2/ga+uPgcxYJIdXJmmTbxhgTDBRYyxcpjXg23fBHVXs20S0iDIUS fQ1LTsV1HNFOIMondRjpUJbeexX1oQv7BsC4BDifj/CC9eosK6ufxV3gHrP8vUbhE3 1CE5X2YtFotPQ== From: Michael Ellerman To: Christophe Leroy , Dmitry Safonov , linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Andy Lutomirski , Benjamin Herrenschmidt , Laurent Dufour , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, stable@vger.kernel.org Subject: Re: [PATCH] powerpc/vdso: Separate vvar vma from vdso In-Reply-To: <09e8d68d-54fe-e327-b44f-8f68543edba1@csgroup.eu> References: <20210326191720.138155-1-dima@arista.com> <09e8d68d-54fe-e327-b44f-8f68543edba1@csgroup.eu> Date: Wed, 31 Mar 2021 20:59:16 +1100 Message-ID: <8735wby77v.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > Le 26/03/2021 =C3=A0 20:17, Dmitry Safonov a =C3=A9crit=C2=A0: >> Since commit 511157ab641e ("powerpc/vdso: Move vdso datapage up front") >> VVAR page is in front of the VDSO area. In result it breaks CRIU >> (Checkpoint Restore In Userspace) [1], where CRIU expects that "[vdso]" >> from /proc/../maps points at ELF/vdso image, rather than at VVAR data pa= ge. >> Laurent made a patch to keep CRIU working (by reading aux vector). >> But I think it still makes sence to separate two mappings into different >> VMAs. It will also make ppc64 less "special" for userspace and as >> a side-bonus will make VVAR page un-writable by debugger (which previous= ly >> would COW page and can be unexpected). >>=20 >> I opportunistically Cc stable on it: I understand that usually such >> stuff isn't a stable material, but that will allow us in CRIU have >> one workaround less that is needed just for one release (v5.11) on >> one platform (ppc64), which we otherwise have to maintain. >> I wouldn't go as far as to say that the commit 511157ab641e is ABI >> regression as no other userspace got broken, but I'd really appreciate >> if it gets backported to v5.11 after v5.12 is released, so as not >> to complicate already non-simple CRIU-vdso code. Thanks! >>=20 >> Cc: Andrei Vagin >> Cc: Andy Lutomirski >> Cc: Benjamin Herrenschmidt >> Cc: Christophe Leroy >> Cc: Laurent Dufour >> Cc: Michael Ellerman >> Cc: Paul Mackerras >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: stable@vger.kernel.org # v5.11 >> [1]: https://github.com/checkpoint-restore/criu/issues/1417 >> Signed-off-by: Dmitry Safonov >> Tested-by: Christophe Leroy >> --- >> arch/powerpc/include/asm/mmu_context.h | 2 +- >> arch/powerpc/kernel/vdso.c | 54 +++++++++++++++++++------- >> 2 files changed, 40 insertions(+), 16 deletions(-) >>=20 > >> @@ -133,7 +135,13 @@ static int __arch_setup_additional_pages(struct lin= ux_binprm *bprm, int uses_int >> * install_special_mapping or the perf counter mmap tracking code >> * will fail to recognise it as a vDSO. >> */ >> - mm->context.vdso =3D (void __user *)vdso_base + PAGE_SIZE; >> + mm->context.vdso =3D (void __user *)vdso_base + vvar_size; >> + >> + vma =3D _install_special_mapping(mm, vdso_base, vvar_size, >> + VM_READ | VM_MAYREAD | VM_IO | >> + VM_DONTDUMP | VM_PFNMAP, &vvar_spec); >> + if (IS_ERR(vma)) >> + return PTR_ERR(vma); >>=20=20=20 >> /* >> * our vma flags don't have VM_WRITE so by default, the process isn't > > > IIUC, VM_PFNMAP is for when we have a vvar_fault handler. Some of the other flags seem odd too. eg. VM_IO ? VM_DONTDUMP ? cheers