From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@suse.de>, Zachary Amsden <zach@vmware.com>,
Anthony Liguori <anthony@codemonkey.ws>,
Avi Kivity <avi@qumranet.com>,
Glauber de Oliveira Costa <glommer@gmail.com>,
"Nakajima, Jun" <jun.nakajima@intel.com>,
Virtualization Mailing List <virtualization@lists.osdl.org>
Subject: Re: [PATCH RFC REPOST 1/2] paravirt: refactor struct paravirt_ops into smaller pv_*_ops
Date: Wed, 10 Oct 2007 11:02:50 -0700 [thread overview]
Message-ID: <470D13CA.3000202@goop.org> (raw)
In-Reply-To: <200710101635.10139.rusty@rustcorp.com.au>
Huh, thought I did a more complete reply to this. Must have farted on it.
Rusty Russell wrote:
> Thanks Jeremy, I've actually taken time to finally review this in detail (I'm
> assuming you'll refactor as necessary after the x86 arch merger).
>
Yep.
>> +struct paravirt_ops paravirt_ops;
>> +
>>
>
> Do you actually need to define this? See below...
>
>
>> +DEF_NATIVE(, ud2a, "ud2a");
>>
>
> Hmm, that's ugly. It was ugly before, but it's uglier now. Maybe just
> use "unsigned char ud2a[] = { 0x0f, 0x0b };" in paravirt_patch_default?
>
Yeah, its not pretty. I'll have another go.
>> }
>>
>> struct paravirt_ops paravirt_ops = {
>>
> ...
>
>> + .pv_info = {
>> + .name = "bare hardware",
>> + .paravirt_enabled = 0,
>> + .kernel_rpl = 0,
>> + .shared_kernel_pmd = 1, /* Only used when CONFIG_X86_PAE is set */
>> + },
>>
>
> This is the bit I don't get. Why not just declare struct pv_info pvinfo, etc,
> and use the declaration of struct paravirt_ops to get your unique
> offset-based identifiers for patching?
>
Given an op id number in .parainstructions, the patching code needs to
be able to index into something to get the corresponding function
pointer. If each pv_* structure is its own little unrelated structure,
then the id has to be a <structure, id> tuple, which just complicates
things. If I pack them all into a single structure then it becomes a
simple offset calculation.
That said, there's no need for pv_info to be in that structure, since it
contains no function pointers. I'll move it out.
J
next prev parent reply other threads:[~2007-10-10 18:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-09 18:24 [PATCH RFC REPOST 1/2] paravirt: refactor struct paravirt_ops into smaller pv_*_ops Jeremy Fitzhardinge
2007-10-10 6:35 ` Rusty Russell
2007-10-10 17:48 ` Jeremy Fitzhardinge
2007-10-10 18:02 ` Jeremy Fitzhardinge [this message]
2007-10-11 14:01 ` Rusty Russell
2007-10-12 19:16 ` Jeremy Fitzhardinge
2007-10-12 19:16 ` Jeremy Fitzhardinge
2007-10-15 8:16 ` Rusty Russell
2007-10-15 19:23 ` Jeremy Fitzhardinge
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=470D13CA.3000202@goop.org \
--to=jeremy@goop.org \
--cc=ak@suse.de \
--cc=anthony@codemonkey.ws \
--cc=avi@qumranet.com \
--cc=glommer@gmail.com \
--cc=jun.nakajima@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.osdl.org \
--cc=zach@vmware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.