Received: by 10.223.176.5 with SMTP id f5csp1921665wra; Wed, 31 Jan 2018 13:43:45 -0800 (PST) X-Google-Smtp-Source: AH8x227kzmL/GmkIW5low27yXNiOWcXtUK9Ar4dI7uxTD9aL1aKB7p09WdNNe3DHk0XTNtAsJKJG X-Received: by 10.98.131.200 with SMTP id h191mr34691275pfe.149.1517435025773; Wed, 31 Jan 2018 13:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517435025; cv=none; d=google.com; s=arc-20160816; b=cKxUND6ExBDiHBnXyw/5ekVGItR74oPGrX8WDyME/NKmXfxl6xGXEL+AscEDmW21uJ /aFFXvLazdemdlXoAb0n9ssSnXGSRDD2cTgWoF+aqKILFctCaSZLg3h1ux244+CO32pO L4m4b3DzTUuZC6EDq4eznsFQ+pZxFv5rsj2y0PdMfej4h5USLOqV14eZQcofl6DTAyA6 IcPaFa9rJIeAwKjJBmcELMvHAV9agsQaLmPnGVMQJVvRIwh5uidnN0eOxbYdV3o9lk6a k9mcb+FZ3ZBcRmEvrGGhPSx9zSxZkMZ/yBxB60v9m6pn4VFIXKTVKcv7NEz6iMUqQZlP 4u4w== 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:arc-authentication-results; bh=TVSzdzgByEYdxgGrlte/yejXxysqu43a/L1TeEdC0KY=; b=lAlv8tUwxiMnz8CpA1Fk3CqYKT8PutKHmquRLFU2fTF8lHVazdWfOz45YBhowhzM2w 1AthHLNFk6OvP1LOdNBok25PtWBw8MuOt61vqbYkEmt8PHIf6m01XQejxN96deNvnxKA uTZwgUjzYnIH4ZgDl+QTJ5FYlFJ3T4JggBjwZP7x50JMP/jsIC9fSLbWnBNfGFrPo/cl eHAwMW3aGFdwlOCCFgcyRhibY7/EauKeDmjkfXO4Efj83C27Hf70pP2XUWnZr7w/cJsS 1s+TRJW1Q5UWFpNiNzowxaiRj1pslegwuJHXwKSJP13qNDcGfXyE+4926pA8AbuDfV2R H7KA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 g1-v6si6480711plt.574.2018.01.31.13.43.29; Wed, 31 Jan 2018 13:43:45 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753261AbeAaVnH (ORCPT + 99 others); Wed, 31 Jan 2018 16:43:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34710 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098AbeAaVnG (ORCPT ); Wed, 31 Jan 2018 16:43:06 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F8A362E83; Wed, 31 Jan 2018 21:43:06 +0000 (UTC) Received: from [10.36.116.69] (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 318795C1A1; Wed, 31 Jan 2018 21:42:59 +0000 (UTC) Subject: Re: [PATCH v5 4/5] KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL To: Jim Mattson Cc: KarimAllah Ahmed , KarimAllah Ahmed , kvm list , LKML , the arch/x86 maintainers , Asit Mallick , Arjan Van De Ven , Dave Hansen , Andi Kleen , Andrea Arcangeli , Linus Torvalds , Tim Chen , Thomas Gleixner , Dan Williams , Jun Nakajima , David Woodhouse , Greg KH , Andy Lutomirski , Ashok Raj References: <1517427467-28567-1-git-send-email-karahmed@amazon.de> <1517427467-28567-5-git-send-email-karahmed@amazon.de> <06cb88da-f355-41ed-380f-7daa8ddf6159@amazon.com> <67dca2bb-1298-c7fa-f681-018e4edc6725@redhat.com> <16d89e09-fbfc-4a08-00a6-40cfb4776018@redhat.com> From: Paolo Bonzini Message-ID: Date: Wed, 31 Jan 2018 16:42:58 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 31 Jan 2018 21:43:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/01/2018 16:05, Jim Mattson wrote: > On Wed, Jan 31, 2018 at 1:00 PM, Paolo Bonzini wrote: > >> Yes, but how would moving the field into struct loaded_vmcs do anything? >> Only vmon/vmoff would change anything in vmx->nested.vmcs02. > > My suggestion was that nested_vmx_merge_msr_bitmap should set the > vmcs02 version of save_spec_ctrl_on_exit based on the calculated value > of the write permission bit for IA32_SPEC_CTRL in the vmcs02 MSR > permission bitmap. > >> Even then, L1 vmexits will also be penalized because L1 has probably >> done an RDMSR/WRMSR on L2->L1 vmexit. So I don't think it's an issue? > > Yes, it sucks to be L1 in this situation. Can we just say it sucks to be L2 too? :) Because in the end as long as no one ever writes to spec_ctrl, everybody is happy. Paolo