Keir Fraser [Wed, 3 Oct 2007 15:33:23 +0000 (16:33 +0100)]
hvm: More changes to reduce size of domain structure.
It is now smaller than a page (4kB) on x86/32 and x86/64. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Wed, 3 Oct 2007 14:47:47 +0000 (15:47 +0100)]
hvm: Do not include full hvm_hw_hpet in 'struct domain'. It is very
large due to the number of (unused) reserved registers. This
unnecessarily blots the size of the domain structure. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Wed, 3 Oct 2007 13:41:28 +0000 (14:41 +0100)]
svm: Actually remove disabling of CR4-read-intercept when using NPT.
Should have been in the previosu changeset. Oops. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Wed, 3 Oct 2007 13:06:06 +0000 (14:06 +0100)]
xend: Check access to the privcmd interface before doing the call to
fetch the currently enforced policy. Assign 'INACCESSIBLE' to the
policy if it cannot be retrieved due to the user not being
privileged.
Keir Fraser [Wed, 3 Oct 2007 13:04:51 +0000 (14:04 +0100)]
Extend 'xm dumppolicy' to support Xen-API
I am extending 'xm dumppolicy' to be used via the Xen-API. For this
there are two new functions in the ACM policy class:
- get the currently enforced policy including statistical data from
the hypervisor
- get the ACM 'ssidref' of a Domain. Since this may be a ACM-specific
variable or type (int) I put it into the ACM class.
I extended the Xen-API documentation with the two new functions.
Keir Fraser [Tue, 2 Oct 2007 15:59:07 +0000 (16:59 +0100)]
vtd: Dynamically allocate IRQ-tracking structures, only for those
domains that actually have PCI-passthru devices. Greatly reduces size
of 'struct domain'. Signed-off-by: Keir Fraser <keir@xensource.com>
Alex Williamson [Tue, 2 Oct 2007 15:31:45 +0000 (09:31 -0600)]
[IA64] xenitp improvements
Remove all the casts by using char * instead of unsigned char *.
The go command now accept a number.
The disass command can now accept a range.
Number of TRs is not hard-coded.
'-' (minus) can now be used in expressions.
'$iip' and '$b0' can be used in expressions.
Keir Fraser [Tue, 2 Oct 2007 15:28:58 +0000 (16:28 +0100)]
x86/32: Re-factor mapcache data structure into per-domain and per-vcpu
components. Greatly reduces size of 'struct domain'. Signed-off-by: Keir Fraser <keir@xensource.com>
Alex Williamson [Mon, 1 Oct 2007 15:57:50 +0000 (09:57 -0600)]
[IA64] Fix wrong insertion of TLB entry in region 0
On PV domain with metaphysical mode, emulation of itc.d in region 0
doesn't work well and inserts an wrong TC entry.
Because set_one_rr() doesn't set the machine region register.
i.e. metaphyisical_rr0 is used instead of guest's rr[0].
This bug causes Dom0/U crash when an application uses region 0.
Actually I met the crash when I was building open GFW (java uses
region 0).
Keir Fraser [Mon, 1 Oct 2007 14:38:58 +0000 (15:38 +0100)]
x86: Rename math_state_restore() to more logical
do_device_not_available(), following naming convection for all other C
exception handlers. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Mon, 1 Oct 2007 14:12:05 +0000 (15:12 +0100)]
hvm: Avoid need for ugly setcpucontext() in HVM domain builder by
pre-setting the vcpu0 to runnable inside Xen, and have the builder
insert a JMP instruction to reach the hvmloader entry point from
address 0x0. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Mon, 1 Oct 2007 05:34:40 +0000 (06:34 +0100)]
vt-d: Allocate iommu pages from domheap rather than xenheap.
xenheap size is 9M on x86/32 xen, it's not enough to setup 1:1 mapping
page table for dom0. It causes dom0 cannot boot successfully. Instead
of xenheap, this patch setup 1:1 mapping page tabel in domheap, and
use map_domain_page() to get temporary mappings when need them.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Alex Williamson [Thu, 27 Sep 2007 22:29:43 +0000 (16:29 -0600)]
[IA64] Kexec: Implement elf_core_save_regs()
Implement elf_core_save_regs() by porting (un #ifdefing)
ia64_elf_core_copy_regs() from Linux.
This ommits the calls to ia64_get_user_rbs_end() and ia64_sync_user_rbs()
in do_copy_task_regs(). Supplying them would seem to involve a reasonably
involved ammount of porting. I'm really not sure that its neccessary.
Alex Williamson [Thu, 27 Sep 2007 22:26:34 +0000 (16:26 -0600)]
[IA64] Kexec: Zap VHPT in relocate_kernel
On XEN do_ia64_purge_tlb unpins the VHPT entry, so it seems
logical that relocate_kernel should do the same thing.
It seems to work, but is it correct?
Alex Williamson [Thu, 27 Sep 2007 22:24:02 +0000 (16:24 -0600)]
[IA64] Kexec: Fix ia64_do_tlb_purge so that it works with XEN
Fix ia64_do_tlb_purge, its broken in too many ways
1. Call SET_PER_CPU_DATA before making any calls to GET_THIS_PADDR
to ensure that per-cpu data is set up correctly.
2. Use the per_cpu variable to derive CURRENT_STACK_OFFSET rather
than reading it from a kernel register. See 1) for explanation
of why.
3. In the VHPT pruning code, don't use r25 as ia64_jump_to_sal,
which branches to ia64_do_tlb_purge expects r25 to be preserved.
There seems no reason not to use r2 as per the other purges
done in ia64_do_tlb_purge. Furthermore use r16 and r18 instead
of r20 and r24 for consistency reasons.
4. Move __va_ul(vcpu_vhpt_maddr(v)) comment outside of
#if VHPT_ENABLED as it also applies to code further down that
is outside the #if
Alex Williamson [Thu, 27 Sep 2007 21:35:02 +0000 (15:35 -0600)]
[IA64] Kexec: partial port of CPU_HOTPLUG
* Enable CONFIG_CPU_HOTPLUG
* Add #ifndef CONFIG_XEN as appropriate around portions that are not
needed for kexec - it is used to take down cpus on SMP systems
before kexecing.
* Port various xen-specific bits as neccessary
- This has mainly been done in the existing kexec-related files,
as kexex is currently the only user of this code. If a full
port of CPU_HOTPLUG was done then this code would either disapear
or be relocated elsewhere.
Alex Williamson [Thu, 27 Sep 2007 21:12:58 +0000 (15:12 -0600)]
[IA64] Kexec: Add kexec_disable_iosapic
Ported from Linux, this shuts down iosapic before preforming kexec.
This resolves a problem whereby the serial port on an HP RX2620
(which uses IOSAPIC) was not able to accept input. It probably
resolves a bunch of other as yet unseen problems too.
Thanks to Takebe-san for working out the solution to this puzzle.
Cc: Akio Takebe <takebe_akio@jp.fujitsu.com> Signed-off-by: Simon Horman <horms@verge.net.au>
xend: Fix name uniqueness check (revert 15168:a717cb2fac90).
Changeset 15168:a717cb2fac90 altered check_name() in XendDomainInfo so
that it compares domain IDs instead of UUIDs. This breaks a number of
things
- You can no longer use 'xm new' to define a persistent config file for
a running guest. This breaks the key OS provisioning scenario where
you boot a kenrel+initrd for the installer, and at the same time
define a permanent config with pygrub.
- It lets you define multiple inactive guests with different UUIDs, but
the same name because all inactive guests have a domid of None. So
you can now end up with multiple guests with same name, which is
contrary to the goal implied by the patch which was name uniqueness.
It is unclear from the original commit logs just what scenario it was
trying to protect against, but the original checking of uniqueness
based on UUID was correct & is what was used in previous releases XenD.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Changeset 15951:ad339d88639d split policy_dir_prefix into
security_dir_prefix and policy_dir_prefix in acm code. I think this
needs to be reflected in the dummy module as well (otherwise we blowup
when bootloader.py tries to reference security.security_dir_prefix).
Fixed in below patch.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
libaio: Fix for *BSD
- Remove unused linux specific header
- Include <sys/time.h> needed for struct timespec Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Alex Williamson [Wed, 26 Sep 2007 19:22:17 +0000 (13:22 -0600)]
[IA64] Use same RID fro rr0 and rr4 in metaphysical mode.
Renames metaphysical_rr0 to metaphysical_rid_dt
Renames metaphysical_rr4 to metaphysical_rid_d
Add comments in optvfault.S
cleanup and update vmx_phy_mode.[ch]
When creating domains that specify scheduler parameters with XenAPI,
the specified parameters are not used when starting the domain. This
patch collapses cpu_weight and cpu_cap in XendConfig into the
vcpus_params dictionary. The patch has been tested using xm and
XenAPI on config with and without scheduler parameters.
In order for Dom0 to be able to map the DMI table, it must not be in
E820 RAM; since some BIOS versions apparently fail to set the type
correctly for the page(s) containing this table, adjust it before
starting to consume memory.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xensource.com>
On 32-bit xen, dom0 crashes when using VT-d to assign devices. It is
caused by setting m2p in clear_mmio_p2m_entry(), because
machine_to_phys_map[] entry for mmio address is not mapped.
Signed-off-by: Weidong Han <weidong.han@intel.com>
- portability fix in Makefile: mkhex is not bash specific
- GNU od separates column with one blank, BSD od uses eight blanks.
Change sed to deal with this.
- Add a fourth sed to fix a build error on NetBSD
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
xend: Fix VIF MAC address being lost across localhost migration.
VIF details in /vm/<uuid> directory in xenstore get deleted by old
domain dying. Signed-off-by: Keir Fraser <keir@xensource.com>
zlib and crypto libs are part of the base system in *BSD.
So no need to check for them on *BSD. This conveniently avoids
executing a non-portable usage of ldconfig.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Protect pygrub from possible malicious content in guest grub
config file. This fixes CVE-2007-4993. Original patch from
Jeremy Katz, I updated to close 2 remaining issues pointed out
by Christian and Keir, and to use setattr(self, ...).
xend memory ballooning: do not bother if guest will not fit in
physical memory constraints.
If users require domain memory size larger than a physical memory
size, we do not need waiting for ballooning, and should cause
xm create command error right away.
[Xend/ACM] Automatic loading of policy after xend has started.
On systems where the grub bootloader is not available or active the
to-be-activated policy is written a simple textfile. Once xend has
started the contents can be read. Using 'xm setpolicy' the policy can
be activated and the Domain-0 label set (using 'xm addlabel').
I fixed some bugs in the grub bootloader handler on the way and
removed some dead functions.
x86: Auto-probe the serial port baud rate if 'com1' or 'com2' is
specified as a Xen console target. Avoids need for 'com1=' or 'com2='
command-line option in some cases. Signed-off-by: Keir Fraser <keir@xensource.com>