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: Tim Deegan <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] libxc: Add xc_domain_hvm_get_mtrr_type() call
Date: Wed, 19 Dec 2012 12:42:51 +0200	[thread overview]
Message-ID: <50D19A2B.2050006@gmail.com> (raw)
In-Reply-To: <1355912063.14620.286.camel@zakaz.uk.xensource.com>

> It would certainly be preferable to have libxc do it now rather than
> every application it or having to introduce cleverer versions of the API
> in the future.

I agree.

> I don't know enough about MTRRs or how Xen represents them either
> internally or at the hypercall interface to have a sensible opinion
> about the feasibility but my gut feeling is that there's no reason it
> shouldn't be.

Unfortunately I'm far from being an expert on MTRRs too, so maybe 
someone can tell us what the equivalent of this:

uint8_t get_mtrr_type(struct mtrr_state *m, paddr_t pa)
{
     [...]
     if ( unlikely(!(m->enabled & 0x2)) )
         return MTRR_TYPE_UNCACHABLE;
     [...]
}

whould be with libxc code using struct hvm_hw_mtrr? Or, more to the 
point, what the equivalent of m->enabled is in this:

struct hvm_hw_mtrr {
#define MTRR_VCNT 8
#define NUM_FIXED_MSR 11
     uint64_t msr_pat_cr;
     /* mtrr physbase & physmask msr pair*/
     uint64_t msr_mtrr_var[MTRR_VCNT*2];
     uint64_t msr_mtrr_fixed[NUM_FIXED_MSR];
     uint64_t msr_mtrr_cap;
     uint64_t msr_mtrr_def_type;
};

I'm also having a hard time figuring out how to map m->overlapped on the 
hvm_hw_mtrr members. It's also quite possible (to me, at least, at this 
stage) that they're not needed because at libxc level they're assumed to 
be set to some value (i.e. 'overlapped' is assumed to be 0, 'enabled' to 
be 1).

Any help is appreciated, if we clear this up I'll modify and re-submit 
the patch.

Thanks,
Razvan Cojocaru

  reply	other threads:[~2012-12-19 10:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 11:38 [PATCH] libxc: Add xc_domain_hvm_get_mtrr_type() call Razvan Cojocaru
2012-12-18 17:04 ` Ian Campbell
2012-12-18 17:24   ` Razvan Cojocaru
2012-12-19 10:14     ` Ian Campbell
2012-12-19 10:42       ` Razvan Cojocaru [this message]
2012-12-19 11:28         ` Ian Campbell
2012-12-19 11:49           ` Razvan Cojocaru
2012-12-19 12:00             ` Razvan Cojocaru
2012-12-19 14:57             ` Razvan Cojocaru
2012-12-19 15:00               ` Ian Campbell
2012-12-19 15:10                 ` Razvan Cojocaru
2012-12-19 15:27                 ` Andrew Cooper
2012-12-19 15:54                   ` Ian Campbell
2012-12-19 16:11                     ` Andrew Cooper
2012-12-19 16:15                       ` Ian Campbell
2012-12-19 16:29                         ` Razvan Cojocaru
2012-12-19 17:46                           ` Tim Deegan
2012-12-19 19:35                             ` Razvan Cojocaru
2012-12-20 11:57                               ` Tim Deegan
2012-12-20 13:40                                 ` Razvan Cojocaru
2012-12-19 15:43                 ` Razvan Cojocaru
2012-12-20 11:54               ` Tim Deegan

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=50D19A2B.2050006@gmail.com \
    --to=rzvncj@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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).