Received: by 10.223.176.5 with SMTP id f5csp1807785wra; Wed, 31 Jan 2018 11:55:50 -0800 (PST) X-Google-Smtp-Source: AH8x227LlB3cyBSu88RTE1sB4pGHDjuitVE6qExDVui5FZ0qkJEqBKGbzJRl3LGXikf1y8s6e9/R X-Received: by 2002:a17:902:d904:: with SMTP id c4-v6mr9461964plz.125.1517428550188; Wed, 31 Jan 2018 11:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517428550; cv=none; d=google.com; s=arc-20160816; b=fTdJ/iVck0XxAVZ+HtPWdvc0qittZ3e0eFbeetaGd2NUQO0oN+u9VixpKiDvau4tfZ S5wzmcRhnTg/m1UhtispknELm247cMkV04zMiAmrySiypOWH0utbc62T7T9Ik+3B/ptO DXB4zV34VcakkcWKJFqRqps6k0DTPooH2j/hQMfBTA/G5MowjoItb51ZDA0LgPDbNeeS BbzqCt/xVlDnc+X6rwi6LABMD9TmUmaZQfIeGkTmTIGolTlZnxFheIREb+U9BRTPeeA+ x6FhCCLmw6w9BqJklVBqOx/CxiZ1RWevl2KBGPogR8LfxfRiL+V02Gz4bbqxLWESlTnr FAfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=K7DS3ZI0l7qjqiT68viWRNtMwrgktdyfBTQFwNc7Agk=; b=inLxK/DoH74BUesExvGeK6I/rLpbsY+H5uDR3pP5Ik/9MijtzR0auFvBJ8K9lbd+ZJ +4EkJMKeb9BjPUT6qDD1HRat6GbMXPNkijyaGbwpauWBcbGfo23liKcpQ93U6jCENK0Q rzpScuqFbseALlxUlGlZTshwq+v//Tgmg7SSVi3PNOpRqxoYNxMlqQd4QYEU6qIKE+Fk sUs7wt+UkKQknWIO9dpS2LdWEb7cvv4LYDAOS4ANRSv0eI/WYiNP/gW3N5N2B2ckjywz SLqFh2F7q/SjCNwwBkTuO/5sC36Ml2yQFAbAux6Z7B5upcmVD6ZCAEJ8HgXoFyiIL8fe ZyFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IJrNNeeb; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14-v6si4230136plj.292.2018.01.31.11.55.35; Wed, 31 Jan 2018 11:55:50 -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=@google.com header.s=20161025 header.b=IJrNNeeb; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751720AbeAaTxz (ORCPT + 99 others); Wed, 31 Jan 2018 14:53:55 -0500 Received: from mail-it0-f48.google.com ([209.85.214.48]:35239 "EHLO mail-it0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751698AbeAaTxx (ORCPT ); Wed, 31 Jan 2018 14:53:53 -0500 Received: by mail-it0-f48.google.com with SMTP id e1so1020843ita.0 for ; Wed, 31 Jan 2018 11:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=K7DS3ZI0l7qjqiT68viWRNtMwrgktdyfBTQFwNc7Agk=; b=IJrNNeebJYOamrqoR8uo7olLGfkMg6cSWROLXlrp4Vr+zgoleIukfVqbS3nV4cxvYR tR8GqxdgkAiVAq1MvcUChlVftS+0WL5oRQJ1+fIwVLxZxyU4wc/YKwY/8Hhjw24+A6aD wzJRkPqE4B9xUSPg6buh+S6WkUKhr9AiI6bsEwiFJ1wcH+DYQYsMrTRCi/T2gcfZcLPn CpNbxm8zEcNVCSenAoQOI6oLQx9NMMZhqBN4bpM+ut1RmWXV0kdeQ9YpcnhSfS12WUPi JYe1BCtWmUHIEndsC4yGuNC3EgffRcKbvN9oIbEqcgOadxbnBOsklSNWkh9fIx+eWlDI l1AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=K7DS3ZI0l7qjqiT68viWRNtMwrgktdyfBTQFwNc7Agk=; b=YB03XGIFldeGPitiIgDgQi+D+5phJ9BQCZJrvkzVkSiRDLDM2BcpVrkcAhlvs1XiFX xC7srefzpJQEs1z825/aJaAoWDJReAwwlgJBbNjTZFtYmsOUPdQ8r9+zLDWgYauzGeEU /nGqSNAzr54iykkvBYZXNI7GLAjtH859i6rzaGXGoto5DXJOwrYYxOT3FDlnoAiUSAyX 7Yga5qwpNeYEcXy2+izXNBues4h0eppbpPoj0r/wlSIaEzsvtH02x+/pDanMCURuosjW Lgn7vD7BReOpFwNGM9GGL+vA5Aayo3zeZ1at+SvVCiJTfjzxp8HCPOP70HDLCbh1S9ac sfRw== X-Gm-Message-State: AKwxytdFy/3zRcb99dbwagLn5PxixGGVe2ZdS9b91HQWdM5ZIoOQNtan k+lveEUO+pdAcPYOuHA62TQaZ1ROSNf7LkOC8GRGhw== X-Received: by 10.36.4.82 with SMTP id 79mr8286128itb.89.1517428432998; Wed, 31 Jan 2018 11:53:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.128.7 with HTTP; Wed, 31 Jan 2018 11:53:52 -0800 (PST) In-Reply-To: <1517427467-28567-5-git-send-email-karahmed@amazon.de> References: <1517427467-28567-1-git-send-email-karahmed@amazon.de> <1517427467-28567-5-git-send-email-karahmed@amazon.de> From: Jim Mattson Date: Wed, 31 Jan 2018 11:53:52 -0800 Message-ID: Subject: Re: [PATCH v5 4/5] KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL To: KarimAllah Ahmed Cc: 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 , Paolo Bonzini , David Woodhouse , Greg KH , Andy Lutomirski , Ashok Raj Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 11:37 AM, KarimAllah Ahmed wrote: > + > + if (to_vmx(vcpu)->save_spec_ctrl_on_exit) { > + nested_vmx_disable_intercept_for_msr( > + msr_bitmap_l1, msr_bitmap_l0, > + MSR_IA32_SPEC_CTRL, > + MSR_TYPE_R | MSR_TYPE_W); > + } > + As this is written, L2 will never get direct access to this MSR until after L1 writes it. What if L1 never writes it? The condition should really be something that captures, "if L0 is willing to yield this MSR to the guest..."