Commit Graph
16439 Commits
Author SHA1 Message Date
Keir Fraser 604132c3d5 [Mini-OS] Add ENOTSUP
Add missing ENOTSUP by defining it to EOPNOTSUPP like in Linux.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:42:23 +00:00
Keir Fraser 63c4c4eabe [Mini-OS] Move _ctype into a module
Move the _ctype array into its own module, instead of having it
defined in a header.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:41:54 +00:00
Keir Fraser 29c4a80b74 vt-d: Fix ISA IRQ alias issue
When assign multiple devices to guest which uses PIC, ISA IRQ alias
may occur. This patch splits ISA IRQ and GSI eoi function. In ISA IRQ
eoi function, searches all assigned mirqs and does eoi for the
corresponding mirqs which match the eoi ISA IRQ. Therefore fix ISA IRQ
alias issue.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-11-23 16:39:45 +00:00
Keir Fraser 9ebc5c7ea6 [Mini-OS] Make bind_virq return the port
Make bind_virq() return the port bound to the irq, which is useful
e.g. for masking/unmasking it.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:25:59 +00:00
Keir Fraser fd2f80c255 [Mini-OS] Fix x86 arch_switch_thread
Fix x86 arch_switch_thread by making it pure assembly.
There were missing general register clobbers for x86_64, and BP should
theorically be clobbered too, but gcc does not believe that, so the
only simple safe solution is to use pure assembly.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:23:28 +00:00
Keir Fraser a222af2ef1 [Mini-OS] Optimize get_current()
Let gcc perform the computation with SP itself, leading to yet better
code.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:23:03 +00:00
Keir Fraser bb44bead10 [Mini-OS] Fix stack closures
So as to make backtracing tools happy, correctly close x86 stacks for
new threads as well as on callback in the x86_32 case since there is
no unwind marker.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:22:36 +00:00
Keir Fraser 8d71c3dfb8 [Mini-OS] Fix x86 initial stack alignment
This fixes the initial stack alignment for x86, which is required for
current to return a fine NULL instead of a random value or possibly
crash during initialization.

Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:22:13 +00:00
Keir Fraser 255c12e851 xend: Add support for NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2007-11-23 11:58:11 +00:00
Keir Fraser 3e213e5435 hvm: Clean up VMCS/VMCB construction.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-22 19:55:42 +00:00
Keir Fraser bec9e32050 x86: emulate I/O port access breakpoints
Emulate the trapping on I/O port accesses when emulating IN/OUT.

Also allow 8-byte breakpoints on x86-64 (and on i686 if the hardware
supports them), and tighten the condition for loading debug registers
during context switch.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-22 19:23:40 +00:00
Keir Fraser 8b831f4189 x86: single step after instruction emulation
Inject single step trap after emulating instructions if guest's
EFLAGS.TF is set.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-22 18:28:47 +00:00
Keir Fraser faeda954c3 acm: Fix an exit label.
Jump to a different error exit label if error occurs early in the
policy update process.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-11-22 17:44:51 +00:00
Keir Fraser 73de16a9b6 netfront/back: Specify interface allowing multicast address add/remove
requests to be passed from the frontend to the backend.

Signed-off-by: David Edmondson <dme@sun.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-22 17:43:29 +00:00
Keir Fraser fb22e22eb1 [SVM] handle MC threshold registers for Barcelona
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2007-11-22 15:10:47 +00:00
Keir Fraser 6a95c873e5 x86: make set_task_gate() x86-32-only since x86-64 doesn't have task gates.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-11-22 14:16:25 +00:00
Keir Fraser 2e7b17d9e3 x86-64: access only 4 bytes a the reset vector location on smpboot.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-11-22 14:12:47 +00:00
Keir Fraser 8b2403f5d7 Header dependency fix.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-11-22 14:04:44 +00:00
Keir Fraser 733d608ba9 Merge with ia64 tree. 2007-11-22 10:44:54 +00:00
Keir Fraser a07275a632 libxc: Minor clean up of xc_core, and fix for -fstrict-overflow.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-11-22 10:40:45 +00:00
Keir Fraser 1b50906da2 hvm: Clean up CPUID 0x80000001 emulation. Filter out RDTSCP feature
and emulate with #UD on AMD.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-22 10:33:10 +00:00
Alex Williamson d8ec192a6b merge with xen-unstable.hg (staging) 2007-11-21 09:12:06 -07:00
Keir Fraser 539c329f1f x86: rmb() can be weakened according to new Intel spec.
Both Intel and AMD agree that, from a programmer's viewpoint:
 Loads cannot be reordered relative to other loads.
 Stores cannot be reordered relative to other stores.

