Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp460750pxu; Tue, 6 Oct 2020 10:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTJQug32FcPfz33LEq8j0BTqhyod4CHZ9SIunxJn5lupNrqxTPidIjKxWddamlxMX/TkvR X-Received: by 2002:aa7:d65a:: with SMTP id v26mr2924403edr.82.1602005134948; Tue, 06 Oct 2020 10:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602005134; cv=none; d=google.com; s=arc-20160816; b=qbULk0j/RO6yNZ7m9rk5G3lJxC930VqPo5A0tNXy9mmdgaezeBKmQ8vJC/7+h6Yzb/ oEyjg2vZr4k3mEGkkz0L3z5oMc1csRqjzZIBrqA+r0l5IijPe7xYV7TIlHGNwfUJ38uk gq26XK7vkKJl4g2GUn7oDKFLClZnCOnKJr58Q6NTKphVfSouo3RZU5slkS2h2/9suhQc n2kqvSWjH/poGZWzGYhyTrOobXaEm0GdsYHDCea/247iLn0qzrjAenDyvBOug/zKefn5 LBml7a4eO4YGgYRSANoscnf5KM5iY5hfa1DX3mBA/hZAGiW1PZhs7ukv4TNpLdHwDb0p xNiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=X0lONWzOnePFJIrNQc2veqXgojAyC9dQiRR6DMgiXz8=; b=TDPDPD88n5GbsrHdwxnpYnOc7TlPbeUGyInCcm4W8ygEqVtP//m5CBuu1me12Cv4tn 4LHidfiVXasFePftLHWK/tkztuHWyBVuyM9nt+L4siU/TDlsBfsnY5mHlhc0Mst2k5j9 FW+0idnYXfxpWxxV0DZ6sW6UfL4Y0Ns/LrR6AswHQO10RScCvM9VOA/FxZeiDUlqwQSq 6oJjNLem9l6Tu6MeNHtOMYSFsMhSnFdjsYSD96jR5QLuLjH+FBFtn/KfOx27JeWjl80k D4EWWOHgAM6ShCZdFMbsEV5fJPcRi3kUblFgrIfRAYyt2nCFQkfvLdagAhbtIWN5BeSo DJ/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="bhJc/tHV"; 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 z8si3475855edp.90.2020.10.06.10.25.10; Tue, 06 Oct 2020 10: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="bhJc/tHV"; 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 S1726391AbgJFRWB (ORCPT + 99 others); Tue, 6 Oct 2020 13:22:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29097 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725902AbgJFRWB (ORCPT ); Tue, 6 Oct 2020 13:22:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602004919; 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=X0lONWzOnePFJIrNQc2veqXgojAyC9dQiRR6DMgiXz8=; b=bhJc/tHV19Z8Uc/tJeGlDxHnxmv3fMAv6Cm5owdyb6dBfdWJcin4qHFrM7OUK8u9oeHAgr tjA++yI+hDg/kmfl+P+lwo7WgOPnv6ZEMIrUgXOKmXh16t2/l4q9uhh6gNRd0X+yX/Yj0x yf22kSwEi8R7OdHK69eOKrlacQ10sj0= 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-241-GFRTdZ1xMxae7fnP5YnmZg-1; Tue, 06 Oct 2020 13:21:57 -0400 X-MC-Unique: GFRTdZ1xMxae7fnP5YnmZg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFFFC1009440; Tue, 6 Oct 2020 17:21:56 +0000 (UTC) Received: from work-vm (ovpn-114-216.ams2.redhat.com [10.36.114.216]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F2CF5C1BD; Tue, 6 Oct 2020 17:21:51 +0000 (UTC) Date: Tue, 6 Oct 2020 18:21:48 +0100 From: "Dr. David Alan Gilbert" To: Sean Christopherson Cc: Vitaly Kuznetsov , virtio-fs-list , pbonzini@redhat.com, kvm@vger.kernel.org, Vivek Goyal , linux-kernel@vger.kernel.org Subject: Re: [Virtio-fs] [PATCH v4] kvm, x86: Exit to user space in case page fault error Message-ID: <20201006172148.GI3000@work-vm> References: <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> <87y2kj71gj.fsf@vitty.brq.redhat.com> <20201006171704.GC17610@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201006171704.GC17610@linux.intel.com> User-Agent: Mutt/1.14.6 (2020-07-11) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Sean Christopherson (sean.j.christopherson@intel.com) wrote: > On Tue, Oct 06, 2020 at 06:39:56PM +0200, Vitaly Kuznetsov wrote: > > Sean Christopherson writes: > > > > > 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. > > > > > > > Oh, right, when the error gets reported synchronously guest's kernel is > > not yet aware of the issue so it won't be possible to find anything in > > its kdump if userspace decides to crash it immediately. The register > > state (if available) will be actual though. > > > > > Note, TDX doesn't allow injection exceptions, so reflecting a #PF back > > > into the guest is not an option. > > > > Not even #MC? So sad :-) > > Heh, #MC isn't allowed either, yet... > > > > 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 recall Paolo objected against making APF 'page not present' into in > > interrupt as it will require some very special handling to make sure it > > gets injected (and handled) immediately but I'm not really sure how big > > the hack is going to be, maybe in the light of TDX/SEV-ES it's worth a > > try. > > This shouldn't have anything to do with APF. Again, the event injection is > needed even in the synchronous case as the file truncation in the host can > affect existing mappings in the guest. > > I don't know that the mechanism needs to be virtiofs specific or if there can > be a more generic "these PFNs have disappeared", but it's most definitely > orthogonal to APF. There are other cases we get 'these PFNs have disappeared' other than virtiofs; the classic is when people back the guest using a tmpfs that then runs out of room. Dave > _______________________________________________ > Virtio-fs mailing list > Virtio-fs@redhat.com > https://www.redhat.com/mailman/listinfo/virtio-fs -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK