Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2344720rda; Tue, 24 Oct 2023 22:59:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGH6fjSmxQYd7z/+HQymMKc2CrxCkYsYAheknrUl1WSU0pO9loa4ngS18QLtlcQqIcul17R X-Received: by 2002:ac8:5cce:0:b0:417:eb46:f81 with SMTP id s14-20020ac85cce000000b00417eb460f81mr17831612qta.58.1698213586422; Tue, 24 Oct 2023 22:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698213586; cv=none; d=google.com; s=arc-20160816; b=imXBEuZ1kGrv+iO7XJLNJUXFQLADxApcmTEiQ77dITxk3n6qXn2cRthQhXbfPa8IYn O2oCWu5idILQ+kw0DHx5E7f2NBAu8IJ2NqAgwjpLYiHkeLUfqOMhLxbY4yPazzE1IqU8 5lrVxo1fY7QG7T0JHD21Rp0E3UoICCardpQ2UD/aXqRvOuCLIFnKB/ethRtfm0+7vmz4 0opFl+HQ5n84UoBp4oSgKFwM836+9J7BVRDvS2Utr3UQw+BhyRCpUT31J0U9120XGPRK spzrTsbHq8VjoWxftHSVhWB6e5fAjFgIFavi+5X6jDnZZva1xxVJyyZDFVnw79KT0ZfW gEHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+S+AFmV5TrL1exvmf1kteSWzHTuJ/oOL0uNZ1mpG7l0=; fh=c0h284fwBPbnjSgqW+1NapS/KZrytKYuy8dfeFaGips=; b=VgrZhahoBSh/Hknf0YVtfD1/3VppNZ4GGtwKBPWsigK5vpLsE8do3UmvR1lDVZevj1 hT2+EZQeT8OkxRetya4S/wIYB+HWt95jb9IuRRmlWwhJygp0caUd+BREBhp5HYQTZGhF HqlHEcgc/xMBZN1zBxk7q+U/WaM7vL9tJKfMR8/pWBr8cHkz6+Kq1VnAW6OI54T4uErK OfYMXJ0VmwXuNwEP1Zm59LX3Znzdn+Jjoho15hlSC9++1Qxq5sTBVwfYj/dG0qquoYdb cmaUMMQTVnOcYo/TBle28ACI2HMg7e03dX1SGja2W5cAr8s5V6RPStdn0lDS3gNCqmyH QktA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Y8ud/hFc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j20-20020a252314000000b00da03ce4fa2dsi3479235ybj.577.2023.10.24.22.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 22:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Y8ud/hFc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CDC1480212CB; Tue, 24 Oct 2023 22:59:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231960AbjJYF7e (ORCPT + 99 others); Wed, 25 Oct 2023 01:59:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231254AbjJYF7b (ORCPT ); Wed, 25 Oct 2023 01:59:31 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B16130; Tue, 24 Oct 2023 22:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698213568; x=1729749568; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jQJiiFvpOMKFbrXXC4RAupxJWvxclI+9fI31oaetUbg=; b=Y8ud/hFcpiKS7W12OPz8RMn7+QCHv/VFToNTe3miWiIibEW2xQANxJZL cmI4Y8CGgUa8qk0Cq6mnsTq41D09BIDiwF9i9VqjjJnpwx+j2rBbWSEub HG0KKph8R3gk8xb1kwQOa1naIJRp5x5htweqtSV+LwtMLQe512oPOj9oI 4b8BHnNlXA8N3S9sCiD/pKdtFKXwShRphymCXEvTOUYSdjeyI5K9b21R/ ALdFsX3NKaktpFlflbJMEbemGdQUkvFGUQdiHNnOrVMZWJZYKvzwJlJj6 4800+FoeHB0wuIzLZHlGsLsN3OCny9YBQnpvl9wOkqHgAgCzWSwF82mS7 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10873"; a="473479250" X-IronPort-AV: E=Sophos;i="6.03,249,1694761200"; d="scan'208";a="473479250" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 22:59:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10873"; a="788021763" X-IronPort-AV: E=Sophos;i="6.03,249,1694761200"; d="scan'208";a="788021763" Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by orsmga008.jf.intel.com with ESMTP; 24 Oct 2023 22:59:25 -0700 From: Xiaoyao Li To: Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Cc: Jonathan Corbet , Wanpeng Li , Vitaly Kuznetsov , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li Subject: [PATCH v2 2/2] KVM: x86: Improve documentation of MSR_KVM_ASYNC_PF_EN Date: Wed, 25 Oct 2023 01:59:14 -0400 Message-Id: <20231025055914.1201792-3-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231025055914.1201792-1-xiaoyao.li@intel.com> References: <20231025055914.1201792-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 22:59:44 -0700 (PDT) Fix some incorrect statement of MSR_KVM_ASYNC_PF_EN documentation and state clearly the token in 'struct kvm_vcpu_pv_apf_data' of 'page ready' event is matchted with the token in CR2 in 'page not present' event. Signed-off-by: Xiaoyao Li --- Documentation/virt/kvm/x86/msr.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/virt/kvm/x86/msr.rst b/Documentation/virt/kvm/x86/msr.rst index f6d70f99a1a7..3aecf2a70e7b 100644 --- a/Documentation/virt/kvm/x86/msr.rst +++ b/Documentation/virt/kvm/x86/msr.rst @@ -193,8 +193,8 @@ data: Asynchronous page fault (APF) control MSR. Bits 63-6 hold 64-byte aligned physical address of a 64 byte memory area - which must be in guest RAM and must be zeroed. This memory is expected - to hold a copy of the following structure:: + which must be in guest RAM. This memory is expected to hold the + following structure:: struct kvm_vcpu_pv_apf_data { /* Used for 'page not present' events delivered via #PF */ @@ -231,14 +231,14 @@ data: as regular page fault, guest must reset 'flags' to '0' before it does something that can generate normal page fault. - Bytes 5-7 of 64 byte memory location ('token') will be written to by the + Bytes 4-7 of 64 byte memory location ('token') will be written to by the hypervisor at the time of APF 'page ready' event injection. The content - of these bytes is a token which was previously delivered as 'page not - present' event. The event indicates the page in now available. Guest is - supposed to write '0' to 'token' when it is done handling 'page ready' - event and to write 1' to MSR_KVM_ASYNC_PF_ACK after clearing the location; - writing to the MSR forces KVM to re-scan its queue and deliver the next - pending notification. + of these bytes is a token which was previously delivered in CR2 as + 'page not present' event. The event indicates the page is now available. + Guest is supposed to write '0' to 'token' when it is done handling + 'page ready' event and to write '1' to MSR_KVM_ASYNC_PF_ACK after + clearing the location; writing to the MSR forces KVM to re-scan its + queue and deliver the next pending notification. Note, MSR_KVM_ASYNC_PF_INT MSR specifying the interrupt vector for 'page ready' APF delivery needs to be written to before enabling APF mechanism -- 2.34.1