Commit Graph
17778 Commits
Author SHA1 Message Date
Keir Fraser cea190c247 Fix blkif.py for virsh start
I defined a cdrom to a guest domain as follows.

  ",hdc:cdrom,r"

When the guest domain was created by using xm create command, uname
of the cdrom was ''.  Then creating the guest domain succeeded.

[2008-06-03 15:23:41 xend.XendDomainInfo 25956] DEBUG
(XendDomainInfo:200)
XendDomainInfo.create(['vm', ['name', 'rhel5.2ga_hvm_lvol1'],
<<snip>>
['device', ['vbd', ['uname', ''], ['dev', 'hdc:cdrom'], ['mode',
'r']]],
<<snip>>

But, when the guest domain was created by using virsh start command,
uname of the cdrom was None.  Then creating the guest domain failed.

[2008-06-03 15:22:10 xend.XendDomainInfo 25559] DEBUG
(XendDomainInfo:200)
XendDomainInfo.create(['vm', ['name', 'rhel5.2ga_hvm_lvol1'],
<<snip>>
['device', ['vbd', ['dev', 'hdc:cdrom'], ['mode', 'r']]],
<<snip>>

This patch fixes to be able to create guest domains by both xm create
command and virsh start command.

FYI:
"if uname is None:" --> "if uname == '':" --> "if not uname:"
   till CS#17625             current           by this patch

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-06-05 10:30:29 +01:00
Keir Fraser 5ede5271a4 Improve HPET comparator reprog to prevent intr-near-missing case
HPET intr-near-missing means if the current counter value is too close
to the comparator value to be reprogrammed the expected HPET intr may
be missing. Linux kernel uses a mininal 48-hpet-ticks(~3.5us) distance
to workaround this, but personal observation showed there is still
failure case while delta=3D0xba (~13.5us). So choosing 20us as the
MIN_DELTA_NS should be helpful to prevent near-missing from happening.

local_irq_save/restore were used to avoid disturbance. (+ 2) was used
as a final guard to avoid wrong judgement due to the real happened
near-missing case.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
2008-06-03 09:41:19 +01:00
Keir Fraser 7534d30b43 x86: Enhance Cx stability by adding softirq check before entry cstate
Without checking softirq_pending before entry Cx state, softirq such
as SCHEDULE_SOFTIRQ and TIMER_SOFTIRQ can't be handled timely. It may
cause severe failures such as disk I/O failure.

This patch addresses the issue above, meanwhile move timing points
closer to cstate entry/exit point to make C3 residency more accurate,
and enable irq a little earlier.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
2008-06-03 09:35:02 +01:00
Keir Fraser 85745512c5 xend: implement VM_hard_reboot of XenAPI.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-06-03 09:33:41 +01:00
Keir Fraser e49b738ccf stubdom: Add console reading support
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-06-03 09:32:50 +01:00
Keir Fraser 9efd150651 rombios: S3 resume fixes.
On AMD cpus, HVM S3 resume was hanging in the bios when trying
to load the x_firmware_waking_vector from absolute
address 0xEA01C (that is, a segment offset greater than 64kB).

This change also now uses 20-bits (instead of 16) from the FACS
standard firmware_waking_vector.

Signed-off-by: Juergen Keil <jk@tools.de>
2008-06-02 16:05:07 +01:00
Keir Fraser e00ed2adcd xc hvm: Fix default CPUID features according to PAE/64-bit
capabilities of the guest and of the hypervisor.

Based on a patch by Juergen Keil <jk@tools.de>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-06-02 16:00:45 +01:00
Keir Fraser 6a7c065e8e Remove domain_pause()/domain_unpause() from SCHEDOP_remote_shutdown.
It is pointless and causes the hypervisor to hang if dom0 invokes this
hypercall on itself.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-06-02 10:56:52 +01:00
Keir Fraser d44e3c1d2e vmx: Better diagnostic messages when VMXON might have failed due to
bad setting of the IA32_FEATURE_CONTROL MSR.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-06-02 10:55:55 +01:00
Keir Fraser a42d40a38b vtd: Fix pagetable teardown on domain detsruction.
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2008-06-02 10:04:19 +01:00
Keir Fraser f368c2f69d vtd: build fix.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-06-02 10:03:18 +01:00
Isaku Yamahata 76b843362d merge with xen-unstable.hg 2008-06-02 11:35:39 +09:00
Isaku Yamahata 18e7bd4797 [IA64] compilation fix of c/s 17723:c684cf331f94
This patch fixes the compilation error caused by the c/s 17723:c684cf331f94.
Define stub functions which return -ENOSYS.

ia64-linux-gnu-ld -g -T xen.lds.s -N \
                -Map map.out linux-xen/head.o xen-unstable.hg/xen/common/built_in.o xen-unstable.hg/xen/drivers/built_in.o xen-unstable.hg/xen/xsm/built_in.o xen-unstable.hg/xen/arch/ia64/built_in.o \
                xen-unstable.hg/xen/common/symbols-dummy.o -o xen-unstable.hg/xen/xen-syms
xen-unstable.hg/xen/common/built_in.o: In function `__gnttab_unmap_common':
xen-unstable.hg/xen/common/grant_table.c:566: undefined reference to `iommu_unmap_page'
xen-unstable.hg/xen/common/built_in.o: In function `__gnttab_map_grant_ref':
xen-unstable.hg/xen/common/grant_table.c:388: undefined reference to `iommu_map_page'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-06-02 11:35:02 +09:00
Keir Fraser 893ee9de18 x86: Fix teardown of relocated vcpu_info structures.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-06-01 09:16:26 +01:00
Keir Fraser 5024576315 x86: i8254 device model is shared between PV and HVM guests, so must
take care not to run hvm_get_guest_time() on a PV VCPU. The spinlock
is not initialised and spin_lock() can thus spin forever.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-30 19:31:18 +01:00
Keir Fraser 8d4e5d626a x86 hvm: Fix task-switch operation ordering.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-30 16:44:13 +01:00
Keir Fraser fcb29bd59a x86 hvm: Support task switch when task state segments straddle page
boundaries. Also improve error diagnostics from hvm_map().

Fixes multi-processor shutdown for some types of Windows OS.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-30 16:30:40 +01:00
Keir Fraser 96967abdc7 Add xen_phys_start value in the crash info note
This patch makes the vmcore utilities (ex. crash, makedumpfile) be
able to get the relocation address of the xen hypervisor from a
vmcore. It is necessary for the utilities to find the data of the
hypervisor structures.

Note that this patch does not raise any comptibility issue for the
utilities (which I know) nor the other components of xen.

Signed-off-by: Itsuro Oda <oda@valinux.co.jp>
2008-05-30 16:04:20 +01:00
Keir Fraser 3ffdbd8569 [IA64] compilation fix of iommu.h
Trivial compilation fix of iommu.h.
It includes asm/msi.h for struct msi_desc and struct msi_msg
definition.
msi.h doesn't exist yet on ia64 so declare struct msi_desc and
struct msi_msg in iommu.h and don't include asm/msi.h.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-05-30 15:09:40 +01:00
Keir Fraser 4a133deb6e vtd: Various cleanups and fixes:
* Handle DRHDs with different supported AGAWs. To support this we
   create page tables which always have 4 levels, and skip top levels
   for units which support only 2 or 3 levels.
 * Handle systems with mixed DRHD support for cache snooping. We must
   pessimistically CLFLUSH if any DRHD does not support snooping.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-30 15:06:08 +01:00
Keir Fraser cedcb04c7d vtd: Remove dead code.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-29 14:30:48 +01:00
Keir Fraser 8a41cd8573 xend: Add node parameter to do_migrate() for HTTP interface
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-29 13:38:31 +01:00
Keir Fraser 2a999fc51f ia64: Do not guest_physmap_remove_page() old page in gnttab_transfer op.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-29 11:19:16 +01:00
Keir Fraser 9d5051f32b x86: Fix reboot failure after S3
"warm reset vector" is used to start APs. At booting time, it is set
by BP, and cleared after all APs have started. When do S3, similar work
need to do. However, when enable non-boot CPUs after S3, Xen just sets
this vector, but forgets to clear it after APs startup.

Signed-off-by: Huacai Chen <huacai.chen@intel.com>
2008-05-29 09:42:59 +01:00
Keir Fraser a37a9008c8 pv-on-hvm: Change barrier from rmb to wmb.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-05-29 09:40:07 +01:00
Keir Fraser 95942d7cab vtd: addr_to_dma_page_maddr() must release its lock.
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2008-05-29 09:39:23 +01:00
Keir Fraser 8a02aa347f vtd: More TLB flush fixes.
- Made the non-present flush testing a bit simpler.
 - Removed dma_addr_level_page_maddr().  Use a modified
   addr_to_dma_page_maddr() instead.
 - Upon mapping new context entry: flush old entry using domid 0 and
   always flush iotlb.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
2008-05-28 16:14:10 +01:00
Keir Fraser 491c0ade25 iommu: Handle sibling device assignment correctly
Domctl interface is extended to allow libxc retrieve device group
information from hypervisor. Vendor-specific iommu_ops is also
extended by adding a new operation "get_device_group_id()", which is
currently a null pointer but could be implemented later for vt-d.

Error will be raised from tools side when user trying to assign PCI
device with a sibling device being driven by dom0. User will keep
being prompted until he has hidden the entire device group (at least,
the sibling devices driven by dom0) in dom0 kernel
parameter. Hopefully this framework could be flexible enough to
support both amd iommu and vt-d.

The following 2 cases are not covered by this patch, but should be
easy to handle.
* Checking for hot-plug devices (maybe we can delay calling
ImageHandler.signalDeviceModel() until all checks are done?)
* Checking for splitted device group between different passthru
domains

Signed-off-by: Wei Wang <wei.wang2@amd.com>
2008-05-28 14:41:23 +01:00
Keir Fraser 32c028cd83 ioemu: set up all xenstore watches even if there are no VBDs.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-05-28 12:22:36 +01:00
Keir Fraser 61730c75ce grant_table: Flush host CPU TLBs during grant transfer.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-28 11:43:37 +01:00
Isaku Yamahata 2288155064 [IA64] cleanup: vcpu_set_psr_sm.
It is pointless to set the machine psr.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-05-28 18:10:44 +09:00
Keir Fraser 435f3f8072 vtd: TLB flush fixups.
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2008-05-28 10:05:57 +01:00
Keir Fraser cc8cdb7e47 hvmloader: No need to map shared_info page into the legacy VGA MMIO
hole. We can access address 0xfffff000 from 32-bit protected mode.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-28 10:02:00 +01:00
Keir Fraser 3113cc5e5f vtd: IOTLB flush fixups
On map: only flush when old PTE was valid or invalid PTE may be
cached.
On unmap: always flush old entry, but skip flush for unaffected
IOMMUs.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
2008-05-28 09:31:49 +01:00
Keir Fraser ddbd09069c stubdom: Save main_thread value by moving it out from app_bss which
gets cleared.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-28 09:31:04 +01:00
Keir Fraser f9b4231a67 stubdom: make the build more generic by moving as many stubdom parts
into stubdom/ as possible.  That also permits to build all of
ioemu, c and caml stubdoms at the same time.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-28 09:30:48 +01:00
Keir Fraser 4151cc56f1 vtd: interrupt remapping for MSI/MSI-x.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-05-28 09:29:05 +01:00
Keir Fraser 99c3cae637 vtd: Fix bugs of ioapic interrupt remapping.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2008-05-28 09:28:42 +01:00
Keir Fraser 28d2d07fde minios: We do not need to pin the page tables, as they implicitly get
pinned when we point the permanent page directory to them.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-05-27 13:03:05 +01:00
Keir Fraser 530f24f8b1 ioemu: Force floppy disk images to be interpreted as raw.
Fixes specifying fda/fdb image names in domain configs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-27 11:51:33 +01:00
Keir Fraser 863d18e20d Revert 17731:eafb252f141.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-27 11:50:43 +01:00
Keir Fraser 09f9ad2f69 Fix 17725:c0c0f4fa8850: use type paddr_t instead of unsigned long for physcial memory address
Otherwise, the address overflows on PAE system with memory size > 4G.

Signed-off-by: Yang, Xiaowei <xiaowei.yang@intel.com>
2008-05-27 10:35:10 +01:00
Keir Fraser 91df8a74b6 xend: fix a typo in domain_migrate().
- @rtype:  ->  @type node:

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-27 10:31:55 +01:00
Keir Fraser 3ebb3ee816 xend: add a reset button to Web interface.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-27 10:31:25 +01:00
Keir Fraser 056f122d52 xend: take care of dead qemu-dm process
This patch fix xend as when fatal error happened (e.g. qemu-dm process
was killed) log error message then mark that domain as crashed, do
what specified on crashed in the domain config file. Added some code in
xend to check those crashed hvm DM status each 30 seconds.

Signed-off-by: Xiaowei Hu <xiaowei.hu@oracle.com>
2008-05-26 08:53:25 +01:00
Keir Fraser 2616d6e2e8 x86 hvm: Drop pagetable reference when resetting a VCPU to real mode.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-26 08:45:59 +01:00
Keir Fraser d91702d514 Fix domain names that xentop shows
When I changed the name of a domain by using xm rename command, the
name of the domain that xentop shows did not change.  This patch
reflects new domain name to the name of domains that xentop shows.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-26 08:37:43 +01:00
Keir Fraser 7ff0fc519d [IA64] remove warnings caused by c/s 17723:c684cf331f94
This patch removes the following warnings on ia64 by
including necessary header files.
On x86 the necessary files are included by recusive inclusion.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-05-26 08:27:19 +01:00
Keir Fraser 11b6a5dbe0 Fix XendAPI VM_migrate parameters
This patch removes unused resource parameter and fixes the default
value for domain_migrate. Also removes tab indent in XendOptions.py.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2008-05-26 08:26:37 +01:00
Keir Fraser 101b0e44af VT-d: flush iotlb of selective iommu when a domain's VT-d table is changed
When a domain's VT-d table is changed, only the iommus under which the
domain has assigned devices need to be flushed.

Signed-off-by: Yang, Xiaowei <xiaowei.yang@intel.com>
2008-05-26 08:25:36 +01:00