From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 649CBC433DF for ; Thu, 20 Aug 2020 13:34:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 312F722B3F for ; Thu, 20 Aug 2020 13:34:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PCeB5h9t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728871AbgHTNd6 (ORCPT ); Thu, 20 Aug 2020 09:33:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28710 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729475AbgHTNdt (ORCPT ); Thu, 20 Aug 2020 09:33:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597930428; 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=X2fJCEf/hhnmDqCnQtY5hjOcNe8YUPEVscVUU8eAkMY=; b=PCeB5h9t4arJmC7gNny9BR5ixdPvS4aReiuGdKagFlgRp6KFFhxgOOWsYCJAnhtCTzft/7 kCPDpLERZoNFA4tI8vaLNDrMSYuGq9dodpF+N4sNM8VzxdLsDthBAdo/Hw6c3W+01i3jJw STrZDp0kklISUTvMmd+ye85yfE3SDgM= 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-196-vDgPCg3fNbqGSmAdSCx5vQ-1; Thu, 20 Aug 2020 09:33:46 -0400 X-MC-Unique: vDgPCg3fNbqGSmAdSCx5vQ-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 B2A52AE641; Thu, 20 Aug 2020 13:33:43 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.173]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35F7219D6C; Thu, 20 Aug 2020 13:33:40 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Jim Mattson , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , Sean Christopherson , Joerg Roedel , Wanpeng Li , Borislav Petkov , Vitaly Kuznetsov , Paolo Bonzini , Maxim Levitsky Subject: [PATCH v2 0/7] KVM: nSVM: ondemand nested state allocation + smm fixes Date: Thu, 20 Aug 2020 16:33:32 +0300 Message-Id: <20200820133339.372823-1-mlevitsk@redhat.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi!=0D =0D This patch series does some refactoring and implements on demand nested sta= te area=0D This way at least guests that don't use nesting won't waste memory=0D on nested state.=0D =0D Patches 1,2,3 are refactoring=0D =0D Patches 4,5 are new from V1 and implement more strict SMM save state area c= hecking=0D on resume from SMM to avoid guest tampering with this area.=0D =0D This was done to avoid crashing if the guest enabled 'guest was interrupted= '=0D flag there and we don't have nested state allocated.=0D =0D Patches 6,7 are for ondemand nested state.=0D =0D The series was tested with various nested guests, in one case even with=0D L3 running, but note that due to unrelated issue, migration with nested=0D guest running didn't work for me with or without this series.=0D I am investigating this currently.=0D =0D Best regards,=0D Maxim Levitsky=0D =0D Maxim Levitsky (7):=0D KVM: SVM: rename a variable in the svm_create_vcpu=0D KVM: nSVM: rename nested 'vmcb' to vmcb12_gpa in few places=0D KVM: SVM: refactor msr permission bitmap allocation=0D KVM: x86: allow kvm_x86_ops.set_efer to return a value=0D KVM: nSVM: more strict smm checks=0D KVM: emulator: more strict rsm checks.=0D KVM: nSVM: implement ondemand allocation of the nested state=0D =0D arch/x86/include/asm/kvm_host.h | 2 +-=0D arch/x86/kvm/emulate.c | 22 ++++--=0D arch/x86/kvm/svm/nested.c | 53 +++++++++++--=0D arch/x86/kvm/svm/svm.c | 130 ++++++++++++++++++--------------=0D arch/x86/kvm/svm/svm.h | 10 ++-=0D arch/x86/kvm/vmx/vmx.c | 5 +-=0D arch/x86/kvm/x86.c | 3 +-=0D 7 files changed, 151 insertions(+), 74 deletions(-)=0D =0D -- =0D 2.26.2=0D =0D