Intel64 Architecture Memory Ordering White Paper
<http://developer.intel.com/products/processor/manuals/318147.pdf>

AMD64 Architecture Programmer's Manual, Volume 2: System Programming
<http://www.amd.com/us-en/assets/content_type/\
 white_papers_and_tech_docs/24593.pdf>

Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-21 14:36:07 +00:00
Keir Fraser 07dd618798 x86: Re-factor and clean up system.h.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-21 14:27:38 +00:00
Keir Fraser 0b5a4a2e10 i386: Remove unnecessary, and broken, address check I added to seg
fixup code. Oops.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-21 12:00:20 +00:00
Keir Fraser 1c56e0d721 i386: adjustment to segment fixup code.
Clean up and support more instructions.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-11-21 11:49:41 +00:00
Keir Fraser bfa574998d x86: Make IDT/GDT/LDT updates safe.
This involves either determining that the entry will not be
read/written while the update takes place, or atomically making the
entry 'present', or doing the entire write atomically, as appropriate.

This issue raised, and original patch provided, by Jan Beulich.

Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-21 11:38:51 +00:00
Keir Fraser 8163649f9e ioemu: Add e100 NIC support. Req'd for w2k3/IA64.
Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
2007-11-21 09:52:04 +00:00
Keir Fraser dddce819d1 hvm: Do not crash guest if it does an unaligned access to an HPET
register. Some CrashMe test apaprently does this and we don't want
that to crash the domain it runs in.
From: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-21 09:49:09 +00:00
Keir Fraser 6841190c24 Remove unused smpboot.h header file.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-21 09:45:22 +00:00
Alex Williamson 77cb35fcb3 merge with xen-unstable.hg (staging) 2007-11-20 11:53:44 -07:00
Keir Fraser c18f962df8 xen: Allow granting of foreign access to iomem pages, and with
arbitrary cache attributes.
Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-20 17:26:48 +00:00
Alex Williamson 3a4adca511 [IA64] vti save-restore: save.h clean up
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-11-20 09:28:15 -07:00
Alex Williamson 69a6f6d074 [IA64] vti save-restore: save/restore opt_feature status
Make hvm domain save/restore support opt_feature.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-11-20 09:21:27 -07:00
Alex Williamson 8e2fe62872 [IA64] vti save-restore: preparation opt_feature support
Pass struct domain* to domain_opt_feature().
This patch is preparation patch for HVM domain save/restore opt_feature.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-11-20 09:14:43 -07:00
Alex Williamson 68d8221103 [IA64] vti save-restore: fix opt_feature hypercall
- Fix XEN_IA64_OPTF_IDENT_MAP_REG[457] definitions.
- SMP fix. writing to domain->arch.opt_feature is racy.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-11-20 09:11:15 -07:00
Alex Williamson 34bd00e90a [IA64] vti save-restore: fix vacpi_save()
Always returned 0.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-11-20 08:46:24 -07:00
Keir Fraser 661f08bb3c x86, 32-on-64: Improve checking in vcpu_destroy_pagetables(). It *is*
possible for 64-bit guest to have matching guest_table and
guest_table_user.
Original patch by John Levon <levon@movementarian.org>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-20 15:34:25 +00:00
Keir Fraser 22883da437 xenapi: Extension to get vif total i/o stats.
From: Stefan de Konink <skinkie@xs4all.nl>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-20 15:18:09 +00:00
Keir Fraser 8f52dbd472 ACM: Test sharing as part of the authorization check.
Protected the policy from being changed while the hooks are being
called.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-11-20 15:13:29 +00:00
Keir Fraser 9c17aa96e6 svm: Fix __update_guest_eip() to clear interrupt shadow.
Get rid of assertions about return value of get_instruction_length()
-- instead test in __update_guest_eip() and crash the domain.
Cache value of 'current' in svm_do_hlt().

