xen.git
17 years agoxm: fix trivial typo. s/ciredump-restore/coredump-restart/
Keir Fraser [Thu, 7 Aug 2008 08:05:31 +0000 (09:05 +0100)]
xm: fix trivial typo. s/ciredump-restore/coredump-restart/

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoRevert 18242:f20fb83dac2c (Xen 3.3 after all)
Keir Fraser [Thu, 7 Aug 2008 08:04:53 +0000 (09:04 +0100)]
Revert 18242:f20fb83dac2c (Xen 3.3 after all)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoUse legacy ioemu on ia64 for Xen 4.0
Keir Fraser [Wed, 6 Aug 2008 14:19:13 +0000 (15:19 +0100)]
Use legacy ioemu on ia64 for Xen 4.0

Signed-off-by: Aron Griffis <aron@hp.com>
17 years agoiommu: Make the iommu boot parameters more generic and flexible
Keir Fraser [Wed, 6 Aug 2008 14:18:17 +0000 (15:18 +0100)]
iommu: Make the iommu boot parameters more generic and flexible

Make the 'iommu' boot parameter take a comma separated value
indicating whether iommu is required to boot and whether to enable
iommu for pv domains.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoioemu-stubdom: fix initialization of vm_change_state_head
Keir Fraser [Wed, 6 Aug 2008 10:38:42 +0000 (11:38 +0100)]
ioemu-stubdom: fix initialization of vm_change_state_head
That is actually a no-op since it just sets it to NULL again, but
makes sense.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: fix documentation file names
Keir Fraser [Wed, 6 Aug 2008 10:38:20 +0000 (11:38 +0100)]
stubdom: fix documentation file names

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agovtd: Update vtd.txt
Keir Fraser [Wed, 6 Aug 2008 09:56:58 +0000 (10:56 +0100)]
vtd: Update vtd.txt

Add "iommu=1" option in grub, due to VT-d is not enabled by default.

In addition, describes how to enable MSI/MSI-x for assigned devices.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoioemu: Fix I/O BAR mapping problem
Keir Fraser [Wed, 6 Aug 2008 09:54:55 +0000 (10:54 +0100)]
ioemu: Fix I/O BAR mapping problem

Check BAR type indicator to avoid I/O BAR being mistaken as 64-bit =
memory BAR.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
17 years agoioemu: fix a bug in serial_load
Keir Fraser [Wed, 6 Aug 2008 08:46:25 +0000 (09:46 +0100)]
ioemu: fix a bug in serial_load

Currently we are trying to read the same value twice in the
serial_load function, this patch fixes that.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agovtd: Tiny cleanups.
Keir Fraser [Wed, 6 Aug 2008 08:40:50 +0000 (09:40 +0100)]
vtd: Tiny cleanups.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxend: Expose persistent domain path in xend conf file
Keir Fraser [Wed, 6 Aug 2008 08:38:43 +0000 (09:38 +0100)]
xend: Expose persistent domain path in xend conf file

This patch exposes the persistent (aka managed) domain path in xend
configuration file.  This option is already supported in XendOptions
but is not annotated in the configuration file.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agovtd: Add 'force_iommu' option
Keir Fraser [Wed, 6 Aug 2008 08:37:53 +0000 (09:37 +0100)]
vtd: Add 'force_iommu' option

For security reasons, add 'force_iommu' option to ensure that it
should not be possible under any conditions to boot Xen w/o VT-d being
enabled. This would only be specified by users that really want the
added security.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agovtd: cleanups
Keir Fraser [Wed, 6 Aug 2008 08:37:01 +0000 (09:37 +0100)]
vtd: cleanups
- Flush iotlb in iommu_page_mapping() after page mapping
- Change BUG_ON() to ASSERT() in iommu_flush_iotlb_psi()
- Add iommu_flush_write_buffer() if iommu_flush_iotlb_psi() fails in
  dma_pte_clear_one()
