[POWERPC][XEN] Safety with foreign get_page() calls and RMA
The following patch deals with get_page() possibly failing for H_ENTER
on a foreign page and returning the correct error. We also tag and
checke that a put_page() for RMA pages will panic (for now) if the
domain is _not_ dying.
The following patch tracks and frees pages correctly. It solves the problem where a foreign mapping would zombie a domain because the refcnts remained.
This involved:
- implement relinquish_memory() for PowerPC
- remove free_rma() since all pages get "relinquished" now.
- foreign pages are get and put correctly
The following patch performs the following:
- add free_rma() to go with allocate_rma()
- allocate_rma() returns -EINVAL if an RMA is already allocated
- PFN_TYPE_REMOTE is now PFN_TYPE_FOREIGN
- better checking of page_info in pfn2mfn()
- Stop using RPN and LPN and use PFN and MFN respectively
- Increase/decrease foreign domain refcount when another domain
maps/unmaps it
[POWERPC][XEN] Detect bad spurious interrupt condition and panic instead of hang
When handing off the MPIC from Xen to Dom0, which is the current yet
not permamnet design, the MPIC can cause the processor to assert an
external interrupt when none is available. Rather then simply hang in
this condition we now panic so the user can see that there is indeed a
problem and identify it as this one.
This condition seems to be related to temperature and the probablity
of it occuring decreases if the machine is allowed to stay idle (not
in the Xen panic loop) for a minute or two.
[XEN][POWERPC] Fix allocation error for xencomm "mini" descriptors.
Previous code worked correctly only if the allocated structure fit in the same
page as the base address. If the structure did not fit, the computation for the
allocation was incorrect. Noticed by Kiyokuni KAWACHIYA <KAWATIYA@jp.ibm.com>.
Signed-off-by: Maria Butrico <butrico@watson.ibm.com> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
[XEN][POWERPC] Fix machine check build break.
Building exceptions.c with CRASH_DEBUG=y produces a build break, because
gcc complains about the unused variable.
[POWERPC][XEN] Track HID4[RM_CI] state for machine check
This patch creates a PIR indexed character array so we can note when a
processor is in RM_CI mode. Machine checks can happen here and we
need to at least report it (and maybe one day) recover from it. Also
some fun with the SCOM.
This patch add the necessary support to use
arch/powerpc/kernel/smp-tbsync.c
from Linux.
Original copyright and author are:
Copyright (C) 2003 Samuel Rydh (samuel@ibrium.se)
This patch allows the platform to define the "IO Hole" of
addressibility and checks that even Dom0 does not try to Map "Remote"
memory that is not there. Also replaces some panic calls with WARN();
and returns failure.
If DEC would have expired we now restore DEC to 0 so it will fire.
The Domain loses info about how late DEC was from looking at DEC but I
don't think anyone tracks that.
[NET] front: move register_netdev() + sysfs attribute registering from create_netdev() into the new open_netdev() function.
open_netdev is called as very last thing in netdev_probe.
This closes at least one initialization race: uninitialized
mac address is visible for a short time in
/sys/class/net/${if}/address
[XEN] Add a start_pfn field in xen_domctl_getmemlist.
This is used by ia64 because it directly reads the P2M table. Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
[LINUX][X86_64] P2M map must be allocated on page aligned boundary.
Otherwise save/restore can break. Signed-off-by: Kazuo Moriwaka <moriwaka@valinux.co.jp>
Ewan Mellor [Tue, 29 Aug 2006 21:51:06 +0000 (22:51 +0100)]
This patch fixed 'xm reboot' to work as you expected with the wait
option. This patch adds a restart sequence counter to xenstore.
The completion of a VM reboot is detected by observing that
its restart sequence counter changes.
[IA64] init the hlt timer on a valid cpu and migrate
Based on a patch from Anthony Xu, v->processor is not initialized
in alloc_vcpu_struct() when we initialize the hlt_timer. Init the
timer on the first cpu and migrate it in schedule_tail().
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Jimi Xenidis [Tue, 29 Aug 2006 10:53:58 +0000 (06:53 -0400)]
[XEN][POWERPC] cleanup for (;;);
When the port first started, we didn't even have panic() working
properly so we used "for(;;);" loops to stop execution. Now that output
is buffered these look like hangs, since you usually do not see the
printk() before.
[qemu] Fix PCI config header space writes and set Subsystem-Vendor ID fields.
Fix failure in Windows HCT's PCI-Compliance-Test by invalidating the
writing to read-only/reserved fields in PCI configuration space header
and giving Subsystem-Vendor-ID field a valid value via copying Vendor-ID
field into it.
Jimi Xenidis [Mon, 28 Aug 2006 21:28:55 +0000 (17:28 -0400)]
[XEN][POWERPC] do not set d->tot_pages, but check it. Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
[modified to use existing cpu_halt() function in linux-xen files] Signed-off-by: Alex Williamson <alex.williamson@hp.com>
[XEND] Move all of the various log files created by xen to
be under /var/log/xen instead of under /var/log directly. This has
the advantage of cleaning things up a little and also can make it
easier to restrict the permissions needed by xend.
[HVM] [SMBIOS] Duplicate UUID into serial number in SMBIOS tables.
Windows zeroes out the UUID in the SMBIOS tables, but the identifier
is often needed by systems management code. Duplicating the UUID
as the virtual system's serial number should help.
The following patch fixes a bug where xenconsoled will can SEGV
because it uses FD_ISSET(-1,xxx). Since the code is written that any
ring/tty handler can set d->tty_fd to -1 it has to be checked
_every_time_.
[TOOLS] Remove Gentoo-specific workaround in networking
scripts -- apparently it is not needed (reported by
Tuan Van <lang.thang@gmail.com>). See bugzilla issue #741
for more details.
[TOOLS] Clean up routed vifs quietly on domain destruction.
I have experienced that the vif-route script does not work as expected
when deleting a virtual interface (Redhat FC5). Both of the commands
"ifdown" and "ip route" cause an early vif-route script exit and
therefore will cause skipping of the later script commands (such as
cleaning up iptables entries for the default 'antispoof'). The
vif-route
script creates the following syslog error entry:
"/etc/xen/scripts/vif-route failed; error detected."
It appears that both of the problematic commands are actually
redundant
when destroying domains:
1. the interface is already gone (I assume because the domain frontend
is gone already) --> ifdown does not do anything
2. the route is gone as well since the interface has disappeared -->
ip
route del does not do anything
Executing those redundant commands with "do_without_error" ensures
that
the script completes and cleans up iptables rules. The attached
RFC-patch only masks those commands when bringing down an interface,
so
that domain creation continues to fail in case of vif setup problems
(intended behavior).
Having the iptables cleanup called correctly by vif-route is important
to keep the iptables rule-set clean, otherwise antispoof rules
accumulate with every vif creation.
Jimi Xenidis [Mon, 28 Aug 2006 00:48:06 +0000 (20:48 -0400)]
[XEN][POWERPC] allocate HTAB using shadow calls
This patch will use the shadow_ops call to allocate the domains Hashed
Page-table. This allows for the management tools to customize its size
for the domain.
Warning! The management tools have yet to be updated to use this
properly and update the devtree accordingly so code will assume 64M
RAM and 1M HTAB while the shadow up continues to receive a 0 request.
Jimi Xenidis [Sun, 27 Aug 2006 20:12:00 +0000 (16:12 -0400)]
[XEN][POWERPC] Allocate more memory than RMA for Dom0
The following patch will only effect Dom0 at the moment and allow it
to be created with memory larger than RMA. It works by allocating
extents (AKA chunks) of memory of an order specified by the processor.
The extent size should be a value that is capabable of mapping a
"large page" so we use the 970s large page size. These extents are
tracked by an extents list that simply tracks these page allocations
and what there mapping is. Other sub-systems effected by this:
- Dom0 OFD devtree /memory cleanup
- log_large_page_sizes is now an array
- Config for minumum Dom0 size
Caveats:
- There is a hack around HTAB allocation because we currently
allocate one at domain creation time, this will be correct by a
patch to follow.
- Dom0, or domains capable of mapping mfns byt have their extents be
PFN=MFN
Alex Williamson [Sun, 27 Aug 2006 05:56:01 +0000 (06:56 +0100)]
[PATCH] fix null pointer dereference in xen_guest_lookup()
The latest ELF changes have a null pointer dereference bug when you
have neither an elf notes section nor a __xen_guest_string. This patch
checks for the existence of the __xen_guest_string prior to using it.
Please apply. Thanks,
Alex
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---
Only use one page for stubs and tables instead of 2MB.
Create struct fw_tables to make code more understandable.
Many comments added.
Correctly compute sal systab checksum.
Introduce HVMOP_setup_shared_info_page
- A page allocated on HVM-guest OS is swapped original shared_info
page with this hypercall.
- In x86 code, original shared_info page is used after pv-on-hvm
setup with remapping feature in arch depend HYPERVISOR_memory_op.
But, we can't implement same feature for IPF, thus we select to
implement with this method.
Introduce HVMOP_setup_gnttab_table
- Pages allocated on HVM-guest OS is swapped original grant_table
page frames with this hypercall.
- Same above.
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com> Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>