xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rzvncj@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim (Xen.org)" <tim@xen.org>
Subject: Re: [PATCH V2] mem_event: Add support for MEM_EVENT_REASON_MSR
Date: Wed, 02 Jan 2013 15:56:15 +0200	[thread overview]
Message-ID: <50E43C7F.6000909@gmail.com> (raw)
In-Reply-To: <1357133451.5668.23.camel@zakaz.uk.xensource.com>

>> +#define MEM_EVENT_REASON_MSR         7    /* MSR was hit: gfn is MSR value, gla is MSR type;
>> +                                             does NOT honour HVMPME_onchangeonly */ 
> 
> Why doesn't/shouldn't it support onchangeonly?

It doesn't support onchangeonly because it is unreasonably complicated
to get the old value (which we need to compare to the new one, and thus
establish if onchangeonly applies or not).

If you look at hvm_msr_write_intercept() (it's at line 2917 in
xen/arch/x86/hvm/hvm.c), depending on the value of the "msr" parameter
there are several ways of setting the value: hvm_set_efer() if msr is
MSR_EFER, hvm_set_guest_tsc() if msr is MSR_IA32_TSC, and so on. So
rather than having a getter call for the current value for each of these
MSR types, I found it cleaner to just notify the event channel that a
value is being written, regardless of whether it's different from the
currently stored value or not, and regardless of how the actual write is
being handle depending on the MSR type.

> HVM_PARAM_MEMORY_EVENT_INT3 and HVM_PARAM_MEMORY_EVENT_SINGLE_STEP seem
> not to support it either but they reject attempts to use them with it
> (in do_hvm_op). I think this new value should do the same.

Understood, I agree. Will add this new modification and submit V3 of the
patch tomorrow (no access to my development machine now).

> By "MSR type" do you mean the address?

I mean one of the following: MSR_EFER, MSR_IA32_TSC, etc.
Would you prefer that I change the "MSR type" expression in the comment
to something else? What would make more sense?

Thanks,
Razvan Cojocaru

  reply	other threads:[~2013-01-02 13:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20 12:55 [PATCH V2] mem_event: Add support for MEM_EVENT_REASON_MSR Razvan Cojocaru
2013-01-02 13:30 ` Ian Campbell
2013-01-02 13:56   ` Razvan Cojocaru [this message]
2013-01-02 14:34     ` Ian Campbell
2013-01-02 14:40       ` Razvan Cojocaru

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=50E43C7F.6000909@gmail.com \
    --to=rzvncj@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xensource.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;
as well as URLs for NNTP newsgroup(s).