Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp418290pxu; Tue, 6 Oct 2020 09:26:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8b8YOSHq3csKBKgQDN171rU8CH5GaHFaG62UxB/CEgXUbV7ELYRG+/5qjhZOV8TyqB5Tt X-Received: by 2002:a05:6402:3c1:: with SMTP id t1mr6102947edw.231.1602001562940; Tue, 06 Oct 2020 09:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602001562; cv=none; d=google.com; s=arc-20160816; b=wVlDPOFzRnCqR4Tm7mIQ+6wd1Vy+XznqrloX1ZKSMz2Fg8tisOLRkemmfVzcVNp2g3 sWC/FdOKk/Yt4tRUJkJNxjPXK7/+zaQkZHC82DG3Jf+Xt+X5quMGruXABPMhNs8IdAtn Gxypla3Yq+yWasdCrwqbN1bBDzyfrpO39TzItWw3YwkUIqmHyKEKzkYXZ2mVVAesEGaT qif72ReUF4MDT+CkHQoNfoTMRnC7FBS/LD1q7ByZo++C2nvV23TPdgasYm5j4n4I1RMn Q1P0XxbZn0JBkR/hCMzVlr+Wp1q9wHVb0Xur8ziL0yuz8awKjEmsek7WqUOh+Q1j/y9Z mpvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iTFHZeHpRZeGDIriRmYC9dE/HIjQlj5bWS/e7+7rp/E=; b=kR3ul6tEiifNF7H8jEpsos73G5VeAw1HQGwJtB3MyeYm5HDI/CHoLH8LJEGVzvN0es THliuiTp7loYQ9+gKjiPUnStLj1xE2l+gkho5FUhbnYZefTGyWH26APBVckPjPB1TH1R pflw5k6fPc0TQtf5taRntqHfl8SPsRBeN2MOeOEYyQOp4wIzGkApe6V2REJnycWv7p2D 0nE6T6UmDGmSS9m2MVowyvsIUvbdy7h4DNgQLZ+VSXUAQhReQjRtPHlTLH3w/MITbn4K YlGM4LJuTs4vF8dDFALc5iq3gvpVcpr0FzIgPg1AEgYtks6X2Y3upk4ZKlgHLWnomWoX iIyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O3SddyB+; 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 z18si2753183edm.355.2020.10.06.09.25.36; Tue, 06 Oct 2020 09:26:02 -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=O3SddyB+; 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 S1725995AbgJFQYP (ORCPT + 99 others); Tue, 6 Oct 2020 12:24:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20860 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbgJFQYP (ORCPT ); Tue, 6 Oct 2020 12:24:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602001453; 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=iTFHZeHpRZeGDIriRmYC9dE/HIjQlj5bWS/e7+7rp/E=; b=O3SddyB+A2VK5+zQpjKhvxDfYYugSf4oyoutjvTHT/RiT8qciFO/aSSPB0YKHP0/SQFz4G T6rADt0ip2xCbLHMA6Yy82fWeJe5H5NOIvLSJ9yV0Y4+/tI16wcLbqoPRpSx5Hv+sHmjCc na21JXbdc5sLJNflzs8Zo1FYacJHxKM= 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-281-cMA5fL7OM1m8t7Ty_6lYIg-1; Tue, 06 Oct 2020 12:24:12 -0400 X-MC-Unique: cMA5fL7OM1m8t7Ty_6lYIg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E54C018829D5; Tue, 6 Oct 2020 16:24:10 +0000 (UTC) Received: from horse.redhat.com (ovpn-117-72.rdu2.redhat.com [10.10.117.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D2A61A835; Tue, 6 Oct 2020 16:24:07 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id E76F5220AD7; Tue, 6 Oct 2020 12:24:06 -0400 (EDT) Date: Tue, 6 Oct 2020 12:24:06 -0400 From: Vivek Goyal To: Sean Christopherson Cc: Vitaly Kuznetsov , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, virtio-fs-list , pbonzini@redhat.com Subject: Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error Message-ID: <20201006162406.GE5306@redhat.com> References: <20201002211314.GE24460@linux.intel.com> <20201005153318.GA4302@redhat.com> <20201005161620.GC11938@linux.intel.com> <20201006134629.GB5306@redhat.com> <877ds38n6r.fsf@vitty.brq.redhat.com> <20201006141501.GC5306@redhat.com> <874kn78l2z.fsf@vitty.brq.redhat.com> <20201006150817.GD5306@redhat.com> <871rib8ji1.fsf@vitty.brq.redhat.com> <20201006161200.GB17610@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201006161200.GB17610@linux.intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2020 at 09:12:00AM -0700, Sean Christopherson wrote: > On Tue, Oct 06, 2020 at 05:24:54PM +0200, Vitaly Kuznetsov wrote: > > Vivek Goyal writes: > > > So you will have to report token (along with -EFAULT) to user space. So this > > > is basically the 3rd proposal which is extension of kvm API and will > > > report say HVA/GFN also to user space along with -EFAULT. > > > > Right, I meant to say that guest kernel has full register state of the > > userspace process which caused APF to get queued and instead of trying > > to extract it in KVM and pass to userspace in case of a (later) failure > > we limit KVM api change to contain token or GFN only and somehow keep > > the rest in the guest. This should help with TDX/SEV-ES. > > Whatever gets reported to userspace should be identical with and without > async page faults, i.e. it definitely shouldn't have token information. > > Note, TDX doesn't allow injection exceptions, so reflecting a #PF back > into the guest is not an option. Nor do I think that's "correct" > behavior (see everyone's objections to using #PF for APF fixed). I.e. the > event should probably be an IRQ. I am not sure if IRQ for "Page not Present" works. Will it have some conflicts/issues with other high priority interrupts which can get injected before "Page not present". Vivek