Keir Fraser [Fri, 30 Jan 2009 11:10:43 +0000 (11:10 +0000)]
x86: re-arrange struct page_info members
By combining the overlay fields that are 8 bytes long (on x86-64) into
a union separate from the one used for the 4 byte wide fields, no
unnecessary padding will be inserted while at the same time avoiding
to use __attribute__((__packed__)) on any of the sub-structures (which
risks misaligning structure members without immediately noticing).
Keir Fraser [Fri, 30 Jan 2009 11:08:06 +0000 (11:08 +0000)]
x86-64: fold shadow_page_info fields into page_info
... combining the list entry members of both structures and removing
the artificial 'mbz' member (shadow code must keep the real underlying
member 'count_info' at zero for the lifetime of pages use as shadows).
This also fixes a latent issue with u.inuse._domain not getting
explicitly cleared before returning shadow pages to the domain heap -
it just so happened that this member turned out to be zero in all
(normal?) cases when a shadow page ends its life (but there were
neither build nor run-time assertions that this would actually be the
case). The bug got exposed by a subsequent patch changing the order of
fields in struct page_info.
Keir Fraser [Fri, 30 Jan 2009 11:03:28 +0000 (11:03 +0000)]
x86-64: use MFNs for linking together pages on lists
Unless more than 16Tb are going to ever be supported in Xen, this will
allow reducing the linked list entries in struct page_info from 16 to
8 bytes.
This doesn't modify struct shadow_page_info, yet, so in order to meet
the constraints of that 'mirror' structure the list entry gets
artificially forced to be 16 bytes in size. That workaround will be
removed in a subsequent patch.
Isaku Yamahata [Fri, 30 Jan 2009 02:04:51 +0000 (11:04 +0900)]
[IA64] remove warning
This patch remove the following warning.
> memory.c:116: warning: implicit declaration of function 'guest_physmap_mark_populate_on_demand'
> memory.c:206: warning: implicit declaration of function 'p2m_pod_decrease_reservation'
Keir Fraser [Thu, 29 Jan 2009 16:41:48 +0000 (16:41 +0000)]
stubdom: add videoram to stubdom initial memory reservation
This patch adds a videoram parameter (4MB is the default) to pv guests
too: if the pv guest is actually a stubdomain then the videoram size
is added to the initial required available memory.
This way there is no risk that a stubdom fails to populate the
videoram because the RAM freed for the videoram by dom0 has already
been used to create the stubdom.
Keir Fraser [Thu, 29 Jan 2009 16:39:56 +0000 (16:39 +0000)]
xend: Fix block device type check
Since changeset 17617 the block device protocols are checked to be
either file or phy. This has later been fixed to also include
tap. This is still not a correct check as there can be arbitrary
additional protocols. Before this check was added you could have a
block-xyz hotplug script and xyz would work as a protocol, now it is
refused. An example for this mechanism is the block-nbd script which
is included in the tree.
This patch changes the check to allow file, phy, tap and all protocol
names for which a block-$protocol hotplug script exists. This should
fix the last regressions introduced by the check.
Keir Fraser [Thu, 29 Jan 2009 11:35:19 +0000 (11:35 +0000)]
tboot: ACPI Generic Address Structure for tboot shutdown
New versions of tboot support ACPI GAS (Generic Address Structure) for
handling sleep states. This required a change to the tboot_shared_t
data structure that is not backwards compatible. This patch requires
that new version makes use of GAS when invoking tboot on shutdown.
Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
Keir Fraser [Tue, 27 Jan 2009 11:54:22 +0000 (11:54 +0000)]
x86-64: don't generate dependency files when building compat headers
The generated dependency files weren't correct (as their names get
derived only from the base name of the target file, and there are
public headers with the same base name in different directories), not
needed (as the makefile already listed all necessary dependencies
explicitly), and resulted in the first re-build in an already built
tree to be an almost full re-build since the *.c files explicitly
mentioned in the .*.d result in make not considering them as
intermediate anymore, thus triggering re-generation of the headers,
and hence re-building of almost the entire tree.
Keir Fraser [Sun, 25 Jan 2009 10:16:11 +0000 (10:16 +0000)]
vt-d: Do not explicitly exclude tboot ranges from dom0 vt-d
mappings. tboot is not registered as RAM in e820 tables, and hence
will not be mapped anyway (fails memory_is_conventional_ram() check).
Keir Fraser [Fri, 23 Jan 2009 12:50:14 +0000 (12:50 +0000)]
hvm bios: add PMM (a memory manager during POST)
The PMM (POST Memory Manager) offers malloc/free functionality
for PCI option ROMs during POST (Power On Self Test).
This patch adds a PMM functionality to the guest BIOS.
For example, the option ROM on LSI Logic SAS card uses PMM and
failed to initialize the device without PMM. Thus, the HVM can't
boot up directly from the passthroughed SCSI disk.
gPXE also uses PMM (I don't know what happens without PMM).
With this patch, we succeeded in SAS boot of HVM.
For further information about PMM:
http://www.phoenix.com/en/OEM-ODM/Customer+Services/White+Papers-Specs/PC+Industry+Specifications.htm
http://www.phoenix.com/NR/rdonlyres/873A00CF-33AC-4775-B77E-08E7B9754993/0/specspmm101.pdf
Keir Fraser [Fri, 23 Jan 2009 11:51:43 +0000 (11:51 +0000)]
bump libxenctrl and libxenguest versions
In c/s 19009 an incompatible change was made to the ABI of libelf-*,
which are included in libxenctrl and libxenguest. To avoid client
programs (such as python/lowlevel/xc/xc.so) picking up a wrong
version and perhaps crashing, the soname should be changed.
I have chosen the version number 3.4 as xen-unstable is currently the
pre-3.4 branch. I assume we don't care about API/ABI stability within
an unstable branch.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Thu, 22 Jan 2009 11:11:10 +0000 (11:11 +0000)]
x86 ucode: microcode logic update
Update microcode logic:
1. separate microcode_fini_cpu() into 2 level to avoid deadlock (when
fail at microcode_update_cpu);
2. cancel redundant collect_cpu_info at microcode.c level, use
relative function at microcode driver level;
3. separate microcode_resume_cpu from microcode_update_cpu, because
it's redundant (should only be called when S3 wakeup) and will block newer
microcode update when user update newer microcode.dat from user level
Keir Fraser [Thu, 22 Jan 2009 11:05:54 +0000 (11:05 +0000)]
x86: Make the num_siblings CPU parameter per-CPU.
While it is unlikely that a system has a different number of siblings
for different physical CPUs, make this parameter per-CPU for
consistency, and deal with the (so far theoretical) case that this is
different per CPU package.
Signed-off-by: Frank van der Linden <Frank.Vanderlinden@Sun.COM>
Keir Fraser [Tue, 20 Jan 2009 15:10:28 +0000 (15:10 +0000)]
hvmloader: ACPI compiler is not to be buil;t and installed on target system.
Since it is a build prerequisite (in some cases) simply fail the build
if it is not found when it turns out to be required. Just as we would
for any other tool-chain prereq.
Keir Fraser [Tue, 20 Jan 2009 13:27:08 +0000 (13:27 +0000)]
x86: update microcode support
- Container header file holding the patches changed. Update to new
format.
- in cpu_request_microcode() move heap re-allocation & copy out of the
loop.
Side-effect: Remove limitation in only supporting fixed sized
microcode patches. Also simplifies code a lot.
- cleanup: use rdmsr and wrmsrl instead of inlined assembler
- pass ucode_cpu_info as arguments. Improves reentrancy.
- cleanup: simplify struct ucode_cpu_info and remove
get_matching_microcode hook. Side-effect: reduces kernel size.
- bugfix: fix xen kernel memory leak in error path. equiv_cpu_table
was not freed.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Keir Fraser [Tue, 20 Jan 2009 13:22:28 +0000 (13:22 +0000)]
passthrough: fix typo
The indentation level of the following code was incidentally
changed when event_lock was added to protect dpci.
It causes no issue but does look a little weird, so fix it.
Keir Fraser [Fri, 16 Jan 2009 11:47:21 +0000 (11:47 +0000)]
[IA64] fix compilation error caused by 19046:ecf603780f56
This patch fixes the following compilation error adjusting
function prototypes.
> xc_core_ia64.c:176: error: conflicting types for
'xc_core_arch_memory_map_get'
> xc_core.h:141: error: previous declaration of
'xc_core_arch_memory_map_get' was here
> xc_core_ia64.c:241: error: conflicting types for
'xc_core_arch_map_p2m'
> xc_core.h:144: error: previous declaration of 'xc_core_arch_map_p2m'
was here
Keir Fraser [Thu, 15 Jan 2009 12:37:42 +0000 (12:37 +0000)]
libxc: Support cross-bitness guest when core-dumping
This patch allows core-dumping to work on a cross-bit host/guest
configuration, whereas previously that was not supported. It supports
both PV and FV guests. The core file format generated by the host,
needs to match that of the guest, so an alignment issue is addressed,
along with the p2m frame list handling being done according to the
guest size.
Keir Fraser [Thu, 15 Jan 2009 12:36:29 +0000 (12:36 +0000)]
xenoprof: The checks in the function passive_domain_do_rdmsr() were
not sufficient.
Also the same checks were done in the function
passive_domain_do_wrmsr().
So these common checks are moved in a new single function
passive_domain_msr_op_checks().
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Keir Fraser [Wed, 14 Jan 2009 10:56:18 +0000 (10:56 +0000)]
x86: propagate disabled APIC state to Dom0
This in particular eliminates the need to specify "noapic" to Dom0
when "noapic" is passed to Xen, provided the kernel side gets slightly
modified to make use of this information (Linux side patch cannot
easily be provided for the 2.6.18 tree, but this is being used by our
2.6.27-based one).
Keir Fraser [Wed, 14 Jan 2009 10:55:40 +0000 (10:55 +0000)]
x86: restore ability to work on systems without APIC
This got broken with the default-enabling of MSI. Apart from fixing
the base issue, the patch also addresses
- the 'i' command crashing where there is no IO-APIC,
- the 'i' command needlessly printing information for all 256 vectors
when the use of IO-APIC(s) is disabled, and
- the need to specify both "nolapic" and "noapic" when "nolapic" alone
should already have the intended effect.