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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 8922CC83000 for ; Thu, 30 Apr 2020 00:45:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61AB520787 for ; Thu, 30 Apr 2020 00:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588207531; bh=N3ANq6sB2a8lmCCJej+V3dGn8w0n7uzbK/eRXsHO3uo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=gRIjuI8IV7c416BNqHZnWzdR3uE/77jfAio4OLZUYIKWAPh6bJPAlYQPeRh69b4R8 iEqWteEvNkK7n5crwYoRoOvWzZIf/zmNINCs//G1Dya0hYcKsaUUjwKOmal0nRuIDe GwqhndcamBl/5SQOYsiBEfmJ6hv3l+A3UlzoB5r8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbgD3Apa (ORCPT ); Wed, 29 Apr 2020 20:45:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:49574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbgD3Apa (ORCPT ); Wed, 29 Apr 2020 20:45:30 -0400 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 43C0E2192A for ; Thu, 30 Apr 2020 00:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588207529; bh=N3ANq6sB2a8lmCCJej+V3dGn8w0n7uzbK/eRXsHO3uo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=xg+cdf9Squc1qTKUxLzUxFRpT+9TYfeljsABrROZLaiBeMCDnwDHdkQ8GsoDUi2UU fIUhxPNAZh/tdtR6cOwQYlph0s2+lDL0vDKeNrE9nGoJSn9aVkoUM/3+J0lm7XTusA 23+gHtfzQB9p87PIZja5Ai0Bj29UxM+2OZ9iiG9o= Received: by mail-wr1-f46.google.com with SMTP id j2so4747215wrs.9 for ; Wed, 29 Apr 2020 17:45:29 -0700 (PDT) X-Gm-Message-State: AGi0PubsKGhceiCesVro/lVnFojqX6+K1yFJ4l9NUybA8Vtzrg41+OKq ukzLuzWbbrQn9T2cqzZLBUZ+9lVV+TKNDne2LEq94A== X-Google-Smtp-Source: APiQypJJOJY3YRF/QTUlTHF0NHfRgu9K+ytc2U5m1lBDYPfYqr3cUXh6I1WPp1YkIROgmKABgcygbJdL9Km/lxxCjH8= X-Received: by 2002:adf:bc05:: with SMTP id s5mr880712wrg.70.1588207527548; Wed, 29 Apr 2020 17:45:27 -0700 (PDT) MIME-Version: 1.0 References: <20200429093634.1514902-1-vkuznets@redhat.com> <20200429093634.1514902-5-vkuznets@redhat.com> <0de4a809-e965-d0ad-489f-5b011aa5bf89@redhat.com> In-Reply-To: <0de4a809-e965-d0ad-489f-5b011aa5bf89@redhat.com> From: Andy Lutomirski Date: Wed, 29 Apr 2020 17:45:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 4/6] KVM: x86: acknowledgment mechanism for async pf page ready notifications To: Paolo Bonzini Cc: Andy Lutomirski , Vitaly Kuznetsov , X86 ML , kvm list , LKML , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Sean Christopherson , Wanpeng Li , Jim Mattson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 10:40 AM Paolo Bonzini wrote: > > On 29/04/20 19:28, Andy Lutomirski wrote: > > This seems functional, but I'm wondering if it could a bit simpler and > > more efficient if the data structure was a normal descriptor ring with > > the same number slots as whatever the maximum number of waiting pages > > is. Then there would never need to be any notification from the guest > > back to the host, since there would always be room for a notification. > > No, it would be much more complicated code for a slow path which is > already order of magnitudes slower than a vmexit. It would also use > much more memory. Fair enough. > > > It might be even better if a single unified data structure was used > > for both notifications. > > That's a very bad idea since one is synchronous and one is asynchronous. > Part of the proposal we agreed upon was to keep "page not ready" > synchronous while making "page ready" an interrupt. The data structure > for "page not ready" will be #VE. > #VE on SVM will be interesting, to say the least, and I think that a solution that is VMX specific doesn't make much sense. #VE also has unpleasant issues involving the contexts in which it can occur. You will have quite a hard time convincing me to ack the addition of a #VE entry handler for this. I think a brand new vector is the right solution.