From: Jack Lange Date: Fri, 14 Aug 2009 20:35:01 +0000 (-0500) Subject: added initial symbiotic swapping framework X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=2304917404cd287c4741d9f85ff8a280e248c7d0;p=palacios.git added initial symbiotic swapping framework --- diff --git a/palacios/include/palacios/vmm_sym_swap.h b/palacios/include/palacios/vmm_sym_swap.h new file mode 100644 index 0000000..6931ea1 --- /dev/null +++ b/palacios/include/palacios/vmm_sym_swap.h @@ -0,0 +1,54 @@ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2008, Jack Lange + * Copyright (c) 2008, The V3VEE Project + * All rights reserved. + * + * Author: Jack Lange + * + * This is free software. You are permitted to use, + * redistribute, and modify it as specified in the file "V3VEE_LICENSE". + */ + +#ifndef __VMM_SYM_SWAP_H__ +#define __VMM_SYM_SWAP_H__ + +#ifdef __V3VEE__ +#ifdef CONFIG_SYMBIOTIC_SWAP + +#include + +static inline int is_swapped_pte32(pte32_t * pte) { + return (*(uint32_t *)pte != 0); +} + + +struct v3_swap_dev { + addr_t (*get_page)(int index); + +}; + + +struct v3_sym_swap_state { + struct v3_swap_dev[256]; + +}; + + +int v3_init_sym_swap(struct guest_info * info); + +addr_t v3_get_swapped_pg_addr(pte32_t * pte); + + + +#endif +#endif + +#endif diff --git a/palacios/src/devices/Kconfig b/palacios/src/devices/Kconfig index 38f8c9e..1452ee3 100644 --- a/palacios/src/devices/Kconfig +++ b/palacios/src/devices/Kconfig @@ -254,7 +254,7 @@ config RAM_HD config SYM_SWAP bool "Symbiotic Swap disk" default y - depends on SYMBIOTIC && (LINUX_VIRTIO_BLOCK || IDE) + depends on SYMBIOTIC_SWAP && (LINUX_VIRTIO_BLOCK || IDE) help Includes the symbiotic ram based swap disk diff --git a/palacios/src/palacios/Makefile b/palacios/src/palacios/Makefile index c0b20f8..88f917a 100644 --- a/palacios/src/palacios/Makefile +++ b/palacios/src/palacios/Makefile @@ -53,3 +53,5 @@ obj-$(CONFIG_VMX) += vmx.o \ obj-$(CONFIG_INSTRUMENT_VMM) += vmm_instrument.o obj-$(CONFIG_PROFILE_VMM) += vmm_profiler.o obj-$(CONFIG_SOCKET) += vmm_socket.o + +obj-$(CONFIG_SYMBIOTIC_SWAP) += vmm_sym_swap.o \ No newline at end of file diff --git a/palacios/src/palacios/vmm_shadow_paging.c b/palacios/src/palacios/vmm_shadow_paging.c index 4a4e719..e43a969 100644 --- a/palacios/src/palacios/vmm_shadow_paging.c +++ b/palacios/src/palacios/vmm_shadow_paging.c @@ -30,6 +30,10 @@ #include +#ifdef CONFIG_SYMBIOTIC_SWAP +#include +#endif + #ifndef CONFIG_DEBUG_SHADOW_PAGING #undef PrintDebug #define PrintDebug(fmt, args...) diff --git a/palacios/src/palacios/vmm_shadow_paging_32.h b/palacios/src/palacios/vmm_shadow_paging_32.h index f96485e..4c8922b 100644 --- a/palacios/src/palacios/vmm_shadow_paging_32.h +++ b/palacios/src/palacios/vmm_shadow_paging_32.h @@ -36,7 +36,7 @@ static inline int activate_shadow_pt_32(struct guest_info * info) { return 0; } -#ifdef __V3_SYMBIOTIC__ +#ifdef CONFIG_SYMBIOTIC_SWAP static inline int is_swapped_pte32(pte32_t * pte) { return (*(uint32_t *)pte != 0); } @@ -229,7 +229,7 @@ static int handle_pte_shadow_pagefault_32(struct guest_info * info, addr_t fault PrintDebug("Access error injecting pf to guest (guest access error=%d) (pf error code=%d)\n", guest_pte_access, *(uint_t*)&error_code); -#ifdef __V3_SYMBIOTIC__ +#ifdef CONFIG_SYMBIOTIC_SWAP_ if (is_swapped_pg(guest_pte)) { PrintError("Page fault on swapped out page\n"); diff --git a/palacios/src/palacios/vmm_sym_swap.c b/palacios/src/palacios/vmm_sym_swap.c new file mode 100644 index 0000000..bb79343 --- /dev/null +++ b/palacios/src/palacios/vmm_sym_swap.c @@ -0,0 +1,20 @@ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2008, Jack Lange + * Copyright (c) 2008, The V3VEE Project + * All rights reserved. + * + * Author: Jack Lange + * + * This is free software. You are permitted to use, + * redistribute, and modify it as specified in the file "V3VEE_LICENSE". + */ + +#include