Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1670978ybt; Thu, 18 Jun 2020 14:25:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9M5KFx2ylsCxwTRqFk1+sxdrLDKYEmom518CmnrySCSMRWaKuBrpDuzKVQrviqCpqYPCm X-Received: by 2002:a17:906:924c:: with SMTP id c12mr659248ejx.457.1592515534459; Thu, 18 Jun 2020 14:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592515534; cv=none; d=google.com; s=arc-20160816; b=JhuL9isEeuiqvggaaiud0mTXfll5FHwbZluqnhAypyQht9UHkAzXIH1NLDnRBfw+yr mu1KPPILtTviCWE5mSl3pnlJx9wKssmN4DhrvQlnAvTjhRYiz3lwwV4AxXfl+fGrYvrf OufK2fzztn3GBGttAW+vlQj1Mab/SrL4zuFS3cwCAUEGTVt8OPuopWefI/eX5emFQtKw 3oiDM75IVoJWnvyczuwg7t3VTCQpvLwuPYHjLKyNExFxwhzRE1mCv8+TfvWX3HB7X1hk IEKVInya0wdjD5pgWfXncaoCQxQxbCPNWiuHAxSlZbQsHVD0I74jTcPo/QfG24J/ZzJq SkfA== 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=TlsMc1mLQuW6Fy9nTnXlEoj8JWjnrS7Ag2B0bw3WO+0=; b=GPfXvd8gXKZfazuNLff7Q/9ZhjEY0ATnV6pLmGj8DQSj5pkFC7MvzNtVWaA9ACIGGv HSxzzt4/ZTKzTIk8P85yc662MlTLT8CS3PA2Q4Y4ANx9BY/O9W+975tuseS/gb0geI3W mZFR0xsL3QOyqNDZuflUQf8EnBfSLPrkKvEYouPlrIia96Kqj1aFi1WGCVLKaNzQsmNq 5L+zyDwuJ8DK7iEcbX7so0gtC+S54mYjXkhzwJeoTHFW/a9PWIXCWV9NDqGoU6GO1qB4 T9vLkkjvNlu6+I63baBQHaAKh+Rq8vRWvgXj+yC4pcigFrfA80EYtCz/Skk01BFG5mEW kjKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hcvUqJNH; 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 lx2si2396743ejb.284.2020.06.18.14.25.10; Thu, 18 Jun 2020 14:25:34 -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=hcvUqJNH; 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 S1729935AbgFRMrM (ORCPT + 99 others); Thu, 18 Jun 2020 08:47:12 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:24133 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728255AbgFRMrL (ORCPT ); Thu, 18 Jun 2020 08:47:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592484430; 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=TlsMc1mLQuW6Fy9nTnXlEoj8JWjnrS7Ag2B0bw3WO+0=; b=hcvUqJNHx7VuqItLfUrqnABeCIA4YRU1qF1V1RN4CwvuipUwx0iZa2HFJTT/cdP+HDT9kC b+Uz2KGpBbOKhZbqfazMYPPZxRqP0ysjwNDbcHoe/YNzX7W7WfJ4P4jedDawJ9DIlYhk87 c8npjuqBU2H3fdET+2Rmuyucez/X3NY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-431--p8fARLGP9OVjj786ZgFmQ-1; Thu, 18 Jun 2020 08:47:09 -0400 X-MC-Unique: -p8fARLGP9OVjj786ZgFmQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C2CF9107ACCD; Thu, 18 Jun 2020 12:47:07 +0000 (UTC) Received: from horse.redhat.com (ovpn-115-20.rdu2.redhat.com [10.10.115.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C52D5D9D3; Thu, 18 Jun 2020 12:47:01 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id B8E99222D7B; Thu, 18 Jun 2020 08:47:00 -0400 (EDT) Date: Thu, 18 Jun 2020 08:47:00 -0400 From: Vivek Goyal To: Sean Christopherson Cc: Vitaly Kuznetsov , virtio-fs@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, wanpengli@tencent.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] kvm: Add capability to be able to report async pf error to guest Message-ID: <20200618124700.GA3814@redhat.com> References: <20200616214847.24482-1-vgoyal@redhat.com> <20200616214847.24482-3-vgoyal@redhat.com> <87lfklhm58.fsf@vitty.brq.redhat.com> <20200617183224.GK26818@linux.intel.com> <20200617215152.GF26770@redhat.com> <20200617230052.GB27751@linux.intel.com> <20200617230548.GC27751@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200617230548.GC27751@linux.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 17, 2020 at 04:05:48PM -0700, Sean Christopherson wrote: > On Wed, Jun 17, 2020 at 04:00:52PM -0700, Sean Christopherson wrote: > > On Wed, Jun 17, 2020 at 05:51:52PM -0400, Vivek Goyal wrote: > > What I'm saying is that KVM cannot do the filtering. KVM, by design, does > > not know what lies behind any given hva, or what the associated gpa maps to > > in the guest. As is, userspace can't even opt out of this behavior, e.g. > > it can't even "filter" on a per-VM granularity, since kvm_pv_enable_async_pf() > > unconditionally allows the guest to enable the behavior[*]. > > Let me rephrase that slightly. KVM can do the filtering, but it cannot make > the decision on what to filter. E.g. if the use case is compatible with doing > this at a memslot level, then a memslot flag could be added to control the > behavior. Ok, may be. But what is that thing which you want to filter out. Just creating a framework for filtering selective regions without any specific use case is hard. Right now we have one switch to enable/disable error reporting and this can be turned off both at qemu level as well as guest level. If the desire is that this needs to me more finer grained, I need to have some examples which show that in these cases we don't want to report page fault errors. Anyway, it seems that atleast first patch is less contentious and can be relatively easily be done. That is exit to user space if page fault error happens instead of getting into an infinite loop. I will post that separately. Thanks Vivek