public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nadav Har'El" <nyh@math.technion.ac.il>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, mtosatti@redhat.com
Subject: Re: Why exit on MSR_STAR and friends?
Date: Thu, 17 Feb 2011 12:29:35 +0200	[thread overview]
Message-ID: <20110217102935.GA19369@fermat.math.technion.ac.il> (raw)
In-Reply-To: <4D5CE8BC.8020306@redhat.com>

On Thu, Feb 17, 2011, Avi Kivity wrote about "Re: Why exit on MSR_STAR and friends?":
> It isn't needed.  The code doesn't distinguish between the read and 
> write bitmaps, and so far no guest issues rdmsr for these msrs with any 
> frequency (kvm as a guest will write those msrs, but it shouldn't read 
> them on Intel).  Do you see frequent reads on some guest?

I saw reads of all these MSRs (STAR, LSTAR, CSTAR and SYSCALL_MASK) at about
half the number of the writes.

Looking deeper now, I realize why I saw these and you didn't. I happened
to run some old L1 image, with apparently a 1 year old Linux and KVM.
In that version, __vmx_load_host_state() called:
	save_msrs(vmx->guest_msrs, vmx->save_nmsrs);
        load_msrs(vmx->host_msrs, vmx->save_nmsrs);
and save_msrs read all those MSRs. Looking at the current code, indeed
this is no loger done.

So you can say that there are some guests which frequently reads those MSRs -
old versions of KVM :-) But I agree, this is nothing to worry about.

I guess I should be more worried why I got all these PIOs in L2 in the
first place - the MSR reads and writes in L1 were just an odd consequence
of that. It turns out that the "ping -f" workload I was running in L2
insisted to get accurate timings of each packet, and this, I'm not still
sure why, caused a ACPI PM_TIMER PIO for each packet. I guess that normal
workloads won't use the timer on every packet, so that shouldn't matter.

-- 
Nadav Har'El                        |    Thursday, Feb 17 2011, 13 Adar I 5771
nyh@math.technion.ac.il             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Knowledge is knowing a tomato is a fruit.
http://nadav.harel.org.il           |Wisdom is not putting it in a fruit salad.

  reply	other threads:[~2011-02-17 10:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 15:17 Why exit on MSR_STAR and friends? Nadav Har'El
2011-02-17  9:22 ` Avi Kivity
2011-02-17 10:29   ` Nadav Har'El [this message]
2011-02-17 10:39     ` Avi Kivity

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=20110217102935.GA19369@fermat.math.technion.ac.il \
    --to=nyh@math.technion.ac.il \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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