Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4500134imd; Tue, 30 Oct 2018 03:03:09 -0700 (PDT) X-Google-Smtp-Source: AJdET5eB15sGnbWA7AFLWKLm+rMkpfIbjqXsnduqP/UIEmNf2OTDVkAkSrh68amF1vK7cVEr98fQ X-Received: by 2002:a62:1d12:: with SMTP id d18-v6mr2286371pfd.50.1540893789824; Tue, 30 Oct 2018 03:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540893789; cv=none; d=google.com; s=arc-20160816; b=H7hcMG5MXu7ZYsHrK7evhtzvIDeQIQVMwAFOlf7qlWfCWDpazU0Y+0RUAHdqevUx4Z M8k8fJq9xexOzzZVbXI/GjzlhTlIYK4eQl6Ddhvg+EfVjQ/EaQqzfsztuYFI8vULMVUC nwcNJHXvdBz26nZJJIaG4A6djbKCjE7qNPenKtPYX0cI3TQa5jrqHr81k9n6HacZBcl7 w4e5iiD5b8FlccWtLDTeyDhOo3WTclbVDtGbfS35YG1RzXVDXVN12O414vYi2b/eZB94 jBfYEhYGwfv+VwL4wWS4uHmbSEwX+7AygYOwMluyMycU31s6fJuBXANE29PuoYe/6GOR g8ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=iCjaCM5BLDN2v25eeQcOakPOF1pFpWJUKavFXGpkXtc=; b=VNRwUklcNdTR5i3wI0bRXZN/oa+FVX9+s6nc9l8toMYSNH/DckvyQXRQtVgm4isHOo yF7PwZzSL5SxW7lFQSciQxInTnujoMbPgW7pJFfg8k3eLpEvlIsBB+bhwkZHTkU8DIVv ldhGmxfayN5qIVtYkufPk/CRBIcZAHuBq5vdojbMHh6YQrOrarPJt/96j9dNaJTWjjAY PZ2j+tslyRQ+f3MTQ0OmZRivD18xIdcKzK7m8RuMvZGQ3C60tOx0sVHA5V90Qe4u/Lym 7O6ICglCcEkKk5yHGkpp/q1Yi0rK81XLI2k7advvXJGVWTSPyindMKmpdJuE8qS+ncff fmQg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si22114052plx.106.2018.10.30.03.02.53; Tue, 30 Oct 2018 03:03:09 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbeJ3Sxw (ORCPT + 99 others); Tue, 30 Oct 2018 14:53:52 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53533 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726225AbeJ3Sxw (ORCPT ); Tue, 30 Oct 2018 14:53:52 -0400 Received: from tmo-115-37.customers.d1-online.com ([80.187.115.37] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gHQp7-0003og-LD; Tue, 30 Oct 2018 11:00:33 +0100 Date: Tue, 30 Oct 2018 11:00:31 +0100 (CET) From: Thomas Gleixner To: Paolo Bonzini cc: Alexander Shishkin , Luwei Kang , kvm@vger.kernel.org, x86@kernel.org, mingo@redhat.com, bp@alien8.de, hpa@zytor.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 Subject: Re: [PATCH v13 08/12] KVM: x86: Add Intel PT context switch for each vcpu In-Reply-To: Message-ID: References: <1540368316-12998-1-git-send-email-luwei.kang@intel.com> <1540368316-12998-9-git-send-email-luwei.kang@intel.com> <87a7n37iuf.fsf@ashishki-desk.ger.corp.intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 Oct 2018, Paolo Bonzini wrote: > On 24/10/2018 12:13, Alexander Shishkin wrote: > > Luwei Kang writes: > >> + /* > >> + * 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 > > Then you should have replied to > https://marc.info/?l=kvm&m=153865386015249&w=2 instead of having Luwei > do the work for nothing. > > Quoting from there: > > >> One shouldn't have to enable or disable anything in KVM to stop it from > >> breaking one's existing workflow. That makes no sense. > > > > If you "have to enable or disable anything" it means you have to > > override the default. But the default in this patches is "no change > > compared to before the patches", leaving tracing of both host and guest > > entirely to the host, so I don't understand your remark. What workflow > > is broken? > > > >> There already are controls in perf that enable/disable guest tracing. > > > > You are confusing "tracing guest from the host" and "the guest can trace > > itself". This patchset is adding support for the latter, and that > > affects directly whether the tracing CPUID leaf can be added to the > > guest. Therefore it's not perf that can decide whether to turn it on; > > KVM must know it when /dev/kvm is opened, which is why it is a module > > parameter. > > I'd be happier if we found an agreement, but without discussion that > just won't happen. So at least we need a way for perf on the host to programmatically detect, that 'guest traces itself' is enabled, so it can inject that information into the host data and post processing can tell that. W/o something like that it's going to be a FAQ. Thanks, tglx