Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80967
b: refs/heads/master
c: 6232665
h: refs/heads/master
i:
  80965: 47ab1f0
  80963: 2160e16
  80959: ad59e4f
v: v3
  • Loading branch information
Linus Torvalds committed Jan 31, 2008
1 parent c220e69 commit 5c7ee0d
Show file tree
Hide file tree
Showing 197 changed files with 15,605 additions and 10,035 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c18d1250c7425dddd2633ce4eaf03d5015e68a0f
refs/heads/master: 6232665040f9a23fafd9d94d4ae8d5a2dc850f65
8 changes: 7 additions & 1 deletion trunk/Documentation/DocBook/kernel-api.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,13 @@ X!Edrivers/pnp/system.c

<chapter id="blkdev">
<title>Block Devices</title>
!Eblock/ll_rw_blk.c
!Eblock/blk-core.c
!Eblock/blk-map.c
!Iblock/blk-sysfs.c
!Eblock/blk-settings.c
!Eblock/blk-exec.c
!Eblock/blk-barrier.c
!Eblock/blk-tag.c
</chapter>

<chapter id="chrdev">
Expand Down
49 changes: 43 additions & 6 deletions trunk/Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ static void *guest_base;
/* The maximum guest physical address allowed, and maximum possible. */
static unsigned long guest_limit, guest_max;

/* a per-cpu variable indicating whose vcpu is currently running */
static unsigned int __thread cpu_id;

/* This is our list of devices. */
struct device_list
{
Expand Down Expand Up @@ -153,6 +156,9 @@ struct virtqueue
void (*handle_output)(int fd, struct virtqueue *me);
};

/* Remember the arguments to the program so we can "reboot" */
static char **main_args;

/* Since guest is UP and we don't run at the same time, we don't need barriers.
* But I include them in the code in case others copy it. */
#define wmb()
Expand Down Expand Up @@ -554,7 +560,7 @@ static void wake_parent(int pipefd, int lguest_fd)
else
FD_CLR(-fd - 1, &devices.infds);
} else /* Send LHREQ_BREAK command. */
write(lguest_fd, args, sizeof(args));
pwrite(lguest_fd, args, sizeof(args), cpu_id);
}
}

Expand Down Expand Up @@ -1489,7 +1495,9 @@ static void setup_block_file(const char *filename)

/* Create stack for thread and run it */
stack = malloc(32768);
if (clone(io_thread, stack + 32768, CLONE_VM, dev) == -1)
/* SIGCHLD - We dont "wait" for our cloned thread, so prevent it from
* becoming a zombie. */
if (clone(io_thread, stack + 32768, CLONE_VM | SIGCHLD, dev) == -1)
err(1, "Creating clone");

/* We don't need to keep the I/O thread's end of the pipes open. */
Expand All @@ -1499,7 +1507,21 @@ static void setup_block_file(const char *filename)
verbose("device %u: virtblock %llu sectors\n",
devices.device_num, cap);
}
/* That's the end of device setup. */
/* That's the end of device setup. :*/

/* Reboot */
static void __attribute__((noreturn)) restart_guest(void)
{
unsigned int i;

/* Closing pipes causes the waker thread and io_threads to die, and
* closing /dev/lguest cleans up the Guest. Since we don't track all
* open fds, we simply close everything beyond stderr. */
for (i = 3; i < FD_SETSIZE; i++)
close(i);
execv(main_args[0], main_args);
err(1, "Could not exec %s", main_args[0]);
}

/*L:220 Finally we reach the core of the Launcher, which runs the Guest, serves
* its input and output, and finally, lays it to rest. */
Expand All @@ -1511,7 +1533,8 @@ static void __attribute__((noreturn)) run_guest(int lguest_fd)
int readval;

/* We read from the /dev/lguest device to run the Guest. */
readval = read(lguest_fd, &notify_addr, sizeof(notify_addr));
readval = pread(lguest_fd, &notify_addr,
sizeof(notify_addr), cpu_id);

