Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp650470pxy; Thu, 22 Apr 2021 10:10:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTBy63vSWxnSYfy66PhCpHWU4YgRsLgxcBgmIocvtuvoLTynQQE6q2wb25kLA7H8Gk6H6f X-Received: by 2002:a05:6402:105a:: with SMTP id e26mr5195621edu.164.1619111435563; Thu, 22 Apr 2021 10:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619111435; cv=none; d=google.com; s=arc-20160816; b=lo5KCzXkFToQK6s99ybUdV5xCzKyn1j/AbX4nsRvJ307XSqIasW1fwondkshoSUxbJ 8rMVcrATdyCTifPs29hUjiTM1PvUK0Umh3DHTjme6EQyEZ5WfFJ51z235TFhmatvLXM7 8vvwg2rVIvvhGykbaSWLJOEZXsv/IzrMOSpFkFDiDCbgRrtiw5x7Xh2S9IKUY5i0Coar bQkxgf/s/uKX7dFZIqzDfz3QuqRCiyb72Jd0YToY0MQyxrbeGlj0Rv28r475OUFyV6DS Zmcs9WNYLujPC8pqV1hrbo3giCFsNTLhLgHB+fUhoE0Izqc2g36NhnZfpAW4wJk+Fj4g gbYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=t/uP9jbpp85SMbF11ayr/xFQAsNMSvflWFM/nt8RApM=; b=ReztZZX+YOk9XZxe+NgdMhQpkXSu5WuyqT0ruXnF0Ow6HSK1+Z1vSQmXoD7GA1i8z5 l4yN8xiXcQ63t930y0QsJ/F3xf2tMEX1vvAh98nkqpoXgCxzVVpm4SkZqhIdn9qLcdOl aBwTcirUDKT0kxTp1877dcwtCD1bhE1AhNhaXYlTDp88obfdhOM8EOejKGHbaIOdn/dj 85REvQIminxLHaIu8ApELdpiez9pgwsKO9TdUB7ImWPDBwZM+22oaNp5Z3rmYCHuZ4dL SLmUGfZUjkjHlzus0k6gvmqXiNGT1E8C8xQ1uqDbHQMJ/lKUWoBzNrCm/2WDyStIulwi Y5Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TD+0zo28; 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 ky1si2717399ejc.438.2021.04.22.10.10.10; Thu, 22 Apr 2021 10:10:35 -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=TD+0zo28; 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 S237829AbhDVRJl (ORCPT + 99 others); Thu, 22 Apr 2021 13:09:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47581 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236287AbhDVRJk (ORCPT ); Thu, 22 Apr 2021 13:09:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619111344; 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: in-reply-to:in-reply-to:references:references; bh=t/uP9jbpp85SMbF11ayr/xFQAsNMSvflWFM/nt8RApM=; b=TD+0zo282yAZSyAJR0hRtCOk6d9tLhqbjAC2gdPt1HQt6znUBwTfZ6MX8NlMXdAf8k5XGB TGWBiCaTdrcWorqipauZuJLqlrGblLoFoDpFwZVAsDAPKv+yZTAI6CQKIs6CGz/m5MMo4y 54BXvFKg0MYFuVk4R63+DLKw8SCFbIQ= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488-Ja67jL7PPJGB4XThnSl0bA-1; Thu, 22 Apr 2021 13:09:02 -0400 X-MC-Unique: Ja67jL7PPJGB4XThnSl0bA-1 Received: by mail-ej1-f69.google.com with SMTP id r14-20020a1709062cceb0290373a80b4002so7446296ejr.20 for ; Thu, 22 Apr 2021 10:09:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=t/uP9jbpp85SMbF11ayr/xFQAsNMSvflWFM/nt8RApM=; b=qw3qvt6VKTfrJ76oX8A/UaaWFzCL9Kn6PVYpnKF3fdn/WrGFmjm5/9TjTNvLgwslQn l9bOIklTeFYPbgku6ZRotRa1/KkErL/vM+NLyjYfQo308K66UrgGaRF6i2bc8bdvNnX3 zEq5zGmbpaq/fuTi7lTvVn4hIwmi2gqpbr0lYEKUJlQ5GXtfUrNVAoA7GyvnIOI28hWO OiY6vTMa0fJpku3ZbDJsoiKGwW7UthV4QHoBM8ACu5Geu8e05D8jjLGahtONruoP7XMY TmRiyUWJ2WnsdUvLRAB1CDBZJdWwywHynetCbAm+uI0KowemWXwD2p2mUJfphRzkX11M D8/Q== X-Gm-Message-State: AOAM530GMiTn1e0X0WsW8O0bc30oVVutdhxYBO5z+mkjIW5whklnQ2mD 8ZW9NViidO6d5a2vxGaKXJBKdgru5wFcixG8LnmMYClPrMWCmL7OuIBVN2/TpWuK/XQKsuCbg27 qO0Vtu1GXTu3T3yZyNlp05lB9 X-Received: by 2002:a17:907:72cc:: with SMTP id du12mr4331291ejc.436.1619111341761; Thu, 22 Apr 2021 10:09:01 -0700 (PDT) X-Received: by 2002:a17:907:72cc:: with SMTP id du12mr4331261ejc.436.1619111341587; Thu, 22 Apr 2021 10:09:01 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id m10sm2233288ejc.32.2021.04.22.10.08.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Apr 2021 10:09:01 -0700 (PDT) Subject: Re: [PATCH v5 00/15] KVM: SVM: Misc SEV cleanups To: Sean Christopherson Cc: Dave Hansen , Andy Lutomirski , Peter Zijlstra , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Tom Lendacky , Brijesh Singh References: <20210422021125.3417167-1-seanjc@google.com> From: Paolo Bonzini Message-ID: <88a5a669-e94c-e197-5321-a1eb043209be@redhat.com> Date: Thu, 22 Apr 2021 19:08:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/04/21 18:02, Sean Christopherson wrote: > On Thu, Apr 22, 2021, Paolo Bonzini wrote: >>> Paolo Bonzini (1): >>> KVM: SEV: Mask CPUID[0x8000001F].eax according to supported features >>> >>> Sean Christopherson (14): >>> KVM: SVM: Zero out the VMCB array used to track SEV ASID association >>> KVM: SVM: Free sev_asid_bitmap during init if SEV setup fails >>> KVM: SVM: Disable SEV/SEV-ES if NPT is disabled >>> KVM: SVM: Move SEV module params/variables to sev.c >>> x86/sev: Drop redundant and potentially misleading 'sev_enabled' >>> KVM: SVM: Append "_enabled" to module-scoped SEV/SEV-ES control >>> variables >>> KVM: SVM: Condition sev_enabled and sev_es_enabled on >>> CONFIG_KVM_AMD_SEV=y >>> KVM: SVM: Enable SEV/SEV-ES functionality by default (when supported) >>> KVM: SVM: Unconditionally invoke sev_hardware_teardown() >>> KVM: SVM: Explicitly check max SEV ASID during sev_hardware_setup() >>> KVM: SVM: Move SEV VMCB tracking allocation to sev.c >>> KVM: SVM: Drop redundant svm_sev_enabled() helper >>> KVM: SVM: Remove an unnecessary prototype declaration of >>> sev_flush_asids() >>> KVM: SVM: Skip SEV cache flush if no ASIDs have been used >>> >>> arch/x86/include/asm/mem_encrypt.h | 1 - >>> arch/x86/kvm/cpuid.c | 8 ++- >>> arch/x86/kvm/cpuid.h | 1 + >>> arch/x86/kvm/svm/sev.c | 80 ++++++++++++++++++++++-------- >>> arch/x86/kvm/svm/svm.c | 57 +++++++++------------ >>> arch/x86/kvm/svm/svm.h | 9 +--- >>> arch/x86/mm/mem_encrypt.c | 12 ++--- >>> arch/x86/mm/mem_encrypt_identity.c | 1 - >>> 8 files changed, 97 insertions(+), 72 deletions(-) >>> >> >> Queued except for patch 6, send that separately since it's purely x86 and >> maintainers will likely not notice it inside this thread. You probably want >> to avoid conflicts by waiting for the migration patches, though. > > It can't be sent separately, having both the kernel's sev_enabled and KVM's > sev_enabled doesn't build with CONFIG_AMD_MEM_ENCRYPT=y: I discovered just as much a few hours later, but Boris has acked it already so it's all set. Paolo > arch/x86/kvm/svm/sev.c:33:13: error: static declaration of ‘sev_enabled’ follows non-static declaration > 33 | static bool sev_enabled = true; > | ^~~~~~~~~~~ > In file included from include/linux/mem_encrypt.h:17, > from arch/x86/include/asm/page_types.h:7, > from arch/x86/include/asm/page.h:9, > from arch/x86/include/asm/thread_info.h:12, > from include/linux/thread_info.h:58, > from arch/x86/include/asm/preempt.h:7, > from include/linux/preempt.h:78, > from include/linux/percpu.h:6, > from include/linux/context_tracking_state.h:5, > from include/linux/hardirq.h:5, > from include/linux/kvm_host.h:7, > from arch/x86/kvm/svm/sev.c:11: > arch/x86/include/asm/mem_encrypt.h:23:13: note: previous declaration of ‘sev_enabled’ was here > 23 | extern bool sev_enabled; > | ^~~~~~~~~~~ > make[3]: *** [scripts/Makefile.build:271: arch/x86/kvm/svm/sev.o] Error 1 >