From patchwork Wed Jan 6 10:53:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 12001345 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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 EE50EC433E9 for ; Wed, 6 Jan 2021 10:54:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A17062310E for ; Wed, 6 Jan 2021 10:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726382AbhAFKyu (ORCPT ); Wed, 6 Jan 2021 05:54:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46842 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbhAFKyu (ORCPT ); Wed, 6 Jan 2021 05:54:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609930404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=QaEUzQ6yh8rdW3dVNi86zCFUfCiUJ9L8dDbZnEnAkcY=; b=cIH5zkajrbSOBznNjLYzkQbRtD0tdGIT80H1shz/nlQXKzZSJYERuwc8Z7OQcFphbraVYV uWIzYUmyONmKYOxnLExjUooI2PzwuOK41EgNpaD4Vz1EZh4gYhWe8kNShH0iVx7CBT3BR7 aO8kCDuS9lLR6LlhZdj3/s4KZdFNTYY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-442-lyyoWnXsNmOTb6hm22CjDg-1; Wed, 06 Jan 2021 05:53:13 -0500 X-MC-Unique: lyyoWnXsNmOTb6hm22CjDg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32F0810054FF; Wed, 6 Jan 2021 10:53:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 858EC5B4A9; Wed, 6 Jan 2021 10:53:08 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Joerg Roedel , Wanpeng Li , linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)), x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Vitaly Kuznetsov , "H. Peter Anvin" , Sean Christopherson , Paolo Bonzini , Ingo Molnar , Borislav Petkov , Jim Mattson , Thomas Gleixner , Maxim Levitsky Subject: [PATCH 0/2] RFC: VMX: fix for disappearing L1->L2 event injection on L1 migration Date: Wed, 6 Jan 2021 12:53:04 +0200 Message-Id: <20210106105306.450602-1-mlevitsk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This is VMX version of the same issue as I reproduced on SVM. Unlike SVM, this version has 2 pending issues to resolve. 1. This seems to break 'vmx' kvm-unit-test in 'error code <-> (!URG || prot_mode) [+]' case. The test basically tries to do nested vm entry with unrestricted guest disabled, real mode, and for some reason that works without patch 2 of this series and it doesn't cause the #GP to be injected, but with this patch the test complains about unexpected #GP. I suspect that this test case is broken, but this has to be investigated. 2. L1 MTF injections are lost since kvm has no notion of them, this is TBD to be fixed. This was lightly tested on my nested migration test which no VMX sadly still crashes and burns on an (likely) unrelated issue. Best regards, Maxim Levitsky Maxim Levitsky (2): KVM: VMX: create vmx_process_injected_event KVM: nVMX: fix for disappearing L1->L2 event injection on L1 migration arch/x86/kvm/vmx/nested.c | 12 ++++---- arch/x86/kvm/vmx/vmx.c | 60 ++++++++++++++++++++++++--------------- arch/x86/kvm/vmx/vmx.h | 4 +++ 3 files changed, 47 insertions(+), 29 deletions(-)