Commit Graph
1091 Commits
Author SHA1 Message Date
Keir Fraser 446b916ca1 Make xc_translate_foreign_address aware of compat-mode guests and
(32-bit) HVM guests.  64-bit HVM guests are still not supported for
now, pending a sensible way of getting at the guest's EFER.LMA.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-01-05 11:08:25 +00:00
Keir Fraser f5fec95647 PoD memory 8/9: libxc interface
Implement libxc interface to PoD functionality:
* Add xc_hvm_build_target_mem(), which takes both memsize and target.
Memsize is the total memory, allocated in PoD pages and reported in
the e820; target is the size of the cache.  If these are the same, the
normal funcitonality is called.  (So you can use the same function to
build always, and it will decide whether to use PoD or not.)
* Add xc_domain_memory_[gs]et_pod_target(), which sets and/or returns
information about the PoD cache and p2m entries.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-01-05 10:46:37 +00:00
Keir Fraser 74d59a59e2 x86: Enable MTF for HVM guest single step in gdb
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-16 11:49:20 +00:00
Keir Fraser 0347bade8b xc_pm: Fix off-by-one error in string array access.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-12-13 15:04:53 +00:00
Keir Fraser de8ffdf6a4 libxc: Fix xc_pm.c build by avoiding bogus header includes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-11 11:19:27 +00:00
Keir Fraser 7542c4ff00 Add user PM control interface
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-12-10 13:27:41 +00:00
Keir Fraser ac677794d6 libxc: Fix memory leak in zlib usage
Any call to inflate() must be followed by inflateEnd(), otherwise the
internal zlib state is leaked.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
2008-12-10 13:14:13 +00:00
Keir Fraser 8d4638d15e Use virtual 8086 mode for VMX guests with CR0.PE == 0
When a VMX guest tries to enter real mode, put it in virtual 8086 mode
instead, if that's possible.  Handle all errors and corner cases by
falling back to the real-mode emulator.

This is similar to the old VMXASSIST system except it uses Xen's
x86_emulate emulator instead of having a partial emulator in the guest
firmware.  It more than doubles the speed of real-mode operation on
VMX.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-12-09 16:28:02 +00:00
Keir Fraser 58daad0d36 libxc: Fix gcc 4.3 build failure
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-09 12:42:18 +00:00
Keir Fraser ceb1434f7d x86: support CPUID hypervisor feature bit
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 16:10:39 +00:00
Keir Fraser 39407bed9c x86: make injection of spurious page faults configurable per domain
Some distro kernels do not handle spurious page faults so allow these
to be supressed on a per VM basis.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2008-10-15 15:56:26 +01:00
Isaku Yamahata 8b44bc08a3 [IA64] libxc: make xc_ia64_copy_memmap use DOM0VP_get_memmap.
Guest domain's memory map may be updated concurrently so that
it is protected sequence lock.
This patch makes xc_ia64_copy_memmap() use DOM0VP_get_memmap
hypercall to avoid the race.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-10-03 12:50:28 +09:00
Isaku Yamahata bd549c3d00 merge with xen-unstable.hg 2008-10-03 11:49:07 +09:00
Keir Fraser 668349f38b xc_ptrace: Allow gdbserver to connect to a guest before APs are
brought online.

Signed-off-by: Kip Macy <kmacy@freebsd.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-10-02 11:32:08 +01:00
Isaku Yamahata 0296f1839a [IA64] libxc clean up.
remove code duplication between xc_ia64_linux_save.c and xc_core_ia64.c
by introducing xc_ia64_copy_memmap().
Later xc_ia64_copy_memmap() will be enhanced.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-10-02 17:27:57 +09:00
Isaku Yamahata 0072510b97 [IA64] xc restore: fix domain restore.
Fix domain restore of version one format.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-10-02 17:27:57 +09:00
Isaku Yamahata ec19302761 [IA64] hvm builder: more precisely use of memory size.
So far, VGA io size is ignored and memory size which assigned to
domain is smaller than what user specified by VGA io size.
This patch take VGA io size into consideration when memory population.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-10-02 17:27:57 +09:00
Isaku Yamahata ae695f6725 [IA64] libxc: improve foreign p2m exposure.
make foreign p2m exposure _PAGE_IO_BIT aware for robustness.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-10-02 17:27:57 +09:00
Isaku Yamahata 8abea5a174 merge with xen-unstable.hg 2008-10-02 15:32:54 +09:00
Keir Fraser ca2eee92df x86, hvm: Expose host core/HT topology to HVM guests.
Based on an initial patch by Nitin Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-30 10:14:54 +01:00
Keir Fraser 73f43ceca7 xc_save: use correct size when unmapping live p2m.
Otherwise we unmap a larger region than was mapped when saving 32 bit
guest from 64 bit tools, leading to badness.

The equivalent change was made to the restore code in
18329:ca7dd77d5365

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2008-09-29 11:00:29 +01:00
Keir Fraser c06a7db0c5 X86 and IA64: Update cpufreq statistic logic for supporting both x86
and ia64

