Re: [patches] [PATCH] [21/22] x86_64: Extend bzImage protocol for relocatable bzImage

2007-04-29 Thread Eric W. Biederman
Rusty Russell <[EMAIL PROTECTED]> writes: > On Sun, 2007-04-29 at 21:38 -0700, H. Peter Anvin wrote: >> Rusty Russell wrote: >> > >> > Dammit, Eric, you spend a lot of time using words like "insane" where >> > you mean we didn't do everything all at once. >> > >> > It's *not* clear that using %e

Re: [patches] [PATCH] [21/22] x86_64: Extend bzImage protocol for relocatable bzImage

2007-04-29 Thread Rusty Russell
On Sun, 2007-04-29 at 21:38 -0700, H. Peter Anvin wrote: > Rusty Russell wrote: > > > > Dammit, Eric, you spend a lot of time using words like "insane" where > > you mean we didn't do everything all at once. > > > > It's *not* clear that using %esi is sane, but nothing in the current > > code pre

Re: [patch 03/32] xen: Add nosegneg capability to the vsyscall page notes

2007-04-29 Thread Jeremy Fitzhardinge
Roland McGrath wrote: > I wouldn't add that macro to asm/elf.h. There is nothing magical or > standard about that number. > It was just there for a later patch to set/clear the mask dynamically depending on whether we're running under Xen. But I haven't implemented that yet. J __

Re: [patches] [PATCH] [21/22] x86_64: Extend bzImage protocol for relocatable bzImage

2007-04-29 Thread H. Peter Anvin
Rusty Russell wrote: > > Dammit, Eric, you spend a lot of time using words like "insane" where > you mean we didn't do everything all at once. > > It's *not* clear that using %esi is sane, but nothing in the current > code prevents that. > Why not? -hpa

Re: [patches] [PATCH] [21/22] x86_64: Extend bzImage protocol for relocatable bzImage

2007-04-29 Thread Rusty Russell
On Sun, 2007-04-29 at 09:11 -0600, Eric W. Biederman wrote: > Right now I'm a little frustrated that insanity below slipped into > head.S right after the 32bit entry point after the review said > use the normal linux parameters for parameter passing. > > > #ifdef CONFIG_PARAVIRT > >

Re: [patch 03/32] xen: Add nosegneg capability to the vsyscall page notes

2007-04-29 Thread Roland McGrath
I wouldn't add that macro to asm/elf.h. There is nothing magical or standard about that number. Thanks, Roland ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization

Re: [patch 26/32] xen: Add Xen virtual block device driver.

2007-04-29 Thread Christoph Hellwig
> source "drivers/s390/block/Kconfig" > +source "drivers/block/xen/Kconfig" Please don't add a new subdirectory for a tiny new driver that really should be only a single .c file. > +config XEN_BLKDEV_FRONTEND > + tristate "Block device frontend driver" > + depends on XEN > + default

[patch 22/32] xen: Add Xen grant table support

2007-04-29 Thread Jeremy Fitzhardinge
Add Xen 'grant table' driver which allows granting of access to selected local memory pages by other virtual machines and, symmetrically, the mapping of remote memory pages which other virtual machines have granted access to. This driver is a prerequisite for many of the Xen virtual device drivers

[patch 32/32] xen: Xen machine operations

