~ressu/+junk/xen-ubuntu

« back to all changes in this revision

Viewing changes to tools/libxc/xc_core_x86.c

  • Committer: sami at haahtinen
  • Date: 2011-05-23 19:11:45 UTC
  • mfrom: (3.1.3 xen)
  • Revision ID: sami@haahtinen.name-20110523191145-55rhsn3endndbbge
* Upload new version to ppa, base off the 4.1.0 package in debian
* Re-enable hvmloader:
  - Use packaged ipxe.
* Workaround incompatibility with xenstored of Xen 4.0.
* New upstream release.
* New upstream release candidate.
* Build documentation using pdflatex.
* Use python 2.6. (closes: #596545)
* Fix lintian override.
* Install new tools: xl, xenpaging.
* Enable blktap2.
  - Use own md5 implementation.
  - Fix includes.
  - Fix linking of blktap2 binaries.
  - Remove optimization setting.
* Temporarily disable hvmloader, wants to download ipxe.
* Remove xenstored pid check from xl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * This program is free software; you can redistribute it and/or modify
3
 
 * it under the terms of the GNU General Public License as published by
4
 
 * the Free Software Foundation; either version 2 of the License, or
5
 
 * (at your option) any later version.
 
2
 * This library is free software; you can redistribute it and/or
 
3
 * modify it under the terms of the GNU Lesser General Public
 
4
 * License as published by the Free Software Foundation; either
 
5
 * version 2.1 of the License, or (at your option) any later version.
6
6
 *
7
 
 * This program is distributed in the hope that it will be useful,
 
7
 * This library is distributed in the hope that it will be useful,
8
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
 * GNU General Public License for more details.
 
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
10
 * Lesser General Public License for more details.
11
11
 *
12
 
 * You should have received a copy of the GNU General Public License
13
 
 * along with this program; if not, write to the Free Software
14
 
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
12
 * You should have received a copy of the GNU Lesser General Public
 
13
 * License along with this library; if not, write to the Free Software
 
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
15
15
 *
16
16
 * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
17
17
 *                    VA Linux Systems Japan K.K.
40
40
}
41
41
 
42
42
 
43
 
static int nr_gpfns(int xc_handle, domid_t domid)
 
43
static int nr_gpfns(xc_interface *xch, domid_t domid)
44
44
{
45
 
    return xc_memory_op(xc_handle, XENMEM_maximum_gpfn, &domid) + 1;
 
45
    return xc_domain_maximum_gpfn(xch, domid) + 1;
46
46
}
47
47
 
48
48
int
52
52
}
53
53
 
54
54
int
55
 
xc_core_arch_memory_map_get(int xc_handle, struct xc_core_arch_context *unused,
 
55
xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unused,
56
56
                            xc_dominfo_t *info, shared_info_any_t *live_shinfo,
57
57
                            xc_core_memory_map_t **mapp,
58
58
                            unsigned int *nr_entries)
59
59
{
60
 
    unsigned long p2m_size = nr_gpfns(xc_handle, info->domid);
 
60
    unsigned long p2m_size = nr_gpfns(xch, info->domid);
61
61
    xc_core_memory_map_t *map;
62
62
 
63
63
    map = malloc(sizeof(*map));
76
76
}
77
77
 
78
78
static int
79
 
xc_core_arch_map_p2m_rw(int xc_handle, struct domain_info_context *dinfo, xc_dominfo_t *info,
 
79
xc_core_arch_map_p2m_rw(xc_interface *xch, struct domain_info_context *dinfo, xc_dominfo_t *info,
80
80
                        shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
81
81
                        unsigned long *pfnp, int rw)
82
82
{
92
92
    int err;
93
93
    int i;
94
94
 
95
 
    dinfo->p2m_size = nr_gpfns(xc_handle, info->domid);
 
95
    dinfo->p2m_size = nr_gpfns(xch, info->domid);
96
96
    if ( dinfo->p2m_size < info->nr_pages  )
97
97
    {
98
98
        ERROR("p2m_size < nr_pages -1 (%lx < %lx", dinfo->p2m_size, info->nr_pages - 1);
100
100
    }
101
101
 
102
102
    live_p2m_frame_list_list =
103
 
        xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, PROT_READ,
 
103
        xc_map_foreign_range(xch, dom, PAGE_SIZE, PROT_READ,
104
104
                             GET_FIELD(live_shinfo, arch.pfn_to_mfn_frame_list_list));
105
105
 
106
106
    if ( !live_p2m_frame_list_list )
129
129
            p2m_frame_list_list[i] = ((uint32_t *)p2m_frame_list_list)[i];
130
130
 
131
131
    live_p2m_frame_list =
132
 
        xc_map_foreign_pages(xc_handle, dom, PROT_READ,
 
132
        xc_map_foreign_pages(xch, dom, PROT_READ,
133
133
                             p2m_frame_list_list,
134
134
                             P2M_FLL_ENTRIES);
135
135
 
156
156
        for ( i = P2M_FL_ENTRIES - 1; i >= 0; i-- )
157
157
            p2m_frame_list[i] = ((uint32_t *)p2m_frame_list)[i];
158
158
 
159
 
    *live_p2m = xc_map_foreign_pages(xc_handle, dom,
 
159
    *live_p2m = xc_map_foreign_pages(xch, dom,
160
160
                                    rw ? (PROT_READ | PROT_WRITE) : PROT_READ,
161
161
                                    p2m_frame_list,
162
162
                                    P2M_FL_ENTRIES);
191
191
}
192
192
 
193
193
int
194
 
xc_core_arch_map_p2m(int xc_handle, unsigned int guest_width, xc_dominfo_t *info,
 
194
xc_core_arch_map_p2m(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info,
195
195
                        shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
196
196
                        unsigned long *pfnp)
197
197
{
198
198
    struct domain_info_context _dinfo = { .guest_width = guest_width };
199
199
    struct domain_info_context *dinfo = &_dinfo;
200
 
    return xc_core_arch_map_p2m_rw(xc_handle, dinfo, info,
 
200
    return xc_core_arch_map_p2m_rw(xch, dinfo, info,
201
201
                                   live_shinfo, live_p2m, pfnp, 0);
202
202
}
203
203
 
204
204
int
205
 
xc_core_arch_map_p2m_writable(int xc_handle, unsigned int guest_width, xc_dominfo_t *info,
 
205
xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info,
206
206
                              shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
207
207
                              unsigned long *pfnp)
208
208
{
209
209
    struct domain_info_context _dinfo = { .guest_width = guest_width };
210
210
    struct domain_info_context *dinfo = &_dinfo;
211
 
    return xc_core_arch_map_p2m_rw(xc_handle, dinfo, info,
 
211
    return xc_core_arch_map_p2m_rw(xch, dinfo, info,
212
212
                                   live_shinfo, live_p2m, pfnp, 1);
213
213
}
214
214
/*