- 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>
Tim Deegan [Mon, 24 Sep 2007 12:44:29 +0000 (13:44 +0100)]
[HVM] Don't count "missed ticks" on one-shot timers.
It's not clear what it would mean, and it leads to division by zero. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Fixes a number of these errors:
cc1: warnings being treated as errors
fsys_fat.c: In function 'fat_dir':
fsys_fat.c:304: warning: array subscript has type 'char'
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
These ugly casts are needed according to the ISO C spec.
network-bridge: default to eth0 if no default gateway.
From: Luke Szymanski <Lukasz.Szymanski@unisys.com> Signed-off-by: Keir Fraser <keir@xensource.com>
George Dunlap [Fri, 21 Sep 2007 14:33:37 +0000 (15:33 +0100)]
[xen][hvm][tracing] Refine hvm tracing
This patch does two things:
* Allows hvm traces to take advantage of the variable-size traces
* Adds some hvm functionality
This includes tracing actions like clts and lmsw, values of {p,mm}io reads
and writes, and making different trace records for hvm domains running in
64-bit mode if the trace record includes a virtual address.
George Dunlap [Fri, 21 Sep 2007 14:26:07 +0000 (15:26 +0100)]
[xen][tracing] Introduce variable-size trace records
This patch introduces variable-size trace records. Each record consists of
a 32-bit "header", an optional cycle count, and up to seven more 32-bit words.
The header is packed with the following information:
bits 0-27: The trace event.
bits 28-30: The number of 32-bit "extra" words in the records
bit 31: Does the trace include a 64-bit tsc?
This patch standardizes behavior wrt 32 and 64-bit hypervisors and dom0s.
Note that this patch requires a new version of the xentrace daemon running in
dom0. The new daemon, instead of pre-pending the cpu to every record as it
writes it, inserts a "cpu change" record to the trace file that record the
cpu and the number of records it's about to write.
Signed-off-by: George Dunlap <gdunlap@xensource.com>
Fix tools/console to build on NetBSD.
- include headers needed to build on NetBSD
- Remove unused pty.h
- Initialize spty terminal before actually using it
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
cpufreq: Support cpufreq updates on AMD hardware by dom0 kernel. Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
- use MAP_ANON, that is what both (BSD-)Unix and Linux have
- change last_error handling to use pthreads
- round mlock() parameters to page alignment
- cleanup: No need to include <xen/sys/privcmd.h>
a second time in xg_private.h
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
hvm: Always keep canonical copy of RIP/RSP/RFLAGS in
guest_cpu_user_regs(). Reduces complexity at little or no performance
cost (except on really old Intel P4 hardware where VMREAD/VMWRITE are
silly expensive). Signed-off-by: Keir Fraser <keir@xensource.com>
Ian Campbell [Wed, 19 Sep 2007 11:12:49 +0000 (12:12 +0100)]
Using "make install" causes a distro specific script
(/sbin/installkernel) to be called since linux-2.6.18-xen.hg
211:c1f5d027adf7.
Unfortunately on some distros this script is broken for non-root
use. Our needs are pretty simple anyway so just open code the
installation of the kernel.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
George Dunlap [Wed, 19 Sep 2007 10:58:04 +0000 (11:58 +0100)]
[shadow] Be smarter about what we check to avoid unnecessary brute-force searches
The old code checked only if the page was still a pagetable before
doing a brute-force search, rather than checking if it was still
shadowed as the type indicated. This meant that if a page was shadowed
as two different types, it was guaranteed to do a full brute-force search
even if all references could be found by up-pointers.
This checks the proper thing so that it will only do a brute-force if
necessary.
It also re-orders the unshadows so that higher levels are done first. In
many cases, lower-level shadows will be destroyed in the process of
higher-level shadows being destroyed, again saving brute-force searches.
hvm: hvm_{load,store}_cpu_guest_regs() does not touch segment
selectors. We have separate accessors for that now. It is now an
invariant that guest_cpu_user_regs()->{cs,ds,es,fs,gs,ss} are invalid
for an HVM guest. Signed-off-by: Keir Fraser <keir@xensource.com>
This fixes a build error for PV guests (OpenBSD, NetBSD) where the use
of XEN_GUEST_HANDLE_64(uint8_t) leads to a build error because uint8_t
is a #define and not a typedef.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
If vtpm_managed is started with the same vtpm instance, the following
error occurs.
++++++++++++
Loading NVM.
Sending LoadNVM command
INFO[VTSP]: Unbinding 256 bytes of data.
ERROR in VTSP_Unbind at vtsp.c:719 code: TPM_BAD_PARAMETER.
ERROR in envelope_decrypt at securestorage.c:156
code:TPM_BAD_PARAMETER.
ERROR[VTPM]: Failed to envelope decrypt data
.ERROR in VTPM_Handle_Load_NVM at securestorage.c:284 code:
TPM_BAD_PARAMETER.
ERROR[VTPM]: Failed to load NVM
.INFO[VTPM]: [VTPM Listener]: VTPM Listener waiting for messages.
Reading LoadNVM header
++++++++++++
I have added CONFIG_PASSTHROUGH in ioemu/Makefile.target and
ioemu/hw/pc.c in attached vtd_tools2.patch. This should turn off
libpci usage by default until user specifically enables it.
This can be safely check-in without breaking builds for people who do
not care about pass-through devices. I will try to think of a better
way to enable this.
Signed-off-by: Allen Kay <allen.m.kay@intel.com> Signed-off-by: Guy Zana <guy@neocleus.com>
I don't know how significant this is (most of the NUMA node data seems
unused at this point), but anyway: enable proper operation of NUMA
emulation and the fake NUMA node in case there's no SRAT table on
x86-32. This will at least make the "Faking node ..." message not
print confusing information anymore.
Generic and VT-d specific Xen header changes for PCI passthru. Signed-off-by: Allen Kay <allen.m.kay@intel.com> Signed-off-by: Guy Zana <guy@neocleus.com>
James Bulpin [Tue, 11 Sep 2007 18:11:02 +0000 (19:11 +0100)]
[xm-test] Set "console=xvc0" for xm-test guests on Intel architecture platforms.
Tests have been failing because the console for the test ramdisk wasn't using
xvc0 so testcases were not able to interact with it.
I found that xend's memory usage grows considerably when running a
script such as
while true; do xm new foo ; sleep 2s; xm delete foo ; sleep 2s; done
XendAPIStore maintains a list of class instances and in the case of
new/create operation, an associated VMMetrics object is stashed in the
list but never removed on delete/shutdown. This patch removes the
instance by invoking XendBase.destroy() method.
This patch adds 'type vnc' to vfb device sexpr for HVM guests. PV
guests already contain this entry in sexpr, e.g.
(device
(vfb
(vncunused 1)
...
(type vnc)
...
)
)
Some tools, such as libvirt, look for device/vfb/type in sexpr before
publishing VNC port. More importantly, this patch provides
consistency in vfb device sexpr between HVM and PV guests.
x86: Clean up asm keyword usage (asm volatile rather than __asm__
__volatile__ in most places) and ensure we use volatile keyword
wherever we have an asm stmt that produces outputs but has other
unspecified side effects or dependencies other than the
explicitly-stated inputs.
Also added volatile in a few places where its not strictly necessary
but where it's unlikely to produce worse code and it makes our
intentions perfectly clear.
The original problem this patch fixes was tracked down by Joseph
Cihula <joseph.cihula@intel.com>.
x86: Cleanup system restart code, and wait 10ms for APs to offline. Signed-off-by: Joseph Cihula <joseph.cihula@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
svm: Greatly reduce total number of CR8 intercepts
This patch reduces the number of CR8 intercept to a fraction of the
number of CR8 intercepts without. First, CR8 read intercepts are
completely disabled since the SVM vTPR is kept kept in sync with the
HVM vLAPIC TPR. Second, CR8 write intercepts are enabled and disabled
based upon certain conditions. Most of the time, CR8 write intercepts
are disabled. They are enabled only when there is a pending interrupt
that can't be delivered because of either the current ISR or TPR (aka
PPR) because this is the only time the TPR matters.
With this patch, the number of CR8 intercepts dropped from around
10,000,000 to around 6,000 during boot of Windows 2003 Server 64-bit
(this is a rough estimate).