From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE6FEC47247 for ; Tue, 5 May 2020 09:54:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5D2920721 for ; Tue, 5 May 2020 09:54:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NULRXHdP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728323AbgEEJyU (ORCPT ); Tue, 5 May 2020 05:54:20 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:24226 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725766AbgEEJyU (ORCPT ); Tue, 5 May 2020 05:54:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588672458; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TlhlzZcZdCKqn6uGJjCk/Di1gwjV8y+RUYlK2OkS3b4=; b=NULRXHdPgHgWBPkEnVjyBg1y7v6TnFSBOK+TgvU0O2hRMFimRq7fVnTgRIGigSLrmwycHk z4C4IAmybf5f8t25v0UeWknrH6uBUNAUCRMRe0lo7lFaFYLqcidZIgYrGAg/mtRGsUQJR+ e43ehBVghsvbslcyBg6j06wpNzgPCxA= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-tfs41hNZMvuqSFzarWfXqg-1; Tue, 05 May 2020 05:54:16 -0400 X-MC-Unique: tfs41hNZMvuqSFzarWfXqg-1 Received: by mail-wm1-f71.google.com with SMTP id f17so614194wmm.5 for ; Tue, 05 May 2020 02:54:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TlhlzZcZdCKqn6uGJjCk/Di1gwjV8y+RUYlK2OkS3b4=; b=qRJ/4CalKNLL8G1DtEfvgReXMxXXLbyUzIyWFZ1I8fqTQ6YJRMmrwagYUFvj7kxHs9 IMqrb2EExiArcNYLKpW50lLukEKDCarbbjur6viKMOKdxTeWtSRkCohL1DD7fGAMsTYq 7uvA9aOkWKUjElM/kdxjXcAtiMkhuPBTLYiA50DyJ4RkoL9a91T75aRAwNOx+ml06AFH yAPOWeam28wfkZyrbNhTOiJb6/aoVumCshopErnS/kkUISkUrWTeShqP/bjU8I+YWetI WeJ+YFLUgVwJDSeMDnh3vqtpaI1t2FbCjgiITiQ57u5l5RCPmhiiET3gkKHcQvzvMeFk Bpgg== X-Gm-Message-State: AGi0PuY64rLv0DSunIqpYBADkGDXtatjsXIN2hTwLQ/avkAuaV8ke0dM yZC1vJEJUnmJvn8odXUVI3gAkkGZzAJBfRsk3u0ar175RRGoFDCIybCfFq/0GzwKFnGHZ+RTwBg bQIEhIHt5jxtt X-Received: by 2002:a1c:770f:: with SMTP id t15mr2334149wmi.178.1588672455602; Tue, 05 May 2020 02:54:15 -0700 (PDT) X-Google-Smtp-Source: APiQypLwWpFo/EZANuablSCEtbPe77SC3Q23ygQMJ3/l0rAGmnTrMl4z0V4JetgLFE2GKMi+iRoCOg== X-Received: by 2002:a1c:770f:: with SMTP id t15mr2334116wmi.178.1588672455367; Tue, 05 May 2020 02:54:15 -0700 (PDT) Received: from [192.168.178.58] ([151.20.132.175]) by smtp.gmail.com with ESMTPSA id y3sm2506687wrm.64.2020.05.05.02.54.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 May 2020 02:54:14 -0700 (PDT) Subject: Re: [PATCH RFC 4/6] KVM: x86: acknowledgment mechanism for async pf page ready notifications To: Gavin Shan , Vitaly Kuznetsov , x86@kernel.org, kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Sean Christopherson , Wanpeng Li , Jim Mattson References: <20200429093634.1514902-1-vkuznets@redhat.com> <20200429093634.1514902-5-vkuznets@redhat.com> <87y2q6dcfm.fsf@vitty.brq.redhat.com> From: Paolo Bonzini Message-ID: Date: Tue, 5 May 2020 11:54:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 05/05/20 10:51, Gavin Shan wrote: >> How does the guest know if host has any pending events or not? > > One way would be through struct kvm_vcpu_pv_apf_data, which is visible > to host and guest. In the host, the workers that have completed their > work (GUP) are queued into vcpu->async_pf.done. So we need a bit in > struct kvm_vcpu_pv_apf_data, written by host while read by guest to > see if there pending work. I even don't think the writer/reader need > to be synchronized. No, this cannot work. The problem is that you need a way to tell the host "you can give me another ready page", and a memory location is not enough for that. Paolo