mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Merged.
This commit is contained in:
commit
effe56337b
65 files changed
+380
-446
No files matched your search
@@ -56,9 +56,11 @@ fastcall void do_fixup_4gb_segment(struct pt_regs *regs, long error_code)
|
||||
DP("***************************************************************");
|
||||
DP("***************************************************************");
|
||||
DP("** WARNING: Currently emulating unsupported memory accesses **");
|
||||
DP("** in /lib/tls libraries. The emulation is very **");
|
||||
DP("** in /lib/tls glibc libraries. The emulation is **");
|
||||
DP("** slow. To ensure full performance you should **");
|
||||
DP("** execute the following as root: **");
|
||||
DP("** install a 'xen-friendly' (nosegneg) version of **");
|
||||
DP("** the library, or disable tls support by executing **");
|
||||
DP("** the following as root: **");
|
||||
DP("** mv /lib/tls /lib/tls.disabled **");
|
||||
DP("** Offending process: %-38.38s **", info);
|
||||
DP("***************************************************************");
|
||||
|
||||
@@ -88,10 +88,10 @@ static inline void flush_plugged_queue(void)
|
||||
* handle returned must be used to unmap the frame. This is needed to
|
||||
* drop the ref count on the frame.
|
||||
*/
|
||||
static u16 pending_grant_handles[MMAP_PAGES];
|
||||
static grant_handle_t pending_grant_handles[MMAP_PAGES];
|
||||
#define pending_handle(_idx, _i) \
|
||||
(pending_grant_handles[((_idx) * BLKIF_MAX_SEGMENTS_PER_REQUEST) + (_i)])
|
||||
#define BLKBACK_INVALID_HANDLE (0xFFFF)
|
||||
#define BLKBACK_INVALID_HANDLE (~0)
|
||||
|
||||
#ifdef CONFIG_XEN_BLKDEV_TAP_BE
|
||||
/*
|
||||
@@ -114,7 +114,7 @@ static void fast_flush_area(int idx, int nr_pages)
|
||||
{
|
||||
struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST];
|
||||
unsigned int i, invcount = 0;
|
||||
u16 handle;
|
||||
grant_handle_t handle;
|
||||
int ret;
|
||||
|
||||
for (i = 0; i < nr_pages; i++) {
|
||||
@@ -335,7 +335,6 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req)
|
||||
{
|
||||
extern void ll_rw_block(int rw, int nr, struct buffer_head * bhs[]);
|
||||
int operation = (req->operation == BLKIF_OP_WRITE) ? WRITE : READ;
|
||||
unsigned long fas = 0;
|
||||
int i, pending_idx = pending_ring[MASK_PEND_IDX(pending_cons)];
|
||||
pending_req_t *pending_req;
|
||||
struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST];
|
||||
@@ -362,16 +361,17 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req)
|
||||
preq.nr_sects = 0;
|
||||
|
||||
for (i = 0; i < nseg; i++) {
|
||||
fas = req->frame_and_sects[i];
|
||||
seg[i].nsec = blkif_last_sect(fas) - blkif_first_sect(fas) + 1;
|
||||
seg[i].nsec = req->seg[i].last_sect -
|
||||
req->seg[i].first_sect + 1;
|
||||
|
||||
if (seg[i].nsec <= 0)
|
||||
if ((req->seg[i].last_sect >= (PAGE_SIZE >> 9)) ||
|
||||
(seg[i].nsec <= 0))
|
||||
goto bad_descriptor;
|
||||
preq.nr_sects += seg[i].nsec;
|
||||
|
||||
map[i].host_addr = MMAP_VADDR(pending_idx, i);
|
||||
map[i].dom = blkif->domid;
|
||||
map[i].ref = blkif_gref_from_fas(fas);
|
||||
map[i].ref = req->seg[i].gref;
|
||||
map[i].flags = GNTMAP_host_map;
|
||||
if ( operation == WRITE )
|
||||
map[i].flags |= GNTMAP_readonly;
|
||||
@@ -381,7 +381,7 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req)
|
||||
BUG_ON(ret);
|
||||
|
||||
for (i = 0; i < nseg; i++) {
|
||||
if (likely(map[i].handle >= 0)) {
|
||||
if (likely(map[i].status == 0)) {
|
||||
pending_handle(pending_idx, i) = map[i].handle;
|
||||
#ifdef __ia64__
|
||||
MMAP_VADDR(pending_idx,i) = gnttab_map_vaddr(map[i]);
|
||||
@@ -390,9 +390,8 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req)
|
||||
pending_idx, i)) >> PAGE_SHIFT,
|
||||
FOREIGN_FRAME(map[i].dev_bus_addr>>PAGE_SHIFT));
|
||||
#endif
|
||||
fas = req->frame_and_sects[i];
|
||||
seg[i].buf = map[i].dev_bus_addr |
|
||||
(blkif_first_sect(fas) << 9);
|
||||
seg[i].buf = map[i].dev_bus_addr |
|
||||
(req->seg[i].first_sect << 9);
|
||||
} else {
|
||||
errors++;
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ typedef struct blkif_st {
|
||||
|
||||
struct work_struct free_work;
|
||||
|
||||
u16 shmem_handle;
|
||||
grant_ref_t shmem_ref;
|
||||
grant_handle_t shmem_handle;
|
||||
grant_ref_t shmem_ref;
|
||||
} blkif_t;
|
||||
|
||||
blkif_t *alloc_blkif(domid_t domid);
|
||||
|
||||
@@ -43,9 +43,9 @@ static int map_frontend_page(blkif_t *blkif, unsigned long shared_page)
|
||||
unlock_vm_area(blkif->blk_ring_area);
|
||||
BUG_ON(ret);
|
||||
|
||||
if (op.handle < 0) {
|
||||
if (op.status) {
|
||||
DPRINTK(" Grant table operation failure !\n");
|
||||
return op.handle;
|
||||
return op.status;
|
||||
}
|
||||
|
||||
blkif->shmem_ref = shared_page;
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#if 1
|
||||
#define ASSERT(p) \
|
||||
if (!(p)) { printk("Assertion '%s' failed, line %d, file %s", #p , \
|
||||
@@ -41,7 +40,6 @@
|
||||
#define ASSERT(_p)
|
||||
#endif
|
||||
|
||||
|
||||
#include <linux/version.h>
|
||||
#include "block.h"
|
||||
#include <linux/cdrom.h>
|
||||
@@ -54,16 +52,14 @@
|
||||
#include <asm-xen/gnttab.h>
|
||||
#include <asm/hypervisor.h>
|
||||
|
||||
|
||||
#define BLKIF_STATE_DISCONNECTED 0
|
||||
#define BLKIF_STATE_CONNECTED 1
|
||||
#define BLKIF_STATE_SUSPENDED 2
|
||||
|
||||
#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
|
||||
(BLKIF_MAX_SEGMENTS_PER_REQUEST * BLKIF_RING_SIZE)
|
||||
(BLKIF_MAX_SEGMENTS_PER_REQUEST * BLK_RING_SIZE)
|
||||
#define GRANT_INVALID_REF 0
|
||||
|
||||
|
||||
static void connect(struct blkfront_info *);
|
||||
static void blkfront_closing(struct xenbus_device *);
|
||||
static int blkfront_remove(struct xenbus_device *);
|
||||
@@ -551,8 +547,11 @@ static int blkif_queue_request(struct request *req)
|
||||
info->shadow[id].frame[ring_req->nr_segments] =
|
||||
mfn_to_pfn(buffer_mfn);
|
||||
|
||||
ring_req->frame_and_sects[ring_req->nr_segments] =
|
||||
blkif_fas_from_gref(ref, fsect, lsect);
|
||||
ring_req->seg[ring_req->nr_segments] =
|
||||
(struct blkif_request_segment) {
|
||||
.gref = ref,
|
||||
.first_sect = fsect,
|
||||
.last_sect = lsect };
|
||||
|
||||
ring_req->nr_segments++;
|
||||
}
|
||||
@@ -699,8 +698,7 @@ static void blkif_completion(struct blk_shadow *s)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < s->req.nr_segments; i++)
|
||||
gnttab_end_foreign_access(
|
||||
blkif_gref_from_fas(s->req.frame_and_sects[i]), 0, 0UL);
|
||||
gnttab_end_foreign_access(s->req.seg[i].gref, 0, 0UL);
|
||||
}
|
||||
|
||||
static void blkif_recover(struct blkfront_info *info)
|
||||
@@ -740,7 +738,7 @@ static void blkif_recover(struct blkfront_info *info)
|
||||
/* Rewrite any grant references invalidated by susp/resume. */
|
||||
for (j = 0; j < req->nr_segments; j++)
|
||||
gnttab_grant_foreign_access_ref(
|
||||
blkif_gref_from_fas(req->frame_and_sects[j]),
|
||||
req->seg[j].gref,
|
||||
info->xbdev->otherend_id,
|
||||
pfn_to_mfn(info->shadow[req->id].frame[j]),
|
||||
rq_data_dir(
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
#define BLKIF_MAJOR(dev) ((dev)>>8)
|
||||
#define BLKIF_MINOR(dev) ((dev) & 0xff)
|
||||
|
||||
/*
|
||||
* For convenience we distinguish between ide, scsi and 'other' (i.e.,
|
||||
* potentially combinations of the two) in the naming scheme and in a few other
|
||||
|
||||
@@ -177,8 +177,8 @@ extern inline domid_t ID_TO_DOM(unsigned long id)
|
||||
*/
|
||||
struct grant_handle_pair
|
||||
{
|
||||
u16 kernel;
|
||||
u16 user;
|
||||
grant_handle_t kernel;
|
||||
grant_handle_t user;
|
||||
};
|
||||
static struct grant_handle_pair pending_grant_handles[MMAP_PAGES];
|
||||
#define pending_handle(_idx, _i) \
|
||||
@@ -713,7 +713,7 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req)
|
||||
/* Map the remote page to kernel. */
|
||||
map[op].host_addr = kvaddr;
|
||||
map[op].dom = blkif->domid;
|
||||
map[op].ref = blkif_gref_from_fas(req->frame_and_sects[i]);
|
||||
map[op].ref = req->seg[i].gref;
|
||||
map[op].flags = GNTMAP_host_map;
|
||||
/* This needs a bit more thought in terms of interposition:
|
||||
* If we want to be able to modify pages during write using
|
||||
@@ -733,7 +733,7 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req)
|
||||
|
||||
map[op].host_addr = ptep;
|
||||
map[op].dom = blkif->domid;
|
||||
map[op].ref = blkif_gref_from_fas(req->frame_and_sects[i]);
|
||||
map[op].ref = req->seg[i].gref;
|
||||
map[op].flags = GNTMAP_host_map | GNTMAP_application_map
|
||||
| GNTMAP_contains_pte;
|
||||
/* Above interposition comment applies here as well. */
|
||||
@@ -755,17 +755,17 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req)
|
||||
uvaddr = MMAP_VADDR(user_vstart, pending_idx, i/2);
|
||||
kvaddr = MMAP_VADDR(mmap_vstart, pending_idx, i/2);
|
||||
|
||||
if (unlikely(map[i].handle < 0)) {
|
||||
if (unlikely(map[i].status)) {
|
||||
DPRINTK("Error on kernel grant mapping (%d)\n",
|
||||
map[i].handle);
|
||||
ret = map[i].handle;
|
||||
map[i].status);
|
||||
ret = map[i].status;
|
||||
cancel = 1;
|
||||
}
|
||||
|
||||
if (unlikely(map[i+1].handle < 0)) {
|
||||
if (unlikely(map[i+1].status)) {
|
||||
DPRINTK("Error on user grant mapping (%d)\n",
|
||||
map[i+1].handle);
|
||||
ret = map[i+1].handle;
|
||||
map[i+1].status);
|
||||
ret = map[i+1].status;
|
||||
cancel = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ typedef struct blkif_st {
|
||||
|
||||
struct work_struct free_work;
|
||||
|
||||
u16 shmem_handle;
|
||||
grant_handle_t shmem_handle;
|
||||
grant_ref_t shmem_ref;
|
||||
} blkif_t;
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ static int map_frontend_page(blkif_t *blkif, unsigned long shared_page)
|
||||
unlock_vm_area(blkif->blk_ring_area);
|
||||
BUG_ON(ret);
|
||||
|
||||
if (op.handle < 0) {
|
||||
if (op.status) {
|
||||
DPRINTK(" Grant table operation failure !\n");
|
||||
return op.handle;
|
||||
return op.status;
|
||||
}
|
||||
|
||||
blkif->shmem_ref = shared_page;
|
||||
|
||||
@@ -45,9 +45,9 @@ typedef struct netif_st {
|
||||
u8 fe_dev_addr[6];
|
||||
|
||||
/* Physical parameters of the comms window. */
|
||||
u16 tx_shmem_handle;
|
||||
grant_handle_t tx_shmem_handle;
|
||||
grant_ref_t tx_shmem_ref;
|
||||
u16 rx_shmem_handle;
|
||||
grant_handle_t rx_shmem_handle;
|
||||
grant_ref_t rx_shmem_ref;
|
||||
unsigned int evtchn;
|
||||
unsigned int irq;
|
||||
|
||||
@@ -127,9 +127,9 @@ static int map_frontend_pages(
|
||||
unlock_vm_area(netif->comms_area);
|
||||
BUG_ON(ret);
|
||||
|
||||
if (op.handle < 0) {
|
||||
if (op.status) {
|
||||
DPRINTK(" Gnttab failure mapping tx_ring_ref!\n");
|
||||
return op.handle;
|
||||
return op.status;
|
||||
}
|
||||
|
||||
netif->tx_shmem_ref = tx_ring_ref;
|
||||
@@ -145,9 +145,9 @@ static int map_frontend_pages(
|
||||
unlock_vm_area(netif->comms_area);
|
||||
BUG_ON(ret);
|
||||
|
||||
if (op.handle < 0) {
|
||||
if (op.status) {
|
||||
DPRINTK(" Gnttab failure mapping rx_ring_ref!\n");
|
||||
return op.handle;
|
||||
return op.status;
|
||||
}
|
||||
|
||||
netif->rx_shmem_ref = rx_ring_ref;
|
||||
|
||||
@@ -68,7 +68,7 @@ static PEND_RING_IDX dealloc_prod, dealloc_cons;
|
||||
|
||||
static struct sk_buff_head tx_queue;
|
||||
|
||||
static u16 grant_tx_ref[MAX_PENDING_REQS];
|
||||
static grant_handle_t grant_tx_handle[MAX_PENDING_REQS];
|
||||
static gnttab_unmap_grant_ref_t tx_unmap_ops[MAX_PENDING_REQS];
|
||||
static gnttab_map_grant_ref_t tx_map_ops[MAX_PENDING_REQS];
|
||||
|
||||
@@ -412,7 +412,7 @@ inline static void net_tx_action_dealloc(void)
|
||||
pending_idx = dealloc_ring[MASK_PEND_IDX(dc++)];
|
||||
gop->host_addr = MMAP_VADDR(pending_idx);
|
||||
gop->dev_bus_addr = 0;
|
||||
gop->handle = grant_tx_ref[pending_idx];
|
||||
gop->handle = grant_tx_handle[pending_idx];
|
||||
gop++;
|
||||
}
|
||||
ret = HYPERVISOR_grant_table_op(
|
||||
@@ -592,7 +592,7 @@ static void net_tx_action(unsigned long unused)
|
||||
sizeof(txreq));
|
||||
|
||||
/* Check the remap error code. */
|
||||
if (unlikely(mop->handle < 0)) {
|
||||
if (unlikely(mop->status)) {
|
||||
printk(KERN_ALERT "#### netback grant fails\n");
|
||||
make_tx_response(netif, txreq.id, NETIF_RSP_ERROR);
|
||||
netif_put(netif);
|
||||
@@ -605,7 +605,7 @@ static void net_tx_action(unsigned long unused)
|
||||
set_phys_to_machine(
|
||||
__pa(MMAP_VADDR(pending_idx)) >> PAGE_SHIFT,
|
||||
FOREIGN_FRAME(mop->dev_bus_addr >> PAGE_SHIFT));
|
||||
grant_tx_ref[pending_idx] = mop->handle;
|
||||
grant_tx_handle[pending_idx] = mop->handle;
|
||||
|
||||
data_len = (txreq.size > PKT_PROT_LEN) ?
|
||||
PKT_PROT_LEN : txreq.size;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <asm-xen/xen_proc.h>
|
||||
|
||||
static struct proc_dir_entry *privcmd_intf;
|
||||
static struct proc_dir_entry *capabilities_intf;
|
||||
|
||||
static int privcmd_ioctl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long data)
|
||||
@@ -234,6 +235,18 @@ static struct file_operations privcmd_file_ops = {
|
||||
.mmap = privcmd_mmap,
|
||||
};
|
||||
|
||||
static int capabilities_read(char *page, char **start, off_t off,
|
||||
int count, int *eof, void *data)
|
||||
{
|
||||
int len = 0;
|
||||
*page = 0;
|
||||
|
||||
if (xen_start_info->flags & SIF_INITDOMAIN)
|
||||
len = sprintf( page, "control_d\n" );
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
static int __init privcmd_init(void)
|
||||
{
|
||||
@@ -241,6 +254,10 @@ static int __init privcmd_init(void)
|
||||
if (privcmd_intf != NULL)
|
||||
privcmd_intf->proc_fops = &privcmd_file_ops;
|
||||
|
||||
capabilities_intf = create_xen_proc_entry("capabilities", 0400 );
|
||||
if (capabilities_intf != NULL)
|
||||
capabilities_intf->read_proc = capabilities_read;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef struct tpmif_st {
|
||||
|
||||
struct work_struct work;
|
||||
|
||||
u16 shmem_handle;
|
||||
grant_handle_t shmem_handle;
|
||||
grant_ref_t shmem_ref;
|
||||
} tpmif_t;
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ map_frontend_page(tpmif_t *tpmif, unsigned long shared_page)
|
||||
unlock_vm_area(tpmif->tx_area);
|
||||
BUG_ON(ret);
|
||||
|
||||
if (op.handle < 0) {
|
||||
if (op.status) {
|
||||
DPRINTK(" Grant table operation failure !\n");
|
||||
return op.handle;
|
||||
return op.status;
|
||||
}
|
||||
|
||||
tpmif->shmem_ref = shared_page;
|
||||
|
||||
@@ -249,7 +249,7 @@ _packet_write(struct packet *pak,
|
||||
* and send it to the front end.
|
||||
*/
|
||||
tpmif_t *tpmif = pak->tpmif;
|
||||
u16 handle;
|
||||
grant_handle_t handle;
|
||||
int rc = 0;
|
||||
unsigned int i = 0;
|
||||
unsigned int offset = 0;
|
||||
@@ -290,7 +290,7 @@ _packet_write(struct packet *pak,
|
||||
|
||||
handle = map_op.handle;
|
||||
|
||||
if (map_op.handle < 0) {
|
||||
if (map_op.status) {
|
||||
DPRINTK(" Grant table operation failure !\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -427,7 +427,7 @@ packet_read_shmem(struct packet *pak,
|
||||
u32 i = (last_read / PAGE_SIZE);
|
||||
u32 pg_offset = last_read & (PAGE_SIZE - 1);
|
||||
u32 to_copy;
|
||||
u16 handle;
|
||||
grant_handle_t handle;
|
||||
|
||||
tpmif_tx_request_t *tx;
|
||||
tx = &tpmif->tx->ring[0].req;
|
||||
@@ -455,7 +455,7 @@ packet_read_shmem(struct packet *pak,
|
||||
BUG();
|
||||
}
|
||||
|
||||
if (map_op.handle < 0) {
|
||||
if (map_op.status) {
|
||||
DPRINTK(" Grant table operation failure !\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
int request_print(blkif_request_t *req)
|
||||
{
|
||||
int i;
|
||||
unsigned long fas;
|
||||
|
||||
if ( (req->operation == BLKIF_OP_READ) ||
|
||||
(req->operation == BLKIF_OP_WRITE) )
|
||||
@@ -24,12 +23,10 @@ int request_print(blkif_request_t *req)
|
||||
|
||||
|
||||
for (i=0; i < req->nr_segments; i++) {
|
||||
fas = req->frame_and_sects[i];
|
||||
printf(" (pf: 0x%8lx start: %lu stop: %lu)\n",
|
||||
(fas & PAGE_MASK),
|
||||
blkif_first_sect(fas),
|
||||
blkif_last_sect(fas)
|
||||
);
|
||||
printf(" (gref: 0x%8x start: %u stop: %u)\n",
|
||||
req->seg[i].gref,
|
||||
req->seg[i].first_sect,
|
||||
req->seg[i].last_sect);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -244,8 +244,8 @@ int blktap_listen(void)
|
||||
RING_IDX rp, i, pfd_count;
|
||||
|
||||
/* pending rings */
|
||||
blkif_request_t req_pending[BLKIF_RING_SIZE];
|
||||
/* blkif_response_t rsp_pending[BLKIF_RING_SIZE] */;
|
||||
blkif_request_t req_pending[BLK_RING_SIZE];
|
||||
/* blkif_response_t rsp_pending[BLK_RING_SIZE] */;
|
||||
|
||||
/* handler hooks: */
|
||||
request_hook_t *req_hook;
|
||||
|
||||
@@ -18,11 +18,13 @@
|
||||
#include <xen/io/domain_controller.h>
|
||||
#include <xs.h>
|
||||
|
||||
#define BLK_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE)
|
||||
|
||||
/* /dev/xen/blktap resides at device number major=10, minor=202 */
|
||||
#define BLKTAP_MINOR 202
|
||||
|
||||
/* size of the extra VMA area to map in attached pages. */
|
||||
#define BLKTAP_VMA_PAGES BLKIF_RING_SIZE
|
||||
#define BLKTAP_VMA_PAGES BLK_RING_SIZE
|
||||
|
||||
/* blktap IOCTLs: */
|
||||
#define BLKTAP_IOCTL_KICK_FE 1
|
||||
|
||||
@@ -280,8 +280,7 @@ int parallax_probe(blkif_request_t *req, blkif_t *blkif)
|
||||
goto err;
|
||||
|
||||
/* Make sure the buffer is page-sized. */
|
||||
if ( (blkif_first_sect(req->frame_and_sects[0]) != 0) ||
|
||||
(blkif_last_sect (req->frame_and_sects[0]) != 7) )
|
||||
if ( (req->seg[0].first_sect != 0) || (req->seg[0].last_sect != 7) )
|
||||
goto err;
|
||||
|
||||
/* fill the list of devices */
|
||||
@@ -350,17 +349,16 @@ static void read_cb(struct io_ret r, void *in_param)
|
||||
/* Calculate read size and offset within the read block. */
|
||||
|
||||
offset = (param->sector << SECTOR_SHIFT) % BLOCK_SIZE;
|
||||
size = ( blkif_last_sect (req->frame_and_sects[segment]) -
|
||||
blkif_first_sect(req->frame_and_sects[segment]) + 1
|
||||
) << SECTOR_SHIFT;
|
||||
start = blkif_first_sect(req->frame_and_sects[segment])
|
||||
<< SECTOR_SHIFT;
|
||||
size = (req->seg[segment].last_sect - req->seg[segment].first_sect + 1) <<
|
||||
SECTOR_SHIFT;
|
||||
start = req->seg[segment].first_sect << SECTOR_SHIFT;
|
||||
|
||||
DPRINTF("ParallaxRead: sect: %lld (%ld,%ld), "
|
||||
"vblock %llx, "
|
||||
"size %lx\n",
|
||||
param->sector, blkif_first_sect(p->req->frame_and_sects[segment]),
|
||||
blkif_last_sect (p->req->frame_and_sects[segment]),
|
||||
param->sector,
|
||||
p->req->seg[segment].first_sect,
|
||||
p->req->seg[segment].last_sect,
|
||||
param->vblock, size);
|
||||
|
||||
memcpy(dpage + start, spage + offset, size);
|
||||
@@ -506,16 +504,15 @@ int parallax_write(blkif_request_t *req, blkif_t *blkif)
|
||||
/* Calculate read size and offset within the read block. */
|
||||
|
||||
offset = (sector << SECTOR_SHIFT) % BLOCK_SIZE;
|
||||
size = ( blkif_last_sect (req->frame_and_sects[i]) -
|
||||
blkif_first_sect(req->frame_and_sects[i]) + 1
|
||||
) << SECTOR_SHIFT;
|
||||
start = blkif_first_sect(req->frame_and_sects[i]) << SECTOR_SHIFT;
|
||||
size = (req->seg[i].last_sect - req->seg[i].first_sect + 1) <<
|
||||
SECTOR_SHIFT;
|
||||
start = req->seg[i].first_sect << SECTOR_SHIFT;
|
||||
|
||||
DPRINTF("ParallaxWrite: sect: %lld (%ld,%ld), "
|
||||
"vblock %llx, gblock %llx, "
|
||||
"size %lx\n",
|
||||
sector, blkif_first_sect(req->frame_and_sects[i]),
|
||||
blkif_last_sect (req->frame_and_sects[i]),
|
||||
sector,
|
||||
req->seg[i].first_sect, req->seg[i].last_sect,
|
||||
vblock, gblock, size);
|
||||
|
||||
/* XXX: For now we just freak out if they try to write a */
|
||||
|
||||
@@ -233,8 +233,7 @@ int ublkback_request(blkif_t *blkif, blkif_request_t *req, int batch_done)
|
||||
case BLKIF_OP_WRITE:
|
||||
{
|
||||
unsigned long size;
|
||||
|
||||
|
||||
|
||||
batch_count++;
|
||||
|
||||
idx = ID_TO_IDX(req->id);
|
||||
@@ -247,18 +246,17 @@ int ublkback_request(blkif_t *blkif, blkif_request_t *req, int batch_done)
|
||||
|
||||
sector = req->sector_number + (8*i);
|
||||
|
||||
size = blkif_last_sect (req->frame_and_sects[i]) -
|
||||
blkif_first_sect(req->frame_and_sects[i]) + 1;
|
||||
size = req->seg[i].last_sect - req->seg[i].first_sect + 1;
|
||||
|
||||
if (blkif_first_sect(req->frame_and_sects[i]) != 0)
|
||||
DPRINTF("iWR: sec_nr: %10llu sec: %10llu (%1lu,%1lu) pos: %15lu\n",
|
||||
req->sector_number, sector,
|
||||
blkif_first_sect(req->frame_and_sects[i]),
|
||||
blkif_last_sect (req->frame_and_sects[i]),
|
||||
(long)(sector << SECTOR_SHIFT));
|
||||
if (req->seg[i].first_sect != 0)
|
||||
DPRINTF("iWR: sec_nr: %10llu sec: %10llu (%1lu,%1lu) "
|
||||
"pos: %15lu\n",
|
||||
req->sector_number, sector,
|
||||
req->seg[i].first_sect, req->seg[i].last_sect,
|
||||
(long)(sector << SECTOR_SHIFT));
|
||||
|
||||
spage = (char *)MMAP_VADDR(ID_TO_IDX(req->id), i);
|
||||
spage += blkif_first_sect(req->frame_and_sects[i]) << SECTOR_SHIFT;
|
||||
spage += req->seg[i].first_sect << SECTOR_SHIFT;
|
||||
|
||||
/*convert size and sector to byte offsets */
|
||||
size <<= SECTOR_SHIFT;
|
||||
@@ -297,19 +295,17 @@ int ublkback_request(blkif_t *blkif, blkif_request_t *req, int batch_done)
|
||||
|
||||
sector = req->sector_number + (8*i);
|
||||
|
||||
size = blkif_last_sect (req->frame_and_sects[i]) -
|
||||
blkif_first_sect(req->frame_and_sects[i]) + 1;
|
||||
|
||||
size = req->seg[i].last_sect - req->seg[i].first_sect + 1;
|
||||
|
||||
dpage = (char *)MMAP_VADDR(ID_TO_IDX(req->id), i);
|
||||
dpage += blkif_first_sect(req->frame_and_sects[i]) << SECTOR_SHIFT;
|
||||
dpage += req->seg[i].first_sect << SECTOR_SHIFT;
|
||||
|
||||
if (blkif_first_sect(req->frame_and_sects[i]) != 0)
|
||||
DPRINTF("iRD : sec_nr: %10llu sec: %10llu (%1lu,%1lu) "
|
||||
"pos: %15lu dpage: %p\n",
|
||||
req->sector_number, sector,
|
||||
blkif_first_sect(req->frame_and_sects[i]),
|
||||
blkif_last_sect (req->frame_and_sects[i]),
|
||||
(long)(sector << SECTOR_SHIFT), dpage);
|
||||
if (req->seg[i].first_sect != 0)
|
||||
DPRINTF("iRD : sec_nr: %10llu sec: %10llu (%1lu,%1lu) "
|
||||
"pos: %15lu dpage: %p\n",
|
||||
req->sector_number, sector,
|
||||
req->seg[i].first_sect, req->seg[i].last_sect,
|
||||
(long)(sector << SECTOR_SHIFT), dpage);
|
||||
|
||||
/*convert size and sector to byte offsets */
|
||||
size <<= SECTOR_SHIFT;
|
||||
|
||||
@@ -376,9 +376,6 @@ static void remove_domain(struct domain *dom)
|
||||
|
||||
static void cleanup_domain(struct domain *d)
|
||||
{
|
||||
if (!buffer_empty(&d->buffer))
|
||||
return;
|
||||
|
||||
if (d->tty_fd != -1) {
|
||||
close(d->tty_fd);
|
||||
d->tty_fd = -1;
|
||||
|
||||
@@ -365,9 +365,9 @@ int xc_domain_get_vcpu_info(int xc_handle,
|
||||
|
||||
int xc_domain_ioport_permission(int xc_handle,
|
||||
uint32_t domid,
|
||||
uint16_t first_port,
|
||||
uint16_t nr_ports,
|
||||
uint16_t allow_access)
|
||||
uint32_t first_port,
|
||||
uint32_t nr_ports,
|
||||
uint32_t allow_access)
|
||||
{
|
||||
DECLARE_DOM0_OP;
|
||||
|
||||
|
||||
@@ -42,9 +42,10 @@ do_gnttab_op(int xc_handle,
|
||||
int xc_gnttab_map_grant_ref(int xc_handle,
|
||||
uint64_t host_virt_addr,
|
||||
uint32_t dom,
|
||||
uint16_t ref,
|
||||
grant_ref_t ref,
|
||||
uint16_t flags,
|
||||
int16_t *handle,
|
||||
int16_t *status,
|
||||
grant_handle_t *handle,
|
||||
uint64_t *dev_bus_addr)
|
||||
{
|
||||
struct gnttab_map_grant_ref op;
|
||||
@@ -58,6 +59,7 @@ int xc_gnttab_map_grant_ref(int xc_handle,
|
||||
if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_map_grant_ref,
|
||||
&op, 1)) == 0 )
|
||||
{
|
||||
*status = op.status;
|
||||
*handle = op.handle;
|
||||
*dev_bus_addr = op.dev_bus_addr;
|
||||
}
|
||||
@@ -69,7 +71,7 @@ int xc_gnttab_map_grant_ref(int xc_handle,
|
||||
int xc_gnttab_unmap_grant_ref(int xc_handle,
|
||||
uint64_t host_virt_addr,
|
||||
uint64_t dev_bus_addr,
|
||||
uint16_t handle,
|
||||
grant_handle_t handle,
|
||||
int16_t *status)
|
||||
{
|
||||
struct gnttab_unmap_grant_ref op;
|
||||
|
||||
@@ -221,7 +221,7 @@ int xc_linux_restore(int xc_handle, int io_fd,
|
||||
|
||||
if(xc_domain_memory_increase_reservation(
|
||||
xc_handle, dom, max_pfn, 0, 0, NULL) != 0) {
|
||||
ERR("Failed to increase reservation by %lx KB\n", PFN_TO_KB(max_pfn));
|
||||
ERR("Failed to increase reservation by %lx KB", PFN_TO_KB(max_pfn));
|
||||
errno = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
@@ -487,7 +487,7 @@ int xc_linux_restore(int xc_handle, int io_fd,
|
||||
for(k = 0; k < j; k++) {
|
||||
if(!uncanonicalize_pagetable(L1TAB,
|
||||
region_base + k*PAGE_SIZE)) {
|
||||
ERR("failed uncanonicalize pt!\n");
|
||||
ERR("failed uncanonicalize pt!");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,13 +523,13 @@ static unsigned long *xc_map_m2p(int xc_handle,
|
||||
|
||||
xmml.max_extents = m2p_chunks;
|
||||
if (!(xmml.extent_start = malloc(m2p_chunks * sizeof(unsigned long)))) {
|
||||
ERR("failed to allocate space for m2p mfns!\n");
|
||||
ERR("failed to allocate space for m2p mfns");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (xc_memory_op(xc_handle, XENMEM_machphys_mfn_list, &xmml) ||
|
||||
(xmml.nr_extents != m2p_chunks)) {
|
||||
ERR("xc_get_m2p_mfns:");
|
||||
ERR("xc_get_m2p_mfns");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ static unsigned long *xc_map_m2p(int xc_handle,
|
||||
}
|
||||
|
||||
if (!(entries = malloc(m2p_chunks * sizeof(privcmd_mmap_entry_t)))) {
|
||||
ERR("failed to allocate space for mmap entries!\n");
|
||||
ERR("failed to allocate space for mmap entries");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -794,7 +794,7 @@ int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
|
||||
pfn_batch = calloc(MAX_BATCH_SIZE, sizeof(unsigned long));
|
||||
|
||||
if ((pfn_type == NULL) || (pfn_batch == NULL)) {
|
||||
ERR("failed to alloc memory for pfn_type and/or pfn_batch arays.");
|
||||
ERR("failed to alloc memory for pfn_type and/or pfn_batch arrays");
|
||||
errno = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <sys/ptrace.h>
|
||||
#include <xen/xen.h>
|
||||
#include <xen/dom0_ops.h>
|
||||
#include <xen/grant_table.h>
|
||||
#include <xen/version.h>
|
||||
#include <xen/event_channel.h>
|
||||
#include <xen/sched.h>
|
||||
@@ -374,9 +375,9 @@ int xc_domain_memory_decrease_reservation(int xc_handle,
|
||||
|
||||
int xc_domain_ioport_permission(int xc_handle,
|
||||
uint32_t domid,
|
||||
uint16_t first_port,
|
||||
uint16_t nr_ports,
|
||||
uint16_t allow_access);
|
||||
uint32_t first_port,
|
||||
uint32_t nr_ports,
|
||||
uint32_t allow_access);
|
||||
|
||||
unsigned long xc_make_page_below_4G(int xc_handle, uint32_t domid,
|
||||
unsigned long mfn);
|
||||
@@ -475,15 +476,16 @@ int xc_grant_interface_close(int xc_handle);
|
||||
int xc_gnttab_map_grant_ref(int xc_handle,
|
||||
uint64_t host_virt_addr,
|
||||
uint32_t dom,
|
||||
uint16_t ref,
|
||||
grant_ref_t ref,
|
||||
uint16_t flags,
|
||||
int16_t *handle,
|
||||
int16_t *status,
|
||||
grant_handle_t *handle,
|
||||
uint64_t *dev_bus_addr);
|
||||
|
||||
int xc_gnttab_unmap_grant_ref(int xc_handle,
|
||||
uint64_t host_virt_addr,
|
||||
uint64_t dev_bus_addr,
|
||||
uint16_t handle,
|
||||
grant_handle_t handle,
|
||||
int16_t *status);
|
||||
|
||||
int xc_gnttab_setup_table(int xc_handle,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define PROGRESS 0
|
||||
|
||||
#define ERR(_f, _a...) do { \
|
||||
fprintf(stderr, _f "\n" , ## _a); \
|
||||
fprintf(stderr, _f ": %d\n" , ## _a, errno);\
|
||||
fflush(stderr); } \
|
||||
while (0)
|
||||
|
||||
|
||||
@@ -575,6 +575,13 @@ static PyObject *pyxc_readconsolering(XcObject *self,
|
||||
return PyString_FromStringAndSize(str, count);
|
||||
}
|
||||
|
||||
|
||||
static unsigned long pages_to_mb(unsigned long pages)
|
||||
{
|
||||
return (pages * (XC_PAGE_SIZE / 1024) + 1023) / 1024;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *pyxc_physinfo(XcObject *self)
|
||||
{
|
||||
xc_physinfo_t info;
|
||||
@@ -599,8 +606,8 @@ static PyObject *pyxc_physinfo(XcObject *self)
|
||||
"cores_per_socket", info.cores_per_socket,
|
||||
"sockets_per_node", info.sockets_per_node,
|
||||
"nr_nodes", info.nr_nodes,
|
||||
"total_pages", info.total_pages,
|
||||
"free_pages", info.free_pages,
|
||||
"total_memory", pages_to_mb(info.total_pages),
|
||||
"free_memory", pages_to_mb(info.free_pages),
|
||||
"cpu_khz", info.cpu_khz,
|
||||
"hw_caps", cpu_cap);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ import xen.util.auxbin
|
||||
|
||||
import xen.lowlevel.xc
|
||||
|
||||
from xen.xend.xenstore.xsutil import IntroduceDomain
|
||||
|
||||
from XendError import XendError
|
||||
from XendLogging import log
|
||||
|
||||
|
||||
@@ -232,6 +232,11 @@ class Xend:
|
||||
return self.xendPost(self.domainurl(id),
|
||||
{'op' : 'pause' })
|
||||
|
||||
def xend_domain_rename(self, id, name):
|
||||
return self.xendPost(self.domainurl(id),
|
||||
{'op' : 'rename',
|
||||
'name' : name})
|
||||
|
||||
def xend_domain_shutdown(self, id, reason):
|
||||
return self.xendPost(self.domainurl(id),
|
||||
{'op' : 'shutdown',
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
|
||||
@@ -35,7 +36,6 @@ from xen.xend import XendRoot
|
||||
from xen.xend import XendCheckpoint
|
||||
from xen.xend.XendError import XendError
|
||||
from xen.xend.XendLogging import log
|
||||
from xen.xend.server import relocate
|
||||
from xen.xend.xenstore.xswatch import xswatch
|
||||
|
||||
|
||||
@@ -54,15 +54,16 @@ class XendDomain:
|
||||
## public:
|
||||
|
||||
def __init__(self):
|
||||
# Hack alert. Python does not support mutual imports, but XendDomainInfo
|
||||
# needs access to the XendDomain instance to look up domains. Attempting
|
||||
# to import XendDomain from XendDomainInfo causes unbounded recursion.
|
||||
# So we stuff the XendDomain instance (self) into xroot's components.
|
||||
xroot.add_component("xen.xend.XendDomain", self)
|
||||
|
||||
self.domains = {}
|
||||
self.domains_lock = threading.RLock()
|
||||
|
||||
|
||||
# This must be called only the once, by instance() below. It is separate
|
||||
# from the constructor because XendDomainInfo calls back into this class
|
||||
# in order to check the uniqueness of domain names. This means that
|
||||
# instance() must be able to return a valid instance of this class even
|
||||
# during this initialisation.
|
||||
def init(self):
|
||||
self.domains_lock.acquire()
|
||||
try:
|
||||
self._add_domain(
|
||||
@@ -389,10 +390,15 @@ class XendDomain:
|
||||
dominfo = self.domain_lookup(domid)
|
||||
|
||||
port = xroot.get_xend_relocation_port()
|
||||
sock = relocate.setupRelocation(dst, port)
|
||||
try:
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.connect((dst, port))
|
||||
except socket.error, err:
|
||||
raise XendError("can't connect: %s" % err[1])
|
||||
|
||||
sock.send("receive\n")
|
||||
XendCheckpoint.save(sock.fileno(), dominfo, live)
|
||||
|
||||
|
||||
|
||||
def domain_save(self, domid, dst):
|
||||
"""Start saving a domain to file.
|
||||
@@ -527,4 +533,5 @@ def instance():
|
||||
inst
|
||||
except:
|
||||
inst = XendDomain()
|
||||
inst.init()
|
||||
return inst
|
||||
@@ -33,14 +33,14 @@ import xen.lowlevel.xc
|
||||
from xen.util import asserts
|
||||
from xen.util.blkif import blkdev_uname_to_file
|
||||
|
||||
from xen.xend import image
|
||||
from xen.xend import sxp
|
||||
from xen.xend import XendRoot
|
||||
import image
|
||||
import sxp
|
||||
import uuid
|
||||
import XendDomain
|
||||
import XendRoot
|
||||
|
||||
from xen.xend.XendBootloader import bootloader
|
||||
from xen.xend.XendError import XendError, VmError
|
||||
from xen.xend.XendRoot import get_component
|
||||
|
||||
import uuid
|
||||
|
||||
from xen.xend.xenstore.xstransact import xstransact
|
||||
from xen.xend.xenstore.xsutil import GetDomainPath, IntroduceDomain
|
||||
@@ -338,9 +338,8 @@ def parseConfig(config):
|
||||
|
||||
|
||||
def domain_by_name(name):
|
||||
# See comment in XendDomain constructor.
|
||||
xd = get_component('xen.xend.XendDomain')
|
||||
return xd.domain_lookup_by_name_nr(name)
|
||||
return XendDomain.instance().domain_lookup_by_name_nr(name)
|
||||
|
||||
|
||||
def shutdown_reason(code):
|
||||
"""Get a shutdown reason from a code.
|
||||
@@ -1343,8 +1342,7 @@ class XendDomainInfo:
|
||||
|
||||
new_dom = None
|
||||
try:
|
||||
xd = get_component('xen.xend.XendDomain')
|
||||
new_dom = xd.domain_create(config)
|
||||
new_dom = XendDomain.instance().domain_create(config)
|
||||
new_dom.unpause()
|
||||
new_dom.removeVm(RESTART_IN_PROGRESS)
|
||||
except:
|
||||
|
||||
@@ -57,30 +57,45 @@ class XendNode:
|
||||
['machine', mch]]
|
||||
|
||||
def physinfo(self):
|
||||
pinfo = self.xc.physinfo()
|
||||
info = [['nr_cpus', pinfo['nr_nodes']*pinfo['sockets_per_node']*pinfo['cores_per_socket']*pinfo['threads_per_core']],
|
||||
['nr_nodes', pinfo['nr_nodes']],
|
||||
['sockets_per_node', pinfo['sockets_per_node']],
|
||||
['cores_per_socket', pinfo['cores_per_socket']],
|
||||
['threads_per_core', pinfo['threads_per_core']],
|
||||
['cpu_mhz', pinfo['cpu_khz']/1000],
|
||||
['hw_caps', pinfo['hw_caps']],
|
||||
['memory', pinfo['total_pages']/256],
|
||||
['free_memory', pinfo['free_pages']/256]]
|
||||
return info
|
||||
|
||||
info = self.xc.physinfo()
|
||||
|
||||
info['nr_cpus'] = (info['nr_nodes'] *
|
||||
info['sockets_per_node'] *
|
||||
info['cores_per_socket'] *
|
||||
info['threads_per_core'])
|
||||
info['cpu_mhz'] = info['cpu_khz'] / 1000
|
||||
|
||||
ITEM_ORDER = ['nr_cpus',
|
||||
'nr_nodes',
|
||||
'sockets_per_node',
|
||||
'cores_per_socket',
|
||||
'threads_per_core',
|
||||
'cpu_mhz',
|
||||
'hw_caps',
|
||||
'total_memory',
|
||||
'free_memory',
|
||||
]
|
||||
|
||||
return [[k, info[k]] for k in ITEM_ORDER]
|
||||
|
||||
|
||||
def xeninfo(self):
|
||||
xinfo = self.xc.xeninfo()
|
||||
return [['xen_major', xinfo['xen_major']],
|
||||
['xen_minor', xinfo['xen_minor']],
|
||||
['xen_extra', xinfo['xen_extra']],
|
||||
['xen_caps', xinfo['xen_caps']],
|
||||
['platform_params',xinfo['platform_params']],
|
||||
['xen_changeset', xinfo['xen_changeset']],
|
||||
['cc_compiler', xinfo['cc_compiler']],
|
||||
['cc_compile_by', xinfo['cc_compile_by']],
|
||||
['cc_compile_domain', xinfo['cc_compile_domain']],
|
||||
['cc_compile_date', xinfo['cc_compile_date']]]
|
||||
info = self.xc.xeninfo()
|
||||
|
||||
ITEM_ORDER = ['xen_major',
|
||||
'xen_minor',
|
||||
'xen_extra',
|
||||
'xen_caps',
|
||||
'platform_params',
|
||||
'xen_changeset',
|
||||
'cc_compiler',
|
||||
'cc_compile_by',
|
||||
'cc_compile_domain',
|
||||
'cc_compile_date',
|
||||
]
|
||||
|
||||
return [[k, info[k]] for k in ITEM_ORDER]
|
||||
|
||||
|
||||
def instance():
|
||||
global inst
|
||||
|
||||
@@ -100,7 +100,7 @@ class XendClientProtocol:
|
||||
"""
|
||||
return self.xendRequest(url, "POST", args)
|
||||
|
||||
def handleStatus(self, version, status, message):
|
||||
def handleStatus(self, _, status, message):
|
||||
"""Handle the status returned from the request.
|
||||
"""
|
||||
status = int(status)
|
||||
@@ -114,8 +114,8 @@ class XendClientProtocol:
|
||||
"""Handle the data returned in response to the request.
|
||||
"""
|
||||
if data is None: return None
|
||||
type = self.getHeader('Content-Type')
|
||||
if type != sxp.mime_type:
|
||||
typ = self.getHeader('Content-Type')
|
||||
if typ != sxp.mime_type:
|
||||
return data
|
||||
try:
|
||||
pin = sxp.Parser()
|
||||
@@ -205,5 +205,5 @@ class UnixXendClientProtocol(HttpXendClientProtocol):
|
||||
path = xroot.get_xend_unix_path()
|
||||
self.path = path
|
||||
|
||||
def makeConnection(self, url):
|
||||
def makeConnection(self, _):
|
||||
return UnixConnection(self.path)
|
||||
@@ -93,24 +93,6 @@ class XendRoot:
|
||||
self.configure()
|
||||
|
||||
|
||||
def add_component(self, name, val):
|
||||
"""Add a xend component.
|
||||
|
||||
@param name: component name
|
||||
@param val: component object
|
||||
"""
|
||||
self.components[name] = val
|
||||
|
||||
def get_component(self, name):
|
||||
"""Get a xend component from its name.
|
||||
This is used as a work-round for problems caused by mutually
|
||||
recursive imports.
|
||||
|
||||
@param name: component name
|
||||
@return: component object (or None)
|
||||
"""
|
||||
return self.components.get(name)
|
||||
|
||||
def _logError(self, fmt, *args):
|
||||
"""Logging function to log to stderr. We use this for XendRoot log
|
||||
messages because they may be logged before the logger has been
|
||||
@@ -189,7 +171,7 @@ class XendRoot:
|
||||
v = self.get_config_value(name, val)
|
||||
try:
|
||||
return int(v)
|
||||
except Exception, ex:
|
||||
except Exception:
|
||||
raise XendError("invalid xend config %s: expected int: %s" % (name, v))
|
||||
|
||||
def get_xend_http_server(self):
|
||||
@@ -277,21 +259,3 @@ def instance():
|
||||
except:
|
||||
inst = XendRoot()
|
||||
return inst
|
||||
|
||||
def add_component(name, val):
|
||||
"""Register a component with XendRoot.
|
||||
This is used to work-round import cycles.
|
||||
|
||||
@param name: component name
|
||||
@param val: component value (often a module)
|
||||
"""
|
||||
return instance().add_component(name, val)
|
||||
|
||||
def get_component(name):
|
||||
"""Get a component.
|
||||
This is used to work-round import cycles.
|
||||
|
||||
@param name: component name
|
||||
@return component or None
|
||||
"""
|
||||
return instance().get_component(name)
|
||||
@@ -55,6 +55,10 @@ class SrvDomain(SrvDir):
|
||||
req.setResponseCode(http.ACCEPTED)
|
||||
req.setHeader("Location", "%s/.." % req.prePathURL())
|
||||
|
||||
def op_rename(self, _, req):
|
||||
self.acceptCommand(req)
|
||||
return self.dom.setName(req.args['name'][0])
|
||||
|
||||
def op_shutdown(self, _, req):
|
||||
self.acceptCommand(req)
|
||||
return self.dom.shutdown(req.args['reason'][0])
|
||||
|
||||
@@ -71,8 +71,8 @@ class NetifController(DevController):
|
||||
script = os.path.join(xroot.network_script_dir,
|
||||
sxp.child_value(config, 'script',
|
||||
xroot.get_vif_script()))
|
||||
type = sxp.child_value(config, 'type')
|
||||
if type == 'ioemu':
|
||||
typ = sxp.child_value(config, 'type')
|
||||
if typ == 'ioemu':
|
||||
return (None,{},{})
|
||||
bridge = sxp.child_value(config, 'bridge')
|
||||
mac = sxp.child_value(config, 'mac')
|
||||
|
||||
@@ -16,23 +16,18 @@
|
||||
# Copyright (C) 2005 XenSource Ltd
|
||||
#============================================================================
|
||||
|
||||
import socket
|
||||
import sys
|
||||
import StringIO
|
||||
|
||||
from xen.web import protocol, tcp, unix
|
||||
|
||||
from xen.xend import sxp
|
||||
from xen.xend.XendError import XendError
|
||||
from xen.xend import XendDomain
|
||||
from xen.xend import XendRoot
|
||||
from xen.xend.XendError import XendError
|
||||
from xen.xend.XendLogging import log
|
||||
|
||||
|
||||
xroot = XendRoot.instance()
|
||||
|
||||
|
||||
DEBUG = 0
|
||||
|
||||
class RelocationProtocol(protocol.Protocol):
|
||||
"""Asynchronous handler for a connected relocation socket.
|
||||
"""
|
||||
@@ -111,8 +106,8 @@ class RelocationProtocol(protocol.Protocol):
|
||||
if self.transport:
|
||||
self.send_reply(["ready", name])
|
||||
self.transport.sock.setblocking(1)
|
||||
xd = xroot.get_component("xen.xend.XendDomain")
|
||||
xd.domain_restore_fd(self.transport.sock.fileno())
|
||||
XendDomain.instance().domain_restore_fd(
|
||||
self.transport.sock.fileno())
|
||||
self.transport.sock.setblocking(0)
|
||||
else:
|
||||
log.error(name + ": no transport")
|
||||
@@ -120,6 +115,7 @@ class RelocationProtocol(protocol.Protocol):
|
||||
|
||||
|
||||
def listenRelocation():
|
||||
xroot = XendRoot.instance()
|
||||
if xroot.get_xend_unix_server():
|
||||
path = '/var/lib/xend/relocation-socket'
|
||||
unix.listenUNIX(path, RelocationProtocol)
|
||||
@@ -128,15 +124,3 @@ def listenRelocation():
|
||||
interface = xroot.get_xend_relocation_address()
|
||||
l = tcp.listenTCP(port, RelocationProtocol, interface=interface)
|
||||
l.setCloExec()
|
||||
|
||||
def setupRelocation(dst, port):
|
||||
try:
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.connect((dst, port))
|
||||
except socket.error, err:
|
||||
raise XendError("can't connect: %s" % err[1])
|
||||
|
||||
sock.send("receive\n")
|
||||
print sock.recv(80)
|
||||
|
||||
return sock
|
||||
@@ -6,8 +6,8 @@ import xen.xend.sxp
|
||||
class test_sxp(unittest.TestCase):
|
||||
|
||||
def testAllFromString(self):
|
||||
def t(input, expected):
|
||||
self.assertEqual(xen.xend.sxp.all_from_string(input), expected)
|
||||
def t(inp, expected):
|
||||
self.assertEqual(xen.xend.sxp.all_from_string(inp), expected)
|
||||
|
||||
t('String', ['String'])
|
||||
t('(String Thing)', [['String', 'Thing']])
|
||||
|
||||
@@ -21,9 +21,9 @@ class test_uuid(unittest.TestCase):
|
||||
self.assertEqual(uuid.toString(inp), expected)
|
||||
self.assertEqual(uuid.fromString(expected), inp)
|
||||
|
||||
t([0 for i in range(0, 16)], "00000000-0000-0000-0000-000000000000")
|
||||
t([0 for _ in range(0, 16)], "00000000-00000000-00000000-00000000")
|
||||
t([185, 158, 125, 206, 250, 178, 125, 57, 2, 6, 162, 74, 178, 236,
|
||||
196, 5], "b99e7dce-fab2-7d39-0206-a24ab2ecc405")
|
||||
196, 5], "b99e7dce-fab27d39-0206a24a-b2ecc405")
|
||||
|
||||
|
||||
def test_suite():
|
||||
|
||||
@@ -25,14 +25,14 @@ import commands
|
||||
import random
|
||||
|
||||
|
||||
def getUuidUuidgen(random = True):
|
||||
def getUuidUuidgen(randomly = True):
|
||||
"""Generate a UUID using the command uuidgen.
|
||||
|
||||
If random is true (default) generates a random uuid.
|
||||
If random is false generates a time-based uuid.
|
||||
If randomly is true (default) generates a random uuid.
|
||||
If randomly is false generates a time-based uuid.
|
||||
"""
|
||||
cmd = "uuidgen"
|
||||
if random:
|
||||
if randomly:
|
||||
cmd += " -r"
|
||||
else:
|
||||
cmd += " -t"
|
||||
@@ -42,7 +42,7 @@ def getUuidUuidgen(random = True):
|
||||
def getUuidRandom():
|
||||
"""Generate a random UUID."""
|
||||
|
||||
return [ random.randint(0, 255) for i in range(0, 16) ]
|
||||
return [ random.randint(0, 255) for _ in range(0, 16) ]
|
||||
|
||||
|
||||
#uuidFactory = getUuidUuidgen
|
||||
|
||||
@@ -198,9 +198,10 @@ class xstransact:
|
||||
if len(tup) == 2:
|
||||
(key, val) = tup
|
||||
try:
|
||||
fmt = { str : "%s",
|
||||
int : "%i",
|
||||
float : "%f",
|
||||
fmt = { str : "%s",
|
||||
int : "%i",
|
||||
float : "%f",
|
||||
long : "%li",
|
||||
type(None) : None }[type(val)]
|
||||
except KeyError:
|
||||
raise TypeError
|
||||
|
||||
+57
-42
@@ -70,6 +70,7 @@ vcpu_list_help = "vcpu-list <DomId> List the VCPUs for a domain (
|
||||
vcpu_pin_help = "vcpu-pin <DomId> <VCPU> <CPUs> Set which cpus a VCPU can use"
|
||||
dmesg_help = "dmesg [--clear] Read or clear Xen's message buffer"
|
||||
info_help = "info Get information about the xen host"
|
||||
rename_help = "rename <DomId> <New Name> Rename a domain"
|
||||
log_help = "log Print the xend log"
|
||||
sched_bvt_help = """sched-bvt <Parameters> Set Borrowed Virtual Time scheduler
|
||||
parameters"""
|
||||
@@ -125,6 +126,7 @@ domain_commands = [
|
||||
"migrate",
|
||||
"pause",
|
||||
"reboot",
|
||||
"rename",
|
||||
"restore",
|
||||
"save",
|
||||
"shutdown",
|
||||
@@ -226,10 +228,20 @@ for command in all_commands:
|
||||
#
|
||||
####################################################################
|
||||
|
||||
def arg_check(args,num,name):
|
||||
if len(args) < num:
|
||||
err("'xm %s' requires %s argument(s)!\n" % (name, num))
|
||||
usage(name)
|
||||
def arg_check(args, name, lo, hi = -1):
|
||||
n = len(args)
|
||||
|
||||
if hi == -1:
|
||||
if n != lo:
|
||||
err("'xm %s' requires %d argument%s.\n" % (name, lo,
|
||||
lo > 1 and 's' or ''))
|
||||
usage(name)
|
||||
else:
|
||||
if n < lo or n > hi:
|
||||
err("'xm %s' requires between %d and %d arguments.\n" %
|
||||
(name, lo, hi))
|
||||
usage(name)
|
||||
|
||||
|
||||
def unit(c):
|
||||
if not c.isalpha():
|
||||
@@ -259,14 +271,17 @@ def int_unit(str, dest):
|
||||
def err(msg):
|
||||
print >>sys.stderr, "Error:", msg
|
||||
|
||||
def handle_xend_error(cmd, dom, ex):
|
||||
def handle_xend_error(cmd, args, ex):
|
||||
non_option = filter(lambda x: x[0] != '-', args)
|
||||
dom = len(non_option) > 0 and non_option[0] or None
|
||||
|
||||
error = str(ex)
|
||||
if error == "Not found" and dom != None:
|
||||
err("Domain '%s' not found when running 'xm %s'" % (dom, cmd))
|
||||
sys.exit(1)
|
||||
else:
|
||||
err(error)
|
||||
sys.exit(1)
|
||||
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
#########################################################################
|
||||
@@ -276,7 +291,7 @@ def handle_xend_error(cmd, dom, ex):
|
||||
#########################################################################
|
||||
|
||||
def xm_save(args):
|
||||
arg_check(args,2,"save")
|
||||
arg_check(args, "save", 2)
|
||||
|
||||
dom = args[0] # TODO: should check if this exists
|
||||
savefile = os.path.abspath(args[1])
|
||||
@@ -289,7 +304,7 @@ def xm_save(args):
|
||||
server.xend_domain_save(dom, savefile)
|
||||
|
||||
def xm_restore(args):
|
||||
arg_check(args,1,"restore")
|
||||
arg_check(args, "restore", 1)
|
||||
|
||||
savefile = os.path.abspath(args[0])
|
||||
|
||||
@@ -479,24 +494,30 @@ def xm_vcpu_list(args):
|
||||
|
||||
|
||||
def xm_reboot(args):
|
||||
arg_check(args,1,"reboot")
|
||||
arg_check(args, "reboot", 1, 4)
|
||||
from xen.xm import shutdown
|
||||
shutdown.main(["shutdown", "-R"] + args)
|
||||
|
||||
def xm_pause(args):
|
||||
arg_check(args, 1, "pause")
|
||||
arg_check(args, "pause", 1)
|
||||
dom = args[0]
|
||||
|
||||
from xen.xend.XendClient import server
|
||||
server.xend_domain_pause(dom)
|
||||
|
||||
def xm_unpause(args):
|
||||
arg_check(args, 1, "unpause")
|
||||
arg_check(args, "unpause", 1)
|
||||
dom = args[0]
|
||||
|
||||
from xen.xend.XendClient import server
|
||||
server.xend_domain_unpause(dom)
|
||||
|
||||
def xm_rename(args):
|
||||
arg_check(args, "rename", 2)
|
||||
|
||||
from xen.xend.XendClient import server
|
||||
server.xend_domain_rename(args[0], args[1])
|
||||
|
||||
def xm_subcommand(command, args):
|
||||
cmd = __import__(command, globals(), locals(), 'xen.xm')
|
||||
cmd.main([command] + args)
|
||||
@@ -517,7 +538,7 @@ def cpu_make_map(cpulist):
|
||||
return cpus
|
||||
|
||||
def xm_vcpu_pin(args):
|
||||
arg_check(args, 3, "vcpu-pin")
|
||||
arg_check(args, "vcpu-pin", 3)
|
||||
|
||||
dom = args[0]
|
||||
vcpu = int(args[1])
|
||||
@@ -527,7 +548,7 @@ def xm_vcpu_pin(args):
|
||||
server.xend_domain_pincpu(dom, vcpu, cpumap)
|
||||
|
||||
def xm_mem_max(args):
|
||||
arg_check(args, 2, "mem-max")
|
||||
arg_check(args, "mem-max", 2)
|
||||
|
||||
dom = args[0]
|
||||
mem = int_unit(args[1], 'm')
|
||||
@@ -536,7 +557,7 @@ def xm_mem_max(args):
|
||||
server.xend_domain_maxmem_set(dom, mem)
|
||||
|
||||
def xm_mem_set(args):
|
||||
arg_check(args, 2, "mem-set")
|
||||
arg_check(args, "mem-set", 2)
|
||||
|
||||
dom = args[0]
|
||||
mem_target = int_unit(args[1], 'm')
|
||||
@@ -545,13 +566,13 @@ def xm_mem_set(args):
|
||||
server.xend_domain_mem_target_set(dom, mem_target)
|
||||
|
||||
def xm_set_vcpus(args):
|
||||
arg_check(args, 2, "set-vcpus")
|
||||
arg_check(args, "set-vcpus", 2)
|
||||
|
||||
from xen.xend.XendClient import server
|
||||
server.xend_domain_set_vcpus(args[0], int(args[1]))
|
||||
|
||||
def xm_domid(args):
|
||||
arg_check(args, 1, "domid")
|
||||
arg_check(args, "domid", 1)
|
||||
|
||||
name = args[0]
|
||||
|
||||
@@ -560,7 +581,7 @@ def xm_domid(args):
|
||||
print sxp.child_value(dom, 'domid')
|
||||
|
||||
def xm_domname(args):
|
||||
arg_check(args, 1, "domname")
|
||||
arg_check(args, "domname", 1)
|
||||
|
||||
name = args[0]
|
||||
|
||||
@@ -569,21 +590,21 @@ def xm_domname(args):
|
||||
print sxp.child_value(dom, 'name')
|
||||
|
||||
def xm_sched_bvt(args):
|
||||
arg_check(args, 6, "sched-bvt")
|
||||
arg_check(args, "sched-bvt", 6)
|
||||
dom = args[0]
|
||||
v = map(long, args[1:6])
|
||||
from xen.xend.XendClient import server
|
||||
server.xend_domain_cpu_bvt_set(dom, *v)
|
||||
|
||||
def xm_sched_bvt_ctxallow(args):
|
||||
arg_check(args, 1, "sched-bvt-ctxallow")
|
||||
arg_check(args, "sched-bvt-ctxallow", 1)
|
||||
|
||||
slice = int(args[0])
|
||||
from xen.xend.XendClient import server
|
||||
server.xend_node_cpu_bvt_slice_set(slice)
|
||||
|
||||
def xm_sched_sedf(args):
|
||||
arg_check(args, 6, "sched-sedf")
|
||||
arg_check(args, "sched-sedf", 6)
|
||||
|
||||
dom = args[0]
|
||||
v = map(int, args[1:6])
|
||||
@@ -600,9 +621,8 @@ def xm_info(args):
|
||||
else:
|
||||
print "%-23s:" % x[0], x[1]
|
||||
|
||||
# TODO: remove as soon as console server shows up
|
||||
def xm_console(args):
|
||||
arg_check(args,1,"console")
|
||||
arg_check(args, "console", 1)
|
||||
|
||||
dom = args[0]
|
||||
from xen.xend.XendClient import server
|
||||
@@ -639,11 +659,13 @@ its contents if the [-c|--clear] flag is specified.
|
||||
server.xend_node_clear_dmesg()
|
||||
|
||||
def xm_log(args):
|
||||
arg_check(args, 'xm-log', 0)
|
||||
|
||||
from xen.xend.XendClient import server
|
||||
print server.xend_node_log()
|
||||
|
||||
def xm_network_list(args):
|
||||
arg_check(args,1,"network-list")
|
||||
arg_check(args, "network-list", 1)
|
||||
dom = args[0]
|
||||
from xen.xend.XendClient import server
|
||||
for x in server.xend_domain_devices(dom, 'vif'):
|
||||
@@ -651,7 +673,7 @@ def xm_network_list(args):
|
||||
print
|
||||
|
||||
def xm_block_list(args):
|
||||
arg_check(args,1,"block-list")
|
||||
arg_check(args, "block-list", 1)
|
||||
dom = args[0]
|
||||
from xen.xend.XendClient import server
|
||||
for x in server.xend_domain_devices(dom, 'vbd'):
|
||||
@@ -659,20 +681,14 @@ def xm_block_list(args):
|
||||
print
|
||||
|
||||
def xm_block_attach(args):
|
||||
n = len(args)
|
||||
if n == 0:
|
||||
usage("block-attach")
|
||||
|
||||
if n < 4 or n > 5:
|
||||
err("%s: Invalid argument(s)" % args[0])
|
||||
usage("block-attach")
|
||||
arg_check(args, 'block-attach', 4, 5)
|
||||
|
||||
dom = args[0]
|
||||
vbd = ['vbd',
|
||||
['uname', args[1]],
|
||||
['dev', args[2]],
|
||||
['mode', args[3]]]
|
||||
if n == 5:
|
||||
if len(args) == 5:
|
||||
vbd.append(['backend', args[4]])
|
||||
|
||||
from xen.xend.XendClient import server
|
||||
@@ -680,10 +696,8 @@ def xm_block_attach(args):
|
||||
|
||||
|
||||
def xm_network_attach(args):
|
||||
n = len(args)
|
||||
if n == 0:
|
||||
usage("network-attach")
|
||||
|
||||
arg_check(args, 'network-attach', 1, 10000)
|
||||
|
||||
dom = args[0]
|
||||
vif = ['vif']
|
||||
|
||||
@@ -695,7 +709,7 @@ def xm_network_attach(args):
|
||||
|
||||
|
||||
def detach(args, command, deviceClass):
|
||||
arg_check(args, 2, command)
|
||||
arg_check(args, command, 2)
|
||||
|
||||
dom = args[0]
|
||||
dev = args[1]
|
||||
@@ -742,7 +756,7 @@ def xm_vnet_list(args):
|
||||
print vnet, ex
|
||||
|
||||
def xm_vnet_create(args):
|
||||
arg_check(args, 1, "vnet-create")
|
||||
arg_check(args, "vnet-create", 1)
|
||||
conf = args[0]
|
||||
if not os.access(conf, os.R_OK):
|
||||
print "File not found: %s" % conf
|
||||
@@ -752,7 +766,7 @@ def xm_vnet_create(args):
|
||||
server.xend_vnet_create(conf)
|
||||
|
||||
def xm_vnet_delete(args):
|
||||
arg_check(args, 1, "vnet-delete")
|
||||
arg_check(args, "vnet-delete", 1)
|
||||
vnet = args[0]
|
||||
from xen.xend.XendClient import server
|
||||
server.xend_vnet_delete(vnet)
|
||||
@@ -765,6 +779,7 @@ commands = {
|
||||
# domain commands
|
||||
"domid": xm_domid,
|
||||
"domname": xm_domname,
|
||||
"rename": xm_rename,
|
||||
"restore": xm_restore,
|
||||
"save": xm_save,
|
||||
"reboot": xm_reboot,
|
||||
@@ -888,7 +903,7 @@ def main(argv=sys.argv):
|
||||
sys.exit(1)
|
||||
except xen.xend.XendError.XendError, ex:
|
||||
if len(args) > 0:
|
||||
handle_xend_error(argv[1], args[0], ex)
|
||||
handle_xend_error(argv[1], args, ex)
|
||||
else:
|
||||
print "Unexpected error:", sys.exc_info()[0]
|
||||
print
|
||||
@@ -896,7 +911,7 @@ def main(argv=sys.argv):
|
||||
raise
|
||||
except xen.xend.XendProtocol.XendError, ex:
|
||||
if len(args) > 0:
|
||||
handle_xend_error(argv[1], args[0], ex)
|
||||
handle_xend_error(argv[1], args, ex)
|
||||
else:
|
||||
print "Unexpected error:", sys.exc_info()[0]
|
||||
print
|
||||
|
||||
@@ -97,7 +97,7 @@ class Machine:
|
||||
"cores_per_socket" : "Unknown",
|
||||
"threads_per_core" : "Unknown",
|
||||
"cpu_mhz" : "Unknown",
|
||||
"memory" : "Unknown"}
|
||||
"total_memory" : "Unknown"}
|
||||
|
||||
xen = self.__getXenInfo(xenValues)
|
||||
cpu = self.__getCpuInfo(cpuValues)
|
||||
|
||||
@@ -31,6 +31,7 @@ domain1=XenDomain(opts1)
|
||||
|
||||
try:
|
||||
domain1.start()
|
||||
eyecatcher1 = "Created"
|
||||
except DomainError, e:
|
||||
eyecatcher1 = "Fail"
|
||||
|
||||
@@ -41,7 +42,7 @@ if eyecatcher1 != "Fail":
|
||||
|
||||
# Test 2: create a domain with mem>sys_mem
|
||||
|
||||
mem = int(getInfo("free_memory"))
|
||||
mem = int(getInfo("total_memory"))
|
||||
extreme_mem = str(mem + 100)
|
||||
|
||||
opts2= {
|
||||
@@ -56,6 +57,7 @@ domain2=XenDomain(opts2)
|
||||
|
||||
try:
|
||||
domain2.start()
|
||||
eyecatcher2 = "Created"
|
||||
except DomainError, e:
|
||||
eyecatcher2 = "Fail"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ for line in lines:
|
||||
map[pieces[0]] = pieces[1]
|
||||
|
||||
for field in ["cores_per_socket", "threads_per_core", "cpu_mhz",
|
||||
"memory", "free_memory", "xen_major", "xen_minor"]:
|
||||
"total_memory", "free_memory", "xen_major", "xen_minor"]:
|
||||
val = map[field]
|
||||
if not val.isdigit():
|
||||
FAIL("Numeric field %s not all-numbers: %s" % (field, val))
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <xen/sched.h>
|
||||
#include <public/io/ioreq.h>
|
||||
#include <asm/vmx.h>
|
||||
#include <public/io/vmx_vpic.h>
|
||||
#include <asm/vmx_vpic.h>
|
||||
#include <asm/current.h>
|
||||
#include <asm/vmx_vioapic.h>
|
||||
#include <asm/vmx_vlapic.h>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <xen/sched.h>
|
||||
#include <public/io/ioreq.h>
|
||||
#include <asm/vmx.h>
|
||||
#include <public/io/vmx_vpic.h>
|
||||
#include <asm/vmx_vpic.h>
|
||||
#include <asm/current.h>
|
||||
|
||||
static void ioapic_enable(vmx_vioapic_t *s, uint8_t enable)
|
||||
|
||||
@@ -144,7 +144,7 @@ long arch_do_dom0_op(dom0_op_t *op, dom0_op_t *u_dom0_op)
|
||||
unsigned int p;
|
||||
|
||||
ret = -EINVAL;
|
||||
if ( (fp + np) >= 65536 )
|
||||
if ( (fp + np) > 65536 )
|
||||
break;
|
||||
|
||||
ret = -ESRCH;
|
||||
|
||||
+2
-2
@@ -43,8 +43,8 @@
|
||||
#endif
|
||||
#include <public/sched.h>
|
||||
#include <public/io/ioreq.h>
|
||||
#include <public/io/vmx_vpic.h>
|
||||
#include <public/io/vmx_vlapic.h>
|
||||
#include <asm/vmx_vpic.h>
|
||||
#include <asm/vmx_vlapic.h>
|
||||
|
||||
int hvm_enabled;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <xen/types.h>
|
||||
#include <asm/vmx.h>
|
||||
#include <asm/vmx_platform.h>
|
||||
#include <asm/vmx_virpit.h>
|
||||
#include <asm/vmx_vpit.h>
|
||||
#include <asm/vmx_intercept.h>
|
||||
#include <asm/vmx_vlapic.h>
|
||||
#include <public/io/ioreq.h>
|
||||
|
||||
@@ -32,13 +32,12 @@
|
||||
#include <asm/vmx.h>
|
||||
#include <asm/vmx_vmcs.h>
|
||||
#include <asm/vmx_platform.h>
|
||||
#include <asm/vmx_virpit.h>
|
||||
#include <asm/vmx_vpit.h>
|
||||
#include <asm/apic.h>
|
||||
#include <asm/shadow.h>
|
||||
|
||||
#include <asm/vmx_vpic.h>
|
||||
#include <asm/vmx_vlapic.h>
|
||||
#include <public/io/ioreq.h>
|
||||
#include <public/io/vmx_vpic.h>
|
||||
|
||||
#ifdef CONFIG_VMX
|
||||
#if defined (__i386__)
|
||||
|
||||
@@ -114,13 +114,13 @@ __gnttab_map_grant_ref(
|
||||
(GNTMAP_device_map|GNTMAP_host_map)) == 0) )
|
||||
{
|
||||
DPRINTK("Bad ref (%d) or flags (%x).\n", ref, dev_hst_ro_flags);
|
||||
(void)__put_user(GNTST_bad_gntref, &uop->handle);
|
||||
(void)__put_user(GNTST_bad_gntref, &uop->status);
|
||||
return GNTST_bad_gntref;
|
||||
}
|
||||
|
||||
if ( acm_pre_grant_map_ref(dom) )
|
||||
{
|
||||
(void)__put_user(GNTST_permission_denied, &uop->handle);
|
||||
(void)__put_user(GNTST_permission_denied, &uop->status);
|
||||
return GNTST_permission_denied;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ __gnttab_map_grant_ref(
|
||||
if ( rd != NULL )
|
||||
put_domain(rd);
|
||||
DPRINTK("Could not find domain %d\n", dom);
|
||||
(void)__put_user(GNTST_bad_domain, &uop->handle);
|
||||
(void)__put_user(GNTST_bad_domain, &uop->status);
|
||||
return GNTST_bad_domain;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ __gnttab_map_grant_ref(
|
||||
{
|
||||
put_domain(rd);
|
||||
DPRINTK("Maptrack table is at maximum size.\n");
|
||||
(void)__put_user(GNTST_no_device_space, &uop->handle);
|
||||
(void)__put_user(GNTST_no_device_space, &uop->status);
|
||||
return GNTST_no_device_space;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ __gnttab_map_grant_ref(
|
||||
{
|
||||
put_domain(rd);
|
||||
DPRINTK("No more map handles available.\n");
|
||||
(void)__put_user(GNTST_no_device_space, &uop->handle);
|
||||
(void)__put_user(GNTST_no_device_space, &uop->status);
|
||||
return GNTST_no_device_space;
|
||||
}
|
||||
|
||||
@@ -370,6 +370,7 @@ __gnttab_map_grant_ref(
|
||||
|
||||
(void)__put_user((u64)frame << PAGE_SHIFT, &uop->dev_bus_addr);
|
||||
(void)__put_user(handle, &uop->handle);
|
||||
(void)__put_user(GNTST_okay, &uop->status);
|
||||
|
||||
put_domain(rd);
|
||||
return rc;
|
||||
@@ -377,7 +378,7 @@ __gnttab_map_grant_ref(
|
||||
|
||||
unlock_out:
|
||||
spin_unlock(&rd->grant_table->lock);
|
||||
(void)__put_user(rc, &uop->handle);
|
||||
(void)__put_user(rc, &uop->status);
|
||||
put_maptrack_handle(ld->grant_table, handle);
|
||||
return rc;
|
||||
}
|
||||
@@ -400,7 +401,7 @@ __gnttab_unmap_grant_ref(
|
||||
{
|
||||
domid_t dom;
|
||||
grant_ref_t ref;
|
||||
u16 handle;
|
||||
grant_handle_t handle;
|
||||
struct domain *ld, *rd;
|
||||
active_grant_entry_t *act;
|
||||
grant_entry_t *sha;
|
||||
@@ -957,7 +958,7 @@ gnttab_release_mappings(
|
||||
grant_table_t *gt = d->grant_table;
|
||||
grant_mapping_t *map;
|
||||
grant_ref_t ref;
|
||||
u16 handle;
|
||||
grant_handle_t handle;
|
||||
struct domain *rd;
|
||||
active_grant_entry_t *act;
|
||||
grant_entry_t *sha;
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
|
||||
#include <public/xen.h>
|
||||
#include <asm/e820.h>
|
||||
#include <asm/vmx_virpit.h>
|
||||
#include <asm/vmx_vpit.h>
|
||||
#include <asm/vmx_intercept.h>
|
||||
#include <asm/vmx_vioapic.h>
|
||||
#include <public/io/vmx_vpic.h>
|
||||
#include <asm/vmx_vpic.h>
|
||||
|
||||
#define MAX_OPERAND_NUM 2
|
||||
|
||||
|
||||
File renamed without changes.
@@ -8,7 +8,7 @@
|
||||
#include <xen/errno.h>
|
||||
#include <xen/ac_timer.h>
|
||||
#include <asm/vmx_vmcs.h>
|
||||
#include <public/io/vmx_vpic.h>
|
||||
#include <asm/vmx_vpic.h>
|
||||
|
||||
#define PIT_FREQ 1193181
|
||||
|
||||
@@ -63,7 +63,7 @@ struct acm_getssid {
|
||||
ssidref_t ssidref;
|
||||
} id;
|
||||
void *ssidbuf;
|
||||
uint16_t ssidbuf_size;
|
||||
uint32_t ssidbuf_size;
|
||||
};
|
||||
|
||||
#define ACM_GETDECISION 8
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* This makes sure that old versions of dom0 tools will stop working in a
|
||||
* well-defined way (rather than crashing the machine, for instance).
|
||||
*/
|
||||
#define DOM0_INTERFACE_VERSION 0xAAAA1012
|
||||
#define DOM0_INTERFACE_VERSION 0xAAAA1014
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
@@ -98,7 +98,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
domid_t domain;
|
||||
uint16_t vcpu;
|
||||
uint32_t vcpu;
|
||||
/* IN/OUT parameters */
|
||||
vcpu_guest_context_t *ctxt;
|
||||
} dom0_setdomaininfo_t;
|
||||
@@ -107,7 +107,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
uint32_t write;
|
||||
uint32_t cpu_mask;
|
||||
cpumap_t cpu_mask;
|
||||
uint32_t msr;
|
||||
uint32_t in1;
|
||||
uint32_t in2;
|
||||
@@ -116,21 +116,6 @@ typedef struct {
|
||||
uint32_t out2;
|
||||
} dom0_msr_t;
|
||||
|
||||
#define DOM0_DEBUG 16
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
domid_t domain;
|
||||
uint8_t opcode;
|
||||
uint32_t in1;
|
||||
uint32_t in2;
|
||||
uint32_t in3;
|
||||
uint32_t in4;
|
||||
/* OUT variables. */
|
||||
uint32_t status;
|
||||
uint32_t out1;
|
||||
uint32_t out2;
|
||||
} dom0_debug_t;
|
||||
|
||||
/*
|
||||
* Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
|
||||
* 1 January, 1970 if the current system time was <system_time>.
|
||||
@@ -182,8 +167,8 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
domid_t domain;
|
||||
uint16_t vcpu;
|
||||
cpumap_t cpumap;
|
||||
uint32_t vcpu;
|
||||
cpumap_t cpumap;
|
||||
} dom0_pincpudomain_t;
|
||||
|
||||
/* Get trace buffers machine base address */
|
||||
@@ -196,9 +181,9 @@ typedef struct {
|
||||
#define DOM0_TBUF_SET_SIZE 3
|
||||
#define DOM0_TBUF_ENABLE 4
|
||||
#define DOM0_TBUF_DISABLE 5
|
||||
uint8_t op;
|
||||
uint32_t op;
|
||||
/* IN/OUT variables */
|
||||
unsigned long cpu_mask;
|
||||
cpumap_t cpu_mask;
|
||||
uint32_t evt_mask;
|
||||
/* OUT variables */
|
||||
unsigned long buffer_mfn;
|
||||
@@ -327,7 +312,7 @@ typedef struct {
|
||||
#define DOM0_PERFCCONTROL_OP_RESET 1 /* Reset all counters to zero. */
|
||||
#define DOM0_PERFCCONTROL_OP_QUERY 2 /* Get perfctr information. */
|
||||
typedef struct {
|
||||
uint8_t name[80]; /* name of perf counter */
|
||||
uint8_t name[80]; /* name of perf counter */
|
||||
uint32_t nr_vals; /* number of values for this counter */
|
||||
uint32_t vals[64]; /* array of values */
|
||||
} dom0_perfc_desc_t;
|
||||
@@ -349,16 +334,16 @@ typedef struct {
|
||||
#define DOM0_IOPORT_PERMISSION 36
|
||||
typedef struct {
|
||||
domid_t domain; /* domain to be affected */
|
||||
uint16_t first_port; /* first port int range */
|
||||
uint16_t nr_ports; /* size of port range */
|
||||
uint16_t allow_access; /* allow or deny access to range? */
|
||||
uint32_t first_port; /* first port int range */
|
||||
uint32_t nr_ports; /* size of port range */
|
||||
uint8_t allow_access; /* allow or deny access to range? */
|
||||
} dom0_ioport_permission_t;
|
||||
|
||||
#define DOM0_GETVCPUCONTEXT 37
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
domid_t domain; /* domain to be affected */
|
||||
uint16_t vcpu; /* vcpu # */
|
||||
uint32_t vcpu; /* vcpu # */
|
||||
/* OUT variables. */
|
||||
vcpu_guest_context_t *ctxt;
|
||||
} dom0_getvcpucontext_t;
|
||||
@@ -367,7 +352,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
domid_t domain; /* domain to be affected */
|
||||
uint16_t vcpu; /* vcpu # */
|
||||
uint32_t vcpu; /* vcpu # */
|
||||
/* OUT variables. */
|
||||
uint8_t online; /* currently online (not hotplugged)? */
|
||||
uint8_t blocked; /* blocked waiting for an event? */
|
||||
@@ -381,35 +366,36 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
domid_t first_domain;
|
||||
unsigned int max_domains;
|
||||
uint32_t max_domains;
|
||||
dom0_getdomaininfo_t *buffer;
|
||||
/* OUT variables. */
|
||||
unsigned int num_domains;
|
||||
uint32_t num_domains;
|
||||
} dom0_getdomaininfolist_t;
|
||||
|
||||
#define DOM0_PLATFORM_QUIRK 39
|
||||
#define QUIRK_NOIRQBALANCING 1
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
int quirk_id;
|
||||
uint32_t quirk_id;
|
||||
} dom0_platform_quirk_t;
|
||||
|
||||
#define DOM0_PHYSICAL_MEMORY_MAP 40
|
||||
typedef struct {
|
||||
/* IN variables. */
|
||||
int max_map_entries;
|
||||
uint32_t max_map_entries;
|
||||
/* OUT variables. */
|
||||
int nr_map_entries;
|
||||
uint32_t nr_map_entries;
|
||||
struct dom0_memory_map_entry {
|
||||
uint64_t start, end;
|
||||
int is_ram;
|
||||
uint32_t flags; /* reserved */
|
||||
uint8_t is_ram;
|
||||
} *memory_map;
|
||||
} dom0_physical_memory_map_t;
|
||||
|
||||
#define DOM0_MAX_VCPUS 41
|
||||
typedef struct {
|
||||
domid_t domain; /* domain to be affected */
|
||||
unsigned int max; /* maximum number of vcpus */
|
||||
domid_t domain; /* domain to be affected */
|
||||
uint32_t max; /* maximum number of vcpus */
|
||||
} dom0_max_vcpus_t;
|
||||
|
||||
#define DOM0_SETDOMAINHANDLE 44
|
||||
@@ -433,7 +419,6 @@ typedef struct {
|
||||
dom0_getdomaininfo_t getdomaininfo;
|
||||
dom0_getpageframeinfo_t getpageframeinfo;
|
||||
dom0_msr_t msr;
|
||||
dom0_debug_t debug;
|
||||
dom0_settime_t settime;
|
||||
dom0_readconsole_t readconsole;
|
||||
dom0_pincpudomain_t pincpudomain;
|
||||
|
||||
@@ -73,14 +73,14 @@
|
||||
*/
|
||||
typedef struct grant_entry {
|
||||
/* GTF_xxx: various type and flag information. [XEN,GST] */
|
||||
uint16_t flags;
|
||||
uint16_t flags;
|
||||
/* The domain being granted foreign privileges. [GST] */
|
||||
domid_t domid;
|
||||
domid_t domid;
|
||||
/*
|
||||
* GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
|
||||
* GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
|
||||
*/
|
||||
uint32_t frame;
|
||||
uint32_t frame;
|
||||
} grant_entry_t;
|
||||
|
||||
/*
|
||||
@@ -131,7 +131,12 @@ typedef struct grant_entry {
|
||||
/*
|
||||
* Reference to a grant entry in a specified domain's grant table.
|
||||
*/
|
||||
typedef uint16_t grant_ref_t;
|
||||
typedef uint32_t grant_ref_t;
|
||||
|
||||
/*
|
||||
* Handle to track a mapping created via a grant reference.
|
||||
*/
|
||||
typedef uint32_t grant_handle_t;
|
||||
|
||||
/*
|
||||
* GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
|
||||
@@ -154,11 +159,12 @@ typedef uint16_t grant_ref_t;
|
||||
typedef struct gnttab_map_grant_ref {
|
||||
/* IN parameters. */
|
||||
uint64_t host_addr;
|
||||
domid_t dom;
|
||||
uint32_t flags; /* GNTMAP_* */
|
||||
grant_ref_t ref;
|
||||
uint16_t flags; /* GNTMAP_* */
|
||||
domid_t dom;
|
||||
/* OUT parameters. */
|
||||
int16_t handle; /* +ve: handle; -ve: GNTST_* */
|
||||
int16_t status; /* GNTST_* */
|
||||
grant_handle_t handle;
|
||||
uint64_t dev_bus_addr;
|
||||
} gnttab_map_grant_ref_t;
|
||||
|
||||
@@ -178,7 +184,7 @@ typedef struct gnttab_unmap_grant_ref {
|
||||
/* IN parameters. */
|
||||
uint64_t host_addr;
|
||||
uint64_t dev_bus_addr;
|
||||
uint16_t handle;
|
||||
grant_handle_t handle;
|
||||
/* OUT parameters. */
|
||||
int16_t status; /* GNTST_* */
|
||||
} gnttab_unmap_grant_ref_t;
|
||||
@@ -196,7 +202,7 @@ typedef struct gnttab_unmap_grant_ref {
|
||||
typedef struct gnttab_setup_table {
|
||||
/* IN parameters. */
|
||||
domid_t dom;
|
||||
uint16_t nr_frames;
|
||||
uint32_t nr_frames;
|
||||
/* OUT parameters. */
|
||||
int16_t status; /* GNTST_* */
|
||||
unsigned long *frame_list;
|
||||
@@ -283,7 +289,8 @@ typedef struct {
|
||||
"invalid virtual address", \
|
||||
"invalid device address", \
|
||||
"no spare translation slot in the I/O MMU", \
|
||||
"permission denied" \
|
||||
"permission denied", \
|
||||
"bad page" \
|
||||
}
|
||||
|
||||
#endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
#define BLKIF_OP_READ 0
|
||||
#define BLKIF_OP_WRITE 1
|
||||
|
||||
/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
|
||||
#define BLKIF_RING_SIZE 64
|
||||
|
||||
/*
|
||||
* Maximum scatter/gather segments per request.
|
||||
* This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
|
||||
@@ -33,24 +30,18 @@ typedef struct blkif_request {
|
||||
uint8_t operation; /* BLKIF_OP_??? */
|
||||
uint8_t nr_segments; /* number of segments */
|
||||
blkif_vdev_t handle; /* only for read/write requests */
|
||||
unsigned long id; /* private guest value, echoed in resp */
|
||||
uint64_t id; /* private guest value, echoed in resp */
|
||||
blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
|
||||
/* @f_a_s[4:0]=last_sect ; @f_a_s[9:5]=first_sect */
|
||||
/* @f_a_s[:16]= grant reference (16 bits) */
|
||||
/* @first_sect: first sector in frame to transfer (inclusive). */
|
||||
/* @last_sect: last sector in frame to transfer (inclusive). */
|
||||
unsigned long frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
|
||||
struct blkif_request_segment {
|
||||
grant_ref_t gref; /* reference to I/O buffer frame */
|
||||
/* @first_sect: first sector in frame to transfer (inclusive). */
|
||||
/* @last_sect: last sector in frame to transfer (inclusive). */
|
||||
uint8_t first_sect, last_sect;
|
||||
} seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
|
||||
} blkif_request_t;
|
||||
|
||||
#define blkif_fas(_addr, _fs, _ls) ((_addr)|((_fs)<<5)|(_ls))
|
||||
#define blkif_first_sect(_fas) (((_fas)>>5)&31)
|
||||
#define blkif_last_sect(_fas) ((_fas)&31)
|
||||
|
||||
#define blkif_fas_from_gref(_gref, _fs, _ls) (((_gref)<<16)|((_fs)<<5)|(_ls))
|
||||
#define blkif_gref_from_fas(_fas) ((_fas)>>16)
|
||||
|
||||
typedef struct blkif_response {
|
||||
unsigned long id; /* copied from request */
|
||||
uint64_t id; /* copied from request */
|
||||
uint8_t operation; /* copied from request */
|
||||
int16_t status; /* BLKIF_RSP_??? */
|
||||
} blkif_response_t;
|
||||
@@ -58,9 +49,6 @@ typedef struct blkif_response {
|
||||
#define BLKIF_RSP_ERROR -1 /* non-specific 'error' */
|
||||
#define BLKIF_RSP_OKAY 0 /* non-specific 'okay' */
|
||||
|
||||
#define BLKIF_MAJOR(dev) ((dev)>>8)
|
||||
#define BLKIF_MINOR(dev) ((dev) & 0xff)
|
||||
|
||||
/*
|
||||
* Generate blkif ring structures and types.
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
typedef struct {
|
||||
unsigned long addr; /* Machine address of packet. */
|
||||
int ref; /* grant table access reference */
|
||||
grant_ref_t ref; /* grant table access reference */
|
||||
uint16_t id; /* Echoed in response message. */
|
||||
uint16_t size; /* Packet size in bytes. */
|
||||
} tpmif_tx_request_t;
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#ifndef _VMX_VLAPIC_H
|
||||
#define _VMX_VLAPIC_H
|
||||
|
||||
/*
|
||||
We extended one bit for PIC type
|
||||
*/
|
||||
#define VLAPIC_DELIV_MODE_FIXED 0x0
|
||||
#define VLAPIC_DELIV_MODE_LPRI 0x1
|
||||
#define VLAPIC_DELIV_MODE_SMI 0x2
|
||||
#define VLAPIC_DELIV_MODE_NMI 0x4
|
||||
#define VLAPIC_DELIV_MODE_INIT 0x5
|
||||
#define VLAPIC_DELIV_MODE_STARTUP 0x6
|
||||
#define VLAPIC_DELIV_MODE_EXT 0x7
|
||||
#define VLAPIC_DELIV_MODE_MASK 0x8
|
||||
|
||||
#define VLAPIC_MSG_LEVEL 4
|
||||
|
||||
#define INTR_EXT 0
|
||||
#define INTR_APIC 1
|
||||
#define INTR_LAPIC 2
|
||||
|
||||
#define VL_STATE_EOI 1
|
||||
#define VL_STATE_EXT_LOCK 2
|
||||
#define VL_STATE_MSG_LOCK 3
|
||||
#define VL_STATE_EOI_LOCK 3
|
||||
|
||||
#define VLOCAL_APIC_MAX_INTS 256
|
||||
#define VLAPIC_INT_COUNT (VLOCAL_APIC_MAX_INTS/(BITS_PER_BYTE * sizeof(uint64_t)))
|
||||
#define VLAPIC_INT_COUNT_32 (VLOCAL_APIC_MAX_INTS/(BITS_PER_BYTE * sizeof(uint32_t)))
|
||||
|
||||
typedef struct {
|
||||
/* interrupt for PIC and ext type IOAPIC interrupt */
|
||||
uint64_t vl_ext_intr[VLAPIC_INT_COUNT];
|
||||
uint64_t vl_ext_intr_mask[VLAPIC_INT_COUNT];
|
||||
uint64_t vl_apic_intr[VLAPIC_INT_COUNT];
|
||||
uint64_t vl_apic_tmr[VLAPIC_INT_COUNT];
|
||||
uint64_t vl_eoi[VLAPIC_INT_COUNT];
|
||||
uint32_t vl_lapic_id;
|
||||
uint32_t direct_intr;
|
||||
uint32_t vl_apr;
|
||||
uint32_t vl_logical_dest;
|
||||
uint32_t vl_dest_format;
|
||||
uint32_t vl_arb_id;
|
||||
uint32_t vl_state;
|
||||
uint32_t apic_msg_count;
|
||||
} vlapic_info;
|
||||
|
||||
#endif /* _VMX_VLAPIC_H_ */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* mode: C
|
||||
* c-set-style: "BSD"
|
||||
* c-basic-offset: 4
|
||||
* tab-width: 4
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*/
|
||||
@@ -48,8 +48,8 @@ struct sched_adjdom_cmd {
|
||||
uint64_t period;
|
||||
uint64_t slice;
|
||||
uint64_t latency;
|
||||
uint16_t extratime;
|
||||
uint16_t weight;
|
||||
uint32_t extratime;
|
||||
uint32_t weight;
|
||||
} sedf;
|
||||
|
||||
} u;
|
||||
|
||||
@@ -410,9 +410,9 @@ typedef struct start_info {
|
||||
unsigned long shared_info; /* MACHINE address of shared info struct. */
|
||||
uint32_t flags; /* SIF_xxx flags. */
|
||||
unsigned long store_mfn; /* MACHINE page number of shared page. */
|
||||
uint16_t store_evtchn; /* Event channel for store communication. */
|
||||
uint32_t store_evtchn; /* Event channel for store communication. */
|
||||
unsigned long console_mfn; /* MACHINE address of console page. */
|
||||
uint16_t console_evtchn; /* Event channel for console messages. */
|
||||
uint32_t console_evtchn; /* Event channel for console messages. */
|
||||
/* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */
|
||||
unsigned long pt_base; /* VIRTUAL address of page directory. */
|
||||
unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. */
|
||||
|
||||