Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1283109pxy; Thu, 29 Apr 2021 03:49:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw29LuvkXKkqOeEzz36omqN1sHXBAuy9V5Vi/62Mcd/L7RCWHDlkZLGV8KB4Q6ebCHJTsAc X-Received: by 2002:a05:6a00:2283:b029:261:abae:917e with SMTP id f3-20020a056a002283b0290261abae917emr32091075pfe.78.1619693387691; Thu, 29 Apr 2021 03:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619693387; cv=none; d=google.com; s=arc-20160816; b=HUzYMyHvngzqrdx3No0A1HoWaCDUFbjXOOO6CcaW2a6AxWOrW6B2f4sfFHc9yRDj5u kWrTsaXKZocgJhBN9+8jjxbFOE94L/CcauQEln7OHYw8Xvb/V1D8ANO0ZKW3+B0ass4n O25JJFsuDOr4c+P5o2bVnjzyZIzfN6UHj0legJQ83JmTAMvM4R/y61CZ0eZkJh5PDkuI 31WDGnHEbtIbODlDiStvUKJYjm/VsvjZeKIJk6I1kGYyngl4vxjK8FpqqRCVCgc8EC3a XfgtLVeUInFKAPBZaNqRlOi51FmgPs5u0K4LISXyZ0Rs/pLhluSt4iUWB+mZzQs4GkkH zogQ== 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=N9yW175n2/Fko+VjOrEdOCUWNBA9vqG7mA8IcKObQLw=; b=Z4LCLFWnEr1vKKxEGVzpelrm3z3DzsNJZ5lRD8V/zvbhjyS0G1Bt2e79dcUqWSBBP8 HsLHJPmX46CdLDBIvhIXT4jvC25gIDX+wDkixFmNA93fag/CxAYVdrySQmsOfoshwax/ DbMVZZR1g/YihJxRjsBgeV9uLbTNiYAujMxFRuke1L3jFKjk/NYxbLQdognpUpc6Mof8 Q0qGFf+N0+aWw/eFBwihUpfZDXkfmoa8TXim2TRelNKc9rrWxz6ZDU0/JQ1zoxz3ezdc 1mt5THX4j46W5GdjDVlyLIHvYyuIvbW0JBU1Lmyf8/dz4A/eF99NhjuFD8xhsCc/KPc5 MAqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=S9bZZPEq; 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 l132si3926966pfd.116.2021.04.29.03.49.35; Thu, 29 Apr 2021 03:49:47 -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=S9bZZPEq; 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 S240520AbhD2KsD (ORCPT + 99 others); Thu, 29 Apr 2021 06:48:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33723 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240450AbhD2KsA (ORCPT ); Thu, 29 Apr 2021 06:48:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619693234; 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=N9yW175n2/Fko+VjOrEdOCUWNBA9vqG7mA8IcKObQLw=; b=S9bZZPEqpkBGSPFrkat08I5/ISDC7fiAPb9fvTf4nMrm6HhLQcWV9lXIVaHkbo51kW8+ew jlb+7Jg0Ev7S1gETIYhbKfmTSgbMNecTh5pB/asEyTcRFK+249/9EzEijtuUYHJuxLSj1v DTOHJRb0nA/trStzp4JoyJvMZghPTFM= 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-539-Y3VwTIlZNjG3KF0B0M7I0A-1; Thu, 29 Apr 2021 06:47:10 -0400 X-MC-Unique: Y3VwTIlZNjG3KF0B0M7I0A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DD55D8018A7; Thu, 29 Apr 2021 10:47:08 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 317EE5DF26; Thu, 29 Apr 2021 10:47:08 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: srutherford@google.com, seanjc@google.com, joro@8bytes.org, brijesh.singh@amd.com, thomas.lendacky@amd.com, ashish.kalra@amd.com Subject: [PATCH v3 0/2] KVM: x86: guest interface for SEV live migration Date: Thu, 29 Apr 2021 06:47:05 -0400 Message-Id: <20210429104707.203055-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a reviewed version of the guest interface (hypercall+MSR) for SEV live migration. The differences lie mostly in the API for userspace. In particular: - the CPUID feature is not exposed in KVM_GET_SUPPORTED_CPUID - the hypercall must be enabled manually with KVM_ENABLE_CAP - the MSR has sensible behavior if not filtered Compared to v2, the KVM-provided behavior of the MSR is different: it is set to 0 if the guest memory is encrypted, and 1 if it is not. The idea is that the MSR is read-only if KVM_FEATURE_HC_PAGE_ENC_STATUS is not exposed to the guest (it should only be exposed if the guest has encrypted memory), but it also has a sensible value for non-encrypted guests. QEMU could however expose a "0" value for the special "-cpu host,migratable=no" mode if it wanted. Because of this new behavior, the CPUID bit are split. Paolo Ashish Kalra (1): KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall Paolo Bonzini (1): KVM: x86: add MSR_KVM_MIGRATION_CONTROL Documentation/virt/kvm/api.rst | 14 +++++++ Documentation/virt/kvm/cpuid.rst | 9 +++++ Documentation/virt/kvm/hypercalls.rst | 21 ++++++++++ Documentation/virt/kvm/msr.rst | 14 +++++++ arch/x86/include/asm/kvm-x86-ops.h | 1 + arch/x86/include/asm/kvm_host.h | 3 ++ arch/x86/include/uapi/asm/kvm_para.h | 5 +++ arch/x86/kvm/cpuid.c | 3 +- arch/x86/kvm/svm/svm.c | 1 + arch/x86/kvm/vmx/vmx.c | 7 ++++ arch/x86/kvm/x86.c | 56 +++++++++++++++++++++++++++ include/uapi/linux/kvm.h | 1 + include/uapi/linux/kvm_para.h | 1 + 13 files changed, 135 insertions(+), 1 deletion(-) -- 2.26.2