From nobody Wed Apr 8 12:01:27 2026 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 03D32C32772 for ; Fri, 19 Aug 2022 17:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351172AbiHSRjE (ORCPT ); Fri, 19 Aug 2022 13:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351163AbiHSRih (ORCPT ); Fri, 19 Aug 2022 13:38:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3AB22186 for ; Fri, 19 Aug 2022 09:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660928211; 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=CN6W9SC8T0+Gz699A5aiqgYNky4W4GX4nc9X+Iadk4Q=; b=jLRoOcQtmUT4fBE6jxPKJ3ZO18afkehWgzeWRny9HdlNuFUHhxpbNM9IJ3SINLRsKc1Li9 ngJjDKhDD4MfMJy8ZqY0F8e72UpnmMZ0yBtDUk+qs9G1Gv1Py2XBcLLMRHyOOvk9xLdxPt 93IptsvxsDGrmr6q449v31gtKiRYcA0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-dKdzcjIjMUmdESMU2YaNyQ-1; Fri, 19 Aug 2022 12:56:44 -0400 X-MC-Unique: dKdzcjIjMUmdESMU2YaNyQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D72E13801140; Fri, 19 Aug 2022 16:56:43 +0000 (UTC) Received: from virtlab511.virt.lab.eng.bos.redhat.com (virtlab511.virt.lab.eng.bos.redhat.com [10.19.152.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB5BD14152E1; Fri, 19 Aug 2022 16:56:43 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Maxim Levitsky Subject: [PATCH] KVM: SVM: remove unnecessary check on INIT intercept Date: Fri, 19 Aug 2022 12:56:43 -0400 Message-Id: <20220819165643.83692-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since svm_check_nested_events() is now handling INIT signals, there is no need to latch it until the VMEXIT is injected. The only condition under which INIT signals are latched is GIF=3D0. Suggested-by: Maxim Levitsky Signed-off-by: Paolo Bonzini Reviewed-by: Maxim Levitsky --- arch/x86/kvm/svm/svm.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index f3813dbacb9f..26a348389ece 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -4697,15 +4697,7 @@ static bool svm_apic_init_signal_blocked(struct kvm_= vcpu *vcpu) { struct vcpu_svm *svm =3D to_svm(vcpu); =20 - /* - * TODO: Last condition latch INIT signals on vCPU when - * vCPU is in guest-mode and vmcb12 defines intercept on INIT. - * To properly emulate the INIT intercept, - * svm_check_nested_events() should call nested_svm_vmexit() - * if an INIT signal is pending. - */ - return !gif_set(svm) || - (vmcb_is_intercept(&svm->vmcb->control, INTERCEPT_INIT)); + return !gif_set(svm); } =20 static void svm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector) --=20 2.31.1