From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C9377080D for ; Sun, 11 Oct 2026 00:13:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791677592; cv=none; b=CGgZO2DCwiEEp2lrLIASmF/Gjx4nv6xzkQEdnFRV53qMfDRESbFQXyy7F147IakQmXhNpYv+htTIhR85crIai9GwbG1c4AYdS4cgS6aCTJMN3gZ4UW96JIaz2mqRSAjyhnbJp3uoZxji18VI6TIFFl6XeTdnl4eNL8R2esPwUlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791677592; c=relaxed/simple; bh=rJr+PXEBRDn/U+unsqqULi2Y/GhllVK3moCQhP/m2ZU=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=BgMMLuSQsUOlIDaoSW9RF3BjAz2M3uV7O4uBJuxpy+CsXGHaWmzjHgteBpMYccvmOX3YKkoFUOWuyjmIjDC8FGn7J8o83F+64I2Edrsddi4ErjTO0nX92z9hWQpr/XqsFiYmfqNOl5/moztsJWhNLQ/8ATvW2Uljf6b3cHUZSIU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JDV4UMJu; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JDV4UMJu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791677590; 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; bh=+OnL34M5MuvxOT/P7cYaq5gvVk8RyqKI4iwPV87ogp8=; b=JDV4UMJu9eulCmLRDSTY/PsMVNX/wI1SayLOYaydyP6wOxE5BQ80mFjxaJtkj0HZjlY07G ja+EVKlCXcQZupV6/V5MxglRaLnnbexDZ4vpygSqTip58JLfHzvPjVjpVjrHUaS6W9T7ZQ fLOSWCpydjmFg+lUOKv1Sbcy6hDhtjQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-466-JDGDCOplNcuGPgomy-isHw-1; Sun, 11 Oct 2026 00:13:07 +0000 X-MC-Unique: JDGDCOplNcuGPgomy-isHw-1 X-Mimecast-MFC-AGG-ID: JDGDCOplNcuGPgomy-isHw_1791677585 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A7D731954237; Sun, 11 Oct 2026 00:13:05 +0000 (UTC) Received: from mlevitsk-thinkpadt14gen3.ibmmarkh.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 72E3B1800351; Sun, 11 Oct 2026 00:13:04 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Maxim Levitsky Subject: [PATCH v2 0/2] KVM: nVMX: fix nested APICv emulation for windows guests Date: Sat, 10 Oct 2026 20:13:01 -0400 Message-ID: <20261011001303.723721-1-mlevitsk@redhat.com> Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Fix two problems that were recently discovered that cause nested APICv=0D to malfunction on windows with hyperv enabled.=0D =0D The first problem is that unlike KVM, windows doesn't set PIR.ON when=0D sending posted interrupts. X86 spec actually allows this.=0D =0D The second problem is that unlilke KVM, which mostly ignores them,=0D windows depends on accurate delivery of the posted notification=0D interrupts, and currently it is possible for a posted notification=0D to get lost it it arrives at the same time as the nested VM exit.=0D =0D V2: to avoid spurious notification in L1, process the posted=0D notification in L2, just before VM exit.=0D =0D PS: I am not 100% sure if I got the barriers right, plus I am not sure=0D about what to do if vmx_complete_nested_posted_interrupt can't write=0D to the nested PIR, in this it calls kvm_handle_memory_failure, and=0D I don't know 100% its interactions with nested VM exit.=0D =0D Best regards,=0D Maxim Levitsky=0D =0D Maxim Levitsky (2):=0D KVM: nVMX: don't check PIR.ON when processing nested posted interrupts=0D KVM: nVMX: avoid losing the posted notification interrupt when exiting=0D L2=0D =0D arch/x86/kvm/vmx/nested.c | 22 ++++++++++++++++++----=0D arch/x86/kvm/vmx/vmx.c | 5 +++++=0D 2 files changed, 23 insertions(+), 4 deletions(-)=0D =0D -- =0D 2.54.0=0D =0D