Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp837695ybl; Wed, 11 Dec 2019 08:14:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwe3dgWoh6ejYcNi6s0LKROYj5ZisWkmuYk5RpnOy/TF17XdpgiMIlcseBaHARKtvDPoMon X-Received: by 2002:aca:ec4d:: with SMTP id k74mr3237889oih.64.1576080887440; Wed, 11 Dec 2019 08:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576080887; cv=none; d=google.com; s=arc-20160816; b=cEdZ0tDt8jnyej1lUSmeCZXGRU7036pZMrED6/zWcktZ4ulHG4lDGa0yC4CscfFo/B 3nNZnjMwp0NR66PMWgVK9IjG0MTSPfPfvjgYcamd1yvz79MboALr5+FKfxarT4tjzkY3 M2aAb/w9s007nA0sd6+HLVbMUg1Hajbb1N4cIJ1UWhbEUZ6evH5eo3CUvVp+rggiqiiV r6HmZeKM3VRBBeLF8A2t/tVfKuOd4rPP6wWhI5EUU6HmvCF1lm4GNtHmYjIN6IcPW89m R1hXPQQPQfKSJKBIfUg3unyGbs/I1ogGCpWJgch09ZRTSAHn/3cl4apn0Iw4Mxdc7mN+ /Auw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=K5VP+OiBT6WPnQ2qPcLj6B72iBo4/zEgQX2sriTR79Q=; b=O4NlarZPyGkL7Y0PiXpIWcwl9wtZeZDt69ICET22F/MJAQ3YFxQvuk/ctQxI5jdPZ8 bbxj87Tz4kBh+E+5wvrHNnW7zCBe/sl8qpHzh23QftVilGpYEBueBMWmeEpp4C86EYxY /4U4eVWHjDFumjGnUGGF7vSYxtXVkvi0GTNCaZCXIt2Om55loBtNaoxh1ROjvqW2MiZ7 pZ+oOPIiJANTH4EHKgPEDovkcVBJHvr9zHM1vXih6Ss84QTY5LkJpYtJ531G/rE7IV21 XpFuveVbEnHvQo2BfZwbOZYmBEtuOYPBPkjXLmkWocwzdzEAvAVWeuPWDScWgXd1NBNF PHpg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n23si1269345otf.265.2019.12.11.08.14.35; Wed, 11 Dec 2019 08:14:47 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730457AbfLKQOH (ORCPT + 99 others); Wed, 11 Dec 2019 11:14:07 -0500 Received: from mga02.intel.com ([134.134.136.20]:20012 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729522AbfLKQOH (ORCPT ); Wed, 11 Dec 2019 11:14:07 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2019 08:14:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,301,1571727600"; d="scan'208";a="203611957" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2019 08:14:05 -0800 Date: Wed, 11 Dec 2019 08:14:05 -0800 From: Sean Christopherson To: "Kang, Luwei" Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Chao Peng Subject: Re: [PATCH 1/2] KVM: VMX: Add non-canonical check on writes to RTIT address MSRs Message-ID: <20191211161405.GA5722@linux.intel.com> References: <20191210232433.4071-1-sean.j.christopherson@intel.com> <20191210232433.4071-2-sean.j.christopherson@intel.com> <82D7661F83C1A047AF7DC287873BF1E17384B7F2@SHSMSX104.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82D7661F83C1A047AF7DC287873BF1E17384B7F2@SHSMSX104.ccr.corp.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 10, 2019 at 06:16:35PM -0800, Kang, Luwei wrote: > > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index > > 51e3b27f90ed..9aa2006dbe04 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ > > b/arch/x86/kvm/vmx/vmx.c @@ -2152,6 +2152,8 @@ static int > > vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) (index >= 2 * > > intel_pt_validate_cap(vmx->pt_desc.caps, PT_CAP_num_address_ranges))) > > return 1; + if (is_noncanonical_address(data, vcpu)) + > > return 1; > > Is this for live migrate a VM with 5 level page table to the VM with 4 level > page table? This is orthogonal to live migration or 5-level paging. Unless I'm missing something, KVM simply fails to validate the incoming address.