/* One unsigned long means the Guest did HCALL_NOTIFY */
if (readval == sizeof(notify_addr)) {
Expand All @@ -1521,16 +1544,23 @@ static void __attribute__((noreturn)) run_guest(int lguest_fd)
/* ENOENT means the Guest died. Reading tells us why. */
} else if (errno == ENOENT) {
char reason[1024] = { 0 };
read(lguest_fd, reason, sizeof(reason)-1);
pread(lguest_fd, reason, sizeof(reason)-1, cpu_id);
errx(1, "%s", reason);
/* ERESTART means that we need to reboot the guest */
} else if (errno == ERESTART) {
restart_guest();
/* EAGAIN means the Waker wanted us to look at some input.
* Anything else means a bug or incompatible change. */
} else if (errno != EAGAIN)
err(1, "Running guest failed");

/* Only service input on thread for CPU 0. */
if (cpu_id != 0)
continue;

/* Service input, then unset the BREAK to release the Waker. */
handle_input(lguest_fd);
if (write(lguest_fd, args, sizeof(args)) < 0)
if (pwrite(lguest_fd, args, sizeof(args), cpu_id) < 0)
err(1, "Resetting break");
}
}
Expand Down Expand Up @@ -1571,6 +1601,12 @@ int main(int argc, char *argv[])
/* If they specify an initrd file to load. */
const char *initrd_name = NULL;

/* Save the args: we "reboot" by execing ourselves again. */
main_args = argv;
/* We don't "wait" for the children, so prevent them from becoming
* zombies. */
signal(SIGCHLD, SIG_IGN);

/* First we initialize the device list. Since console and network
* device receive input from a file descriptor, we keep an fdset
* (infds) and the maximum fd number (max_infd) with the head of the
Expand All @@ -1582,6 +1618,7 @@ int main(int argc, char *argv[])
devices.lastdev = &devices.dev;
devices.next_irq = 1;

cpu_id = 0;
/* We need to know how much memory so we can set up the device
* descriptor and memory pages for the devices as we parse the command
* line. So we quickly look through the arguments to find the amount
Expand Down
4 changes: 2 additions & 2 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ P: Alexander Viro
M: viro@zeniv.linux.org.uk
S: Maintained

FIREWIRE SUBSYSTEM
FIREWIRE SUBSYSTEM (drivers/firewire, <linux/firewire*.h>)
P: Kristian Hoegsberg, Stefan Richter
M: krh@redhat.com, stefanr@s5r6.in-berlin.de
L: linux1394-devel@lists.sourceforge.net
Expand Down Expand Up @@ -1917,7 +1917,7 @@ L: linux-ide@vger.kernel.org
L: linux-scsi@vger.kernel.org
S: Orphan

IEEE 1394 SUBSYSTEM
IEEE 1394 SUBSYSTEM (drivers/ieee1394)
P: Ben Collins
M: ben.collins@ubuntu.com
P: Stefan Richter
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/ia64/hp/sim/simscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ static struct scsi_host_template driver_template = {
.max_sectors = 1024,
.cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN,
.use_clustering = DISABLE_CLUSTERING,
.use_sg_chaining = ENABLE_SG_CHAINING,
};

static int __init
Expand Down
13 changes: 4 additions & 9 deletions trunk/arch/powerpc/kernel/vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <asm/iseries/hv_call_xm.h>
#include <asm/iseries/iommu.h>

extern struct kset devices_subsys; /* needed for vio_find_name() */

static struct bus_type vio_bus_type;

