From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DC1A3EE1C1 for ; Tue, 2 Jun 2026 14:28:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780410533; cv=none; b=hsAMSZBFja0uAuODWcmJM/Cdgf+a9GpcYMmjoTaCxcGFfOvBHYT6+upAfD1V6vFglJNqH+rvuf1uIRtDPHb6nyWSP+MzScwHJBBzOx9PLoh5Xd0iCKu24d2k2XBCrLfAeCNVxm97taNNt4YVkacz6PmS74RtPA3O+PHqOWkRts4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780410533; c=relaxed/simple; bh=PgCdkok4gzT4v4tvCsk5v6uloEQGVZR1NF1GdjCisRI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=GSMbMoOFMKHBVE8hTWvMuq5OAJT/a19bohDec8IwDS2/pQPBAFqJU8ggPyDh5W+rYApy+OC/g/lfDrvIwoMDiLhQ7rxP0mY36KRNPLhR3RtuEP7ejQNBclaYkgF7PYfUStTkn/7/R5tOBjyoR7Zn+VuE0kdfFig0+NTgRF4bdis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EqpPcSHi; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=NBpB8Nuh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EqpPcSHi"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="NBpB8Nuh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780410531; 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=FfUjFymOGeqIDcrOYtdmO5pEs/tI3OUL6hwn8Ge8iGA=; b=EqpPcSHiFMwN8SP1F8QCrJcJ1ryMxNl9z2cVWU3Mkpy8SLZxqwPqNnJD4cWzm302V10Ii8 60T4iNMivXJqLVkkgacExGKY35U1QoE/1QYoOhAUvttEMMC9phatCgj1mrtct+dhQdKCkY IPn+FQfeDT28lN4kbKZRjB5aoEhIoAo= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-6UYUcLqpNG-ik6v0igydrw-1; Tue, 02 Jun 2026 10:28:49 -0400 X-MC-Unique: 6UYUcLqpNG-ik6v0igydrw-1 X-Mimecast-MFC-AGG-ID: 6UYUcLqpNG-ik6v0igydrw_1780410529 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-8cceb0317b3so68217916d6.2 for ; Tue, 02 Jun 2026 07:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780410528; x=1781015328; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=FfUjFymOGeqIDcrOYtdmO5pEs/tI3OUL6hwn8Ge8iGA=; b=NBpB8NuhXBMwWvopzh74JU924uWrTDMqwxgs+PvyPTt8QE12fpavp73vsX+Sk3/lgE uaEtyZ18VCrd9tbbkz3powxvBNPl4xH5+XywXae8BewhawzxiA6KyFx2S6yPu5bAst9k btiezsbhc95i9FJ5gvdtUGjr4YiTNYOVJCYE/hns4KpzTZocPjXgUh1NNaBEHsNkAbKt ZPeO8I8h4hVRQceov/jbydQU1+F5PLaIruNjvyjw/j8Tw6/it8oqgvS0SY12+PEcwrZz 3jHY6wgbDFal6kwjcEXxusQfXomT5gZWzjYXwokNS0QZ3A3YWIYGbRR8Rf8jVeWT8vtf 6khQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780410528; x=1781015328; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FfUjFymOGeqIDcrOYtdmO5pEs/tI3OUL6hwn8Ge8iGA=; b=GOo4RDW5GQZE/NucxJHJ9/5Ks6aN/sT/s3S7+udM0QD6Se6vRrhdml6Zn393eI04Ud atvl3swJdX8gdbNheaFY0q1XfnwxHiSc0xkexs76OSF09m0yp4mJ2IAXbJDdaAntndl8 ErE67KIC3uuSocrFMeCs6t2UfxsWJgV0KdRW2kXhWg39hyRIs3VqoIs3i34N0EjksYsg +/iKJ5MgtiEo9QDdCgBY2jExZUNBd/S5wY6qhYewyB29b8Z9xmeptvG3KwaGR5mbIwNx Xvjb22/rQ/ALNpR7RaYZ06RxULO2++B78gFocAjx80Gfol54LLrXyjB3q3mPjiiEatwI IndA== X-Forwarded-Encrypted: i=1; AFNElJ+zwZyHJ07jT91XHJhvIKiqlOa3YPd/OnQfmNMT+BVDMA4Lnf/+KKGMUuPK+WnxzsyKE4weVxV7JEggBs4=@vger.kernel.org X-Gm-Message-State: AOJu0YxwZf9qVdn+pnbeg33gUiWVfOsbSKbRtNLetIUfrad1Cz0SJv9/ 3gGX4jaj060b1WIjYccnQUkuMtOtPGgQkkH3k1SLkwyRIEH9+NtoIPwkH0YRqNwIwly9GhU4SU0 aSfMleWJvVzw0z2Jz6CePto0fO8MQfIxq3sDQ0MUXP450oSMqKw/XuE7Cp7t3lagOVw== X-Gm-Gg: Acq92OHUVz71yFdxbdtrWqpoQDrlBRgvLLbLMCSeBRsodfpImgKsQVxbEBYSVDAeinn W5a9itHfv1evN/uaM7NkqBaBU+MADMRrBvxJSDFLdcd1LVCLpDNrd2FxKVNhX6oj2o+6Gv238K2 X5diCW+c6HLK9lTvad6HGNQN8NpDCEzgGS11Cx7JFdd8Q2G5iD2F5oAtURoQR3n4L6YX9aZRQ+X cATOnvH8DuLtjNlvI9Wxn3wDFe+58bdQhfUiSOwj6Qs+YP2Hd6HorDOW5/6r7pM3VVBextfyeps vUqEN+95SSruDapnSNgQEPUnvV54M7Qq1SsyI2mVb+AcBtnnTNCFQvWOuYsXoX7lwUCY/TvPyxw Hmew18FEnT44DO2U5WIk8onNSctQz7ExnF6G+PDQ= X-Received: by 2002:a05:6214:20a9:b0:8ce:b2e9:a4c0 with SMTP id 6a1803df08f44-8ceb2e9a7b5mr119841746d6.15.1780410528479; Tue, 02 Jun 2026 07:28:48 -0700 (PDT) X-Received: by 2002:a05:6214:20a9:b0:8ce:b2e9:a4c0 with SMTP id 6a1803df08f44-8ceb2e9a7b5mr119841056d6.15.1780410527783; Tue, 02 Jun 2026 07:28:47 -0700 (PDT) Received: from intellaptop.lan ([2607:fea8:fc01:88aa:f1de:f35:7935:804f]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8cebf08e2d9sm26888836d6.10.2026.06.02.07.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 07:28:47 -0700 (PDT) Message-ID: <9176c891af8dc496f02c1e8cbef53976576ae7e1.camel@redhat.com> Subject: Re: [PATCH 20/28] KVM: nVMX: allow MBEC with EVMCS From: mlevitsk@redhat.com To: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: d.riley@proxmox.com, jon@nutanix.com, Vitaly Kuznetsov Date: Tue, 02 Jun 2026 10:28:46 -0400 In-Reply-To: <20260505195226.563317-21-pbonzini@redhat.com> References: <20260505195226.563317-1-pbonzini@redhat.com> <20260505195226.563317-21-pbonzini@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-2.fc40) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 2026-05-05 at 21:52 +0200, Paolo Bonzini wrote: > From: Jon Kohler >=20 > Extend EVMCS1_SUPPORTED_2NDEXEC to allow MBEC and EVMCS to coexist. > Presenting both EVMCS and MBEC simultaneously causes KVM to filter out > MBEC and not present it as a supported control to the guest, preventing > performance gains from MBEC when Windows HVCI is enabled. >=20 > The guest may choose not to use MBEC (e.g., if the admin does not enable > Windows HVCI / Memory Integrity), but if they use traditional nested > virt (Hyper-V, WSL2, etc.), having EVMCS exposed is important for > improving nested guest performance. IOW allowing MBEC and EVMCS to > coexist provides maximum optionality to Windows users without > overcomplicating VM administration. >=20 > Signed-off-by: Jon Kohler > Message-ID: <20251223054806.1611168-8-jon@nutanix.com> > Tested-by: David Riley > Signed-off-by: Paolo Bonzini > --- > =C2=A0arch/x86/kvm/vmx/hyperv_evmcs.h | 1 + > =C2=A01 file changed, 1 insertion(+) >=20 > diff --git a/arch/x86/kvm/vmx/hyperv_evmcs.h b/arch/x86/kvm/vmx/hyperv_ev= mcs.h > index fc7c4e7bd1bf..bc08fe40590e 100644 > --- a/arch/x86/kvm/vmx/hyperv_evmcs.h > +++ b/arch/x86/kvm/vmx/hyperv_evmcs.h > @@ -87,6 +87,7 @@ > =C2=A0 SECONDARY_EXEC_PT_CONCEAL_VMX | \ > =C2=A0 SECONDARY_EXEC_BUS_LOCK_DETECTION | \ > =C2=A0 SECONDARY_EXEC_NOTIFY_VM_EXITING | \ > + SECONDARY_EXEC_MODE_BASED_EPT_EXEC | \ > =C2=A0 SECONDARY_EXEC_ENCLS_EXITING) > =C2=A0 > =C2=A0#define EVMCS1_SUPPORTED_3RDEXEC (0ULL) Unrelated to this patch: I haven't paid much attention to this particular area of KVM, but 'EVMCSv1_= LEGACY' caught my attention now. According to the Hypervisor Top Level Function Specificaiton v5.0C and v6.0= b that I have, there is only one version defined, version 1.=C2=A0 Is there a reason on why we choose to call it "Legacy"? Also I see: Enlightened VMCSv1 doesn't support these: .... * TSC_MULTIPLIER =3D 0x00002032, And yet I see it defined: EVMCS1_FIELD(TSC_MULTIPLIER, tsc_multiplier, HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_GRP2), Anyway I haven't found any restrictions on the execution controls in the EV= MCS in the Microsoft's spec,=C2=A0 so it is unlikely that it is not supported. So: Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky