Commit Graph
19285 Commits
Author SHA1 Message Date
Keir Fraser 3ba7d233c7 xend: allow VM configuration with both sdl=1 and vnc=1
In the stubdom case you can now specify sdl=1 and vnc=1 (again, both
can be selected at the same time) in the vfb configuration.
So instead of:

vfb = [ 'type=vnc' ]

now you have:

vfb = [ 'vnc=1,sdl=1' ]

the former configuration option is deprecated but still supported for
backward compatibility.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-03-06 19:13:23 +00:00
Keir Fraser 31e93ebbdd tboot: Fix return code for S3 integrity
The original patch left in a debug return value from one of the memory
integrity checks.  This patch returns the correct error code in case of a
failure.  This was re-tested to ensure that it still passes for the
expected case.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-06 19:10:29 +00:00
Keir Fraser 8033414951 i386: Build fix.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-06 19:07:15 +00:00
Keir Fraser f2c104206e Clean xen/crypto on make clean.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-06 19:07:00 +00:00
Keir Fraser 1aa391a262 vt-d: Better restrict memory ranges considered to be in Xen
The current implementation of xen_in_range() misses several memory
ranges that are used by the hypervisor and thus shouldn't get mapped
into dom0's VT-d tables.  This patch should make the check complete.

This patch is only against x86 because I'm not familiar enough with
IA64 to know how much, if any, of these checks apply there.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-06 19:06:30 +00:00
Keir Fraser f3cc74d2f1 tool: make management of PCI D-states by guest optional
D3hot state in some PCI devices causes the failure of domain
creation/destruction.

The default is "pci_power_mgmt=3D0" which disables the guest OS from
managing D-states because it would be better to avoid the trouble than
advantage of low power consumption.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-03-06 18:58:41 +00:00
Keir Fraser 7468faf8d3 xm-test: Identifying the network env specified in xend config fails,
if an additional parameter is given for the network-bridge
(e.g. netdev=eth1) The patch splits the network command into the
command name and its parameters to determine the netenv (bridge,
route, nat)

Signed-off-by: juergen.gross@fujitsu-siemens.com
2009-03-06 18:56:28 +00:00
Keir Fraser adfb6cc3c0 Panic rather than BUG if an error is encountered decompressing a bzImage
This gives a more useful error message without an unnecessary stack dump.

Noticed by Jeremy Fitzhardinge.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-03-06 18:55:05 +00:00
Keir Fraser 2ff253bcb6 Fix cpu selection at the time vCPU allocation
After cpu_[online/offline], set bits in cpu_online_map could be not
continuous. Use cycle_cpu() to pick the next one.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2009-03-06 18:54:09 +00:00
Keir Fraser b3a3ac0f6b Do not deadlock in scheduler when sending VIRQ_CON_RING.
Instead defer the virq notification to tasklet context.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-06 14:28:27 +00:00
Keir Fraser 6976476d8c xend: Handle missing s3_integrity value, default to zero.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-05 17:50:05 +00:00
Keir Fraser eea1a2ea39 xend: blkif hda regexp fix
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-03-05 15:10:17 +00:00
Keir Fraser b6f1cfa1c3 init script: Enable to run xend stop when dom0 shutdown
Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
2009-03-05 15:06:06 +00:00
Keir Fraser f78e2193b6 x86: Enable THERM_CONTROL_MSR write for dom0 even when cpufreq=xen
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-05 15:02:02 +00:00
Keir Fraser ca1c7b25a6 vtd: Fix iommu_inclusive_mapping to map all under 4GB.
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-05 14:55:24 +00:00
Keir Fraser 4e3057fddb [IA64] Remove compilation warning and typo caused by 19268:4b7d638a8b89
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-03-05 09:32:37 +00:00
Keir Fraser ce870565b6 Be careful with page_get_owner() now that owner field can be clobbered
by some users. Introduce get_page_owner_and_reference() where that can
be more useful.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-04 14:28:50 +00:00
Keir Fraser 86d2a1cec5 blktap: Allow creation of qcow2 files.
Signed-off-by: Yang Zhang <yang.zhang@intel.com>
2009-03-03 13:22:28 +00:00
Keir Fraser b47276c18f x86: Fix event-channel access for 32-bit HVM guests.
Based on a patch by Joe Jin <joe.jin@oracle.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-03 13:17:05 +00:00
Keir Fraser 6deab1ae31 txt: perform per-domain (and frametable and xenheap) MAC on entry into
S3 and verification on resume.

The MAC algorithm is called VMAC and was developed by Ted Krovetz and
Wei Dai (more details are in the files).  It is based on a universal hash
function.  The universal hash is passed through a pseudo-random function,
implemented using AES.  More details can be found at
http://fastcrypto.org/vmac/. =
 The AES code comes from the OpenBSD implementation (which is derived
 from the implementation referenced in VMAC site).

As Xen does not have a good source of entropy to generate its own key
(for the keyed hash), it uses the key that tboot passes in.

Although the code attempts to MAC all of a domain's pages (code/data,
VT-d tables) based on its s3_integrity flag, some of a domain's memory may
always be MAC'ed, e.g. shadow page tables.  Only xenheap pages that are in
use are MAC'ed.  We believe that the memory MAC'ed by the Xen code and the
ranges passed to tboot to MAC cover all of the memory whose integrity needs
to be protected on S3.  Any suggestions or ranges that we missed are
welcome.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-03 12:48:16 +00:00
Keir Fraser 8aaf870611 txt: Xen per-domain S3 integrity config
This patch adds a per-domain flag to specify whether a domain will be
S3 integrity protected when Xen is launched using tboot/TXT.

The tools now support an integer domain configuration parameter called
's3_integrity', which defaults to 1, to enable S3 integrity protection.

The struct arch_domain structure has been extended to have an
's3_integrity' field that represents this setting.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-03 11:52:44 +00:00
Keir Fraser 43246f5e26 hvm: passthrough MSI-X: fix ia64 link and MSI-X clean up
This patch fixes the ia64 link error and some clean up of MSI-X code.
- add ia64 dummy function to link
- fix unmatched prototype
- add error check

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-03-03 11:46:52 +00:00
Keir Fraser 9b82af4b03 libxen: fix a problem preventing use of xen_event_register().
The conversion of input parameter xen_string_set to XML format creates
a XML "struct" tag instead of "array". The patch sets the XML tag for
SET now to "array".

Signed-off-by: Lutz Dube <Lutz.Dube@fujitsu-siemens.com>
2009-03-03 11:41:15 +00:00
Keir Fraser 7fabf1409c xend: Make /var/lib/xen if not already present.
Signed-off-by: Christoph Egger <christoph.egger@amd.com>
2009-03-03 11:37:31 +00:00
Keir Fraser b57f88e746 ia64: fix build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-02 16:24:50 +00:00
Keir Fraser bb8b9cf891 When a domain crashes, ignore shutdown deferrals.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-02 14:09:21 +00:00
Keir Fraser e1608e7efb x86: Minimize the TSC drift between pCPUs
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2009-03-02 13:56:47 +00:00
Keir Fraser 6efe0dfb1c vtd: boolean boot parameter to allow inclusive mapping of all memory below 4GB
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
2009-03-02 11:23:23 +00:00
Keir Fraser 3b38f56731 x86: Make offlined CPU enter deepest C state
Before cpuidle is introduced, offlined CPU only enter C1 (by HLT
instruction). This is not optimal since C2/C3 can bring more power
saving. Since now cpuidle is introduced, it is time for offlined CPU
to enter more deeper C state.

This patch add the logic to make offlined CPU enter deepest C state,
if cpuidle is enabled.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
2009-03-02 11:11:19 +00:00
Keir Fraser f70473e487 xmexample: portability fix
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-02 11:04:43 +00:00
Keir Fraser e2f85a0f05 xen, pci: Fix the definition of PCI_PM_CTRL_NO_SOFT_RESET.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-03-02 11:01:06 +00:00
Keir Fraser be9ce82fc4 minios: general cleanup of mm.c
Major clean up of mm.c. Added comments, fixed coding style, more
sensible variable names, mark some local functions static etc.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2009-03-02 10:52:07 +00:00
Keir Fraser 6767a71fdd minios: cleanup events.c
Don't throw away hypercall error codes. They might be useful. Also
some minor coding style cleanups.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2009-03-02 10:51:34 +00:00
Keir Fraser 6976b9a7c2 minios: add ioremap/iounmap
Add ioremap and iounmap functions to minios. Also move some unmapping
code from and clean up mem_test.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2009-03-02 10:50:59 +00:00
Keir Fraser 8e3feb5145 xend: Fix removing /vm/UUID/device paths when device cannot be disconnected
Change deviceDestroy behavior to remove /vm/UUID/device/...
path only when force was used (as it already does so for both frontend
and backend) and do the removing from xen-hotplug-cleanup script when we
are sure the device is really not attached to the guest any more.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2009-03-02 10:34:37 +00:00
Keir Fraser 353e3c0d57 x86: Small fix for gpf when writing 1s to MCi_STATUS MSRs.
According to spec, only 0s is allowed to be written. This error is
found when do cpu-offline, cmci happens.
For avoiding missing future cmci after changing cmci owner, we need to
process pending cmci errors to clear MCi_STATUS MSRs.

