Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4581966imd; Tue, 30 Oct 2018 04:28:57 -0700 (PDT) X-Google-Smtp-Source: AJdET5dX5S03FARhk5rtzpPrXHr78njvcaXPU/EAFo1kp8FoeADPMo1TT+bPK/oOLr2gRjCbCD0W X-Received: by 2002:a62:43cd:: with SMTP id l74-v6mr2607969pfi.240.1540898937199; Tue, 30 Oct 2018 04:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540898937; cv=none; d=google.com; s=arc-20160816; b=Z38elI1g1OwWUzrjeYa+rckYZDO33FZsaiiXP6vILJzuEhYnV0YfrM3JGzKmqBUa5E lueXU0yT8CUrMu9ts64NYng1xbzmBBupYmgb+Y9+zyOLSbstVYcBwtPP1EokQbhuCzEd I8UZytCfI3QtxH9Zsq/ZPLfrgHmIhzG1bnvepRIP3XWj/AhlLt813dLy9+C1o6CPyUQ4 QLy0uRfycmAi9i/np9Oh1Fb3E64UGqgTlU2TPUgW9WQP04uU6HZmpCBQv/ONvPC2wR6E OOOamzRe+Ttxl8bpa6xYhGShEP+AFxYeon8cHZjpf/11NoRaUEYjL8fCP6nugsf+hP+I cVug== 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=pt1Kh7kLFsjX+XT6Ezt8lfs04HrkA4Kme7dHosoGFC0=; b=mnBQNMgOVcDo/Ebw/GAfU4YVZg5L/Ydvv0qc1DuxAOuoaRxVN7Awsg8xk3rOYLDL9U ioQL2vTVtzNRpHSrTsuOEzUaP5prdYEQ/am79ufo8A/ifVhvilFcR7CTikwn0e+MrxBi 13EzQGmxq77DHksXqCKKVXz6S89d9w32Wf4RJPAmKMUlv6BlNe6V3spTT3OJXGkk3QYq BUOQ34z2lP09VcEyzDmzW87Mdi3HcNstzHW+1ZT1GkiY08UvXFmwgnhbmmVzE0ixnxWm ASuTIMsl7y5j6kpMKCZQSkFijamp9QVqeNm/vzaMM/nu1hhHJ1Lbh6P6yye9d7nwEl/O Er7w== 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 32-v6si24585634pls.331.2018.10.30.04.28.41; Tue, 30 Oct 2018 04:28:57 -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 S1727591AbeJ3UUK (ORCPT + 99 others); Tue, 30 Oct 2018 16:20:10 -0400 Received: from mga18.intel.com ([134.134.136.126]:18611 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726225AbeJ3UUK (ORCPT ); Tue, 30 Oct 2018 16:20:10 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2018 04:27:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,444,1534834800"; d="scan'208";a="275643314" Received: from um.fi.intel.com (HELO localhost) ([10.237.72.212]) by fmsmga005.fm.intel.com with ESMTP; 30 Oct 2018 04:26:57 -0700 From: Alexander Shishkin To: Paolo Bonzini , Luwei Kang , kvm@vger.kernel.org, x86@kernel.org Cc: tglx@linutronix.de, 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: 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> Date: Tue, 30 Oct 2018 13:26:57 +0200 Message-ID: <87y3af65fi.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 Paolo Bonzini writes: >> 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 I'm not confusing anything. In the terminology that you're using, the latter breaks the former. This cannot happen. >> 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. There is a control in the perf event attribute that enables tracing the guest. If this control is enabled, the kvm needs to stay away from any PT related MSRs. Conversely, if kvm is using PT (or, as you say, "the guest is tracing itself"), the host should not be allowed to ask for tracing the guest at the same time. Regards, -- Alex