Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp243433pxa; Fri, 31 Jul 2020 10:49:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuGIhMWUoTOXlv6tJXrEBtAVVI+pyERnr9/nH6jC9mIyjFg962eCkWm/hXUhjNfDGZy5FL X-Received: by 2002:a05:6402:b32:: with SMTP id bo18mr5016073edb.201.1596217763150; Fri, 31 Jul 2020 10:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596217763; cv=none; d=google.com; s=arc-20160816; b=zzHg3zBh+4ge8474zEUrdSS/jwK73GG2HH6rQpA45fukz+Xlz5ByQStiUBqdr67reY Fc6BS6fqlJZACEMm0mOBlO8ac+pycCwWOV1PAlVByNQhrl3MlFZY/4TNRx3lHfxXexY/ 8GhUUGDUnlLopvSCXZ8kS8qOsYcSjoktNpdpFE+JyJYBWzNnNH5iqLoNmk86/awnCY3p o/seO4LHWkoGu42Ic1bgyH3lXvZaoiTrtvhAUY/QvVy1IMoivJ+4Jq6quvNV/oTITGh8 fG2OIYPfuc8bevzXJx7+4gz9Bk9ToBjHfrV9OWLb/cRz3alIJ8DeY82Ur0FcdWkjsTYp njPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PgavFM9fv9RyVhfrzNoVsCZw1UsAPzbtBmN1LRCEpDI=; b=GMNqapwht0fbS1InYEJFOGZRDlysxySfsu2SSPFOg5rgq/4tI5As3pma7J27JO+OWh EVhYFYTzs+PsrKo5QHIEtgPzyfUGX5m+cc9IUuae+Q2PzVHKSGLLIcKT247SUGm3sptZ Myq9UTrJxK/BpZ6Cbvv4TqKHmZHx2N0pGl8M/OoICXZU2tnjE6r64W6F3gPP56dpzb0E FPocCDrq7cvcP9jMHTU5U/Y/rzJ90FCsfiVo4Ga9yC1WDv+kKNyvVWmiSkbgINt/i+BP igJeloC+WoehtMiS4NyiGic8EFEPv8mNxeb2M02mH/FRy+IuG1vIJWqnBjhKfDD8dbT9 jFLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=NVVxcC3P; 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 dn28si5518754edb.195.2020.07.31.10.49.00; Fri, 31 Jul 2020 10:49:23 -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=@ziepe.ca header.s=google header.b=NVVxcC3P; 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 S2387561AbgGaRsk (ORCPT + 99 others); Fri, 31 Jul 2020 13:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387541AbgGaRsj (ORCPT ); Fri, 31 Jul 2020 13:48:39 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67C7EC061756 for ; Fri, 31 Jul 2020 10:48:39 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id l6so29539165qkc.6 for ; Fri, 31 Jul 2020 10:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PgavFM9fv9RyVhfrzNoVsCZw1UsAPzbtBmN1LRCEpDI=; b=NVVxcC3PrAhlWdWZAWXxQH3YnlOFLgOFSt9l4fAQh5s9CGD+7SfmnH7YtjzVCrmpAL /yoy1xD/5Y3ppQ/nvRTkHrv4u9eJ2hIDdvbPZvVyBWzSnVn4Q1ZI6Ogru6RAZXtl9WNZ jHZQMgE64oC3noQpXLWf3N6gOB4ERfg3ihC16yTOCMhwlAvGABhNAPpSfLKnWw2rdN2l ATEDeLEF7WEbyWs3zItzJaX/FLJuVcoO3JorFxvMhgyU24GVw2xIRGKxJ8Bh12drH+w0 /ZR4XSjBm0Hr4fb7q1NoZQ/bqna8kQn6OutHIE+wtJzCRTc29vF8cZQKnO/JZK9zM+dl kQbA== 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=PgavFM9fv9RyVhfrzNoVsCZw1UsAPzbtBmN1LRCEpDI=; b=G8eQdhCD/dAHd5vO+95tE45pq0Z5DgJF9lgslZqsFSiEgSVovakHDlR2o3I5YiP0Oj 0nlKRRgemJBwD+mz3XMjC/EBzPLhqs7mtsNL3yad3E2OEBxDzlkkt/Bb/SNe+KYo3uFs ol9n3tslFnm7wBf9yZ7OMSZ3ALBGD/BUGsQp50DFK2C8y/Pr4qZVWfMvJBiFXA890K00 WIx/nRweeSoNR804+57SSPqtWTh+S5SzP74HHYY0HM+0CzeyGePKjKyBLzaP0Oy69ra3 aHdV4KHeyK66H2Kjfn/68vkfQt8uvOyxhplm37EKX924lL12nMh8pdtZdOwEkLgv9oCa digA== X-Gm-Message-State: AOAM533Ap3rVCposQalEbPmtXI4XgWbstsMudhP8OISDx4frChnEkv+L ZQVNIiAfTpQjAl4QBC2eSGJHDQ== X-Received: by 2002:a37:b942:: with SMTP id j63mr5170964qkf.138.1596217718437; Fri, 31 Jul 2020 10:48:38 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id 22sm8910314qkd.64.2020.07.31.10.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 10:48:37 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1k1Z93-002AAS-77; Fri, 31 Jul 2020 14:48:37 -0300 Date: Fri, 31 Jul 2020 14:48:37 -0300 From: Jason Gunthorpe To: Steven Sistare Cc: Matthew Wilcox , "Eric W. Biederman" , Anthony Yznaga , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, mhocko@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, arnd@arndb.de, keescook@chromium.org, gerg@linux-m68k.org, ktkhai@virtuozzo.com, christian.brauner@ubuntu.com, peterz@infradead.org, esyr@redhat.com, christian@kellner.me, areber@redhat.com, cyphar@cyphar.com Subject: Re: [RFC PATCH 0/5] madvise MADV_DOEXEC Message-ID: <20200731174837.GH24045@ziepe.ca> References: <20200730171251.GI23808@casper.infradead.org> <63a7404c-e4f6-a82e-257b-217585b0277f@oracle.com> <20200730174956.GK23808@casper.infradead.org> <87y2n03brx.fsf@x220.int.ebiederm.org> <689d6348-6029-5396-8de7-a26bc3c017e5@oracle.com> <20200731152736.GP23808@casper.infradead.org> <9ba26063-0098-e796-9431-8c1d0c076ffc@oracle.com> <20200731165649.GG24045@ziepe.ca> <71ddd3c1-bb59-3e63-e137-99b88ace454d@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71ddd3c1-bb59-3e63-e137-99b88ace454d@oracle.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 31, 2020 at 01:15:34PM -0400, Steven Sistare wrote: > On 7/31/2020 12:56 PM, Jason Gunthorpe wrote: > > On Fri, Jul 31, 2020 at 12:11:52PM -0400, Steven Sistare wrote: > >>> Your preservation-across-exec use-case might or might not need the > >>> VMA to be mapped at the same address. > >> > >> It does. qemu registers memory with vfio which remembers the va's in kernel > >> metadata for the device. > > > > Once the memory is registered with vfio the VA doesn't matter, vfio > > will keep the iommu pointing at the same physical pages no matter > > where they are mapped. > > Yes, but there are other code paths that compute and use offsets between va and the > base va. Mapping at a different va in the new process breaks vfio; I have tried it. Maybe you could fix vfio instead of having this adventure, if vfio is the only motivation. Jason