static struct vio_dev vio_bus_device = { /* fake "parent" device */
Expand Down Expand Up @@ -361,19 +359,16 @@ EXPORT_SYMBOL(vio_get_attribute);
#ifdef CONFIG_PPC_PSERIES
/* vio_find_name() - internal because only vio.c knows how we formatted the
* kobject name
* XXX once vio_bus_type.devices is actually used as a kset in
* drivers/base/bus.c, this function should be removed in favor of
* "device_find(kobj_name, &vio_bus_type)"
*/
static struct vio_dev *vio_find_name(const char *kobj_name)
static struct vio_dev *vio_find_name(const char *name)
{
struct kobject *found;
struct device *found;

found = kset_find_obj(&devices_subsys, kobj_name);
found = bus_find_device_by_name(&vio_bus_type, NULL, name);
if (!found)
return NULL;

return to_vio_dev(container_of(found, struct device, kobj));
return to_vio_dev(found);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ config ARCH_SUPPORTS_OPROFILE
bool
default y

select HAVE_KVM

config ZONE_DMA32
bool
Expand Down Expand Up @@ -1598,4 +1599,6 @@ source "security/Kconfig"

source "crypto/Kconfig"

source "arch/x86/kvm/Kconfig"

source "lib/Kconfig"
2 changes: 2 additions & 0 deletions trunk/arch/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ else
KBUILD_DEFCONFIG := $(ARCH)_defconfig
endif

core-$(CONFIG_KVM) += arch/x86/kvm/

# BITS is used as extension for files which are available in a 32 bit
# and a 64 bit version to simplify shared Makefiles.
# e.g.: obj-y += foo_$(BITS).o
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/kvm/Kconfig → trunk/arch/x86/kvm/Kconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#
# KVM configuration
#
config HAVE_KVM
bool

menuconfig VIRTUALIZATION
bool "Virtualization"
depends on X86
depends on HAVE_KVM || X86
default y
---help---
Say Y here to get to see options for using your Linux host to run other
Expand All @@ -16,7 +19,7 @@ if VIRTUALIZATION

config KVM
tristate "Kernel-based Virtual Machine (KVM) support"
depends on X86 && EXPERIMENTAL
depends on HAVE_KVM && EXPERIMENTAL
select PREEMPT_NOTIFIERS
select ANON_INODES
---help---
Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/kvm/Makefile → trunk/arch/x86/kvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# Makefile for Kernel-based Virtual Machine module
#

kvm-objs := kvm_main.o mmu.o x86_emulate.o i8259.o irq.o lapic.o ioapic.o
common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o)

EXTRA_CFLAGS += -Ivirt/kvm -Iarch/x86/kvm

kvm-objs := $(common-objs) x86.o mmu.o x86_emulate.o i8259.o irq.o lapic.o
obj-$(CONFIG_KVM) += kvm.o
kvm-intel-objs = vmx.o
obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/kvm/i8259.c → trunk/arch/x86/kvm/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <linux/mm.h>
#include "irq.h"

#include <linux/kvm_host.h>

/*
* set irq level. If an edge is detected, then the IRR is set to 1
*/
Expand Down Expand Up @@ -181,10 +183,8 @@ int kvm_pic_read_irq(struct kvm_pic *s)
return intno;
}

static void pic_reset(void *opaque)
void kvm_pic_reset(struct kvm_kpic_state *s)
{
struct kvm_kpic_state *s = opaque;

s->last_irr = 0;
s->irr = 0;
s->imr = 0;
Expand All @@ -209,7 +209,7 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
addr &= 1;
if (addr == 0) {
if (val & 0x10) {
pic_reset(s); /* init */
kvm_pic_reset(s); /* init */
/*
* deassert a pending interrupt
*/
Expand Down
22 changes: 1 addition & 21 deletions trunk/drivers/kvm/irq.c → trunk/arch/x86/kvm/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
*/

#include <linux/module.h>
#include <linux/kvm_host.h>

#include "kvm.h"
#include "irq.h"

/*
Expand Down Expand Up @@ -63,26 +63,6 @@ int kvm_cpu_get_interrupt(struct kvm_vcpu *v)
}
EXPORT_SYMBOL_GPL(kvm_cpu_get_interrupt);

static void vcpu_kick_intr(void *info)
{
#ifdef DEBUG
struct kvm_vcpu *vcpu = (struct kvm_vcpu *)info;
printk(KERN_DEBUG "vcpu_kick_intr %p \n", vcpu);
#endif
}

void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
{
int ipi_pcpu = vcpu->cpu;

if (waitqueue_active(&vcpu->wq)) {
wake_up_interruptible(&vcpu->wq);
++vcpu->stat.halt_wakeup;
}
if (vcpu->guest_mode)
smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0, 0);
}

void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu)
{
kvm_inject_apic_timer_irqs(vcpu);
Expand Down
Loading

0 comments on commit 5c7ee0d

Please sign in to comment.