Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109113
b: refs/heads/master
c: ec73adb
h: refs/heads/master
i:
  109111: 25f81d9
v: v3
  • Loading branch information
Linus Torvalds committed Aug 25, 2008
1 parent 501e33e commit 8c1f6e4
Show file tree
Hide file tree
Showing 25 changed files with 145 additions and 147 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: 2a61812af2e564cba2c8170cf96e1c823210f619
refs/heads/master: ec73adba51b4dae11134f7e6ffc84feade9f15fa
8 changes: 8 additions & 0 deletions trunk/Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,9 @@ static void handle_console_output(int fd, struct virtqueue *vq, bool timeout)
}
}

/* This is called when we no longer want to hear about Guest changes to a
* virtqueue. This is more efficient in high-traffic cases, but it means we
* have to set a timer to check if any more changes have occurred. */
static void block_vq(struct virtqueue *vq)
{
struct itimerval itm;
Expand Down Expand Up @@ -939,6 +942,11 @@ static void handle_net_output(int fd, struct virtqueue *vq, bool timeout)
if (!timeout && num)
block_vq(vq);

/* We never quite know how long should we wait before we check the
* queue again for more packets. We start at 500 microseconds, and if
* we get fewer packets than last time, we assume we made the timeout
* too small and increase it by 10 microseconds. Otherwise, we drop it
* by one microsecond every time. It seems to work well enough. */
if (timeout) {
if (num < last_timeout_num)
timeout_usec += 10;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kvm/paging_tmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
shadow_addr = __pa(shadow_page->spt);
shadow_pte = shadow_addr | PT_PRESENT_MASK | PT_ACCESSED_MASK
| PT_WRITABLE_MASK | PT_USER_MASK;
*shadow_ent = shadow_pte;
set_shadow_pte(shadow_ent, shadow_pte);
}

mmu_set_spte(vcpu, shadow_ent, access, walker->pte_access & access,
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/lguest/lguest_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ static u32 lg_get_features(struct virtio_device *vdev)
return features;
}

/* The virtio core takes the features the Host offers, and copies the
* ones supported by the driver into the vdev->features array. Once
* that's all sorted out, this routine is called so we can tell the
* Host which features we understand and accept. */
static void lg_finalize_features(struct virtio_device *vdev)
{
unsigned int i, bits;
Expand All @@ -108,6 +112,10 @@ static void lg_finalize_features(struct virtio_device *vdev)
/* Give virtio_ring a chance to accept features. */
vring_transport_features(vdev);

/* The vdev->feature array is a Linux bitmask: this isn't the
* same as a the simple array of bits used by lguest devices
* for features. So we do this slow, manual conversion which is
* completely general. */
memset(out_features, 0, desc->feature_len);
bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8;
for (i = 0; i < bits; i++) {
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/pci/hotplug/pciehp.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ extern int pciehp_poll_mode;
extern int pciehp_poll_time;
extern int pciehp_debug;
extern int pciehp_force;
extern int pciehp_slot_with_bus;
extern struct workqueue_struct *pciehp_wq;

#define dbg(format, arg...) \
Expand Down
21 changes: 14 additions & 7 deletions trunk/drivers/pci/hotplug/pciehp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ int pciehp_debug;
int pciehp_poll_mode;
int pciehp_poll_time;
int pciehp_force;
int pciehp_slot_with_bus;
struct workqueue_struct *pciehp_wq;

#define DRIVER_VERSION "0.4"
Expand All @@ -56,12 +55,10 @@ module_param(pciehp_debug, bool, 0644);
module_param(pciehp_poll_mode, bool, 0644);
module_param(pciehp_poll_time, int, 0644);
module_param(pciehp_force, bool, 0644);
module_param(pciehp_slot_with_bus, bool, 0644);
MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not");
MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not");
MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds");
MODULE_PARM_DESC(pciehp_force, "Force pciehp, even if _OSC and OSHP are missing");
MODULE_PARM_DESC(pciehp_slot_with_bus, "Use bus number in the slot name");

#define PCIE_MODULE_NAME "pciehp"

Expand Down Expand Up @@ -194,6 +191,7 @@ static int init_slots(struct controller *ctrl)
struct slot *slot;
struct hotplug_slot *hotplug_slot;
struct hotplug_slot_info *info;
int len, dup = 1;
int retval = -ENOMEM;

list_for_each_entry(slot, &ctrl->slot_list, slot_list) {
Expand All @@ -220,15 +218,24 @@ static int init_slots(struct controller *ctrl)
dbg("Registering bus=%x dev=%x hp_slot=%x sun=%x "
"slot_device_offset=%x\n", slot->bus, slot->device,
slot->hp_slot, slot->number, ctrl->slot_device_offset);
duplicate_name:
retval = pci_hp_register(hotplug_slot,
ctrl->pci_dev->subordinate,
slot->device);
if (retval) {
/*
* If slot N already exists, we'll try to create
* slot N-1, N-2 ... N-M, until we overflow.
*/
if (retval == -EEXIST) {
len = snprintf(slot->name, SLOT_NAME_SIZE,
"%d-%d", slot->number, dup++);
if (len < SLOT_NAME_SIZE)
goto duplicate_name;
else
err("duplicate slot name overflow\n");
}
err("pci_hp_register failed with error %d\n", retval);
if (retval == -EEXIST)
err("Failed to register slot because of name "
"collision. Try \'pciehp_slot_with_bus\' "
"module option.\n");
goto error_info;
}
/* create additional sysfs entries */
Expand Down
11 changes: 1 addition & 10 deletions trunk/drivers/pci/hotplug/pciehp_hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,15 +1030,6 @@ static void pcie_shutdown_notification(struct controller *ctrl)
pciehp_free_irq(ctrl);
}

static void make_slot_name(struct slot *slot)
{
if (pciehp_slot_with_bus)
snprintf(slot->name, SLOT_NAME_SIZE, "%04d_%04d",
slot->bus, slot->number);
else
snprintf(slot->name, SLOT_NAME_SIZE, "%d", slot->number);
}

static int pcie_init_slot(struct controller *ctrl)
{
struct slot *slot;
Expand All @@ -1053,7 +1044,7 @@ static int pcie_init_slot(struct controller *ctrl)
slot->device = ctrl->slot_device_offset + slot->hp_slot;
slot->hpc_ops = ctrl->hpc_ops;
slot->number = ctrl->first_slot;
make_slot_name(slot);
snprintf(slot->name, SLOT_NAME_SIZE, "%d", slot->number);
mutex_init(&slot->lock);
INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work);
list_add(&slot->slot_list, &ctrl->slot_list);
Expand Down
34 changes: 15 additions & 19 deletions trunk/drivers/pci/hotplug/shpchp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
int shpchp_debug;
int shpchp_poll_mode;
int shpchp_poll_time;
static int shpchp_slot_with_bus;
struct workqueue_struct *shpchp_wq;

#define DRIVER_VERSION "0.4"
Expand All @@ -53,11 +52,9 @@ MODULE_LICENSE("GPL");
module_param(shpchp_debug, bool, 0644);
module_param(shpchp_poll_mode, bool, 0644);
module_param(shpchp_poll_time, int, 0644);
module_param(shpchp_slot_with_bus, bool, 0644);
MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
MODULE_PARM_DESC(shpchp_slot_with_bus, "Use bus number in the slot name");

#define SHPC_MODULE_NAME "shpchp"

Expand Down Expand Up @@ -99,23 +96,13 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
kfree(slot);
}

static void make_slot_name(struct slot *slot)
{
if (shpchp_slot_with_bus)
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d",
slot->bus, slot->number);
else
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d",
slot->number);
}

