Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2932897pxy; Mon, 3 May 2021 11:10:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlnAvgxywyBsp2vAo0frWaNLDkSqgNYEkhsH2ZLZgMrZdxJ9kCAWINFjeapoFGXkKB3zh4 X-Received: by 2002:aa7:8692:0:b029:28e:7bfd:655c with SMTP id d18-20020aa786920000b029028e7bfd655cmr8479640pfo.81.1620065432766; Mon, 03 May 2021 11:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065432; cv=none; d=google.com; s=arc-20160816; b=icuochW9rn88hLJmQKaikmwUbchiUrhO0pDoGhtYwfHQeaB2xMcBtROkNjLKxPpu+2 dVLTpbLl/GKwqegIyxBGivuyw18Wc2YzYtxrx9hkW1r0FoW+3XM38DSsGhjpDslCfrTj 1uPfWlLFZ5JgwgQNJxJ7qnPZJpW/jW2Y9sGwRfUwIjCmyZP3nxQ9PxWcbHATJQs0lZnK +ahNKcV5OGcacgiqB5b9mgIqC4+iz7mEqj9C+TitdQE1umdf/zXWD4JduEr5VdjZd+Ou XkCq3Dc97FdGIT7FdOaUO8LEhydAjFrU0/yFirAPoBX34hrfv2/ji7E9w8p5eOnTEY7v rrZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3NSTvLyUxmHOiVo7fotK2BXG7bF8hMwAK4lLfzcPP+k=; b=AX3OfN/awjB3pbHJJIwytUlX4MXkfkYhyMHW01UTznL2VSUtq9RnVc831ZGAPuhqMQ RNI10IOnQACM03RIpTss6AjyiVlizZs+uXXDkqkqquhBx+VD7YACcdqMTgX+/fm5r06c hsR6oBeq87lsEFDoy+uIYZGmlxrMSFrsZcWUqSNXU5BofePqE/dTssgdAC5hyo9JEwPa luS1ban9pqSDZ+IpE//L6XgZvFlGkRkfT/1Y9WgEdJk7YQoHaC+4kx1NhsGQqwXY2U28 yQunQGVW/vcQaqWpC0z/JMQ6TjdnURTnpQj9F2c6VKHOu+kac1sAoITHPJ0Wcx+mR4pi bgBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d7H2rc5G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m197si413540pga.196.2021.05.03.11.10.20; Mon, 03 May 2021 11:10:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d7H2rc5G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229946AbhECPJz (ORCPT + 99 others); Mon, 3 May 2021 11:09:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42296 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbhECPJy (ORCPT ); Mon, 3 May 2021 11:09:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620054541; 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=3NSTvLyUxmHOiVo7fotK2BXG7bF8hMwAK4lLfzcPP+k=; b=d7H2rc5Gs0V1wR/LrH8zHK1J9FDP0j1cJ/JZ5Qm//NwO48SjOU29xIzYALQcbEDfos3M1B oos+v20LwMT0i173t3TrQEEpHV6DQ6ppU8OJTUBFFtLeFhtntO2A7LUVihrILVVx8WVl3Y cp5CNASh1R77SRgpT2ewtS+QvRfrLMU= 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-575-ynpy81ogPmqaVuiVqqWbYQ-1; Mon, 03 May 2021 11:08:59 -0400 X-MC-Unique: ynpy81ogPmqaVuiVqqWbYQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06994107ACC7; Mon, 3 May 2021 15:08:58 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.40.194.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFDFA19C45; Mon, 3 May 2021 15:08:55 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Maxim Levitsky , linux-kernel@vger.kernel.org Subject: [PATCH 0/4] KVM: nVMX: Fix migration of nested guests when eVMCS is in use Date: Mon, 3 May 2021 17:08:50 +0200 Message-Id: <20210503150854.1144255-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Win10 guests with WSL2 enabled sometimes crash on migration when enlightened VMCS was used. The condition seems to be induced by the situation when L2->L1 exit is caused immediately after migration and before L2 gets a chance to run (e.g. when there's an interrupt pending). The issue was introduced by commit f2c7ef3ba955 ("KVM: nSVM: cancel KVM_REQ_GET_NESTED_STATE_PAGES on nested vmexit") and the first patch of the series addresses the immediate issue. The eVMCS mapping restoration path, however, seems to be fragile and the rest of the series tries to make it more future proof by including eVMCS GPA in the migration data. Vitaly Kuznetsov (4): KVM: nVMX: Always make an attempt to map eVMCS after migration KVM: nVMX: Properly pad 'struct kvm_vmx_nested_state_hdr' KVM: nVMX: Introduce __nested_vmx_handle_enlightened_vmptrld() KVM: nVMX: Map enlightened VMCS upon restore when possible arch/x86/include/uapi/asm/kvm.h | 4 ++ arch/x86/kvm/vmx/nested.c | 82 +++++++++++++++++++++++---------- 2 files changed, 61 insertions(+), 25 deletions(-) -- 2.30.2