- Change panic() message to easily know where panic happens

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoinstall more documentation to /usr/share/doc/xen and /etc/xen
Keir Fraser [Wed, 6 Aug 2008 08:34:55 +0000 (09:34 +0100)]
install more documentation to /usr/share/doc/xen and /etc/xen
Also resync xmexample3 with xmexample1 and 2.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: add *_URL variables to permit to use e.g. local mirrors.
Keir Fraser [Wed, 6 Aug 2008 08:33:10 +0000 (09:33 +0100)]
stubdom: add *_URL variables to permit to use e.g. local mirrors.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoUpdate version number 3.3->4.0.
Keir Fraser [Tue, 5 Aug 2008 12:55:14 +0000 (13:55 +0100)]
Update version number 3.3->4.0.

17 years agoRemove vncconsole from example HVM configs. It's deprecated.
Keir Fraser [Tue, 5 Aug 2008 12:45:53 +0000 (13:45 +0100)]
Remove vncconsole from example HVM configs. It's deprecated.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: vncconsole config option mustn't be a string
Keir Fraser [Tue, 5 Aug 2008 12:45:25 +0000 (13:45 +0100)]
xend: vncconsole config option mustn't be a string
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Do not pass -m (memory) option to qemu, as ioemu-remote rejects
Keir Fraser [Tue, 5 Aug 2008 12:23:59 +0000 (13:23 +0100)]
ioemu: Do not pass -m (memory) option to qemu, as ioemu-remote rejects
memory sizes greater than 2GB when built as a 32-bit binary.

Instead, direct HVM Linux loading approximates end of low memory via a
different method.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Remove WARN_ON() in domain_relinquish_resources().
Keir Fraser [Tue, 5 Aug 2008 09:48:53 +0000 (10:48 +0100)]
x86: Remove WARN_ON() in domain_relinquish_resources().
It can fire if domain0 (e.g., qemu-dm) has Xen heap pages mapped.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agofs-back: build fix for BSD
Keir Fraser [Tue, 5 Aug 2008 08:59:01 +0000 (09:59 +0100)]
fs-back: build fix for BSD
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoxend: remove default NIC in qemu when no vif configured
Keir Fraser [Tue, 5 Aug 2008 08:29:42 +0000 (09:29 +0100)]
xend: remove default NIC in qemu when no vif configured

Latest QEMU would add a NIC device by default, unless specify the
"-nic none". So end user still get a unusable NIC even no vif in the
config file.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
17 years agox86: debug key prints memory node info of each domain
Keir Fraser [Tue, 5 Aug 2008 08:28:24 +0000 (09:28 +0100)]
x86: debug key prints memory node info of each domain

This patch will collect memory location (the domain has how many pages
in different node) of each domain and display if you input debug key.

Signed-off-by: Zhou Ting <ting.g.zhou@intel.com>
17 years agox86: Actually mdelay() in machine_restart().
Keir Fraser [Tue, 5 Aug 2008 08:25:10 +0000 (09:25 +0100)]
x86: Actually mdelay() in machine_restart().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRevert 18232:2e47722d3501
Keir Fraser [Mon, 4 Aug 2008 22:00:30 +0000 (23:00 +0100)]
Revert 18232:2e47722d3501

17 years agoRevert to old ioemu for now.
Keir Fraser [Mon, 4 Aug 2008 19:54:22 +0000 (20:54 +0100)]
Revert to old ioemu for now.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: install stubdom kernels as data
Keir Fraser [Mon, 4 Aug 2008 17:11:12 +0000 (18:11 +0100)]
stubdom: install stubdom kernels as data
since they do not need to be directly executed

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoPV-GRUB: add sample config file
Keir Fraser [Mon, 4 Aug 2008 17:10:51 +0000 (18:10 +0100)]
PV-GRUB: add sample config file

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86: rendezvous-based local time calibration
Keir Fraser [Mon, 4 Aug 2008 17:08:51 +0000 (18:08 +0100)]
x86: rendezvous-based local time calibration

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRevert 18102:85a83b919653 (clocksource=tsc)
Keir Fraser [Mon, 4 Aug 2008 16:04:21 +0000 (17:04 +0100)]
Revert 18102:85a83b919653 (clocksource=tsc)