static int init_slots(struct controller *ctrl)
{
struct slot *slot;
struct hotplug_slot *hotplug_slot;
struct hotplug_slot_info *info;
int retval = -ENOMEM;
int i;
int i, len, dup = 1;

for (i = 0; i < ctrl->num_slots; i++) {
slot = kzalloc(sizeof(*slot), GFP_KERNEL);
Expand Down Expand Up @@ -146,7 +133,7 @@ static int init_slots(struct controller *ctrl)
/* register this slot with the hotplug pci core */
hotplug_slot->private = slot;
hotplug_slot->release = &release_slot;
make_slot_name(slot);
snprintf(slot->name, SLOT_NAME_SIZE, "%d", slot->number);
hotplug_slot->ops = &shpchp_hotplug_slot_ops;

get_power_status(hotplug_slot, &info->power_status);
Expand All @@ -157,14 +144,23 @@ static int init_slots(struct controller *ctrl)
dbg("Registering bus=%x dev=%x hp_slot=%x sun=%x "
"slot_device_offset=%x\n", slot->bus, slot->device,
slot->hp_slot, slot->number, ctrl->slot_device_offset);
duplicate_name:
retval = pci_hp_register(slot->hotplug_slot,
ctrl->pci_dev->subordinate, slot->device);
if (retval) {
/*
* If slot N already exists, we'll try to create
* slot N-1, N-2 ... N-M, until we overflow.
*/
if (retval == -EEXIST) {
len = snprintf(slot->name, SLOT_NAME_SIZE,
"%d-%d", slot->number, dup++);
if (len < SLOT_NAME_SIZE)
goto duplicate_name;
else
err("duplicate slot name overflow\n");
}
err("pci_hp_register failed with error %d\n", retval);
if (retval == -EEXIST)
err("Failed to register slot because of name "
"collision. Try \'shpchp_slot_with_bus\' "
"module option.\n");
goto error_info;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/pci/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ static struct pci_dev *pci_get_dev_by_id(const struct pci_device_id *id,
match_pci_dev_by_id);
if (dev)
pdev = to_pci_dev(dev);
if (from)
pci_dev_put(from);
return pdev;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/virtio/virtio_balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static inline s64 towards_target(struct virtio_balloon *vb)
vb->vdev->config->get(vb->vdev,
offsetof(struct virtio_balloon_config, num_pages),
&v, sizeof(v));
return v - vb->num_pages;
return (s64)v - vb->num_pages;
}

static void update_balloon_size(struct virtio_balloon *vb)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/xen/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static void do_suspend(void)
/* XXX use normal device tree? */
xenbus_suspend();

err = stop_machine_run(xen_suspend, &cancelled, 0);
err = stop_machine(xen_suspend, &cancelled, &cpumask_of_cpu(0));
if (err) {
printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
goto out;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-x86/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ asmlinkage void kvm_handle_fault_on_reboot(void);

#define __kvm_handle_fault_on_reboot(insn) \
"666: " insn "\n\t" \
".pushsection .text.fixup, \"ax\" \n" \
".pushsection .fixup, \"ax\" \n" \
"667: \n\t" \
KVM_EX_PUSH " $666b \n\t" \
"jmp kvm_handle_fault_on_reboot \n\t" \
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,12 @@ struct kvm_trace_rec {
struct {
__u64 cycle_u64;
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
} cycle;
} __attribute__((packed)) cycle;
struct {
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
} nocycle;
} u;
} __attribute__((packed));
};

