Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1114910ybs; Mon, 25 May 2020 07:30:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwu82zxyIV2Us4TrRktFdvdS3793J15OAK4mdbHLbz6jFWa5sspKGXgrFfLTAxi0GffJj9 X-Received: by 2002:a50:bf04:: with SMTP id f4mr14954097edk.91.1590417022133; Mon, 25 May 2020 07:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590417022; cv=none; d=google.com; s=arc-20160816; b=Hkb8HiAjRsgT+8EwAUqn7yXy1ymR/3rgaaha4RhPIcJOvfH2j37Ot4tKWl48nI5skw TvpZpRv4rV3WJKVuh7eUVoBBGT+aGntbxgvqxavCdO9/oPCS+/Jg/pX+I/c8RNyaJqum 2xXFctWXcJNbMAkfM7mhPFJHzIGmKvAOspw36OUhuZA79hL/wf+3NaHnfopTIfz1oKlB 68lYGxu9C7fvYLNAwZg6NSDQBMUKnV2a6Qq0u6wFw1jH8/YTahJl4Rvpc7n7mDXkYado LdqCYM4RWTT36K33fhGR/JAkyQrxML8+4Ed4UIB9k3Z0VHbkgLiX2drp6I8Gk6WhvJFN FiOw== 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=ZaEIUSBX9tpbhuTtXwt0hPkJYnX8LPVpuC0gCRduKRM=; b=imqy6gwbDfFfUOeM8JHZdkLutiSEr/IJBw5563byVCk21kUaPDEQNoweokMLYNIgz1 ZyUe8loUvsQg4y8HUsM2QdOrQBVLb5Hfg4pVK2PjEOb2joq+UO47Zx+YWqScDUPSav1C za3c//QtQrBJ8CT/uSvlSHQ7FJxCAHfxqu0k3sTNnO9tWS8YD35KPZSDjoKz4oTF1Bbf 7mBC1j29Rs8yX5/sNXKjGFO/4jbQVxc66wEVybsFxRFOxFuXCELGBLXjDdTxZ8Lg78qB MTtZ0wmft+4BN3KyGKKjxPqfdzfbw5kL6CyTcckbWiip552RV6/8ukqgn55MU0Ve50yW gDaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TAjphygu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ov17si9485012ejb.741.2020.05.25.07.29.57; Mon, 25 May 2020 07:30:22 -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=@redhat.com header.s=mimecast20190719 header.b=TAjphygu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390911AbgEYO2N (ORCPT + 99 others); Mon, 25 May 2020 10:28:13 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30669 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390879AbgEYO2M (ORCPT ); Mon, 25 May 2020 10:28:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590416891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZaEIUSBX9tpbhuTtXwt0hPkJYnX8LPVpuC0gCRduKRM=; b=TAjphygu3iA4QXwEqmcVdAvkaMtxKjBCasWNZmvtaxkCDxjcWFQ7RHfwNn+UxtTa12QlyI jonP9GKchSPd1AlxH4j2xMFigXvTc1f/RT1nsSNdXviNjSkBdJqr8Bq0WOu9eQct+3vpNF 2e+NeaEBD0m4Od3Auwda8R3MPg/9cvY= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-174-WaWKYkqiOLaACR2Gkrh6Qw-1; Mon, 25 May 2020 10:28:09 -0400 X-MC-Unique: WaWKYkqiOLaACR2Gkrh6Qw-1 Received: by mail-qk1-f197.google.com with SMTP id n22so2651735qka.18 for ; Mon, 25 May 2020 07:28:09 -0700 (PDT) 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=ZaEIUSBX9tpbhuTtXwt0hPkJYnX8LPVpuC0gCRduKRM=; b=N7y+/dRUdLVOLH/Lr1EmsJS3132Gb6tk+NnP73FK/hROUVvdq+r1xElcjgC5rnajGe WJ8SPiXaTOGTNrRiAd8fdGZHhMdw5u4NF/zUi5kZj0cEpHgWwdsdZaV7XKc6NonTmVJf 6bfoS8+6WBwy6xZaVZ5/LVti1XmQ+yYzFB2sfJ216EYN0Tgdwv8SEsbCIpLvZHTMu492 TT+W0qM3+nh0dcNYnJowu43ZxSRNjurcctv0RKl1YcoUE6cJN+c3LFf0v9Hgtv2wwi1K P2xooXSHY4DVo/DXFHUuLr/Ti5m/YUosSsACdtv/pf64s/Yyfdfhlf7dqJym1CpmTtdh YbFQ== X-Gm-Message-State: AOAM5311pBKPgUc1a5lcLgeO1cYY0joSmAKajVHBFSoHJ8fKP/4mRVWu 7k42zl0VL5Q0inwCsZ69Z/wN0RZMRwbHr6RDcQlM7AgWo5QStWO3/GKhxpZTvb9M/4ZZypHwj9q V1hhHRnB8eYJ+Ehy+t9j0AeO9 X-Received: by 2002:ad4:4e6f:: with SMTP id ec15mr16255160qvb.88.1590416889390; Mon, 25 May 2020 07:28:09 -0700 (PDT) X-Received: by 2002:ad4:4e6f:: with SMTP id ec15mr16255137qvb.88.1590416889166; Mon, 25 May 2020 07:28:09 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id h3sm13643021qkl.28.2020.05.25.07.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 07:28:08 -0700 (PDT) Date: Mon, 25 May 2020 10:28:06 -0400 From: Peter Xu To: Jason Gunthorpe Cc: Alex Williamson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, cohuck@redhat.com, cai@lca.pw Subject: Re: [PATCH v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory Message-ID: <20200525142806.GC1058657@xz-x1> References: <159017449210.18853.15037950701494323009.stgit@gimli.home> <159017506369.18853.17306023099999811263.stgit@gimli.home> <20200523193417.GI766834@xz-x1> <20200523170602.5eb09a66@x1.home> <20200523235257.GC939059@xz-x1> <20200525122607.GC744@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200525122607.GC744@ziepe.ca> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 25, 2020 at 09:26:07AM -0300, Jason Gunthorpe wrote: > On Sat, May 23, 2020 at 07:52:57PM -0400, Peter Xu wrote: > > > For what I understand now, IMHO we should still need all those handlings of > > FAULT_FLAG_RETRY_NOWAIT like in the initial version. E.g., IIUC KVM gup will > > try with FOLL_NOWAIT when async is allowed, before the complete slow path. I'm > > not sure what would be the side effect of that if fault() blocked it. E.g., > > the caller could be in an atomic context. > > AFAICT FAULT_FLAG_RETRY_NOWAIT only impacts what happens when > VM_FAULT_RETRY is returned, which this doesn't do? Yes, that's why I think we should still properly return VM_FAULT_RETRY if needed.. because IMHO it is still possible that the caller calls with FAULT_FLAG_RETRY_NOWAIT. My understanding is that FAULT_FLAG_RETRY_NOWAIT majorly means: - We cannot release the mmap_sem, and, - We cannot sleep But we're allowed to return VM_FAULT_RETRY if any of the above is necessary. Thanks, -- Peter Xu