17 years agoRevert 18150:b47e503f3282
Keir Fraser [Mon, 4 Aug 2008 15:57:42 +0000 (16:57 +0100)]
Revert 18150:b47e503f3282

17 years agostubdom: rename the ioemu-dm domain config file to domainname-dm,
Keir Fraser [Mon, 4 Aug 2008 15:47:52 +0000 (16:47 +0100)]
stubdom: rename the ioemu-dm domain config file to domainname-dm,
which is shorter, makes more sense, and sorts better.

From: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agomini-os: Fix 32bit compilation of fs-front.c
Keir Fraser [Mon, 4 Aug 2008 15:45:11 +0000 (16:45 +0100)]
mini-os: Fix 32bit compilation of fs-front.c

Reported-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoFix make help for stubdom
Keir Fraser [Mon, 4 Aug 2008 15:44:14 +0000 (16:44 +0100)]
Fix make help for stubdom

This patch fixes "make help".
"make stubdomain" does not work.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
17 years agoFix a few typos
Keir Fraser [Mon, 4 Aug 2008 10:25:20 +0000 (11:25 +0100)]
Fix a few typos

From: Diego Ongaro <diego.ongaro@eu.citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years ago.hgignore: ignore any kind of tag file anywhere
Keir Fraser [Mon, 4 Aug 2008 10:16:02 +0000 (11:16 +0100)]
.hgignore: ignore any kind of tag file anywhere

From: Diego Ongaro <diego.ongaro@eu.citrix.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: Fix the Makefile to avoid brace expansion
Keir Fraser [Mon, 4 Aug 2008 10:15:24 +0000 (11:15 +0100)]
stubdom: Fix the Makefile to avoid brace expansion

