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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 755DEC433FE for ; Wed, 20 Apr 2022 01:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358766AbiDTBkU (ORCPT ); Tue, 19 Apr 2022 21:40:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236207AbiDTBkS (ORCPT ); Tue, 19 Apr 2022 21:40:18 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A86323467E for ; Tue, 19 Apr 2022 18:37:34 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id c32-20020a631c60000000b0039cec64e9f1so117817pgm.3 for ; Tue, 19 Apr 2022 18:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:message-id:mime-version:subject:from:to:cc; bh=eY9rhzFCQwp4CslexU/2ccvHtC1KtRSxjLpofde0bGw=; b=VHH5ZBF37otk0WtV/tSvsGY/Gct4zudkIIYxo0R5S43YvQhA4s4SvHIWOFCkQam3Lg 2/wSihGWny4ZRcpoZ9Rd5JSXRhn6YF5twzkUSt18W33pViahuC2Td8TmzgBDdlHjI2+n fc4nhFQZobPbNgCYFCpKgO2zoxunEX9IA5wHDvAutKvmo50yBckK5yE6cvJEFdRfb1oF pgVTuzHizqB+/zwB5bYzQwm7/XQyWtP9bcP96LypAgUtm9972uxNLawZaPVsAtsXW+Oq xKES0Kea7RalLxSBNj9jMHv22sRILhbdH+9wzq8/HQBZZpUNKWkd4bM9PwDmQ02QVXq8 UFAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:message-id:mime-version:subject :from:to:cc; bh=eY9rhzFCQwp4CslexU/2ccvHtC1KtRSxjLpofde0bGw=; b=1LL4pjQ+0pvn8iCFDyr8H8kE6PVCcGvEAG4UMPv/FVpjQv1UuABiS08bq5hNM8+TKp s6AxpVZCW1GZFqTP0OZAZiQm93434C0qJoifSNfRJzWj9ArJPlfKev39tMz7HoQiVg4h 1sHo+Qy4PfAJiG+eWFAlOAP9PKVO17zTBOO3Pg49CJe7g3Wf2VfPrsAHxnHHG0Cwt48M QE6Kzp1oaoNTith+0GksH08GZJ6sQvo/F8BXRkhDk6LmLZ+7OlmmJNfLRDqCNbRC+9Mb A5MDn3Bc14MuTbqLR6VwnOjgDtoYVr0D9azMcVGg1bTfv1uIMBjw0M6RIo2zKOBFLojb NUWw== X-Gm-Message-State: AOAM533T8u44x0wKaZd2e2UXlmRBYZ9W2D2hZ0KICTEeWsfqLihdwiOo 46ZaHI5fAQcsfkhzT1wF2EbQwIp4WfE= X-Google-Smtp-Source: ABdhPJyItzAyxnB6JimtWaJClPTmyqjT/e4k9MJ4QGgq2Tsac1QNZdwbAF08WqmHc+RZjf6K63IxRjDytYc= X-Received: from seanjc.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:3e5]) (user=seanjc job=sendgmr) by 2002:a05:6a00:1490:b0:4fb:1544:bc60 with SMTP id v16-20020a056a00149000b004fb1544bc60mr20634404pfu.73.1650418654213; Tue, 19 Apr 2022 18:37:34 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 20 Apr 2022 01:37:28 +0000 Message-Id: <20220420013732.3308816-1-seanjc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.rc0.470.gd361397f0d-goog Subject: [PATCH v2 0/4] KVM: x86: APICv fixes 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, Maxim Levitsky , Gaoning Pan , Yongkang Jia Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Patch 1 is brown paper bag fix for a copy+paste bug (thankfully from this cycle). Patch 2 fixes a nVMX + APICv bug where KVM essentially corrupts vmcs02 if an APICv update arrives while L2 is running. Found when testing a slight variation of patch 3. Patch 3 fixes a race where an APICv update that occurs while a vCPU is being created will fail to notify that vCPU due it not yet being visible to the updater. Patch 4 is a minor optimization/cleanup found by inspection when digging into everything else. v2: - Collect reviews. [Maxim] - Reword patch 2's changelog to make it clear that ignoring vmcs02 is perfectly ok. [Maxim] v1: https://lore.kernel.org/all/20220416034249.2609491-3-seanjc@google.com Sean Christopherson (4): KVM: x86: Tag APICv DISABLE inhibit, not ABSENT, if APICv is disabled KVM: nVMX: Defer APICv updates while L2 is active until L1 is active KVM: x86: Pend KVM_REQ_APICV_UPDATE during vCPU creation to fix a race KVM: x86: Skip KVM_GUESTDBG_BLOCKIRQ APICv update if APICv is disabled arch/x86/kvm/vmx/nested.c | 5 +++++ arch/x86/kvm/vmx/vmx.c | 5 +++++ arch/x86/kvm/vmx/vmx.h | 1 + arch/x86/kvm/x86.c | 20 ++++++++++++++++++-- 4 files changed, 29 insertions(+), 2 deletions(-) base-commit: 150866cd0ec871c765181d145aa0912628289c8a -- 2.36.0.rc0.470.gd361397f0d-goog