lkml.org 
[lkml]   [2007]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH RFC REPOST 1/2] paravirt: refactor struct paravirt_ops into smaller pv_*_ops
    Date
    On Thursday 11 October 2007 04:02:50 Jeremy Fitzhardinge wrote:
    > >> 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.

    Sure, but this can actually be a temporary thing inside the patch code (or at
    least static to that file if it's too big for the stack).

    struct paravirt_ops patch_template = { .pv_info = pv_info, .pv_cpu_ops =
    pv_cpu_ops, ... };

    Then you can even rename struct paravirt_ops to "struct patch_template" and
    we're well on the way to making this a generic function-call patching
    mechanism, rather than something paravirt-specific.

    Hope that clarifies my thinking...
    Rusty.


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-10-11 16:05    [W:0.021 / U:62.436 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site