While building stubdom, I saw an error.

  install: cannot stat `lib/{config,header,pci,types}.h': No such file
  or directory

It seems brace expansion is not available in some environments, so we
had better avoid using it.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years ago.hgignore updates for MiniOS
Keir Fraser [Mon, 4 Aug 2008 10:13:27 +0000 (11:13 +0100)]
.hgignore updates for MiniOS

From: Diego Ongaro <diego.ongaro@eu.citrix.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agovtd: Fix a missing spin_unlock_irqrestore()
Keir Fraser [Mon, 4 Aug 2008 10:12:15 +0000 (11:12 +0100)]
vtd: Fix a missing spin_unlock_irqrestore()

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxend: Fix handling of pci creation failure in device_create().
Keir Fraser [Mon, 4 Aug 2008 10:11:24 +0000 (11:11 +0100)]
xend: Fix handling of pci creation failure in device_create().

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agoxm on xenapi: Enable 'xm pci-list' via Xen-API
Keir Fraser [Mon, 4 Aug 2008 10:11:02 +0000 (11:11 +0100)]
xm on xenapi: Enable 'xm pci-list' via Xen-API

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agoxend: fix finding pci capability
Keir Fraser [Mon, 4 Aug 2008 10:10:27 +0000 (11:10 +0100)]
xend: fix finding pci capability

Xend doesn't start up on my laptop which has a PCI-CardBus bridge.
PCI-CardBus bridge device doesn't have a capability chain.
Also sanity checking of a capability chain.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agostubdom: fix read-only disks access
Keir Fraser [Mon, 4 Aug 2008 10:07:17 +0000 (11:07 +0100)]
stubdom: fix read-only disks access

There is no need for a flush on read-only disks.  It would actually
even error out and disturb the guest.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoxm: fix up exception handling when spawning vnc viewer.
Keir Fraser [Mon, 4 Aug 2008 10:06:31 +0000 (11:06 +0100)]
xm: fix up exception handling when spawning vnc viewer.

From: Ian Jackson <Ian.Jackson@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoDelay 5 seconds on reboot *after* stopping all CPUs.
Keir Fraser [Mon, 4 Aug 2008 09:59:22 +0000 (10:59 +0100)]
Delay 5 seconds on reboot *after* stopping all CPUs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix stubdom makefile mistake.
Keir Fraser [Fri, 1 Aug 2008 14:38:07 +0000 (15:38 +0100)]
Fix stubdom makefile mistake.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: fix clean target after distclean
Keir Fraser [Fri, 1 Aug 2008 14:25:02 +0000 (15:25 +0100)]
stubdom: fix clean target after distclean

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu, passthrough: fix flag for expansion rom base address register.
Keir Fraser [Fri, 1 Aug 2008 08:54:54 +0000 (09:54 +0100)]
ioemu, passthrough: fix flag for expansion rom base address register.

pt_bar_reg_parse() is called for expansion rom base address register.
Currently it returns PT_BAR_FLAG_MEM if bit 0 is 0. It returns
PT_BAR_FLAG_IO if bit 0 is 1.

But bit 0 in expansion rom base address register is enable bit. If bit
0 is 1 for some reason, it returns PT_BAR_FLAG_IO. Expansion rom is
mapped to memory space. It should return PT_BAR_FLAG_MEM.

After applying this patch, it returns PT_BAR_FLAG_MEM regardless
of bit 0, when it is called for expansion rom base address register.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoioemu, passthrough: fix corrupting register value in pt_pci_write_config().
Keir Fraser [Fri, 1 Aug 2008 08:54:13 +0000 (09:54 +0100)]
ioemu, passthrough: fix corrupting register value in pt_pci_write_config().

I forgot to shift value read from real device. If the emulated
register offset is not aligned with 4 byte, the write emulation will
not be handled well because of corrupting register value read from
real device. The patch fixes this issue.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoioemu: fix libpci error handling.
Keir Fraser [Fri, 1 Aug 2008 08:53:05 +0000 (09:53 +0100)]
ioemu: fix libpci error handling.

libpci returns ALL F when error occurs. Currently, if libpci returns
ALL F, emulation stops. But it is possible that the field of real register
which is read by guest software is ALL F.

After applying this patch, if libpci returns ALL F, ioemu will log
warning message and continue the emulation.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoioemu, passthrough: fix writing handlers for base address registers.
Keir Fraser [Fri, 1 Aug 2008 08:52:22 +0000 (09:52 +0100)]
ioemu, passthrough: fix writing handlers for base address registers.

This patch fixes writing handlers for base address registers (include
expansion rom base address register) as follows.
It can be applied to both ioemu-remote and ioemu.

- Current implementation can not work fine when base address registers
  are accessed via 1 byte write access and 2 byte write access. This
  patch enables them.

- Currently guest software can set address which is not aligned
  with resource size and page size. The patch does not allow guest
  software to set unaligned address.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoioemu, passthrough: fix log messages and comments
Keir Fraser [Fri, 1 Aug 2008 08:51:27 +0000 (09:51 +0100)]
ioemu, passthrough: fix log messages and comments

- fix log messages to make analysis easier when issue occurs.

- remove verbose message.

- add comments in the source code.

- fix wrong comments in the source code.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoio passthru: fix a bug when assigning a SATA CDROM or DISK
Keir Fraser [Fri, 1 Aug 2008 08:45:36 +0000 (09:45 +0100)]
io passthru: fix a bug when assigning a SATA CDROM or DISK
Signed-off-by: Li Zhang <li.zhang@intel.com>
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
17 years agominios: Error case when unbinding unknown port in xc_evtchn_unbind is
Keir Fraser [Fri, 1 Aug 2008 08:38:25 +0000 (09:38 +0100)]
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>
17 years agoFSIF: extend protocol to multi-grant requests and multi-page ring
Keir Fraser [Fri, 1 Aug 2008 08:37:10 +0000 (09:37 +0100)]
FSIF: extend protocol to multi-grant requests and multi-page ring

To improve throughput and inline the stat response.

Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: update documentation
Keir Fraser [Fri, 1 Aug 2008 08:36:18 +0000 (09:36 +0100)]
stubdom: update documentation

stubdom/ is now compiled and installed by default
HVM+IOEMU-stubdom can not boot if dom0 has to be ballooned.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agopass IOEMU_CONFIGURE_CROSS to ioemu-remote/xen-setup
Keir Fraser [Thu, 31 Jul 2008 15:13:22 +0000 (16:13 +0100)]
pass IOEMU_CONFIGURE_CROSS to ioemu-remote/xen-setup

Add --cpu to IOEMU_CONFIGURE_CROSS since otherwise qemu uses the
output of `uname -m` even for cross-building.  Pass
IOEMU_CONFIGURE_CROSS to xen-setup which passes it on to
ioemu/configure.

Signed-off-by: Aron Griffis <aron@hp.com>
17 years agoAMD IOMMU: spin_uinlock() on early return path.
Keir Fraser [Thu, 31 Jul 2008 14:38:09 +0000 (15:38 +0100)]
AMD IOMMU: spin_uinlock() on early return path.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agopv-on-hvm: Update for linux-2.6.18-xen.hg:623:2866e6af50
Keir Fraser [Thu, 31 Jul 2008 14:34:58 +0000 (15:34 +0100)]
pv-on-hvm: Update for linux-2.6.18-xen.hg:623:2866e6af50
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAMD IOMMU: Miscellaneous fixes and cleanups.
Keir Fraser [Thu, 31 Jul 2008 12:37:29 +0000 (13:37 +0100)]
AMD IOMMU: Miscellaneous fixes and cleanups.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoAMD IOMMU: Add deallocation for interrupt remapping table.
Keir Fraser [Thu, 31 Jul 2008 12:36:45 +0000 (13:36 +0100)]
AMD IOMMU: Add deallocation for interrupt remapping table.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoAMD IOMMU: Remove pci scanning, parse acpi structures to detect iommu hardware.
Keir Fraser [Thu, 31 Jul 2008 12:36:14 +0000 (13:36 +0100)]
AMD IOMMU: Remove pci scanning, parse acpi structures to detect iommu hardware.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoAMD IOMMU: Remove device range register access, parse acpi structures
Keir Fraser [Thu, 31 Jul 2008 12:35:41 +0000 (13:35 +0100)]
AMD IOMMU: Remove device range register access, parse acpi structures
to acquire IO topology.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoAMD IOMMU: Since device id covered by each iommu can never overlap,
Keir Fraser [Thu, 31 Jul 2008 12:35:00 +0000 (13:35 +0100)]
AMD IOMMU: Since device id covered by each iommu can never overlap,
use a global device table instead of allocating private tables for
each iommu. Migrate a few functions from pci_amd_iommu.c

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoxm on xenapi: Enable 'xm pci-{att,det}ach' commands to be executed via xen-api.
Keir Fraser [Thu, 31 Jul 2008 12:31:15 +0000 (13:31 +0100)]
xm on xenapi: Enable 'xm pci-{att,det}ach' commands to be executed via xen-api.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agoxm on xenapi: Add missing support for creating pci-assigned domains
Keir Fraser [Thu, 31 Jul 2008 12:30:59 +0000 (13:30 +0100)]
xm on xenapi: Add missing support for creating pci-assigned domains

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agomini-os: make init_pcifront fail early if there is no backend
Keir Fraser [Thu, 31 Jul 2008 12:30:24 +0000 (13:30 +0100)]
mini-os: make init_pcifront fail early if there is no backend

Else, we would leave entries in xenstore, which disturbs xend.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoxend: Fix portability issue of lspci option.
Keir Fraser [Thu, 31 Jul 2008 11:39:56 +0000 (12:39 +0100)]
xend: Fix portability issue of lspci option.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agohvm builder: Cleaner sp_extents allocation
Keir Fraser [Thu, 31 Jul 2008 11:38:32 +0000 (12:38 +0100)]
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>
17 years agox86: Handle p2m_ram_ro with HAP
Keir Fraser [Thu, 31 Jul 2008 11:11:00 +0000 (12:11 +0100)]
x86: Handle p2m_ram_ro with HAP

I realized that I had failed to cover the hardware assisted paging
case in my earlier p2m_ram_ro patches. This should fix it.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoUpdate Xen version for 3.3.0-rc3-pre
Keir Fraser [Thu, 31 Jul 2008 10:55:19 +0000 (11:55 +0100)]
Update Xen version for 3.3.0-rc3-pre

17 years agoAdded tag 3.3.0-rc2 for changeset dde12ff94c96331668fe38a7b09506fa94d03c34
Keir Fraser [Thu, 31 Jul 2008 10:54:29 +0000 (11:54 +0100)]
Added tag 3.3.0-rc2 for changeset dde12ff94c96331668fe38a7b09506fa94d03c34

17 years agoUpdate Xen version for 3.3.0-rc2.
Keir Fraser [Thu, 31 Jul 2008 10:54:22 +0000 (11:54 +0100)]
Update Xen version for 3.3.0-rc2.

17 years agofirmware: Fix build dependencies.
Keir Fraser [Thu, 31 Jul 2008 10:51:14 +0000 (11:51 +0100)]
firmware: Fix build dependencies.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove vtd_hw_check().
Keir Fraser [Thu, 31 Jul 2008 10:14:23 +0000 (11:14 +0100)]
Remove vtd_hw_check().

Since we have separate VT-d page tables, actually we don't need the
checking.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoevtchn: Avoid spurious event-channel notifications across unbind/bind.
Keir Fraser [Thu, 31 Jul 2008 10:13:30 +0000 (11:13 +0100)]
evtchn: Avoid spurious event-channel notifications across unbind/bind.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Huacai Chen <huacai.chen@intel.com>
17 years agovtd: Fix bug #1306: Dom0 hangs when destroying guest with MSI NIC assigned
Keir Fraser [Thu, 31 Jul 2008 08:51:06 +0000 (09:51 +0100)]
vtd: Fix bug #1306: Dom0 hangs when destroying guest with MSI NIC assigned

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
17 years agostubdom: fix make clean ; make
Keir Fraser [Thu, 31 Jul 2008 08:49:28 +0000 (09:49 +0100)]
stubdom: fix make clean ; make

make should not have to regenerate the libxc and ioemu directories
since that is part of the mk-headers target.  Use the subdirectory
clean targets instead to clean just the object files.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agovtd: Add a debug key 'V' to dump some iommu info.
Keir Fraser [Thu, 31 Jul 2008 08:48:46 +0000 (09:48 +0100)]
vtd: Add a debug key 'V' to dump some iommu info.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoAllow xm to spawn vnc viewer
Keir Fraser [Wed, 30 Jul 2008 15:22:45 +0000 (16:22 +0100)]
Allow xm to spawn vnc viewer

The new merged qemu no longer has the ability to spawn a vnc viewer
process in the bowels of the xend/qemu stack.  In this patch we
provide support for this use case in a different manner - one more
akin to the mechanism used for `xm console' and `xm create -c'.

