WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [makedumpfile] makedumpfile port to Xen 4 (exclude_xen_user_

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [makedumpfile] makedumpfile port to Xen 4 (exclude_xen_user_domain)
From: "Trapp, Norbert" <norbert.trapp@xxxxxxxxxxxxxx>
Date: Tue, 16 Aug 2011 18:06:19 +0200
Accept-language: de-DE, en-US
Acceptlanguage: de-DE, en-US
Delivery-date: Tue, 16 Aug 2011 16:43:32 -0700
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=norbert.trapp@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1313510784; x=1345046784; h=from:to:date:subject:message-id:mime-version; bh=9Ia7au2iXNgs+S2XXV1HAKXe6GhKC7LDuZTNpP4NuHo=; b=tMPUHk3r+tsKEYdrXuSFtGh+frPCzsVTcf5U+tJK5In/WKyAVpHeojq5 A5yYHWxgflqC4wSE58+vZyKAq1I+ONIB6NgqrKz2r1oZX7ivM+7aYnLs4 IRXWR8/WQcyimAEUuhfb1mzEfg8q51olG+JhZm0opYtNNGor94UKIywf6 /k/VO0FDLQem+vNTr41pWd0N2SCtgDSaPDGTmecpoQnqinvlliFn2HaPa MeTkPvAGrrs3+kgoFRXnbGl+KNpuO;
Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:Received:From:To:Date: Subject:Thread-Topic:Thread-Index:Message-ID: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:acceptlanguage:Content-Type: MIME-Version; b=I9F/sdKBxQWj3uvRcKbNOHrP3axMdZnPycBl0U+GX2K/r8cJbJ1+ayWH 7HNPKEtP7ja1ptYICOC3eth1JtJ/Kt/cBHj92nMmFutSOiQQRTPD+YAyB V3pUBT1uGDWy66OmeEL40noClQdu/+AR0RRfRzLFuduivJJmPy0lWCLl8 df5pMe/5ETcQnAHPzhj1pFTMSaVMOrLNvKDRWaj/XRiZwtJCWV3CIbw3B AK6CnLGeDjwolhQ4U56s6dlnRcnxv;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcxcLm+DOfg60BIxQXGTbAjdkqYJeg==
Thread-topic: [Xen-devel] [makedumpfile] makedumpfile port to Xen 4 (exclude_xen_user_domain)
Hello,
 
makedumpfile can be used to save just the dom0 memory in case of a crash.
We need this feature to quickly restart systems with a huge amount of
(domU) memory. Unfortunately makedumpfile has not yet been ported to Xen 4.
So I gave it a try and I plan to send patches to the makedumpfile
project. The makedumpfile project leader asked me to also send the patches to
the xen-devel mailing list. Let me start with the code for determining
the dom0 pages in Xen 4. If you care please let me know about any faults or
improvements.
 
Thanks
Norbert
 
The function exclude_xen_user_domain() determines the dom0 and xen
pages and clears a bit in a bitmap for all other pages.
The function is_select_domain() determines whether the parameter is the pickled_id
of dom0.
 
#define BITS_PER_LONG 64
#define PG_shift(idx) (BITS_PER_LONG - (idx))
#define PG_mask(x, idx) (x ## UL << PG_shift(idx))
#define PGC_state_inuse PG_mask(0, 9)
#define PGC_allocated PG_mask(1, 1)
#define PGC_xen_heap PG_mask(1, 2)
#define PGC_state_free    PG_mask(3, 9)
 
int
exclude_xen_user_domain(void)
{
    int i;
    unsigned long count_info;
    unsigned int _domain;
    unsigned long page_info_addr;
    unsigned long long pfn, pfn_end;
    unsigned long long j, size;
    struct pt_load_segment *pls;
 
    for (i = 0; i < info->num_load_memory; i++) {
 
        pls = &info->pt_load_segments[i];
        pfn     = paddr_to_pfn(pls->phys_start);
        pfn_end = paddr_to_pfn(pls->phys_end);
        size    = pfn_end - pfn;
 
        for (j = 0; pfn < pfn_end; pfn++, j++) {
 
            page_info_addr = info->frame_table_vaddr + pfn * SIZE(page_info);
            if (!readmem(VADDR_XEN,
                  page_info_addr + OFFSET(page_info.count_info),
                  &count_info, sizeof(count_info))) {
                clear_bit_on_2nd_bitmap(pfn);
                continue;   /* page_info may not exist */
            }
            if (!readmem(VADDR_XEN,
                  page_info_addr + OFFSET(page_info._domain),
                  &_domain, sizeof(_domain))) {
                ERRMSG("Can't get page_info._domain.\n");
                return FALSE;
            }
 
            if (count_info & PGC_state_free) {
                clear_bit_on_2nd_bitmap(pfn);
                continue;
            }
            if (count_info & PGC_xen_heap) {
                continue;
            }
            if (count_info & PGC_allocated) {
                if (_domain == 0) {
                    continue;
                }
                if (is_select_domain(_domain)) {
                    continue;
                } else {
                    clear_bit_on_2nd_bitmap(pfn);
                    continue;
                }
            }
            if (count_info == PGC_state_inuse) {
                continue;
            }
            clear_bit_on_2nd_bitmap(pfn);
        }
    }
 
    return TRUE;
}
 
 
With kind regards
 
Norbert Trapp
PDG ES&S SWE OS 6
 
FUJITSU
Fujitsu Technology Solutions GmbH
Domagkstraße 28, D-80807 München, Germany
E-Mail: Norbert.Trapp@xxxxxxxxxxxxxx
Company details: ts.fujitsu.com/imprint
 
 
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [makedumpfile] makedumpfile port to Xen 4 (exclude_xen_user_domain), Trapp, Norbert <=