#define KVMIO 0xAE

Expand Down
19 changes: 1 addition & 18 deletions trunk/include/linux/stop_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
/* "Bogolock": stop the entire machine, disable interrupts. This is a
very heavy lock, which is equivalent to grabbing every spinlock
(and more). So the "read" side to such a lock is anything which
diables preeempt. */
disables preeempt. */
#include <linux/cpu.h>
#include <linux/cpumask.h>
#include <asm/system.h>

#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)

/* Deprecated, but useful for transition. */
#define ALL_CPUS ~0U

/**
* stop_machine: freeze the machine on all CPUs and run this function
* @fn: the function to run
Expand Down Expand Up @@ -50,18 +47,4 @@ static inline int stop_machine(int (*fn)(void *), void *data,
return ret;
}
#endif /* CONFIG_SMP */

static inline int __deprecated stop_machine_run(int (*fn)(void *), void *data,
unsigned int cpu)
{
/* If they don't care which cpu fn runs on, just pick one. */
if (cpu == NR_CPUS)
return stop_machine(fn, data, NULL);
else if (cpu == ~0U)
return stop_machine(fn, data, &cpu_possible_map);
else {
cpumask_t cpus = cpumask_of_cpu(cpu);
return stop_machine(fn, data, &cpus);
}
}
#endif /* _LINUX_STOP_MACHINE */
2 changes: 1 addition & 1 deletion trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ static void *module_alloc_update_bounds(unsigned long size)

/* Allocate and load the module: note that size of section 0 is always
zero, and we rely on this for optional sections. */
static struct module *load_module(void __user *umod,
static noinline struct module *load_module(void __user *umod,
unsigned long len,
const char __user *uargs)
{
Expand Down
Loading

0 comments on commit 8c1f6e4

Please sign in to comment.