The mismanagement of the interrupt shadow was found by Christoph
Egger of AMD.

Signed-off-by: Keir Fraser <keir@xensource.com>
2007-11-20 15:05:36 +00:00
Keir Fraser 6ca4cce4f4 xen: Domain0 builder should set start_info magic string to
'xen-3.0-...' just like user-space builder for domUs.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-11-20 14:35:36 +00:00
Keir Fraser d39cbe97e5 x86: Move log-dirty-mode assertion to correct place.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-11-17 13:11:25 +00:00
Keir Fraser eddc96ee2b Log dirty radix tree code cleanup. Also do not deference non-existent
pointer in paging_new_log_dirty_*() functions if allocation fails.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-16 20:06:15 +00:00
Keir Fraser 0d501a8598 hvm: RTC emulation - RTC_UIE/RTC_SET fix
This patch fixes a bug in the RTC code which appears to originate in
having written the emuated device following an incorrect
specification. VMware has (or had, at least, at the time we were still
testing on both VMWare and Xen) the same issue. In the current code,
when RTC_SET is set, RTC_UIE is cleared. This does not match the
behavior of real hardware, where the case is simply that no update
ended interrupts are sent as long as RTC_SET is set, but the UE ints
will resume as soon as RTC_SET is cleared and the clock update is
done. This little patch fixes this issue. In practicality, this means
OS/2 can now set the time without having the clock stop. I don't know
if any other guests have been affected by this issue.

From: Trolle Selander <trolle.selander@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-16 19:07:46 +00:00
Keir Fraser a36b32e53f hvm: make dirty logging stop requiring physical pages of order > 0
This patch re-implements the (x86) hypervisor dirty page log with a
simple four-level radix tree whose nodes are all single pages, thus
making migration require only order-0 pages (where before it required
at least an order-5 page).

Unlike the p2m radix tree implementation, the interior nodes of this
tree are NOT page table nodes.  I chose a lazy-allocation and -mapping
approach because most pages are not marked dirty while dirty-logging is
enabled.  There are doubtless situations (the 'stream' benchmark, for
example) where a more complex p2m-like approach is faster, but I'm not
sure they're worth the effort.

Signed-off-by: Dave Lively <dlively@virtualiron.com>
2007-11-16 18:33:24 +00:00
Keir Fraser 503ddff720 x86: Clean up some files of inline asm, and fix
__copy_{to,from}_user_ll() for gcc 3.4 (asm output constraints all
need to be '=&').
Based on a patch by Jan Beulich.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-16 17:59:34 +00:00
Keir Fraser 22e2d08efb hvm passthru: Uses of XC_PAGE_MASK should be XC_PAGE_SIZE-1.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-11-16 17:09:53 +00:00
Keir Fraser 995ee5c0f3 xentrace: make xentrace and xenmon work on Solaris and *BSD.
- Use getopt() to get rid of argp dependency which does not exist
   on Solaris and *BSD. Done by Tariq Magdon-Ismail.
 - Minor modifications by me (Christoph) to make it also work on *BSD.
 - Tested on Linux by me (Christoph). No functional change on Linux.
 - Tariq ok'd BSD modifications for Solaris
 - Tariq ok'd submission by me :)

Signed-off-by: Tariq Magdon-Ismail <tariqmi@sun.com>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2007-11-16 17:08:05 +00:00
Keir Fraser fec0543a2c xentrace: Fix TypeError handling of xentrace_format.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2007-11-16 17:05:20 +00:00