qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kang, Luwei" <luwei.kang@intel.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Strong, Beeman" <beeman.strong@intel.com>,
	"rth@twiddle.net" <rth@twiddle.net>
Subject: RE: [PATCH v1 1/3] i386: Remove the limitation of IP payloads for Intel PT
Date: Tue, 29 Sep 2020 02:28:48 +0000	[thread overview]
Message-ID: <CY4PR11MB1447410A5DFEDEEEC51A2A9780320@CY4PR11MB1447.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200928141228.GW3717385@habkost.net>

> > > >>>> No, it's not possible.  KVM doesn't have a say on what the
> > > >>>> processor writes in the tracing packets.
> > > >>> Can KVM refuse to enable packet generation if CSbase is not zero
> > > >>> and CPUID.(EAX=14H,ECX=0)[bit 31] seen by guest is different from
> host?
> > > >>
> > > >> Yes, but the processor could change operating mode (and hence
> > > >> CSbase) while tracing is active.  This is very unlikely, since it
> > > >> would require nonzero CS-base and a 32-bit host, but in principle
> > > >> not impossible (could be a firmware call, for example).
> > > >>
> > > >> The only solution is for KVM to accept both, and for QEMU to
> > > >> refuse a setting that does not match the host.
> > > >>
> > > >
> > > > So I need to add a patch in KVM to disabled the Intel PT when the
> > > > CSbase is not zero and the guest LIP different from the host. And
> > > > this limitation in qemu (disabled the PT when LIP is enabled in
> > > > the host) can be remove. Is that right?
> > >
> > > No, if a feature cannot be emulated, that means it cannot be enabled
> > > unless it matches the host.  That's generally not a problem since
> > > Intel PT is usually used only with "-cpu host".
> > >
> >
> > The limitation of LIP in qemu will mask off the Intel PT in KVM guest
> > even with "-cpu host". e.g. This bit will be set in SnowRidge HW and
> > later.
> 
> This behavior can and should be changed.
> 
> >
> > How about "-cpu cpu_model, +intel-pt" use case? The current value of
> > Intel PT CPUID is a constant. Can we make the ICX CPUID as basic
> > inforation(LIP is 0) and using "+intel-pt-lip"
> > to make Intel PT work on the CPU which LIP is 1 on the host? As you
> > mentioned before, Intel PT cannot be enabled in guest unless it
> > matches the host.
> 
> This makes sense, but you can also make each CPU model set a default for the
> LIP bit.  "-cpu SnowRidge,+intel-pt" could set
> LIP=1 by default.

I have a question on how to set LIP=1 in SnowRidge by default. 
1. Set LIP in "builtin_x86_defs[]" SnowRidge CPU model. The LIP included in CPUID.(eax=14x,ecx=0)ecx[bit31] and a new leaf needs to be added.
2. Checking the CPU model in the later software flow and set the LIP bit if the CPU model is Snowridge. And we also need to add more CPU model's checking for new CPUs.

What is your opinion?

Thanks,
Luwei Kang

> 
> --
> Eduardo


  reply	other threads:[~2020-09-29  2:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 21:38 [PATCH v1 0/3] Remove the limitation of Intel PT CPUID info Luwei Kang
2020-02-24 21:38 ` [PATCH v1 1/3] i386: Remove the limitation of IP payloads for Intel PT Luwei Kang
2020-09-25 16:15   ` Eduardo Habkost
2020-09-25 16:42     ` Strong, Beeman
2020-09-25 16:54       ` Eduardo Habkost
2020-09-25 20:23         ` Paolo Bonzini
2020-09-25 20:29           ` Eduardo Habkost
2020-09-25 20:40             ` Paolo Bonzini
2020-09-28  5:19               ` Kang, Luwei
2020-09-28  7:35                 ` Paolo Bonzini
2020-09-28 12:42                   ` Kang, Luwei
2020-09-28 14:12                     ` Eduardo Habkost
2020-09-29  2:28                       ` Kang, Luwei [this message]
2020-09-29  3:44                         ` Eduardo Habkost
2020-09-28 16:46                     ` Paolo Bonzini
2020-09-29  2:28                       ` Kang, Luwei
2020-02-24 21:38 ` [PATCH v1 2/3] i386: Remove the CPUID limitation of " Luwei Kang
2020-02-24 21:38 ` [PATCH v1 3/3] i386: Mark the 'INTEL_PT' CPUID bit as unmigratable Luwei Kang
2020-03-30  9:56 ` [PATCH v1 0/3] Remove the limitation of Intel PT CPUID info Kang, Luwei
2020-09-18 22:02   ` Eduardo Habkost
2020-09-21  7:49     ` Kang, Luwei
2020-09-21 16:50       ` Eduardo Habkost
2020-09-23  2:52         ` Kang, Luwei
2020-09-23 14:15           ` Eduardo Habkost
2020-09-24 12:47             ` Kang, Luwei
2020-09-24 13:34               ` Eduardo Habkost
2020-09-25  8:20                 ` Kang, Luwei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR11MB1447410A5DFEDEEEC51A2A9780320@CY4PR11MB1447.namprd11.prod.outlook.com \
    --to=luwei.kang@intel.com \
    --cc=beeman.strong@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).