Alex Williamson [Fri, 12 Oct 2007 21:02:06 +0000 (15:02 -0600)]
[IA64] Fix MCA error handler problems
Fixing MCA issues related to changes from kexec patch series...
[From "Kexec: Fix ia64_do_tlb_purge so that it works with XEN"]
> 2. Use the per_cpu variable to derive CURRENT_STACK_OFFSET rather
> than reading it from a kernel register. See 1) for explanation
> of why.
I added the same code in Reload DTR for stack part and also added a
code to avoid overlapping with kernel TR.
> 3. In the VHPT pruning code, don't use r25 as ia64_jump_to_sal,
> which branches to ia64_do_tlb_purge expects r25 to be preserved.
> There seems no reason not to use r2 as per the other purges
> done in ia64_do_tlb_purge. Furthermore use r16 and r18 instead
> of r20 and r24 for consistency reasons.
The r25 kept the value of __va_ul(vcpu_vhpt_maddr(v)), and it was
referred to by the following lines.
468 // r25 = __va_ul(vcpu_vhpt_maddr(v));
469 dep r20=0,r25,0,IA64_GRANULE_SHIFT
470 movl r26=PAGE_KERNEL
471 ;;
472 mov r21=IA64_TR_VHPT
473 dep r22=0,r20,60,4 // physical address of
I defined GET_VA_VCPU_VHPT_MADDR() macro to re-calculate the value of
__va_ul(vcpu_vhpt_maddr(v)) in each part.
And I renamed the register names for same reasons.
Alex Williamson [Fri, 12 Oct 2007 20:49:37 +0000 (14:49 -0600)]
[IA64] Fix TLB insertion for subpaging
Without this patch, Longhorn is sure to hang up. .NET application
might hit this bug. itc.i instruction is repeated forever, because
TLB entry with smaller page size is volatile.
add unwind directive to fast_hypercall path.
While fast_hypercall path calls function (hypercall, do_softirq()) and
might be blocked, it doesn't have unwind infomation.
So stack unwinding fails. Add necessary unwind directive.
fix stack unwinder.
- fix find_save_locs() and unw_unwind().
instruction pointer check should be suite for xen.
- fix unw_unwind_to_user()
VTi domain fault handler doesn't always updatevcpu->on_stack so that
the pUStk check fails. Add more checking to stop winding.
Keir Fraser [Thu, 11 Oct 2007 18:18:12 +0000 (19:18 +0100)]
x86: Fix emulation of DIV instruction. Never actually used currently,
but this will avoid a #DE in Xen. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Thu, 11 Oct 2007 12:32:41 +0000 (13:32 +0100)]
Clean up SMP macros and always have IRQs disabled when executing an
'smp_call_function' callback function. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Thu, 11 Oct 2007 09:20:45 +0000 (10:20 +0100)]
Shadow code printing adjustments.
Messages prior to BUG() should always be displayed, not just when
DEBUG_TRACE_DUMP is defined (which by default it isn't). Convert them
from SHADOW_PRINTK() to SHADOW_ERROR().
Keir Fraser [Thu, 11 Oct 2007 08:41:16 +0000 (09:41 +0100)]
[vTPM] Add set/get_other_config to Xen-API.
Add get_- and set_other_config methods to the vTPM class. Write the
parameters into the xenstore while the domain is running prefixing it
with 'oc_'. Also I add the methods to the C library as well as the
documentation.
Keir Fraser [Thu, 11 Oct 2007 07:14:11 +0000 (08:14 +0100)]
hvm: Fix migration of 64-bit guests by permitting EFER_LMA to be set
in restored VCPU context. Signed-off-by: David Lively <dlively@virtualiron.com> Signed-off-by: Robert Phillips <rphillips@virtualiron.com>
Keir Fraser [Mon, 8 Oct 2007 09:55:50 +0000 (10:55 +0100)]
xenconsoled: portability fixes:
- Use openpty(), which does the same as the sequence
of open(), grantpt(), unlockpt(), ptsname(), tcgetattr()
simplifies code
- Check return code from tcsetattr()
- sprintf() -> snprintf()
- OpenBSD lacks POSIX grantpt() and unlockpt()
requires use of openpty()
- Solaris lacks POSIX openpty() via feedback from SUN (John Levon)
implement openpty() for Solaris, tested and ok'd by SUN (John
Levon)
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Keir Fraser [Mon, 8 Oct 2007 09:46:45 +0000 (10:46 +0100)]
Fix domU reboot failure when using "pci=" option
The failure only happens on the second or later auto reboot.
See the following thread for a long discussion on this issue where
most problems were fixed.
Keir Fraser [Fri, 5 Oct 2007 09:31:25 +0000 (10:31 +0100)]
[NW scripts] Choose alternative interface if NFSroot is used.
Allow the network bridging setup script to choose an alternative
network interface if it is determined that the root is mounted using
NFS, which is assumed to be done over the NIC serving the default
gw. In this case the prefix of the device is used to find other
devices, i.e., if eth0 is the default device an alternative device may
be an other ones starting with 'eth'.
Keir Fraser [Thu, 4 Oct 2007 16:58:16 +0000 (17:58 +0100)]
xen: Changes to printk handling:
1. Command-line option 'console_timestamps' adds a timestamp prefix
to each line of Xen console output (x86 only, after CMOS has been
interrogated).
2. Clean up prefix handling and vanity banner info. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Wed, 3 Oct 2007 15:33:23 +0000 (16:33 +0100)]
hvm: More changes to reduce size of domain structure.
It is now smaller than a page (4kB) on x86/32 and x86/64. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Wed, 3 Oct 2007 14:47:47 +0000 (15:47 +0100)]
hvm: Do not include full hvm_hw_hpet in 'struct domain'. It is very
large due to the number of (unused) reserved registers. This
unnecessarily blots the size of the domain structure. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Wed, 3 Oct 2007 13:41:28 +0000 (14:41 +0100)]
svm: Actually remove disabling of CR4-read-intercept when using NPT.
Should have been in the previosu changeset. Oops. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Wed, 3 Oct 2007 13:06:06 +0000 (14:06 +0100)]
xend: Check access to the privcmd interface before doing the call to
fetch the currently enforced policy. Assign 'INACCESSIBLE' to the
policy if it cannot be retrieved due to the user not being
privileged.
Keir Fraser [Wed, 3 Oct 2007 13:04:51 +0000 (14:04 +0100)]
Extend 'xm dumppolicy' to support Xen-API
I am extending 'xm dumppolicy' to be used via the Xen-API. For this
there are two new functions in the ACM policy class:
- get the currently enforced policy including statistical data from
the hypervisor
- get the ACM 'ssidref' of a Domain. Since this may be a ACM-specific
variable or type (int) I put it into the ACM class.
I extended the Xen-API documentation with the two new functions.
Keir Fraser [Tue, 2 Oct 2007 15:59:07 +0000 (16:59 +0100)]
vtd: Dynamically allocate IRQ-tracking structures, only for those
domains that actually have PCI-passthru devices. Greatly reduces size
of 'struct domain'. Signed-off-by: Keir Fraser <keir@xensource.com>
Alex Williamson [Tue, 2 Oct 2007 15:31:45 +0000 (09:31 -0600)]
[IA64] xenitp improvements
Remove all the casts by using char * instead of unsigned char *.
The go command now accept a number.
The disass command can now accept a range.
Number of TRs is not hard-coded.
'-' (minus) can now be used in expressions.
'$iip' and '$b0' can be used in expressions.
Keir Fraser [Tue, 2 Oct 2007 15:28:58 +0000 (16:28 +0100)]
x86/32: Re-factor mapcache data structure into per-domain and per-vcpu
components. Greatly reduces size of 'struct domain'. Signed-off-by: Keir Fraser <keir@xensource.com>
Alex Williamson [Mon, 1 Oct 2007 15:57:50 +0000 (09:57 -0600)]
[IA64] Fix wrong insertion of TLB entry in region 0
On PV domain with metaphysical mode, emulation of itc.d in region 0
doesn't work well and inserts an wrong TC entry.
Because set_one_rr() doesn't set the machine region register.
i.e. metaphyisical_rr0 is used instead of guest's rr[0].
This bug causes Dom0/U crash when an application uses region 0.
Actually I met the crash when I was building open GFW (java uses
region 0).
Keir Fraser [Mon, 1 Oct 2007 14:38:58 +0000 (15:38 +0100)]
x86: Rename math_state_restore() to more logical
do_device_not_available(), following naming convection for all other C
exception handlers. Signed-off-by: Keir Fraser <keir@xensource.com>
Keir Fraser [Mon, 1 Oct 2007 14:12:05 +0000 (15:12 +0100)]
hvm: Avoid need for ugly setcpucontext() in HVM domain builder by
pre-setting the vcpu0 to runnable inside Xen, and have the builder
insert a JMP instruction to reach the hvmloader entry point from
address 0x0. Signed-off-by: Keir Fraser <keir@xensource.com>