[PATCH 00 of 24] More Xen updates - Kernel

This is a discussion on [PATCH 00 of 24] More Xen updates - Kernel ; Ingo Molnar wrote: > * Jeremy Fitzhardinge wrote: > > >> Hi Ingo, >> >> More patches. There are three groups: >> >> - some code movements to make common code available to other >> architectures (namely, ia64) >> - ...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 23 of 23

Thread: [PATCH 00 of 24] More Xen updates

  1. Re: [PATCH 00 of 24] More Xen updates

    Ingo Molnar wrote:
    > * Jeremy Fitzhardinge wrote:
    >
    >
    >> Hi Ingo,
    >>
    >> More patches. There are three groups:
    >>
    >> - some code movements to make common code available to other
    >> architectures (namely, ia64)
    >> - Xen device driver updates, including a new xen paravirt framebuffer driver,
    >> - The Xen balloon driver (shrink only, so no dependency on memory hotplug yet)
    >> - some "using smp_processor_id while preemptable" warning fixes,
    >> mostly as a result of the core kernel's tendency to do tlb flushes
    >> and update init_mm while preemptable,
    >> - other little Xen cleanups
    >>

    >
    > thanks, applied for testing. The .25 Xen items we've got queued up are:
    >
    > Subject: xen: refactor xen_{alloc,release}_{pte,pmd}()
    > Subject: xen: do not pin/unpin PMD pages
    > Subject: xen: clear PG_pinned in release_{pte,pmd}()
    >


    Mark just posted another bugfix patch - attached.

    J



    Subject: xen: Fix grant table bug

    From: Michael Abd-El-Malek

    A PV OS has two grant table data structures: the grant table itself
    and a free list. The free list is composed of an array of pages,
    which grow dynamically as the guest OS requires more grants. While
    the grant table contains 8-byte entries, the free list contains 4-byte
    entries. So we have half as many pages in the free list than in the
    grant table.

    There was a bug in the free list allocation code. The free list was
    indexed as if it was the same size as the grant table. But it's only
    half as large. So memory got corrupted, and I was seeing crashes in
    the slab allocator later on.

    Taken from:

    http://xenbits.xensource.com/linux-2...v/4018c0da3360

    Signed-off-by: Michael Abd-El-Malek
    Signed-off-by: Mark McLoughlin
    Signed-off-by: Jeremy Fitzhardinge
    ---
    drivers/xen/grant-table.c | 17 ++++++++++-------
    1 file changed, 10 insertions(+), 7 deletions(-)

    ================================================== =================
    --- a/drivers/xen/grant-table.c
    +++ b/drivers/xen/grant-table.c
    @@ -381,11 +381,15 @@ EXPORT_SYMBOL_GPL(gnttab_cancel_free_callback);
    static int grow_gnttab_list(unsigned int more_frames)
    {
    unsigned int new_nr_grant_frames, extra_entries, i;
    + unsigned int nr_glist_frames, new_nr_glist_frames;

    new_nr_grant_frames = nr_grant_frames + more_frames;
    extra_entries = more_frames * GREFS_PER_GRANT_FRAME;

    - for (i = nr_grant_frames; i < new_nr_grant_frames; i++) {
    + nr_glist_frames = (nr_grant_frames * GREFS_PER_GRANT_FRAME + RPP - 1) / RPP;
    + new_nr_glist_frames =
    + (new_nr_grant_frames * GREFS_PER_GRANT_FRAME + RPP - 1) / RPP;
    + for (i = nr_glist_frames; i < new_nr_glist_frames; i++) {
    gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_ATOMIC);
    if (!gnttab_list[i])
    goto grow_nomem;
    @@ -407,7 +411,7 @@ static int grow_gnttab_list(unsigned int more_frames)
    return 0;

    grow_nomem:
    - for ( ; i >= nr_grant_frames; i--)
    + for ( ; i >= nr_glist_frames; i--)
    free_page((unsigned long) gnttab_list[i]);
    return -ENOMEM;
    }
    @@ -530,7 +534,7 @@ static int gnttab_expand(unsigned int req_entries)
    static int __devinit gnttab_init(void)
    {
    int i;
    - unsigned int max_nr_glist_frames;
    + unsigned int max_nr_glist_frames, nr_glist_frames;
    unsigned int nr_init_grefs;

    if (!is_running_on_xen())
    @@ -543,15 +547,15 @@ static int __devinit gnttab_init(void)
    * grant reference free list on the current hypervisor.
    */
    max_nr_glist_frames = (boot_max_nr_grant_frames *
    - GREFS_PER_GRANT_FRAME /
    - (PAGE_SIZE / sizeof(grant_ref_t)));
    + GREFS_PER_GRANT_FRAME / RPP);

    gnttab_list = kmalloc(max_nr_glist_frames * sizeof(grant_ref_t *),
    GFP_KERNEL);
    if (gnttab_list == NULL)
    return -ENOMEM;

    - for (i = 0; i < nr_grant_frames; i++) {
    + nr_glist_frames = (nr_grant_frames * GREFS_PER_GRANT_FRAME + RPP - 1) / RPP;
    + for (i = 0; i < nr_glist_frames; i++) {
    gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_KERNEL);
    if (gnttab_list[i] == NULL)
    goto ini_nomem;
    --



    _______________________________________________
    Xen-devel mailing list
    Xen-devel@lists.xensource.com
    http://lists.xensource.com/xen-devel



  2. Re: [PATCH 24 of 24] xen: add balloon driver

    The following modification to include/xen/interface/memory.h
    removes handles related definitions.
    It breaks ia64/xen compilation because ia64/xen uses memory interface
    not only for balloon, but also for xen_alloc_vm_area/xen_free_vm_area().

    Can it be added again?

    thanks,

    On Wed, Apr 02, 2008 at 10:54:13AM -0700, Jeremy Fitzhardinge wrote:
    > diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
    > --- a/include/xen/interface/memory.h
    > +++ b/include/xen/interface/memory.h
    > @@ -29,7 +29,7 @@
    > * OUT: GMFN bases of extents that were allocated
    > * (NB. This command also updates the mach_to_phys translation table)
    > */
    > - GUEST_HANDLE(ulong) extent_start;
    > + ulong extent_start;
    >
    > /* Number of extents, and size/alignment of each (2^extent_order pages). */
    > unsigned long nr_extents;
    > @@ -50,7 +50,6 @@
    > domid_t domid;
    >
    > };
    > -DEFINE_GUEST_HANDLE_STRUCT(xen_memory_reservation) ;
    >
    > /*
    > * Returns the maximum machine frame number of mapped RAM in this system.
    > @@ -86,7 +85,7 @@
    > * any large discontiguities in the machine address space, 2MB gaps in
    > * the machphys table will be represented by an MFN base of zero.
    > */
    > - GUEST_HANDLE(ulong) extent_start;
    > + ulong extent_start;
    >
    > /*
    > * Number of extents written to the above array. This will be smaller
    > @@ -94,7 +93,6 @@
    > */
    > unsigned int nr_extents;
    > };
    > -DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mfn_list);
    >
    > /*
    > * Sets the GPFN at which a particular page appears in the specified guest's
    > @@ -117,7 +115,6 @@
    > /* GPFN where the source mapping page should appear. */
    > unsigned long gpfn;
    > };
    > -DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap);
    >
    > /*
    > * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
    > @@ -132,14 +129,13 @@
    > unsigned long nr_gpfns;
    >
    > /* List of GPFNs to translate. */
    > - GUEST_HANDLE(ulong) gpfn_list;
    > + ulong gpfn_list;
    >
    > /*
    > * Output list to contain MFN translations. May be the same as the input
    > * list (in which case each input GPFN is overwritten with the output MFN).
    > */
    > - GUEST_HANDLE(ulong) mfn_list;
    > + ulong mfn_list;
    > };
    > -DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list );
    >
    > #endif /* __XEN_PUBLIC_MEMORY_H__ */
    >
    >
    >


    --
    yamahata
    --
    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/

  3. Re: [PATCH 24 of 24] xen: add balloon driver

    Isaku Yamahata wrote:
    > The following modification to include/xen/interface/memory.h
    > removes handles related definitions.
    > It breaks ia64/xen compilation because ia64/xen uses memory interface
    > not only for balloon, but also for xen_alloc_vm_area/xen_free_vm_area().
    >
    > Can it be added again?
    >


    Yes, sure. We're going to hit that a bit because we needed to remove
    them to make the initial upstreaming smooth.

    J
    --
    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/

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2