Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4891532ybl; Wed, 22 Jan 2020 06:34:43 -0800 (PST) X-Google-Smtp-Source: APXvYqyZh9cD0KGCiOZNhrr4+yCkpYVwRS0ISYTGTPcwpjW3vk8mA7IS1c8zaeRaBACY0mR7Cl9h X-Received: by 2002:aca:cd92:: with SMTP id d140mr6831875oig.68.1579703682929; Wed, 22 Jan 2020 06:34:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579703682; cv=none; d=google.com; s=arc-20160816; b=Za9aDlYEIYdjzXtCMdp9hi564a6Oqu5q1rnUbZFZRTX3IumHiTyqKjq9twMTeB5NwE zfC95WGk5bZc3QdjzJ6Jvrr46Q/o1Hn2iX0YP4c4/tqQLNYnMtrCY24YPCObKYVrEcKl CQi3HeRzEY0kuqeLIC3v0nYnMOJ9gi+UEq9qjnxee7gaBqSj9VAf86XPxamadOKnKTsG YUVBfoI1vctgDhUGer2BWb+JQSY6ATmkcYuIO4HE88veaD75/xl76jeg8IyFBJUyF9rJ P3zGd0TaVxtjaYrBCDlXwo5uV/RPKLyNa0NDMiCB1gHABKa/giUYQsf/ofJ8iJGHFayf msnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=gRFnpY3I1mQxECqBRA9YuD/Lzsy9AbE9ywfF+lfpJFA=; b=bN4nHX3cfhl3HKr2yJyQDwa378dLCE8SO6ltRi4mN0TU0QavrjuV0G2gDSvE6WvPdW ku/ggQHwsNYhYHRduue/kHupjRwUOJJ0lR40axfqeqNipnt1K4jwN0gfR7D2HFfnLYwt eI4y58QKE9tSC8iQ77z42ryYR9CA+ii6xQrUHtnF1iBEMQeFYIbBj97kJwXpWZs0osC/ zyF+IFtG9GvcINSRG/UwxiRLSqiEPZhNmW+Luo16hvGHYi0QtfX6SusXff0E9fn0MnCF rsfSLKFjvDvcIm9GDtGHnS+084XrdUeaOZU+jSQAiG8dyz3yML+bHdqPwoUk+VdTplQL s4+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MzbnTDh2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id m24si20009768oic.11.2020.01.22.06.34.30; Wed, 22 Jan 2020 06:34:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MzbnTDh2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726911AbgAVOdO (ORCPT + 99 others); Wed, 22 Jan 2020 09:33:14 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:32080 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725884AbgAVOdN (ORCPT ); Wed, 22 Jan 2020 09:33:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579703591; 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=gRFnpY3I1mQxECqBRA9YuD/Lzsy9AbE9ywfF+lfpJFA=; b=MzbnTDh2bIIBjP76ji5lWlWOkKIH4Ahie33GNw3vlbpKkTg3p7ztghlJJrHWNTFCwa+j/0 iP+DvB+8vvQHDTnMkTirAaXaN7XXyxVGDzPPEWdSrFUaa3pA1gIWCxcqfWtbxlmD4eMh6+ bcl1X3ryT0dyOTLV5xMvGFeIQleCVg4= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-183-8VF3c0rIPTCLrBdjq3-XfQ-1; Wed, 22 Jan 2020 09:33:09 -0500 X-MC-Unique: 8VF3c0rIPTCLrBdjq3-XfQ-1 Received: by mail-wm1-f70.google.com with SMTP id t17so1455441wmi.7 for ; Wed, 22 Jan 2020 06:33:09 -0800 (PST) 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=gRFnpY3I1mQxECqBRA9YuD/Lzsy9AbE9ywfF+lfpJFA=; b=s1FK+8GiK1fv0ceUDo9Jlp9xtgTs5RAaPTCDDCb6Q4djL41RdEDcGrFCre7BXflNKt j0fALwu9AsUboqGe77Y6pFmHuPKY2cMrZGJjLxWB9wJrPVnXHP2hcej5kilxcTqHkxHI lawK1gXmNIBHKhdv2WT8oXBlVj3hPQ01mo4WGEXG3+R46RitkFsC1sqbpPIHoIAWtDLz UA4ynCO+ymNZ0c9XY2glbuEsMcVfoQcKCMrJYGhjtXlDZI1GbtujzjcK1px30CRBfjrW Y+GYyDbfDotNxIpuVcA/5ME5qQyIhVVsLPgeM0rXJiwcNSclFovoL9vdTAkjpTq0Qsuk iIkA== X-Gm-Message-State: APjAAAU5vBr9WQVbS3/o0ZGm0jHXC9ceNyqt65FjwblB7rnweXJ3JQad FXXng0VPqLJe88brPAYsVbDkolMhqU95RFQrUWYkxdavWx18/e64xywgC96/L6tpj+RJJ/RPyis GIcXZc7ZCO2xWuDskln3LxwoB X-Received: by 2002:adf:fa43:: with SMTP id y3mr11489097wrr.65.1579703588396; Wed, 22 Jan 2020 06:33:08 -0800 (PST) X-Received: by 2002:adf:fa43:: with SMTP id y3mr11489067wrr.65.1579703588121; Wed, 22 Jan 2020 06:33:08 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:b8fe:679e:87eb:c059? ([2001:b07:6468:f312:b8fe:679e:87eb:c059]) by smtp.gmail.com with ESMTPSA id e12sm57096696wrn.56.2020.01.22.06.33.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jan 2020 06:33:07 -0800 (PST) Subject: Re: [PATCH RFC 2/3] x86/kvm/hyper-v: move VMX controls sanitization out of nested_enable_evmcs() To: Sean Christopherson Cc: Vitaly Kuznetsov , kvm@vger.kernel.org, Jim Mattson , linux-kernel@vger.kernel.org, Liran Alon , Roman Kagan References: <20200115171014.56405-1-vkuznets@redhat.com> <20200115171014.56405-3-vkuznets@redhat.com> <6c4bdb57-08fb-2c2d-9234-b7efffeb72ed@redhat.com> <20200122054724.GD18513@linux.intel.com> From: Paolo Bonzini Message-ID: <9c126d75-225b-3b1b-d97a-bcec1f189e02@redhat.com> Date: Wed, 22 Jan 2020 15:33:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20200122054724.GD18513@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/01/20 06:47, Sean Christopherson wrote: >> Yes, it most likely is and it would be nice if Microsoft fixed it, but I >> guess we're stuck with it for existing Windows versions. Well, for one >> we found a bug in Hyper-V and not the converse. :) >> >> There is a problem with this approach, in that we're stuck with it >> forever due to live migration. But I guess if in the future eVMCS v2 >> adds an apic_address field we can limit the hack to eVMCS v1. Another >> possibility is to use the quirks mechanism but it's overkill for now. >> >> Unless there are objections, I plan to apply these patches. > Doesn't applying this patch contradict your earlier opinion? This patch > would still hide the affected controls from the guest because the host > controls enlightened_vmcs_enabled. It does. Unfortunately the key sentence is "we're stuck with it for existing Windows versions". :( > Rather than update vmx->nested.msrs or filter vmx_get_msr(), what about > manually adding eVMCS consistency checks on the disallowed bits and handle > SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES as a one-off case by simply > clearing it from the eVMCS? Or alternatively, squashing all the disallowed > bits. Hmm, that is also a possibility. It's a very hacky one, but I guess adding APIC virtualization to eVMCS would require bumping the version to 2. Vitaly, what do you think? Paolo