Signed-off-by: Yu, Ke <ke.yu@intel.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-09-26 14:05:09 +01:00
Isaku Yamahata 9dc665723c [IA64] xc_domain_save: Do not poll-wait for guest to shutdown.
This patch is ia64 counter part of 18452:59904b180078.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-25 11:47:53 +09:00
Keir Fraser c2c1029070 hvm, save/restore: Skip page batches which contain no valid pages.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-23 17:11:33 +01:00
Keir Fraser c134d74fda libxc: Wrapper functions for cpu online/offline
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
2008-09-22 16:10:25 +01:00
Keir Fraser 549e1d9ec5 x86, amd, hvm: pass through one more cpuid cache description leaf
Add a missing CPUID leaf that contains AMD-specific cache info.
Without this, Windows can spin trying to prefetch memory buffers using
a stride length of zero.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-18 10:39:53 +01:00
Keir Fraser 792f9bc05e xc_domain_save: Do not poll-wait for guest to shutdown -- it should
already be suspended when the (*suspend)() function returns.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-09 15:33:27 +01:00
Keir Fraser 03a0c0a048 libxc: fix xc_memory_op(): handles XENMEM_remove_from_phsymap case.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-09 15:02:32 +01:00
Keir Fraser 112dcc7dd0 xc_save: Clean up (*suspend)() callback hook.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-08 11:13:03 +01:00
Keir Fraser 406b8494bb lsevtchn: Improve this evtchn reporting tool.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-05 11:56:35 +01:00
Keir Fraser 2e8459a4fc stubdom: make xc_map_foreign_ranges use malloc instead of stack space
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-28 09:40:10 +01:00
Keir Fraser 8a68b82ff1 libxc: Use vcpu_guest_context_any_t instead of two pages
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 16:23:10 +01:00
Keir Fraser d818f3cb7c hvm: Use main memory for video memory.
When creating an HVM domain, if e.g. another domain is created before
qemu allocates video memory, the extra 8MB memory ballooning is not
available any more, because it got consumed by the other domain.

This fixes it by taking video memory from the main memory:

- make hvmloader use e820_malloc to reserve some of the main memory
  and notify ioemu of its address through the Xen platform PCI card.
- add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow
  ioemu to move the MFNs between the original position and the PCI
  mapping, when LFB acceleration is disabled/enabled
- add a remove_from_physmap memory op, to allow ioemu to unmap it
  completely for the case of old guests with acceleration disabled.
- add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to
  get the MFNs of the video memory.
- have xend save the PCI memory space instead of ioemu: if a memory
  page is there, the guest can access it like usual memory, so xend
  can safely be responsible to save it.  The extra benefit is that
  live migration will apply the logdirty optimization there too.
- handle old saved images, populating the video memory from ioemu if
  really needed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 14:53:39 +01:00
Keir Fraser 55c1a137e7 stubdom: drop debugging message
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:46:09 +01:00
Keir Fraser f6c2c609f7 Fix restore crash with certain guest memory sizes
This fixes a crash when restoring guests with certain memory sizes (eg
223MB).  The ROUNDUP in the call to memcpy, was the main offender, but
I didn't care for the inplace resizing of the p2m entries either.

Signed-off-by: Bruce Rogers <brogers@novell.com>
2008-08-14 10:18:08 +01:00
Keir Fraser f9307cbb49 MSI-X: enhancement
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
2008-08-13 13:45:39 +01:00
Keir Fraser 3adee298e7 Fix a few typos
From: Diego Ongaro <diego.ongaro@eu.citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-04 11:25:20 +01:00
Keir Fraser 0ae64c2ff8 minios: Error case when unbinding unknown port in xc_evtchn_unbind is
missing a return statement.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
2008-08-01 09:38:25 +01:00
Keir Fraser 52c456a522 hvm builder: Cleaner sp_extents allocation
We do not need more than count elements in the sp_extents array.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-31 12:38:32 +01:00
Keir Fraser dba5b800e3 stubdom: fix do_xen_hypercall error report
call.result is an unsigned long

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-25 09:40:14 +01:00
Keir Fraser ae41a026ab minios: grant table map (gntdev) bug fixes
* Uninitialized dev_bus_addr argument to GNTTABOP_unmap_grant_ref
   results in an angry hypervisor.
 * Set errno in libxc and return -1 on error.
 * op.status is a int16_t, so it should be printed with PRId16.
 * Don't print domids[0] or refs[0] if the ptr is NULL. It's more
   polite to crash later, after the message has been printed.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
2008-07-24 17:34:50 +01:00
Keir Fraser 6f79893756 tools: remove type parameter from xc_physdev_map_pirq{,_msi}()
... as it's implied by the function name.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-24 14:18:58 +01:00
Keir Fraser 7d0b678231 minios: grant table map (gntdev) for minios
I've implemented a grant map for mini-os to support the xc_gnttab_*()
functions, the equivalent of gntdev in linux. This is useful for my
work in putting xenstored in a stub domain.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
2008-07-24 14:14:27 +01:00
Keir Fraser 597e548eef mini-os: select call incorrectly reports xce_handle as ready
The current implementation in minios of xc_evtchn_pending doesn't set
read=0 when there is exactly one port pending. This resulted in
select() incorrectly reporting the file descriptor as ready.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-24 14:11:47 +01:00
Keir Fraser fd6a37dbdc pv-grub: re-implement xc_map_foreign_ranges
Also get rid of va and npages members of privcmd_mmap_entry since we
do not need them any more.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-24 14:10:45 +01:00
Keir Fraser 28f8960f3e libxc: Fix after xc_map_foreign_ranges() patch.
Must munmap() region after loading elf image.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 11:18:53 +01:00
Keir Fraser ce29ad450c libxc: Clean up xc_map_foreign_ranges() interface to hide the
underlying mmap() invocation.

From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-23 16:39:46 +01:00
Keir Fraser 19aa4a65a3 libxc: add xc_gnttab_map_domain_grant_refs.
xc_gnttab_map_domain_grant_refs permits to simply map several pages
from the same domain.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-21 14:02:53 +01:00
Keir Fraser 0373c0538d libxc: remove redundant declaration of xc_copy_to_domain_page().
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-11 15:35:50 +01:00
Keir Fraser 41296317a3 x86: allow control domain to limit machine addresses given to a particular guest
This allows domains which make buggy assumptions about the maximum
possible MFN to be worked around.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2008-07-11 12:51:26 +01:00