Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp399978ima; Wed, 24 Oct 2018 03:14:54 -0700 (PDT) X-Google-Smtp-Source: AJdET5eLEjgTql2yq5hEFlH6TK0eK6MWzqZ5DMtblCzPFJknbONfqjHK7J+rXjnRWQ78K+Xf73NH X-Received: by 2002:a17:902:1c3:: with SMTP id b61-v6mr1963261plb.65.1540376094745; Wed, 24 Oct 2018 03:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540376094; cv=none; d=google.com; s=arc-20160816; b=oNJOebzhLSeuPBfPhlicRvHiUJPSMORJ/KHuALhdTa3751L5dw7H6A7ZahYMNi6AaQ sZcNoFshNuqvxibok3GbEm9eYcnSH8G7gU+M0slUPY8P132RJqSiwyfQYbiSGqglAJQ6 WfVdIKIMjtoORkPejkZxkJC0+b395hQxIezX5wv4LOETQd7G2qNJyuPxuEUNPqzezupD P9ET1IsC/jekMgnQXTLTWdnMovlbjigouspBGIyICyGh741eYibEamD7DDi+AHNypXvZ 2KvDP/lcAU9/kKNvy56gDZgjqvZH8XFF4NCrG1LlUR6ysMNDMPj1pbv6WN+W1KNDPOIK 1JXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=pfBFF76haTuxAx8D1KPEGVmeZeknH90wL1N7lq9Z4es=; b=XqSF6v8IBtLZztOf5wFz1R8ClpolDNHnNGFa/KYFkBZfU2aVMFe4Wh0PQmGiaFpSXU N2DZBi5W/q5lcvgDYB1lLPbXD+QU4sWKRBR7+Y+2yWZWD01fo5+EyKlciGdPr4ErvpDR tkmm3kJFerrsRJPzbgb/lc1f6N52Glrdr6BiLOB9SxznpGDUssF+OdeRah2vQBP4Mfi5 /OgbcZ+2CZ3UDbnm2TGSqhilJJ6rz6ssUayYJIsoEPZwtKbZc9BX6KYV+J4puSuShjxf gVqVeIV9HsBfiU9wV/GOK7c3qYOd5vuOtELUtT2m+UP6W62CsJLb1/9jNDDQZbcCGK/S 78Aw== 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 d2-v6si4145494plh.152.2018.10.24.03.14.39; Wed, 24 Oct 2018 03:14:54 -0700 (PDT) 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 S1727199AbeJXSlX (ORCPT + 99 others); Wed, 24 Oct 2018 14:41:23 -0400 Received: from mga03.intel.com ([134.134.136.65]:61009 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726301AbeJXSlX (ORCPT ); Wed, 24 Oct 2018 14:41:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 03:13:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,420,1534834800"; d="scan'208";a="268358455" Received: from um.fi.intel.com (HELO localhost) ([10.237.72.212]) by orsmga005.jf.intel.com with ESMTP; 24 Oct 2018 03:13:47 -0700 From: Alexander Shishkin To: Luwei Kang , kvm@vger.kernel.org, x86@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, pbonzini@redhat.com, rkrcmar@redhat.com, joro@8bytes.org, songliubraving@fb.com, peterz@infradead.org, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, thomas.lendacky@amd.com, konrad.wilk@oracle.com, mattst88@gmail.com, Janakarajan.Natarajan@amd.com, dwmw@amazon.co.uk, jpoimboe@redhat.com, marcorr@google.com, ubizjak@gmail.com, sean.j.christopherson@intel.com, jmattson@google.com, linux-kernel@vger.kernel.org, Chao Peng , Luwei Kang Subject: Re: [PATCH v13 08/12] KVM: x86: Add Intel PT context switch for each vcpu In-Reply-To: <1540368316-12998-9-git-send-email-luwei.kang@intel.com> References: <1540368316-12998-1-git-send-email-luwei.kang@intel.com> <1540368316-12998-9-git-send-email-luwei.kang@intel.com> Date: Wed, 24 Oct 2018 13:13:44 +0300 Message-ID: <87a7n37iuf.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Luwei Kang writes: > +static void pt_guest_enter(struct vcpu_vmx *vmx) > +{ > + if (pt_mode == PT_MODE_SYSTEM) > + return; > + > + /* Save host state before VM entry */ > + rdmsrl(MSR_IA32_RTIT_CTL, vmx->pt_desc.host.ctl); > + > + /* > + * Set guest state of MSR_IA32_RTIT_CTL MSR (PT will be disabled > + * on VM entry when it has been disabled in guest before). > + */ > + vmcs_write64(GUEST_IA32_RTIT_CTL, vmx->pt_desc.guest.ctl); > + > + if (vmx->pt_desc.guest.ctl & RTIT_CTL_TRACEEN) { > + wrmsrl(MSR_IA32_RTIT_CTL, 0); > + pt_save_msr(&vmx->pt_desc.host, vmx->pt_desc.addr_range); > + pt_load_msr(&vmx->pt_desc.guest, vmx->pt_desc.addr_range); > + } > +} From my side this is still a NAK, because [1]. [1] https://marc.info/?l=kvm&m=153847567226248&w=2 Thanks, -- Alex