We introduce new xm options:
   xm create --vncviewer [--vncviewer-autopass]
   xm vncviewer [--vncviewer-autopass]

These spawn a VNC viewer, obtaining the relevant information
(including the port number and if you tell it your viewer supports it
the password to use) directly from xenstore.

Like xm console it waits in the foreground for the vnc port to become
available; the timeout case isn't handled as well as it might be - it
just causes the whole program (xm) to die with `Alarm clock' but this
is difficult to deal with given the current structure of the xs Python
lowlevel interface, which doesn't provide a timeout on the call to
wait for a xenstore watch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agogrant_table: Remove compat-shim BUG_ON() which can fail if
Keir Fraser [Wed, 30 Jul 2008 14:25:09 +0000 (15:25 +0100)]
grant_table: Remove compat-shim BUG_ON() which can fail if
GMFN==INVALID (~0UL).

Found by Diego Ongaro <diego.ongaro@citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agofirmware: Fix CFLAGS -I directives.
Keir Fraser [Wed, 30 Jul 2008 09:55:06 +0000 (10:55 +0100)]
firmware: Fix CFLAGS -I directives.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agorombios: Simplify and clarify POST code a little.
Keir Fraser [Wed, 30 Jul 2008 09:02:11 +0000 (10:02 +0100)]
rombios: Simplify and clarify POST code a little.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: fix warnings in pass-through.h and pass-through.c
Keir Fraser [Wed, 30 Jul 2008 08:26:06 +0000 (09:26 +0100)]
ioemu: fix warnings in pass-through.h and pass-through.c

This patch backports following changes of ioemu-remote to ioemu.
It fixs warning in tools/ioemu/hw/pass-through.h and
tools/ioemu/hw/pass-through.c.

commit 30f00a0284a5ee356de6f6095e52173f2234145b
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Fri Jul 18 16:02:23 2008 +0100

    hw/pass-through.c: pt_unregister_regions returns void

    It only ever falls off the end, and its return value is not used
    by its one caller.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
commit 439836900dad41f66234d2a14981aa2a90d4d346
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Tue Jul 22 11:55:18 2008 +0100

    Add missing cast for printf of maddr

commit cf5b00e6b714eb5f900d55471d85956b09cb8fd9
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Jul 24 13:57:10 2008 +0100

    pass-through.h: Sprinkle some #ifdefs to cope with pciutils-dev
    versions

    Some versions of pciutils-dev contain #defines which others are
    lacking.
    To avoid spurious compiler warnings we add some #ifdefs.  *sigh*

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agovtd: Move dom0 RMRR check to intel_iommu_remove_device()
Keir Fraser [Wed, 30 Jul 2008 08:25:07 +0000 (09:25 +0100)]
vtd: Move dom0 RMRR check to intel_iommu_remove_device()

If put dom0 RMRR check in domain_context_unmap_one(), the devices with
RMRR cannot be assigned to other domain, becuase
domain_context_unmap_one() won't unmap context for them, and dom0
always owns them. This patch moves the check to intel_iommu_remove_device()
which is only called by dom0 hypercall.  This not only guarantees
keeping RMRR mappings for dom0 during its booting, but also won't
impact device assignment.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agopygrub: Add 64bit library path to pygrub default search path.
Keir Fraser [Wed, 30 Jul 2008 08:23:47 +0000 (09:23 +0100)]
pygrub: Add 64bit library path to pygrub default search path.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxm, xenapi: Fix a problem in xm client for domain shutdown
Keir Fraser [Wed, 30 Jul 2008 08:23:11 +0000 (09:23 +0100)]
xm, xenapi: Fix a problem in xm client for domain shutdown

Xm did not shut down domains anymore when run in xen-api mode due to a
'None' parameter being passed to xend when looking up a domain. This
fixes the problem.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxm: Enable a bootloader when using XM via Xen-API
Keir Fraser [Wed, 30 Jul 2008 08:22:24 +0000 (09:22 +0100)]
xm: Enable a bootloader when using XM via Xen-API

This enables the usage of a bootloader, i.e., pygrub, when starting a
domain using xm in Xen-API mode.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agox86: Fix the build after c/s 18163 (5fbcbee355e2)
Keir Fraser [Wed, 30 Jul 2008 08:20:42 +0000 (09:20 +0100)]
x86: Fix the build after c/s 18163 (5fbcbee355e2)

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxenconsoled: replace gettimeofday with clock_gettime
Keir Fraser [Wed, 30 Jul 2008 08:18:35 +0000 (09:18 +0100)]
xenconsoled: replace gettimeofday with clock_gettime

Currently if someone changes the date on the host, xenconsoled may
behave incorrectly due to the use of gettimeofday for the rate control
algorithm. For example I was able to hang the console connected to a
guest just setting the date forward 20 years. To solve the problem we
need to use a time source that doesn't change start point, that is
clock_gettime with CLOCK_MONOTONIC. The only bad side effect is that
it introduces a dependency to librt, but I think is well worth it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agorombios: Remove dead code.
Keir Fraser [Tue, 29 Jul 2008 16:00:29 +0000 (17:00 +0100)]
rombios: Remove dead code.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agorombios: Obtain S3 wake vector from >1MB.
Keir Fraser [Tue, 29 Jul 2008 15:03:58 +0000 (16:03 +0100)]
rombios: Obtain S3 wake vector from >1MB.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agohvmloader: Load ACPI tables outside BIOS area, so they are writable by
Keir Fraser [Tue, 29 Jul 2008 14:10:58 +0000 (15:10 +0100)]
hvmloader: Load ACPI tables outside BIOS area, so they are writable by
OSPM (particularly the S3 firmware_waking_vector).

TODO: rombios must enter protected mode to fetch the vector on S3 resume.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoChange Px control protection corresponding to changeset 18125
Keir Fraser [Tue, 29 Jul 2008 12:27:29 +0000 (13:27 +0100)]
Change Px control protection corresponding to changeset 18125

xen changeset 18125(ab1d7db3facb) changed some px init logic, which
has some effect to Px statistic and S3 suspend/resume logic.
This patch change Px control protection corresponding to changeset
18125.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
17 years agox86, hvm: Fix issue with user-mode writes to read-only memory.
Keir Fraser [Tue, 29 Jul 2008 12:24:57 +0000 (13:24 +0100)]
x86, hvm: Fix issue with user-mode writes to read-only memory.

This patch fixes an issue where a guest could get stuck if a write to
memory marked p2m_ram_ro happened from user mode. It would get
misinterpreted as a user-mode page-table write, and the "dummy write"
emulation necessary to skip over the instruction never got done. In
looking into this, I also discovered that the user-mode page-table
check is done in two places, the second (in emulate_map_dest) of which
can never be reached and is just a waste of cycles. Tim Deegan
requested that rather than completely removing that code, I'd leave it
in for debug-builds with an added warning-print.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agorombios: Narrow window where BIOS area is writable, and ensure it
Keir Fraser [Tue, 29 Jul 2008 12:11:29 +0000 (13:11 +0100)]
rombios: Narrow window where BIOS area is writable, and ensure it
really *is* writable in that region. This is almost enough to get S3
working again (read-only firmware-waking-vector is still a problem).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: reprogram LAPIC timer in pit_broadcast_exit
Keir Fraser [Tue, 29 Jul 2008 09:42:30 +0000 (10:42 +0100)]
x86: reprogram LAPIC timer in pit_broadcast_exit

Thus to remove possible timer expiring delay caused by deep C state
LAPIC timer stopping.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agovtd: Fix some dmar bugs
Keir Fraser [Tue, 29 Jul 2008 09:41:41 +0000 (10:41 +0100)]
vtd: Fix some dmar bugs

In acpi_parse_one_drhd(), remove return directly when only one
INCLUDE_ALL check fails, so that avoid memory leak. In addition,
remove "dmaru->scope.devices_cnt == 0 && !dmaru->include_all" check,
due to PCI-PCI bridges are not counted.

This patch fixes bug #1307.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agox86: fix a few page table handling issues
Keir Fraser [Tue, 29 Jul 2008 09:05:32 +0000 (10:05 +0100)]
x86: fix a few page table handling issues

- adjust_guest_l?e() shouldn't be called on non-guest entries
- unadjust_guest_l3e() should be called in the back-out loop of
  alloc_l3_table()
- create_pae_xen_mappings() and pae_flush_pgd() shouldn't be called in
  the failure case of mod_l3_entry()

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoFix ia64 build.
Keir Fraser [Tue, 29 Jul 2008 08:57:14 +0000 (09:57 +0100)]
Fix ia64 build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>