2007-04-29 Thread Jeremy Fitzhardinge
Make the appropriate hypercalls to halt and reboot the virtual machine. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> --- arch/i386/xen/enlighten.c | 43 +++ arch/i386/xen/smp.c |4 +--- 2 files changed, 44 insertions(+), 3 deletions(-

[patch 30/32] xen: diddle netfront

2007-04-29 Thread Jeremy Fitzhardinge
Move things around a bit to match xen-unstable netfront. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> --- drivers/net/xen-netfront.c | 36 +--- 1 file changed, 17 insertions(+), 19 deletions(-) =

[patch 28/32] xen: xen-netfront: use skb.cb for storing private data

2007-04-29 Thread Jeremy Fitzhardinge
Netfront's use of nh.raw and h.raw for storing page+offset is a bit hinky, and it breaks with upcoming network stack updates which reduce these fields to sub-pointer sizes. Fortunately, skb offers the "cb" field specifically for stashing this kind of info, so use it. Signed-off-by: Jeremy Fitzhar

Re: [patch 27/32] xen: Add the Xen virtual network device driver.

2007-04-29 Thread Christoph Hellwig
On Sun, Apr 29, 2007 at 10:29:02AM -0700, Jeremy Fitzhardinge wrote: > +#include not needed. > +#include > +#include > +#include > +#ifdef CONFIG_XEN_BALLOON > +#include > +#endif > +#include Please don't try to put such a fucked up include hierachy in. Just move everything under include/x

[patch 26/32] xen: Add Xen virtual block device driver.

2007-04-29 Thread Jeremy Fitzhardinge
The block device frontend driver allows the kernel to access block devices exported exported by a virtual machine containing a physical block device driver. Signed-off-by: Ian Pratt <[EMAIL PROTECTED]> Signed-off-by: Christian Limpach <[EMAIL PROTECTED]> Signed-off-by: Chris Wright <[EMAIL PROTECT

[patch 25/32] xen: rename dev_changed to xenbus_dev_changed

2007-04-29 Thread Jeremy Fitzhardinge
"dev_changed" is too generic to be global. Put "xenbus_" on the front. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> --- drivers/xen/xenbus/xenbus_probe.c |4 ++-- drivers/xen/xenbus/xenbus_probe.h |2 +- drivers/xen/xenbus/xenbus_probe_backend.c |2 +- 3 fi

[patch 14/32] xen: Implement xen_sched_clock

2007-04-29 Thread Jeremy Fitzhardinge
Implement xen_sched_clock, which returns the number of ns the current vcpu has been actually in an unstolen state (ie, running or blocked, vs runnable-but-not-running, or offline) since boot. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Cc: john stultz <[EMAIL PROTECTED]> --- arch/i386

[patch 21/32] xen: Add early printk support via hvc console

2007-04-29 Thread Jeremy Fitzhardinge
Add early printk support via hvc console, enable using "earlyprintk=xen" on the kernel command line. From: Gerd Hoffmann <[EMAIL PROTECTED]> Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Acked-by: Ingo Molnar <[EMAIL PROTECTED]> --- arch/x86_64/kernel/early_printk.c |5 + driver

[patch 15/32] xen: Xen SMP guest support

2007-04-29 Thread Jeremy Fitzhardinge
This is a fairly straightforward Xen implementation of smp_ops. Xen has its own IPI mechanisms, and has no dependency on any APIC-based IPI. The smp_ops hooks and the flush_tlb_others pv_op allow a Xen guest to avoid all APIC code in arch/i386 (the only apic operation is a single apic_read for th

[patch 27/32] xen: Add the Xen virtual network device driver.

2007-04-29 Thread Jeremy Fitzhardinge
The network device frontend driver allows the kernel to access network devices exported exported by a virtual machine containing a physical network device driver. Signed-off-by: Ian Pratt <[EMAIL PROTECTED]> Signed-off-by: Christian Limpach <[EMAIL PROTECTED]> Signed-off-by: Chris Wright <[EMAIL P

[patch 05/32] xen: Core Xen implementation

2007-04-29 Thread Jeremy Fitzhardinge
This patch is a rollup of all the core pieces of the Xen implementation, including: - booting and setup - pagetable setup - privileged instructions - segmentation - multicall batching Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Cc: Ian Pratt <[EMAIL PROTECTED]> Cc: Christian Limpac

[patch 29/32] xen: Lockdep fixes for xen-netfront

2007-04-29 Thread Jeremy Fitzhardinge
netfront contains two locking problems found by lockdep: 1. rx_lock is a normal spinlock, and tx_lock is an irq spinlock. This means that in normal use, tx_lock may be taken by an interrupt routine while rx_lock is held. However, netif_disconnect_backend takes them in the order tx_lock-

[patch 31/32] xen: --- drivers/net/xen-netfront.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

2007-04-29 Thread Jeremy Fitzhardinge
=== --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1213,10 +1213,10 @@ static int netif_poll(struct net_device int pages_flipped = 0; int err; - spin_lock_bh(&np->rx_lock); + spin_l

[patch 24/32] xen: use xenbus_watch_pathfmt rather than watch_path2

2007-04-29 Thread Jeremy Fitzhardinge
xenbus_watch_path2 is not very general. Passing a printf-style format string is no more complex and more general. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Cc: Keir Fraser <[EMAIL PROTECTED]> --- drivers/xen/xenbus/xenbus_client.c | 44 driver

[patch 20/32] xen: Use the hvc console infrastructure for Xen console

2007-04-29 Thread Jeremy Fitzhardinge
Implement a Xen back-end for hvc console. From: Gerd Hoffmann <[EMAIL PROTECTED]> Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Cc: Olof Johansson <[EMAIL PROTECTED]> --- arch/i386/xen/events.c |3 - drivers/Makefile |3 + drivers/char/Kconfig |8 ++ drivers/char/Make

[patch 06/32] xen: Xen virtual mmu

2007-04-29 Thread Jeremy Fitzhardinge
Xen pagetable handling, including the machinery to implement direct pagetables. This means that pte update operations are intercepted so that pseudo-physical addresses can be converted to machine addresses. It also implements late pinning/early unpinning so that pagetables are initialized while th

[patch 08/32] xen: xen time implementation

2007-04-29 Thread Jeremy Fitzhardinge
Time is implemented by using a clocksource which is driven from the hypervisor's nanosecond timebase. Xen implements time by extrapolating from known timestamps using the tsc; the hypervisor is responsible for making sure that the tsc is constant rate and synchronized between vcpus. Signed-off-by

[patch 16/32] xen: Add support for preemption

2007-04-29 Thread Jeremy Fitzhardinge
Add Xen support for preemption. This is mostly a cleanup of existing preempt_enable/disable calls, or just comments to explain the current usage. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> --- arch/i386/xen/Kconfig |2 arch/i386/xen/enlighten.c | 105

[patch 18/32] xen: deal with negative stolen time

2007-04-29 Thread Jeremy Fitzhardinge
Stolen time should never be negative; if it ever is, it probably indicates some other bug. However, if it does happen, then its better to just clamp it at zero, rather than trying to account for it as a huge positive number. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> --- arch/i386/x

[patch 19/32] xen: xen time fixups

2007-04-29 Thread Jeremy Fitzhardinge
1. make sure timer state is set up before bringing up CPU 2. make sure snapshot of 64-bit time values is atomic Be sure, however, that the clockevent source is registered on its home CPU. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> --- arch/i386/xen/smp.c |4 +- arch/i386/xen

[patch 10/32] xen: Complete pagetable pinning for Xen

2007-04-29 Thread Jeremy Fitzhardinge
Xen has a notion of pinned pagetables, which are pagetables that remain read-only to the guest and are validated by the hypervisor. This makes context switches much cheaper, because the hypervisor doesn't need to revalidate the pagetable each time. This patch adds a PG_pinned flag for pagetable pa

[patch 07/32] xen: xen event channels

2007-04-29 Thread Jeremy Fitzhardinge
Xen implements interrupts in terms of event channels. This patch maps an event through an event channel to an irq, and then feeds it through the normal interrupt path, via a Xen irq_chip implementation. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Cc: Ingo Molnar <[EMAIL PROTECTED]> Cc:

[patch 13/32] xen: Account for time stolen by Xen

2007-04-29 Thread Jeremy Fitzhardinge
This accounts for the time Xen steals from our VCPUs. This accounting gets run on each timer interrupt, just as a way to get it run relatively often, and when interesting things are going on. Stolen time is not really used by much in the kernel; it is reported in /proc/stats, and that's about it.

[patch 17/32] xen: lazy-mmu operations

2007-04-29 Thread Jeremy Fitzhardinge
This patch uses the lazy-mmu hooks to batch mmu operations where possible. This is primarily useful for batching operations applied to active pagetables, which happens during mprotect, munmap, mremap and the like (mmap does not do bulk pagetable operations, so it isn't helped). Signed-off-by: Jer

[patch 12/32] xen: fix multicall batching

2007-04-29 Thread Jeremy Fitzhardinge
Disable interrupts between allocating a multicall entry and actually issuing it, to prevent an interrupt from coming in, allocating and initializing further multicall entries, and then issuing them all, including the partially completed one. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]>

[patch 11/32] xen: ignore RW mapping of RO pages in pagetable_init

2007-04-29 Thread Jeremy Fitzhardinge
When setting up the initial pagetable, which includes mappings of all low physical memory, ignore a mapping which tries to set the RW bit on an RO pte. An RO pte indicates a page which is part of the current pagetable, and so it cannot be allowed to become RW. Once xen_pagetable_setup_done is cal

[patch 09/32] xen: xen configuration

2007-04-29 Thread Jeremy Fitzhardinge
Put config options for Xen after the core pieces are in place. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> --- arch/i386/Kconfig |2 ++ arch/i386/xen/Kconfig | 12 2 files changed, 14 insertions(+) ===

[patch 01/32] xen: Add apply_to_page_range() which applies a function to a pte range.

2007-04-29 Thread Jeremy Fitzhardinge
Add a new mm function apply_to_page_range() which applies a given function to every pte in a given virtual address range in a given mm structure. This is a generic alternative to cut-and-pasting the Linux idiomatic pagetable walking code in every place that a sequence of PTEs must be accessed. Alt

[patch 02/32] xen: Allocate and free vmalloc areas

2007-04-29 Thread Jeremy Fitzhardinge
Allocate/destroy a 'vmalloc' VM area: alloc_vm_area and free_vm_area The alloc function ensures that page tables are constructed for the region of kernel virtual address space and mapped into init_mm. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Signed-off-by: Ian Pratt <[EMAIL PROTECTED

[patch 03/32] xen: Add nosegneg capability to the vsyscall page notes

2007-04-29 Thread Jeremy Fitzhardinge
Add the "nosegneg" fake capabilty to the vsyscall page notes. This is used by the runtime linker to select a glibc version which then disables negative-offset accesses to the thread-local segment via %gs. These accesses require emulation in Xen (because segments are truncated to protect the hypervi

[patch 00/32] xen: Xen implementation for paravirt_ops

2007-04-29 Thread Jeremy Fitzhardinge
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21 + 2.6.21-070428-1 + the patches I've posted over the last couple of days. Changes since the last posting: - update per review comments - comment each file - comment barrier use - use common c

Re: [PATCH 10/28] i386: map enough initial memory to create lowmem mappings

2007-04-29 Thread Jeremy Fitzhardinge
Eric W. Biederman wrote: > Any chance you had CONFIG_DEBUG_PAGEALLOC selected? > Yes, that's quite likely. J ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualizat

Re: [PATCH 10/28] i386: map enough initial memory to create lowmem mappings

2007-04-29 Thread Eric W. Biederman
Jeremy Fitzhardinge <[EMAIL PROTECTED]> writes: > Eric W. Biederman wrote: >> And it just occurred to me PSE disabled, otherwise you would not have >> needed more than 4 pages. I supposed you were testing the Xen case. >> > > No, actually, I wasn't. It was booting native (the Xen boot path >

Re: [patches] [PATCH] [21/22] x86_64: Extend bzImage protocol for relocatable bzImage

2007-04-29 Thread Eric W. Biederman
Jeremy Fitzhardinge <[EMAIL PROTECTED]> writes: > Eric W. Biederman wrote: >> All it does is set a flag that tells a bootloader. >> "Hey. I can run when loaded a non-default address, and this is what >> you have to align me to." >> >> All relocation processing happens in the kernel itself. >>

[PATCH 1/2] lguest: fix up after pda->percpu conversion

2007-04-29 Thread Rusty Russell
Andrew Morton commented out some stuff to make lguest compile. This should actually make it work (in the latest -mm). Signed-off-by: Rusty Russell <[EMAIL PROTECTED]> --- drivers/lguest/lguest.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-)

[PATCH 2/2] lguest: handle new paravirt lazy mode (fix userspace segfaults)

2007-04-29 Thread Rusty Russell
There's a new paravirt_lazy_mode mode in town. Well, it's spelled "mode", but it's pronounced "hack". Signed-off-by: Rusty Russell <[EMAIL PROTECTED]> --- drivers/lguest/lguest.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) ===

Re: [PATCH 22/25] xen: xen-netfront: use skb.cb for storing private data

2007-04-29 Thread Herbert Xu
On Sun, Apr 29, 2007 at 12:43:33AM -0700, Jeremy Fitzhardinge wrote: > Herbert Xu wrote: > > BTW, the version I posted to you is missing the following line. > > > > --- linux-2.6.20.i386/drivers/xen/core/skbuff.c 2007-04-28 > > 15:30:16.0 +1000 > > +++ build-2.6.20.i386/drivers/xen/

Re: [PATCH 22/25] xen: xen-netfront: use skb.cb for storing private data

2007-04-29 Thread Jeremy Fitzhardinge
Herbert Xu wrote: > BTW, the version I posted to you is missing the following line. > > --- linux-2.6.20.i386/drivers/xen/core/skbuff.c 2007-04-28 > 15:30:16.0 +1000 > +++ build-2.6.20.i386/drivers/xen/core/skbuff.c 2007-04-28 > 15:30:52.0 +1000 > @@ -89,6 +89,7 @@