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=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 D08B5C4727F for ; Wed, 23 Sep 2020 22:04:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82C4723772 for ; Wed, 23 Sep 2020 22:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726680AbgIWWE1 (ORCPT ); Wed, 23 Sep 2020 18:04:27 -0400 Received: from mga11.intel.com ([192.55.52.93]:60138 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726199AbgIWWE1 (ORCPT ); Wed, 23 Sep 2020 18:04:27 -0400 IronPort-SDR: hZJCBN3wvXXHfsSb94AwEm1htFsxaq8VIsV4Juj+AuI+bVL/bPK+cYo00o/H0jRBigRAFDXhm2 d68LcKNxh0tg== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="158381351" X-IronPort-AV: E=Sophos;i="5.77,295,1596524400"; d="scan'208";a="158381351" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 15:04:26 -0700 IronPort-SDR: SbBoppeSUtxVda/CYgowXFdVBdZnT58iPc+A9OzyJMZASltR2sLt4NyW4SnQpM3FYwtnYDkMxm +lwKs46mjqjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,295,1596524400"; d="scan'208";a="335647632" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.160]) by fmsmga004.fm.intel.com with ESMTP; 23 Sep 2020 15:04:26 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Kai Huang Subject: [PATCH 0/4] KVM: x86/mmu: Page fault handling cleanups Date: Wed, 23 Sep 2020 15:04:21 -0700 Message-Id: <20200923220425.18402-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cleanups for page fault handling that were encountered during early TDX enabling, but are worthwhile on their own. Specifically, patch 4 fixes an issue where KVM doesn't detect a spurious page fault (due to the fault being fixed by a different pCPU+vCPU) and does the full gamut of writing the SPTE, updating stats, and prefetching SPTEs. Sean Christopherson (4): KVM: x86/mmu: Return -EIO if page fault returns RET_PF_INVALID KVM: x86/mmu: Invert RET_PF_* check when falling through to emulation KVM: x86/mmu: Return unique RET_PF_* values if the fault was fixed KVM: x86/mmu: Bail early from final #PF handling on spurious faults arch/x86/kvm/mmu/mmu.c | 70 +++++++++++++++++++++------------- arch/x86/kvm/mmu/mmutrace.h | 13 +++---- arch/x86/kvm/mmu/paging_tmpl.h | 3 ++ 3 files changed, 52 insertions(+), 34 deletions(-) -- 2.28.0