Signed-off-by: Ke Liping <liping.ke@intel.com>
Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
2009-03-02 10:32:32 +00:00
Keir Fraser 69e8ef7314 acm: Return a valid buffer
This patch reverts a previous patch trying to fix a memory, even
though I don't think there was any. Now return a valid buffer. All
functions calling this function do free the buffer.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2009-03-02 10:31:16 +00:00
Keir Fraser 8bb7b3914b hvmloader: Make build fail if packages required to build hvmloader not present
Also, corrected the message generated by the makefile which says what
packages are required.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-03-02 10:30:15 +00:00
Keir Fraser 34097f0d30 hvm: passthrough MSI-X mask bit acceleration
Add a new parameter to DOMCTL_bind_pt_irq to allow Xen to know the
guest physical address of MSI-X table. Also add a new MMIO intercept
handler to intercept that gpa in order to handle MSI-X vector mask
bit operation in the hypervisor. This reduces the load of device model
considerably if the guest does mask and unmask frequently

Signed-off-by: Qing He <qing.he@intel.com>
2009-03-02 10:26:37 +00:00
Keir Fraser ec9db49cf0 xend: Fix some mistakes in tools/python/xend/util/pci.py
1) PCI_PM_CTRL_NO_SOFT_RESET: this is bit3 of PMCSR(Power Management
Control/Status). It should be 8. This bit means a device's capability
of not doing an internal reset across D3hot/D0.
If the bit is 1, there shall be no reset across D3hot/D0, so we should
not use it as a method to reset device.
2) When performing reset using standard FLR methods, we should sleep
at least 100ms; in current code, it's incorrect somewhere we sleep
0.2s and somewhere 0.01s.
3) In detect_dev_info(), fix a typo: PCI_EXP_TYPE_PCI_BRIDG ->
PCI_EXP_FLAGS_TYPE.
4) fix a small typo in the comment of transform_list().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-03-02 10:23:50 +00:00
Keir Fraser 5b0d675696 xend: Don't forget backend domain definitions for pvSCSI
Backend domain definitions for pvSCSI are forgotten.
This patch correctly handles them.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-02 10:22:23 +00:00
Keir Fraser b16ca0e441 x86, hvm: gcc44 build fix.
Broken constrain in inline asm.  Bytewise access works with a, b, c, d
registers only, thus "r" is wrong, it must be "q".  gcc 4.4 tries to
use the si register, which doesn't work and thus fails the build.

From: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-01 14:58:07 +00:00
Keir Fraser 1622101b19 xenstored: fix use-after free bug
Problem:  Handling requests for one connection can not only zap the
connection itself, due to socket disconnects for example.  It can also
zap *other* connections, due to domain release requests.  Especially
it can zap the connection we have saved a pointer to in the "next"
variable.

From: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-01 14:50:04 +00:00
Keir Fraser a81c662925 x86: Relax spinlock checks during shutdown or S3.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-01 14:35:57 +00:00
Keir Fraser 1c89143b63 x86, time: fix S3 suspend error
platform_time_calibration() is invoked in S3 when irq is disabled,
which causes ASSERT() error in spin_lock_irq(). spin_lock_irqsave()
saves us.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2009-03-01 14:30:35 +00:00
Keir Fraser 1f4246974a x86, ioapic: Fix S3 suspend error.
Invoke ioapic_pm_state_alloc() earlier,
thus avoiding check_lock() BUG_ON() in spin_lock().

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2009-03-01 14:17:08 +00:00
Keir Fraser 8bb2359cd7 xenconsole: Fix pty handling
I printed the terminal attributes after openpty() and they were
garbage on the first console, valid on the second etc.
openpty() gets garbage in (uninitialized attributes MODIFIED by
cfmakeraw()). It sets the slave to the attributes requested. Using
uninitialized data for cfmakeraw->openpty results in pty attributes
that may even have the receiver disabled. Closing the slave just hides
the bug as these attributes disappear and hope the slave will be
reopened and initialized.

From: Juergen Hannken-Illjes <hannken@netbsd.org>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-02-20 17:02:36 +00:00
Keir Fraser fecfa97c11 xenconsoled: make guest console visible on NetBSD dom0
After openpty(), slave_fd must be closed or guest console output goes
to the slave while select() in xen console client listens on the
master.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-02-20 11:13:11 +00:00
Keir Fraser 3a3034d101 [VTD] Utilise the snoop control capability in shadow with VT-d code
We compute the shadow PAT index in leaf page entries now as:
1) No VT-d assigned: let shadow PAT index as WB, handled already
in shadow code before.
2) direct assigned MMIO area: let shadow code compute the shadow
PAT with gMTRR=UC and gPAT value.
3) Snoop control enable: let shadow PAT index as WB.
4) Snoop control disable:  let shadow code compute the shadow
PAT with gMTRR and gPAT, handled already in shadow code before

Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com>
2009-02-20 11:11:40 +00:00
Keir Fraser d3d0b89247 libxc: xc_ptrace cleanup
There are some bugs in PTRACE_PEEK/POKE.
- can't track 2MB pages in 32bit pae mode.
- leakage of mmap/munmap.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-02-20 11:09:46 +00:00