* [BK PATCH] PCI Hotplug changes for 2.4.21-pre1
From: Greg KH @ 2002-12-16 23:48 UTC (permalink / raw)
To: marcelo; +Cc: linux-kernel, pcihpd-discuss
Hi,
Here is an update for the PCI Hotplug core and the PCI ACPI Hotplug
driver. This fixes a problem for ia64 machines, enabling the driver to
now work properly. Thanks go out to Matthew Wilcox for finally fixing
this problem.
Please pull from: bk://linuxusb.bkbits.net/pci_hp-2.4
The raw patches will follow.
thanks,
greg k-h
drivers/hotplug/acpiphp.h | 2
drivers/hotplug/acpiphp_glue.c | 16 --
drivers/hotplug/acpiphp_pci.c | 48 +++----
drivers/hotplug/pci_hotplug.h | 12 +
drivers/hotplug/pci_hotplug_util.c | 223 ++++++++++++++++++++++---------------
5 files changed, 176 insertions(+), 125 deletions(-)
-----
ChangeSet@1.886, 2002-12-16 11:47:08-08:00, willy@debian.org
[PATCH] Convert acpiphp to pci_bus_*() API [2/2]
Convert the acpiphp driver from the pci_*_nodev() API to the pci_bus_*() API.
This patch is relative to 2.4.21-bk.
drivers/hotplug/acpiphp.h | 2 -
drivers/hotplug/acpiphp_glue.c | 16 ++-----------
drivers/hotplug/acpiphp_pci.c | 48 +++++++++++++++++++----------------------
3 files changed, 26 insertions(+), 40 deletions(-)
------
ChangeSet@1.885, 2002-12-16 11:46:55-08:00, willy@debian.org
[PATCH] Add pci_bus_*() API for 2.4 [1/2]
Introduce the pci_bus_(read|write)_config(byte|word|dword) functions from
Linux 2.5. Reimplement the pci_(read|write)_config(byte|word|dword)_nodev
functions as compatibility wrappers.
drivers/hotplug/pci_hotplug.h | 12 +
drivers/hotplug/pci_hotplug_util.c | 223 ++++++++++++++++++++++---------------
2 files changed, 150 insertions(+), 85 deletions(-)
------
^ permalink raw reply
* [PATCH] PCI Hotplug changes for 2.4.21-pre1
From: Greg KH @ 2002-12-16 23:49 UTC (permalink / raw)
To: marcelo; +Cc: linux-kernel, pcihpd-discuss
In-Reply-To: <20021216234817.GD17214@kroah.com>
ChangeSet 1.885, 2002/12/16 11:46:55-08:00, willy@debian.org
[PATCH] Add pci_bus_*() API for 2.4 [1/2]
Introduce the pci_bus_(read|write)_config(byte|word|dword) functions from
Linux 2.5. Reimplement the pci_(read|write)_config(byte|word|dword)_nodev
functions as compatibility wrappers.
diff -Nru a/drivers/hotplug/pci_hotplug.h b/drivers/hotplug/pci_hotplug.h
--- a/drivers/hotplug/pci_hotplug.h Mon Dec 16 15:42:52 2002
+++ b/drivers/hotplug/pci_hotplug.h Mon Dec 16 15:42:52 2002
@@ -167,6 +167,18 @@
struct pci_dev_wrapped *wrapped_dev,
struct pci_bus_wrapped *wrapped_parent);
+int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val);
+int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val);
+int pci_bus_read_config_dword (struct pci_bus *bus, unsigned int devfn, int where, u32 *val);
+int pci_bus_write_config_byte(struct pci_bus *bus, unsigned int devfn, int where, u8 val);
+int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn, int where, u16 val);
+int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, int where, u32 val);
+
+/*
+ * Compatibility functions. Don't use these, use the
+ * pci_bus_*() functions above.
+ */
+
extern int pci_read_config_byte_nodev (struct pci_ops *ops, u8 bus, u8 device,
u8 function, int where, u8 *val);
extern int pci_read_config_word_nodev (struct pci_ops *ops, u8 bus, u8 device,
diff -Nru a/drivers/hotplug/pci_hotplug_util.c b/drivers/hotplug/pci_hotplug_util.c
--- a/drivers/hotplug/pci_hotplug_util.c Mon Dec 16 15:42:52 2002
+++ b/drivers/hotplug/pci_hotplug_util.c Mon Dec 16 15:42:52 2002
@@ -50,78 +50,58 @@
/* local variables */
static int debug;
-
-static int build_dev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, struct pci_dev **pci_dev)
+static int build_dev (struct pci_bus *bus, unsigned int devfn, struct pci_dev **pci_dev)
{
struct pci_dev *my_dev;
- struct pci_bus *my_bus;
-
- /* Some validity checks. */
- if ((function > 7) ||
- (slot > 31) ||
- (pci_dev == NULL) ||
- (ops == NULL))
- return -ENODEV;
my_dev = kmalloc (sizeof (struct pci_dev), GFP_KERNEL);
if (!my_dev)
return -ENOMEM;
- my_bus = kmalloc (sizeof (struct pci_bus), GFP_KERNEL);
- if (!my_bus) {
- kfree (my_dev);
- return -ENOMEM;
- }
+
memset(my_dev, 0, sizeof(struct pci_dev));
- memset(my_bus, 0, sizeof(struct pci_bus));
- my_bus->number = bus;
- my_bus->ops = ops;
- my_dev->devfn = PCI_DEVFN(slot, function);
- my_dev->bus = my_bus;
+ my_dev->devfn = devfn;
+ my_dev->bus = bus;
+ my_dev->sysdata = bus->sysdata;
*pci_dev = my_dev;
return 0;
}
/**
- * pci_read_config_byte_nodev - read a byte from a pci device
- * @ops: pointer to a &struct pci_ops that will be used to read from the pci device
- * @bus: the bus of the pci device to read from
- * @slot: the pci slot number of the pci device to read from
- * @function: the function of the pci device to read from
- * @where: the location on the pci address space to read from
+ * pci_bus_read_config_byte - read a byte from a pci device
+ * @bus: pointer to the parent bus of the pci device to read from
+ * @devfn: the device / function of the pci device to read from
+ * @where: the location in the pci address space to read from
* @value: pointer to where to place the data read
*
* Like pci_read_config_byte() but works for pci devices that do not have a
* pci_dev structure set up yet.
* Returns 0 on success.
*/
-int pci_read_config_byte_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u8 *value)
+int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *value)
{
struct pci_dev *dev = NULL;
int result;
- dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
+ dbg("%p, %d, %d, %p\n", bus, devfn, where, value);
+ dev = pci_find_slot(bus->number, devfn);
if (dev) {
dbg("using native pci_dev\n");
return pci_read_config_byte (dev, where, value);
}
- result = build_dev (ops, bus, slot, function, &dev);
+ result = build_dev(bus, devfn, &dev);
if (result)
return result;
result = pci_read_config_byte(dev, where, value);
- kfree (dev->bus);
kfree (dev);
return result;
}
/**
- * pci_read_config_word_nodev - read a word from a pci device
- * @ops: pointer to a &struct pci_ops that will be used to read from the pci device
- * @bus: the bus of the pci device to read from
- * @slot: the pci slot number of the pci device to read from
- * @function: the function of the pci device to read from
+ * pci_bus_read_config_word - read a word from a pci device
+ * @bus: pointer to the parent bus of the pci device to read from
+ * @devfn: the device / function of the pci device to read from
* @where: the location on the pci address space to read from
* @value: pointer to where to place the data read
*
@@ -129,34 +109,30 @@
* pci_dev structure set up yet.
* Returns 0 on success.
*/
-int pci_read_config_word_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u16 *value)
+int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *value)
{
struct pci_dev *dev = NULL;
int result;
- dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
+ dbg("%p, %d, %d, %p\n", bus, devfn, where, value);
+ dev = pci_find_slot(bus->number, devfn);
if (dev) {
dbg("using native pci_dev\n");
return pci_read_config_word (dev, where, value);
}
- result = build_dev (ops, bus, slot, function, &dev);
+ result = build_dev(bus, devfn, &dev);
if (result)
return result;
result = pci_read_config_word(dev, where, value);
- kfree (dev->bus);
kfree (dev);
return result;
}
/**
- * pci_read_config_dword_nodev - read a dword from a pci device
- * @ops: pointer to a &struct pci_ops that will be used to read from the pci
- * device
- * @bus: the bus of the pci device to read from
- * @slot: the pci slot number of the pci device to read from
- * @function: the function of the pci device to read from
+ * pci_bus_read_config_dword - read a dword from a pci device
+ * @bus: pointer to the parent bus of the pci device to read from
+ * @devfn: the device / function of the pci device to read from
* @where: the location on the pci address space to read from
* @value: pointer to where to place the data read
*
@@ -164,34 +140,30 @@
* pci_dev structure set up yet.
* Returns 0 on success.
*/
-int pci_read_config_dword_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u32 *value)
+int pci_bus_read_config_dword (struct pci_bus *bus, unsigned int devfn, int where, u32 *value)
{
struct pci_dev *dev = NULL;
int result;
- dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
+ dbg("%p, %d, %d, %p\n", bus, devfn, where, value);
+ dev = pci_find_slot(bus->number, devfn);
if (dev) {
dbg("using native pci_dev\n");
return pci_read_config_dword (dev, where, value);
}
- result = build_dev (ops, bus, slot, function, &dev);
+ result = build_dev(bus, devfn, &dev);
if (result)
return result;
result = pci_read_config_dword(dev, where, value);
- kfree (dev->bus);
kfree (dev);
return result;
}
/**
- * pci_write_config_byte_nodev - write a byte to a pci device
- * @ops: pointer to a &struct pci_ops that will be used to write to the pci
- * device
- * @bus: the bus of the pci device to write to
- * @slot: the pci slot number of the pci device to write to
- * @function: the function of the pci device to write to
+ * pci_bus_write_config_byte - write a byte to a pci device
+ * @bus: pointer to the parent bus of the pci device to read from
+ * @devfn: the device / function of the pci device to read from
* @where: the location on the pci address space to write to
* @value: the value to write to the pci device
*
@@ -199,34 +171,30 @@
* pci_dev structure set up yet.
* Returns 0 on success.
*/
-int pci_write_config_byte_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u8 value)
+int pci_bus_write_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 value)
{
struct pci_dev *dev = NULL;
int result;
- dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
+ dbg("%p, %d, %d, %d\n", bus, devfn, where, value);
+ dev = pci_find_slot(bus->number, devfn);
if (dev) {
dbg("using native pci_dev\n");
return pci_write_config_byte (dev, where, value);
}
- result = build_dev (ops, bus, slot, function, &dev);
+ result = build_dev(bus, devfn, &dev);
if (result)
return result;
result = pci_write_config_byte(dev, where, value);
- kfree (dev->bus);
kfree (dev);
return result;
}
/**
- * pci_write_config_word_nodev - write a word to a pci device
- * @ops: pointer to a &struct pci_ops that will be used to write to the pci
- * device
- * @bus: the bus of the pci device to write to
- * @slot: the pci slot number of the pci device to write to
- * @function: the function of the pci device to write to
+ * pci_bus_write_config_word - write a word to a pci device
+ * @bus: pointer to the parent bus of the pci device to read from
+ * @devfn: the device / function of the pci device to read from
* @where: the location on the pci address space to write to
* @value: the value to write to the pci device
*
@@ -234,34 +202,30 @@
* pci_dev structure set up yet.
* Returns 0 on success.
*/
-int pci_write_config_word_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u16 value)
+int pci_bus_write_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 value)
{
struct pci_dev *dev = NULL;
int result;
- dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
+ dbg("%p, %d, %d, %d\n", bus, devfn, where, value);
+ dev = pci_find_slot(bus->number, devfn);
if (dev) {
dbg("using native pci_dev\n");
return pci_write_config_word (dev, where, value);
}
- result = build_dev (ops, bus, slot, function, &dev);
+ result = build_dev(bus, devfn, &dev);
if (result)
return result;
result = pci_write_config_word(dev, where, value);
- kfree (dev->bus);
kfree (dev);
return result;
}
/**
- * pci_write_config_dword_nodev - write a dword to a pci device
- * @ops: pointer to a &struct pci_ops that will be used to write to the pci
- * device
- * @bus: the bus of the pci device to write to
- * @slot: the pci slot number of the pci device to write to
- * @function: the function of the pci device to write to
+ * pci_bus_write_config_dword - write a dword to a pci device
+ * @bus: pointer to the parent bus of the pci device to read from
+ * @devfn: the device / function of the pci device to read from
* @where: the location on the pci address space to write to
* @value: the value to write to the pci device
*
@@ -269,23 +233,22 @@
* pci_dev structure set up yet.
* Returns 0 on success.
*/
-int pci_write_config_dword_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u32 value)
+int pci_bus_write_config_dword (struct pci_bus *bus, unsigned int devfn, int where, u32 value)
{
struct pci_dev *dev = NULL;
int result;
- dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
+ dbg("%p, %d, %d, %d\n", bus, devfn, where, value);
+ dev = pci_find_slot(bus->number, devfn);
if (dev) {
dbg("using native pci_dev\n");
return pci_write_config_dword (dev, where, value);
}
- result = build_dev (ops, bus, slot, function, &dev);
+ result = build_dev(bus, devfn, &dev);
if (result)
return result;
result = pci_write_config_dword(dev, where, value);
- kfree (dev->bus);
kfree (dev);
return result;
}
@@ -392,8 +355,98 @@
return result;
}
+/* Compatibility wrapper functions */
+
+static struct pci_bus *alloc_bus(struct pci_ops *ops, u8 bus_nr)
+{
+ struct pci_bus *bus = kmalloc(sizeof(struct pci_bus), GFP_KERNEL);
+ if (!bus)
+ return NULL;
+ memset(bus, 0, sizeof(struct pci_bus));
+ bus->number = bus_nr;
+ bus->ops = ops;
+ return bus;
+}
+
+int pci_read_config_byte_nodev(struct pci_ops *ops, u8 bus_nr, u8 slot, u8 function, int where, u8 *value)
+{
+ int result;
+ struct pci_bus *bus = alloc_bus(ops, bus_nr);
+ if (!bus)
+ return -ENOMEM;
+ result = pci_bus_read_config_byte(bus, PCI_DEVFN(slot, function),
+ where, value);
+ kfree(bus);
+ return result;
+}
+
+int pci_read_config_word_nodev(struct pci_ops *ops, u8 bus_nr, u8 slot, u8 function, int where, u16 *value)
+{
+ int result;
+ struct pci_bus *bus = alloc_bus(ops, bus_nr);
+ if (!bus)
+ return -ENOMEM;
+ result = pci_bus_read_config_word(bus, PCI_DEVFN(slot, function),
+ where, value);
+ kfree(bus);
+ return result;
+}
+
+int pci_read_config_dword_nodev(struct pci_ops *ops, u8 bus_nr, u8 slot, u8 function, int where, u32 *value)
+{
+ int result;
+ struct pci_bus *bus = alloc_bus(ops, bus_nr);
+ if (!bus)
+ return -ENOMEM;
+ result = pci_bus_read_config_dword(bus, PCI_DEVFN(slot, function),
+ where, value);
+ kfree(bus);
+ return result;
+}
+
+int pci_write_config_byte_nodev(struct pci_ops *ops, u8 bus_nr, u8 slot, u8 function, int where, u8 value)
+{
+ int result;
+ struct pci_bus *bus = alloc_bus(ops, bus_nr);
+ if (!bus)
+ return -ENOMEM;
+ result = pci_bus_write_config_byte(bus, PCI_DEVFN(slot, function),
+ where, value);
+ kfree(bus);
+ return result;
+}
+
+int pci_write_config_word_nodev(struct pci_ops *ops, u8 bus_nr, u8 slot, u8 function, int where, u16 value)
+{
+ int result;
+ struct pci_bus *bus = alloc_bus(ops, bus_nr);
+ if (!bus)
+ return -ENOMEM;
+ result = pci_bus_write_config_word(bus, PCI_DEVFN(slot, function),
+ where, value);
+ kfree(bus);
+ return result;
+}
+
+int pci_write_config_dword_nodev(struct pci_ops *ops, u8 bus_nr, u8 slot, u8 function, int where, u32 value)
+{
+ int result;
+ struct pci_bus *bus = alloc_bus(ops, bus_nr);
+ if (!bus)
+ return -ENOMEM;
+ result = pci_bus_write_config_dword(bus, PCI_DEVFN(slot, function),
+ where, value);
+ kfree(bus);
+ return result;
+}
EXPORT_SYMBOL(pci_visit_dev);
+EXPORT_SYMBOL(pci_bus_read_config_byte);
+EXPORT_SYMBOL(pci_bus_read_config_word);
+EXPORT_SYMBOL(pci_bus_read_config_dword);
+EXPORT_SYMBOL(pci_bus_write_config_byte);
+EXPORT_SYMBOL(pci_bus_write_config_word);
+EXPORT_SYMBOL(pci_bus_write_config_dword);
EXPORT_SYMBOL(pci_read_config_byte_nodev);
EXPORT_SYMBOL(pci_read_config_word_nodev);
EXPORT_SYMBOL(pci_read_config_dword_nodev);
^ permalink raw reply
* Re: [PATCH] PCI Hotplug changes for 2.4.21-pre1
From: Greg KH @ 2002-12-16 23:51 UTC (permalink / raw)
To: marcelo; +Cc: linux-kernel, pcihpd-discuss
In-Reply-To: <20021216234953.GE17214@kroah.com>
ChangeSet 1.886, 2002/12/16 11:47:08-08:00, willy@debian.org
[PATCH] Convert acpiphp to pci_bus_*() API [2/2]
Convert the acpiphp driver from the pci_*_nodev() API to the pci_bus_*() API.
This patch is relative to 2.4.21-bk.
diff -Nru a/drivers/hotplug/acpiphp.h b/drivers/hotplug/acpiphp.h
--- a/drivers/hotplug/acpiphp.h Mon Dec 16 15:42:46 2002
+++ b/drivers/hotplug/acpiphp.h Mon Dec 16 15:42:46 2002
@@ -173,8 +173,6 @@
/* PCI-to-PCI bridge device */
struct pci_dev *pci_dev;
- struct pci_ops *pci_ops;
-
/* ACPI 2.0 _HPP parameters */
struct hpp_param hpp;
diff -Nru a/drivers/hotplug/acpiphp_glue.c b/drivers/hotplug/acpiphp_glue.c
--- a/drivers/hotplug/acpiphp_glue.c Mon Dec 16 15:42:46 2002
+++ b/drivers/hotplug/acpiphp_glue.c Mon Dec 16 15:42:46 2002
@@ -43,7 +43,6 @@
static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
static void handle_hotplug_event_func (acpi_handle, u32, void *);
-static struct pci_ops *default_ops;
/*
* initialization & terminatation routines
@@ -515,7 +514,6 @@
bridge->bus = bus;
bridge->pci_bus = find_pci_bus(&pci_root_buses, bus);
- bridge->pci_ops = bridge->pci_bus->ops;
bridge->res_lock = SPIN_LOCK_UNLOCKED;
@@ -592,7 +590,6 @@
kfree(bridge);
return;
}
- bridge->pci_ops = bridge->pci_bus->ops;
bridge->res_lock = SPIN_LOCK_UNLOCKED;
@@ -1072,11 +1069,9 @@
if (ACPI_SUCCESS(status) && sta)
break;
} else {
- pci_read_config_dword_nodev(default_ops,
- slot->bridge->bus,
- slot->device,
- func->function,
- PCI_VENDOR_ID, &dvid);
+ pci_bus_read_config_dword(slot->bridge->pci_bus,
+ PCI_DEVFN(slot->device, func->function),
+ PCI_VENDOR_ID, &dvid);
if (dvid != 0xffffffff) {
sta = ACPI_STA_ALL;
break;
@@ -1204,11 +1199,6 @@
acpi_status status;
if (list_empty(&pci_root_buses))
- return -1;
-
- /* set default pci_ops for configuration space operation */
- default_ops = pci_bus_b(pci_root_buses.next)->ops;
- if (!default_ops)
return -1;
status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
diff -Nru a/drivers/hotplug/acpiphp_pci.c b/drivers/hotplug/acpiphp_pci.c
--- a/drivers/hotplug/acpiphp_pci.c Mon Dec 16 15:42:46 2002
+++ b/drivers/hotplug/acpiphp_pci.c Mon Dec 16 15:42:46 2002
@@ -58,23 +58,22 @@
int count;
struct acpiphp_bridge *bridge;
struct pci_resource *res;
- struct pci_ops *ops;
- int bus, device, function;
+ struct pci_bus *bus;
+ int devfn;
bridge = func->slot->bridge;
- bus = bridge->bus;
- device = func->slot->device;
- function = func->function;
- ops = bridge->pci_ops;
+ bus = bridge->pci_bus;
+ devfn = PCI_DEVFN(func->slot->device, func->function);
for (count = 0; address[count]; count++) { /* for 6 BARs */
- pci_write_config_dword_nodev(ops, bus, device, function, address[count], 0xFFFFFFFF);
- pci_read_config_dword_nodev(ops, bus, device, function, address[count], &bar);
+ pci_bus_write_config_dword(bus, devfn, address[count], 0xFFFFFFFF);
+ pci_bus_read_config_dword(bus, devfn, address[count], &bar);
if (!bar) /* This BAR is not implemented */
continue;
- dbg("Device %02x.%02x BAR %d wants %x\n", device, function, count, bar);
+ dbg("Device %02x.%d BAR %d wants %x\n", PCI_SLOT(devfn),
+ PCI_FUNC(devfn), count, bar);
if (bar & PCI_BASE_ADDRESS_SPACE_IO) {
/* This is IO */
@@ -90,10 +89,10 @@
if (!res) {
err("cannot allocate requested io for %02x:%02x.%d len %x\n",
- bus, device, function, len);
+ bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), len);
return -1;
}
- pci_write_config_dword_nodev(ops, bus, device, function, address[count], (u32)res->base);
+ pci_bus_write_config_dword(bus, devfn, address[count], (u32)res->base);
res->next = func->io_head;
func->io_head = res;
@@ -113,16 +112,16 @@
if (!res) {
err("cannot allocate requested pfmem for %02x:%02x.%d len %x\n",
- bus, device, function, len);
+ bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), len);
return -1;
}
- pci_write_config_dword_nodev(ops, bus, device, function, address[count], (u32)res->base);
+ pci_bus_write_config_dword(bus, devfn, address[count], (u32)res->base);
if (bar & PCI_BASE_ADDRESS_MEM_TYPE_64) { /* takes up another dword */
dbg("inside the pfmem 64 case, count %d\n", count);
count += 1;
- pci_write_config_dword_nodev(ops, bus, device, function, address[count], (u32)(res->base >> 32));
+ pci_bus_write_config_dword(bus, devfn, address[count], (u32)(res->base >> 32));
}
res->next = func->p_mem_head;
@@ -142,17 +141,17 @@
if (!res) {
err("cannot allocate requested pfmem for %02x:%02x.%d len %x\n",
- bus, device, function, len);
+ bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), len);
return -1;
}
- pci_write_config_dword_nodev(ops, bus, device, function, address[count], (u32)res->base);
+ pci_bus_write_config_dword(bus, devfn, address[count], (u32)res->base);
if (bar & PCI_BASE_ADDRESS_MEM_TYPE_64) {
/* takes up another dword */
dbg("inside mem 64 case, reg. mem, count %d\n", count);
count += 1;
- pci_write_config_dword_nodev(ops, bus, device, function, address[count], (u32)(res->base >> 32));
+ pci_bus_write_config_dword(bus, devfn, address[count], (u32)(res->base >> 32));
}
res->next = func->mem_head;
@@ -163,7 +162,7 @@
}
/* disable expansion rom */
- pci_write_config_dword_nodev(ops, bus, device, function, PCI_ROM_ADDRESS, 0x00000000);
+ pci_bus_write_config_dword(bus, devfn, PCI_ROM_ADDRESS, 0x00000000);
return 0;
}
@@ -556,9 +555,9 @@
int retval = 0;
int is_multi = 0;
- pci_read_config_byte_nodev(slot->bridge->pci_ops,
- slot->bridge->bus, slot->device, 0,
- PCI_HEADER_TYPE, &hdr);
+ pci_bus_read_config_byte(slot->bridge->pci_bus,
+ PCI_DEVFN(slot->device, 0),
+ PCI_HEADER_TYPE, &hdr);
if (hdr & 0x80)
is_multi = 1;
@@ -566,10 +565,9 @@
list_for_each (l, &slot->funcs) {
func = list_entry(l, struct acpiphp_func, sibling);
if (is_multi || func->function == 0) {
- pci_read_config_dword_nodev(slot->bridge->pci_ops,
- slot->bridge->bus,
- slot->device,
- func->function,
+ pci_bus_read_config_dword(slot->bridge->pci_bus,
+ PCI_DEVFN(slot->device,
+ func->function),
PCI_VENDOR_ID, &dvid);
if (dvid != 0xffffffff) {
retval = init_config_space(func);
^ permalink raw reply
* Re: [parisc-linux] Is this system_irqsave diff is correct?
From: Grant Grundler @ 2002-12-16 23:47 UTC (permalink / raw)
To: Joel Soete; +Cc: parisc-linux
In-Reply-To: <3DFC7EFA.9040708@freebel.net>
On Sun, Dec 15, 2002 at 01:09:14PM +0000, Joel Soete wrote:
> is this diff is right:
> -#define local_irq_restore(x) \
> - __asm__ __volatile__("mtsm %0" : : "r" (x) : "memory" )
> +#define local_irq_restore(x) __restore_flags(x)
Yes - those seem the be the same.
grant
^ permalink raw reply
* Re: [Benchmark] AIM9 results
From: Hans Reiser @ 2002-12-17 0:00 UTC (permalink / raw)
To: Andrew Morton; +Cc: Paolo Ciarrocchi, linux-kernel, Chris Mason
In-Reply-To: <3DFE63D3.B4D3308B@digeo.com>
Andrew Morton wrote:
>Andrew Morton wrote:
>
>
>>Hans Reiser wrote:
>>
>>
>>>Andrew and Chris, are these changes in performance definitely due to VM
>>>changes (and not some difference I am not thinking of between 2.5 and
>>>2.4 reiserfs code)?
>>>
>>>
>>>
>>aim9 is just doing
>>
>> for (lots)
>> close(creat(filename))
>>
>>
> unlink(filename); /* of course */
>
>
>
>
Oh, commercial fs vendors must really love tuning for this benchmark....
sigh....
Hans
^ permalink raw reply
* MSN helper module
From: Carlos Fernandez Sanz @ 2002-12-16 23:57 UTC (permalink / raw)
To: netfilter-devel
Hi,
Is there a helper module for MSN? If not, is it being developed and can I
join the effort?
If nothing is being done I'll just write the module myself before not having
full MSN support becomes a serious issue and starts going up...
^ permalink raw reply
* mouse grabbing gotcha (was: dosemu 1.1.3.9 user report)
From: Peter Jay Salzman @ 2002-12-16 23:57 UTC (permalink / raw)
To: linux-msdos
In-Reply-To: <Pine.LNX.4.33.0212161445270.5051-100000@DHCP-94-246.math.ohio-state.edu>
begin Bart Oldeman <oldeman@math.ohio-state.edu>
> On Mon, 16 Dec 2002, Peter Jay Salzman wrote:
>
> > have you been able to have xdosemu grab the mouse? i've been having
> > trouble playing redneck rampage because if the mouse "moves over" too
> > far left or right, the mouse leaves the xdos window.
>
> try ctrl-alt-home. I noticed in your dosemu.conf that you uncommented the
> mgrab_key setting, but it should work by default.
>
> Bart
i guess enlightenment traps cntl-alt-home, because the key combo won't
let dosemu grab the mouse.
however, it DOES work with twm.
these are the only 2 wm's i use. :)
also, running DOSEMU as your "window manager" by running "exec xdosemu"
from .xinitrc also works. :)
pete
--
First they ignore you, then they laugh at you, then they fight you,
then you win. -- Gandhi, being prophetic about Linux.
Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
^ permalink raw reply
* Linksys WPC11 PCMCIA Wireless
From: Matthew J Fanto @ 2002-12-17 0:08 UTC (permalink / raw)
To: linux-kernel
I am trying to install a linksys WPC11 pcmcia card on my sony
vaio. I have enabled the Hermes driver in the kernel (using
2.4.20). I have also built the linux-wlan package. When I
insert the card, I get the following:
prism2_cs.o: 0.1.16-pre7 loaded
init_module: dev_info is prism2_cs
prism2_cs: RequestIRQ: Resource in use
prism2sta_config: NextTuple failure? It's probably a Vcc mismatch
prism2sta_event: prism2_cs: initalization failed!
Any help would be appreciated.
I had to unsubscribe from the list while I'm on vacation, so
please reply back to me.
-Matthew J. Fanto
^ permalink raw reply
* Re: slave_destroy called in scsi_scan.c:scsi_probe_and_add_lun()
From: Douglas Gilbert @ 2002-12-17 0:03 UTC (permalink / raw)
To: Justin T. Gibbs; +Cc: linux-scsi, dledford
In-Reply-To: <170040000.1040080786@aslan.btc.adaptec.com>
Justin T. Gibbs wrote:
> In debugging a different bug in the new 2.5.X port of the aic7xxx driver,
> I came across this behavior in scsi_probe_and_add_lun()
>
> /*
> * Since we reuse the same sdevscan over and over with different
> * target and lun values, we have to destroy and then recreate
> * any possible low level attachments since they very will might
> * also store the id and lun numbers in some form and need updating
> * with each scan.
> */
> if (sdevscan->host->hostt->slave_destroy)
> sdevscan->host->hostt->slave_destroy(sdevscan);
> if (sdevscan->host->hostt->slave_alloc)
> sdevscan->host->hostt->slave_alloc(sdevscan);
>
> So, you cannot rely on slave_destroy as an indication of a device really
> going away in the physical sense. In SPI, for example, the driver can only
> tell that the device is gone if a command is issued to it. I had hoped that
> I could detect hot-pull/scsi-remove-single-device operations via this
> callback.
> Granted, for some drivers, recreating and destroying state associated with a
> particular device might be pretty cheap, but certainly not in all cases.
> The
> aic7xxx and aic79xx drivers maintain domain validation and other negotiation
> state in these structures. You certainly don't want to go through another
> full
> Domain Validation sequence the next time a device is allocated via
> slave_alloc() if the device isn't really "new".
>
> Any chance in changing this behavior?
Justin,
Yes, that behaviour does seem inconsistent with the
description of slave_alloc() and slave_destroy().
This post from 29th November shows a trace from a
device scan being done on the scsi_debug driver:
marc.theaimsgroup.com/?l=linux-scsi&m=103855771307230&w=2
I believe Pat Mansfield has done most of the recent
work in th device scan area and he is currently on
holiday.
Doug Gilbert
^ permalink raw reply
* Re: [CryptoAPI-devel] [RFC] Hardware support notes for the kernel crypto API (2.5+)
From: Steve Isaacs @ 2002-12-17 0:15 UTC (permalink / raw)
To: James Morris, linux-kernel; +Cc: David S. Miller, cryptoapi-devel
In-Reply-To: <Mutt.LNX.4.44.0212150025190.24712-100000@blackbird.intercode.com.au>
On Saturday 14 December 2002 05:51, James Morris wrote:
> Motorola
> Unknown (Steve is working on some Linux drivers though).
>
The User's Manuals can be downloaded at:
MPC190
http://e-www.motorola.com/brdata/PDFDB/docs/MPC190UM.pdf
MPC184
http://e-www.motorola.com/brdata/PDFDB/docs/MPC184UM.pdf
Steve
^ permalink raw reply
* Re: Multithreaded coredump patch where?
From: mgross @ 2002-12-16 21:21 UTC (permalink / raw)
To: Roberto Fichera, linux-kernel
In-Reply-To: <5.2.0.9.0.20021216182325.042a2b60@mail.isolaweb.it>
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
I haven't rebased the patches I posted back in June for a while now.
Attached is the patch I posted for the 2.4.18 vanilla kernel. Its a bit
controversial, but it seems to work for a number of folks. Let me know if
you have any troubles re-basing it.
I don't know if there is any plan to back port Ingo's version of this feature
to 2.4.x
--mgross
On Monday 16 December 2002 09:28 am, Roberto Fichera wrote:
> Does anyone point me where can I download a stable
> multithread coredump patch for the 2.4.19/20 kernel ?
>
> Thanks in advance,
>
> Roberto Fichera.
>
>
> ______________________________________
> E-mail protetta dal servizio antivirus di IsolaWeb Agency & ISP
> http://wwww.isolaweb.it
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
[-- Attachment #2: tcore-2418-061802.pat --]
[-- Type: text/x-diff, Size: 26472 bytes --]
diff -urN -X dontdiff linux-2.4.18/arch/i386/kernel/i387.c linux2418.tcore/arch/i386/kernel/i387.c
--- linux-2.4.18/arch/i386/kernel/i387.c Fri Feb 23 13:09:08 2001
+++ linux2418.tcore/arch/i386/kernel/i387.c Thu Jun 13 10:00:48 2002
@@ -520,3 +520,44 @@
return fpvalid;
}
+
+int dump_task_fpu( struct task_struct *tsk, struct user_i387_struct *fpu )
+{
+ int fpvalid;
+
+ fpvalid = tsk->used_math;
+ if ( fpvalid ) {
+ if (tsk == current) unlazy_fpu( tsk );
+ if ( cpu_has_fxsr ) {
+ copy_fpu_fxsave( tsk, fpu );
+ } else {
+ copy_fpu_fsave( tsk, fpu );
+ }
+ }
+
+ return fpvalid;
+}
+
+int dump_task_extended_fpu( struct task_struct *tsk, struct user_fxsr_struct *fpu )
+{
+ int fpvalid;
+
+ fpvalid = tsk->used_math && cpu_has_fxsr;
+ if ( fpvalid ) {
+ if (tsk == current) unlazy_fpu( tsk );
+ memcpy( fpu, &tsk->thread.i387.fxsave,
+ sizeof(struct user_fxsr_struct) );
+ }
+
+ return fpvalid;
+}
+
+
+#ifdef CONFIG_SMP
+void dump_smp_unlazy_fpu(void)
+{
+ unlazy_fpu(current);
+ return;
+}
+#endif
+
diff -urN -X dontdiff linux-2.4.18/arch/i386/kernel/process.c linux2418.tcore/arch/i386/kernel/process.c
--- linux-2.4.18/arch/i386/kernel/process.c Mon Feb 25 14:37:53 2002
+++ linux2418.tcore/arch/i386/kernel/process.c Thu Jun 13 10:00:48 2002
@@ -644,6 +644,24 @@
dump->u_fpvalid = dump_fpu (regs, &dump->i387);
}
+/*
+ * Capture the user space registers if the task is not running (in user space)
+ */
+#include <linux/elfcore.h>
+int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
+{
+ struct pt_regs ptregs;
+
+ ptregs = *(struct pt_regs *)((unsigned long)tsk + THREAD_SIZE - sizeof(struct pt_regs));
+ ptregs.xcs &= 0xffff;
+ ptregs.xds &= 0xffff;
+ ptregs.xes &= 0xffff;
+ ptregs.xss &= 0xffff;
+
+ elf_core_copy_regs(regs, &ptregs);
+
+ return 1;
+}
/*
* This special macro can be used to load a debugging register
diff -urN -X dontdiff linux-2.4.18/arch/ia64/kernel/process.c linux2418.tcore/arch/ia64/kernel/process.c
--- linux-2.4.18/arch/ia64/kernel/process.c Fri Nov 9 17:26:17 2001
+++ linux2418.tcore/arch/ia64/kernel/process.c Thu Jun 13 10:00:48 2002
@@ -298,6 +298,31 @@
void
do_copy_regs (struct unw_frame_info *info, void *arg)
{
+ do_copy_task_regs(current, info, arg);
+}
+
+void
+do_dump_fpu (struct unw_frame_info *info, void *arg)
+{
+ do_dump_task_fpu(current, info, arg);
+}
+
+void
+ia64_elf_core_copy_regs (struct pt_regs *pt, elf_gregset_t dst)
+{
+ unw_init_running(do_copy_regs, dst);
+}
+
+int
+dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
+{
+ unw_init_running(do_dump_fpu, dst);
+ return 1; /* f0-f31 are always valid so we always return 1 */
+}
+
+static void
+do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *arg)
+{
unsigned long mask, sp, nat_bits = 0, ip, ar_rnat, urbs_end, cfm;
elf_greg_t *dst = arg;
struct pt_regs *pt;
@@ -312,12 +337,12 @@
unw_get_sp(info, &sp);
pt = (struct pt_regs *) (sp + 16);
- urbs_end = ia64_get_user_rbs_end(current, pt, &cfm);
+ urbs_end = ia64_get_user_rbs_end(task, pt, &cfm);
- if (ia64_sync_user_rbs(current, info->sw, pt->ar_bspstore, urbs_end) < 0)
+ if (ia64_sync_user_rbs(task, info->sw, pt->ar_bspstore, urbs_end) < 0)
return;
- ia64_peek(current, info->sw, urbs_end, (long) ia64_rse_rnat_addr((long *) urbs_end),
+ ia64_peek(task, info->sw, urbs_end, (long) ia64_rse_rnat_addr((long *) urbs_end),
&ar_rnat);
/*
@@ -366,7 +391,7 @@
}
void
-do_dump_fpu (struct unw_frame_info *info, void *arg)
+do_dump_task_fpu (struct task_struct *task, struct unw_frame_info *info, void *arg)
{
elf_fpreg_t *dst = arg;
int i;
@@ -381,22 +406,41 @@
for (i = 2; i < 32; ++i)
unw_get_fr(info, i, dst + i);
- ia64_flush_fph(current);
- if ((current->thread.flags & IA64_THREAD_FPH_VALID) != 0)
- memcpy(dst + 32, current->thread.fph, 96*16);
+ ia64_flush_fph(task);
+ if ((task->thread.flags & IA64_THREAD_FPH_VALID) != 0)
+ memcpy(dst + 32, task->thread.fph, 96*16);
}
-void
-ia64_elf_core_copy_regs (struct pt_regs *pt, elf_gregset_t dst)
+int dump_task_regs(struct task_struct *task, elf_gregset_t *regs)
{
- unw_init_running(do_copy_regs, dst);
+ struct unw_frame_info tcore_info;
+
+ if(current == task) {
+ unw_init_running(do_copy_regs, regs);
+ }
+ else {
+ memset(&tcore_info, 0, sizeof(tcore_info));
+ unw_init_from_blocked_task(&tcore_info, task);
+ do_copy_task_regs(task, &tcore_info, regs);
+ }
+
+ return 1;
}
-int
-dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
+int dump_task_fpu (struct task_struct *task, elf_fpregset_t *dst)
{
- unw_init_running(do_dump_fpu, dst);
- return 1; /* f0-f31 are always valid so we always return 1 */
+ struct unw_frame_info tcore_info;
+
+ if(current == task) {
+ unw_init_running(do_dump_fpu, dst);
+ }
+ else {
+ memset(&tcore_info, 0, sizeof(tcore_info));
+ unw_init_from_blocked_task(&tcore_info, task);
+ do_dump_task_fpu(task, &tcore_info, dst);
+ }
+
+ return 1;
}
asmlinkage long
Binary files linux-2.4.18/core and linux2418.tcore/core differ
diff -urN -X dontdiff linux-2.4.18/fs/binfmt_elf.c linux2418.tcore/fs/binfmt_elf.c
--- linux-2.4.18/fs/binfmt_elf.c Mon Feb 25 14:38:08 2002
+++ linux2418.tcore/fs/binfmt_elf.c Tue Jun 18 10:00:13 2002
@@ -30,6 +30,7 @@
#include <linux/elfcore.h>
#include <linux/init.h>
#include <linux/highuid.h>
+#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/compiler.h>
#include <linux/highmem.h>
@@ -952,7 +953,7 @@
/* #define DEBUG */
#ifdef DEBUG
-static void dump_regs(const char *str, elf_greg_t *r)
+static void dump_regs(const char *str, elf_gregset_t *r)
{
int i;
static const char *regs[] = { "ebx", "ecx", "edx", "esi", "edi", "ebp",
@@ -1000,6 +1001,156 @@
#define DUMP_SEEK(off) \
if (!dump_seek(file, (off))) \
goto end_coredump;
+
+static inline void fill_elf_header(struct elfhdr *elf, int segs)
+{
+ memcpy(elf->e_ident, ELFMAG, SELFMAG);
+ elf->e_ident[EI_CLASS] = ELF_CLASS;
+ elf->e_ident[EI_DATA] = ELF_DATA;
+ elf->e_ident[EI_VERSION] = EV_CURRENT;
+ memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
+
+ elf->e_type = ET_CORE;
+ elf->e_machine = ELF_ARCH;
+ elf->e_version = EV_CURRENT;
+ elf->e_entry = 0;
+ elf->e_phoff = sizeof(struct elfhdr);
+ elf->e_shoff = 0;
+ elf->e_flags = 0;
+ elf->e_ehsize = sizeof(struct elfhdr);
+ elf->e_phentsize = sizeof(struct elf_phdr);
+ elf->e_phnum = segs;
+ elf->e_shentsize = 0;
+ elf->e_shnum = 0;
+ elf->e_shstrndx = 0;
+ return;
+}
+
+static inline void fill_elf_note_phdr(struct elf_phdr *phdr, int sz, off_t offset)
+{
+ phdr->p_type = PT_NOTE;
+ phdr->p_offset = offset;
+ phdr->p_vaddr = 0;
+ phdr->p_paddr = 0;
+ phdr->p_filesz = sz;
+ phdr->p_memsz = 0;
+ phdr->p_flags = 0;
+ phdr->p_align = 0;
+ return;
+}
+
+static inline void fill_note(struct memelfnote *note, const char *name, int type,
+ unsigned int sz, void *data)
+{
+ note->name = name;
+ note->type = type;
+ note->datasz = sz;
+ note->data = data;
+ return;
+}
+
+/*
+ * fill up all the fields in prstatus from the given task struct, except registers
+ * which need to be filled up seperately.
+ */
+static inline void fill_prstatus(struct elf_prstatus *prstatus, struct task_struct *p, long signr)
+{
+ prstatus->pr_info.si_signo = prstatus->pr_cursig = signr;
+ prstatus->pr_sigpend = p->pending.signal.sig[0];
+ prstatus->pr_sighold = p->blocked.sig[0];
+ prstatus->pr_pid = p->pid;
+ prstatus->pr_ppid = p->p_pptr->pid;
+ prstatus->pr_pgrp = p->pgrp;
+ prstatus->pr_sid = p->session;
+ prstatus->pr_utime.tv_sec = CT_TO_SECS(p->times.tms_utime);
+ prstatus->pr_utime.tv_usec = CT_TO_USECS(p->times.tms_utime);
+ prstatus->pr_stime.tv_sec = CT_TO_SECS(p->times.tms_stime);
+ prstatus->pr_stime.tv_usec = CT_TO_USECS(p->times.tms_stime);
+ prstatus->pr_cutime.tv_sec = CT_TO_SECS(p->times.tms_cutime);
+ prstatus->pr_cutime.tv_usec = CT_TO_USECS(p->times.tms_cutime);
+ prstatus->pr_cstime.tv_sec = CT_TO_SECS(p->times.tms_cstime);
+ prstatus->pr_cstime.tv_usec = CT_TO_USECS(p->times.tms_cstime);
+ return;
+}
+
+static inline void fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p)
+{
+ int i;
+
+ psinfo->pr_pid = p->pid;
+ psinfo->pr_ppid = p->p_pptr->pid;
+ psinfo->pr_pgrp = p->pgrp;
+ psinfo->pr_sid = p->session;
+
+ i = p->state ? ffz(~p->state) + 1 : 0;
+ psinfo->pr_state = i;
+ psinfo->pr_sname = (i < 0 || i > 5) ? '.' : "RSDZTD"[i];
+ psinfo->pr_zomb = psinfo->pr_sname == 'Z';
+ psinfo->pr_nice = p->nice;
+ psinfo->pr_flag = p->flags;
+ psinfo->pr_uid = NEW_TO_OLD_UID(p->uid);
+ psinfo->pr_gid = NEW_TO_OLD_GID(p->gid);
+ strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname));
+ return;
+}
+
+/* Here is the structure in which status of each thread is captured. */
+struct elf_thread_status
+{
+ struct list_head list;
+ struct elf_prstatus prstatus; /* NT_PRSTATUS */
+ elf_fpregset_t fpu; /* NT_PRFPREG */
+#ifdef ELF_CORE_COPY_XFPREGS
+ elf_fpxregset_t xfpu; /* NT_PRXFPREG */
+#endif
+ struct memelfnote notes[3];
+ int num_notes;
+};
+
+/*
+ * In order to add the specific thread information for the elf file format,
+ * we need to keep a linked list of every threads pr_status and then
+ * create a single section for them in the final core file.
+ */
+static int elf_dump_thread_status(long signr, struct task_struct * p, struct list_head * thread_list)
+{
+
+ struct elf_thread_status *t;
+ int sz = 0;
+
+ t = kmalloc(sizeof(*t), GFP_KERNEL);
+ if (!t) {
+ printk(KERN_WARNING "Cannot allocate memory for thread status.\n");
+ return 0;
+ }
+
+ INIT_LIST_HEAD(&t->list);
+ t->num_notes = 0;
+
+ fill_prstatus(&t->prstatus, p, signr);
+ elf_core_copy_task_regs(p, &t->prstatus.pr_reg);
+
+ fill_note(&t->notes[0], "CORE", NT_PRSTATUS, sizeof(t->prstatus), &(t->prstatus));
+ t->num_notes++;
+ sz += notesize(&t->notes[0]);
+
+ if ((t->prstatus.pr_fpvalid = elf_core_copy_task_fpregs(p, &t->fpu))) {
+ fill_note(&t->notes[1], "CORE", NT_PRFPREG, sizeof(t->fpu), &(t->fpu));
+ t->num_notes++;
+ sz += notesize(&t->notes[1]);
+ }
+
+#ifdef ELF_CORE_COPY_XFPREGS
+ if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
+ fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), &(t->xfpu));
+ t->num_notes++;
+ sz += notesize(&t->notes[2]);
+ }
+#endif
+ list_add(&t->list, thread_list);
+ return sz;
+}
+
/*
* Actual dumper
*
@@ -1018,12 +1169,23 @@
struct elfhdr elf;
off_t offset = 0, dataoff;
unsigned long limit = current->rlim[RLIMIT_CORE].rlim_cur;
- int numnote = 4;
- struct memelfnote notes[4];
+ int numnote = 5;
+ struct memelfnote notes[5];
struct elf_prstatus prstatus; /* NT_PRSTATUS */
- elf_fpregset_t fpu; /* NT_PRFPREG */
struct elf_prpsinfo psinfo; /* NT_PRPSINFO */
+ struct task_struct *p;
+ LIST_HEAD(thread_list);
+ struct list_head *t;
+ elf_fpregset_t fpu;
+#ifdef ELF_CORE_COPY_XFPREGS
+ elf_fpxregset_t xfpu;
+#endif
+ int thread_status_size = 0;
+
+ /* First pause all related threaded processes */
+ tcore_suspend_threads();
+
/* first copy the parameters from user space */
memset(&psinfo, 0, sizeof(psinfo));
{
@@ -1041,51 +1203,50 @@
}
- memset(&prstatus, 0, sizeof(prstatus));
- /*
- * This transfers the registers from regs into the standard
- * coredump arrangement, whatever that is.
- */
-#ifdef ELF_CORE_COPY_REGS
- ELF_CORE_COPY_REGS(prstatus.pr_reg, regs)
-#else
- if (sizeof(elf_gregset_t) != sizeof(struct pt_regs))
- {
- printk("sizeof(elf_gregset_t) (%ld) != sizeof(struct pt_regs) (%ld)\n",
- (long)sizeof(elf_gregset_t), (long)sizeof(struct pt_regs));
+ /* capture the status of all other threads */
+ if (signr) {
+ read_lock(&tasklist_lock);
+ for_each_task(p)
+ if (current->mm == p->mm && current != p) {
+ int sz = elf_dump_thread_status(signr, p, &thread_list);
+ if (!sz) {
+ read_unlock(&tasklist_lock);
+ goto cleanup;
+ }
+ else
+ thread_status_size += sz;
+ }
+ read_unlock(&tasklist_lock);
}
- else
- *(struct pt_regs *)&prstatus.pr_reg = *regs;
-#endif
- /* now stop all vm operations */
- down_write(¤t->mm->mmap_sem);
- segs = current->mm->map_count;
+ /* now capture current's thread state */
+ memset(&prstatus, 0, sizeof(prstatus));
+ fill_prstatus(&prstatus, current, signr);
+ elf_core_copy_regs(&prstatus.pr_reg, regs);
+
+ /* We no longer stop all vm operations */
+
+ /* This because those proceses that could possibly
+ * change map_count or the mmap / vma pages are now suspended.
+ *
+ * Only ptrace can touch these memory address, but it cannot change
+ * the map_count or the pages. So no possibility of crashing exists while dumping
+ * the mm->vm_next areas to the core file.
+ *
+ * Grabbing mmap_sem in this function is risky WRT the use of suspend_threads.
+ * Although no locks ups have been induced, if one of the suspended threads was
+ * in line for the current->mmap_sem and if gets it while on the Phantom runque,
+ * then we would dead lock in this function if we continue to attempt to down_write
+ * in this function.
+ */
+ segs = current->mm->map_count;
#ifdef DEBUG
printk("elf_core_dump: %d segs %lu limit\n", segs, limit);
#endif
/* Set up header */
- memcpy(elf.e_ident, ELFMAG, SELFMAG);
- elf.e_ident[EI_CLASS] = ELF_CLASS;
- elf.e_ident[EI_DATA] = ELF_DATA;
- elf.e_ident[EI_VERSION] = EV_CURRENT;
- memset(elf.e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
-
- elf.e_type = ET_CORE;
- elf.e_machine = ELF_ARCH;
- elf.e_version = EV_CURRENT;
- elf.e_entry = 0;
- elf.e_phoff = sizeof(elf);
- elf.e_shoff = 0;
- elf.e_flags = 0;
- elf.e_ehsize = sizeof(elf);
- elf.e_phentsize = sizeof(struct elf_phdr);
- elf.e_phnum = segs+1; /* Include notes */
- elf.e_shentsize = 0;
- elf.e_shnum = 0;
- elf.e_shstrndx = 0;
+ fill_elf_header(&elf, segs+1); /* including notes section*/
fs = get_fs();
set_fs(KERNEL_DS);
@@ -1102,64 +1263,34 @@
* with info from their /proc.
*/
- notes[0].name = "CORE";
- notes[0].type = NT_PRSTATUS;
- notes[0].datasz = sizeof(prstatus);
- notes[0].data = &prstatus;
- prstatus.pr_info.si_signo = prstatus.pr_cursig = signr;
- prstatus.pr_sigpend = current->pending.signal.sig[0];
- prstatus.pr_sighold = current->blocked.sig[0];
- psinfo.pr_pid = prstatus.pr_pid = current->pid;
- psinfo.pr_ppid = prstatus.pr_ppid = current->p_pptr->pid;
- psinfo.pr_pgrp = prstatus.pr_pgrp = current->pgrp;
- psinfo.pr_sid = prstatus.pr_sid = current->session;
- prstatus.pr_utime.tv_sec = CT_TO_SECS(current->times.tms_utime);
- prstatus.pr_utime.tv_usec = CT_TO_USECS(current->times.tms_utime);
- prstatus.pr_stime.tv_sec = CT_TO_SECS(current->times.tms_stime);
- prstatus.pr_stime.tv_usec = CT_TO_USECS(current->times.tms_stime);
- prstatus.pr_cutime.tv_sec = CT_TO_SECS(current->times.tms_cutime);
- prstatus.pr_cutime.tv_usec = CT_TO_USECS(current->times.tms_cutime);
- prstatus.pr_cstime.tv_sec = CT_TO_SECS(current->times.tms_cstime);
- prstatus.pr_cstime.tv_usec = CT_TO_USECS(current->times.tms_cstime);
-
#ifdef DEBUG
dump_regs("Passed in regs", (elf_greg_t *)regs);
dump_regs("prstatus regs", (elf_greg_t *)&prstatus.pr_reg);
#endif
- notes[1].name = "CORE";
- notes[1].type = NT_PRPSINFO;
- notes[1].datasz = sizeof(psinfo);
- notes[1].data = &psinfo;
- i = current->state ? ffz(~current->state) + 1 : 0;
- psinfo.pr_state = i;
- psinfo.pr_sname = (i < 0 || i > 5) ? '.' : "RSDZTD"[i];
- psinfo.pr_zomb = psinfo.pr_sname == 'Z';
- psinfo.pr_nice = current->nice;
- psinfo.pr_flag = current->flags;
- psinfo.pr_uid = NEW_TO_OLD_UID(current->uid);
- psinfo.pr_gid = NEW_TO_OLD_GID(current->gid);
- strncpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname));
-
- notes[2].name = "CORE";
- notes[2].type = NT_TASKSTRUCT;
- notes[2].datasz = sizeof(*current);
- notes[2].data = current;
-
- /* Try to dump the FPU. */
- prstatus.pr_fpvalid = dump_fpu (regs, &fpu);
- if (!prstatus.pr_fpvalid)
- {
- numnote--;
- }
- else
- {
- notes[3].name = "CORE";
- notes[3].type = NT_PRFPREG;
- notes[3].datasz = sizeof(fpu);
- notes[3].data = &fpu;
- }
+ fill_note(¬es[0], "CORE", NT_PRSTATUS, sizeof(prstatus), &prstatus);
+ fill_psinfo(&psinfo, current);
+ fill_note(¬es[1], "CORE", NT_PRPSINFO, sizeof(psinfo), &psinfo);
+
+ fill_note(¬es[2], "CORE", NT_TASKSTRUCT, sizeof(*current), current);
+
+ /* Try to dump the FPU. */
+ if ((prstatus.pr_fpvalid = elf_core_copy_task_fpregs(current, &fpu))) {
+ fill_note(¬es[3], "CORE", NT_PRFPREG, sizeof(fpu), &fpu);
+ } else {
+ --numnote;
+ }
+#ifdef ELF_CORE_COPY_XFPREGS
+ if (elf_core_copy_task_xfpregs(current, &xfpu)) {
+ fill_note(¬es[4], "LINUX", NT_PRXFPREG, sizeof(xfpu), &xfpu);
+ } else {
+ --numnote;
+ }
+#else
+ numnote --;
+#endif
+
/* Write notes phdr entry */
{
struct elf_phdr phdr;
@@ -1167,17 +1298,11 @@
for(i = 0; i < numnote; i++)
sz += notesize(¬es[i]);
+
+ sz += thread_status_size;
- phdr.p_type = PT_NOTE;
- phdr.p_offset = offset;
- phdr.p_vaddr = 0;
- phdr.p_paddr = 0;
- phdr.p_filesz = sz;
- phdr.p_memsz = 0;
- phdr.p_flags = 0;
- phdr.p_align = 0;
-
- offset += phdr.p_filesz;
+ fill_elf_note_phdr(&phdr, sz, offset);
+ offset += sz;
DUMP_WRITE(&phdr, sizeof(phdr));
}
@@ -1206,10 +1331,19 @@
DUMP_WRITE(&phdr, sizeof(phdr));
}
+ /* write out the notes section */
for(i = 0; i < numnote; i++)
if (!writenote(¬es[i], file))
goto end_coredump;
+ /* write out the thread status notes section */
+ list_for_each(t, &thread_list) {
+ struct elf_thread_status *tmp = list_entry(t, struct elf_thread_status, list);
+ for (i = 0; i < tmp->num_notes; i++)
+ if (!writenote(&tmp->notes[i], file))
+ goto end_coredump;
+ }
+
DUMP_SEEK(dataoff);
for(vma = current->mm->mmap; vma != NULL; vma = vma->vm_next) {
@@ -1253,11 +1387,21 @@
(off_t) file->f_pos, offset);
}
- end_coredump:
+end_coredump:
set_fs(fs);
- up_write(¤t->mm->mmap_sem);
+
+cleanup:
+ while(!list_empty(&thread_list)) {
+ struct list_head *tmp = thread_list.next;
+ list_del(tmp);
+ kfree(list_entry(tmp, struct elf_thread_status, list));
+ }
+
+ tcore_resume_threads();
+
return has_dumped;
}
+
#endif /* USE_ELF_CORE_DUMP */
static int __init init_elf_binfmt(void)
diff -urN -X dontdiff linux-2.4.18/include/asm-i386/elf.h linux2418.tcore/include/asm-i386/elf.h
--- linux-2.4.18/include/asm-i386/elf.h Thu Nov 22 14:48:29 2001
+++ linux2418.tcore/include/asm-i386/elf.h Thu Jun 13 11:19:11 2002
@@ -99,6 +99,21 @@
#ifdef __KERNEL__
#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
+
+
+extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
+extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
+extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct *);
+
+#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
+#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
+#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs)
+
+#ifdef CONFIG_SMP
+extern void dump_smp_unlazy_fpu(void);
+#define ELF_CORE_SYNC dump_smp_unlazy_fpu
+#endif
+
#endif
#endif
diff -urN -X dontdiff linux-2.4.18/include/asm-ia64/elf.h linux2418.tcore/include/asm-ia64/elf.h
--- linux-2.4.18/include/asm-ia64/elf.h Tue Jul 11 18:43:45 2000
+++ linux2418.tcore/include/asm-ia64/elf.h Thu Jun 13 10:00:48 2002
@@ -62,12 +62,16 @@
#define ELF_NGREG 128 /* we really need just 72 but let's leave some headroom... */
#define ELF_NFPREG 128 /* f0 and f1 could be omitted, but so what... */
+typedef unsigned long elf_fpxregset_t;
+
typedef unsigned long elf_greg_t;
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
typedef struct ia64_fpreg elf_fpreg_t;
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+
struct pt_regs; /* forward declaration... */
extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
#define ELF_CORE_COPY_REGS(_dest,_regs) ia64_elf_core_copy_regs(_regs, _dest);
@@ -83,6 +87,12 @@
#ifdef __KERNEL__
#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
+extern int dump_task_regs(struct task_struct *, elf_gregset_t *);
+extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
+
+#define ELF_CORE_COPY_TASK_REGS(tsk, elf_gregs) dump_task_regs(tsk, elf_gregs)
+#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
+
#endif
#endif /* _ASM_IA64_ELF_H */
diff -urN -X dontdiff linux-2.4.18/include/linux/elf.h linux2418.tcore/include/linux/elf.h
--- linux-2.4.18/include/linux/elf.h Thu Nov 22 14:48:29 2001
+++ linux2418.tcore/include/linux/elf.h Thu Jun 13 11:20:43 2002
@@ -576,6 +576,9 @@
#define NT_PRPSINFO 3
#define NT_TASKSTRUCT 4
#define NT_PRFPXREG 20
+#define NT_PRXFPREG 0x46e62b7f /* note name must be "LINUX" as per GDB */
+ /* from gdb5.1/include/elf/common.h */
+
/* Note header in a PT_NOTE section */
typedef struct elf32_note {
@@ -606,6 +609,5 @@
#define elf_note elf64_note
#endif
-
#endif /* _LINUX_ELF_H */
diff -urN -X dontdiff linux-2.4.18/include/linux/elfcore.h linux2418.tcore/include/linux/elfcore.h
--- linux-2.4.18/include/linux/elfcore.h Thu Nov 22 14:49:02 2001
+++ linux2418.tcore/include/linux/elfcore.h Thu Jun 13 11:19:11 2002
@@ -86,4 +86,66 @@
#define PRARGSZ ELF_PRARGSZ
#endif
+#ifdef __KERNEL__
+static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs)
+{
+#ifdef ELF_CORE_COPY_REGS
+ ELF_CORE_COPY_REGS((*elfregs), regs)
+#else
+ if (sizeof(elf_gregset_t) != sizeof(struct pt_regs)) {
+ printk("sizeof(elf_gregset_t) (%ld) != sizeof(struct pt_regs) (%ld)\n",
+ (long)sizeof(elf_gregset_t), (long)sizeof(struct pt_regs));
+ } else
+ *(struct pt_regs *)elfregs = *regs;
+#endif
+}
+
+static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
+{
+#ifdef ELF_CORE_COPY_TASK_REGS
+
+ return ELF_CORE_COPY_TASK_REGS(t, elfregs);
+#endif
+ return 0;
+}
+
+extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
+
+static inline int elf_core_copy_task_fpregs(struct task_struct *t, elf_fpregset_t *fpu)
+{
+#ifdef ELF_CORE_COPY_FPREGS
+ return ELF_CORE_COPY_FPREGS(t, fpu);
+#else
+ return dump_fpu(NULL, fpu);
+#endif
+}
+
+#ifdef ELF_CORE_COPY_XFPREGS
+static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
+{
+ return ELF_CORE_COPY_XFPREGS(t, xfpu);
+}
+#endif
+
+#ifdef CONFIG_SMP
+/*
+ * trivial function used for SMP CPU synchronization.
+ * It doesn't do anything.
+ */
+static void tcore_do_nothing(void *var)
+{
+
+#ifdef ELF_CORE_SYNC
+ ELF_CORE_SYNC();
+#endif
+
+ return;
+}
+
+#endif
+
+
+#endif /* __KERNEL__ */
+
+
#endif /* _LINUX_ELFCORE_H */
diff -urN -X dontdiff linux-2.4.18/include/linux/sched.h linux2418.tcore/include/linux/sched.h
--- linux-2.4.18/include/linux/sched.h Fri Dec 21 12:42:03 2001
+++ linux2418.tcore/include/linux/sched.h Thu Jun 13 11:19:11 2002
@@ -132,6 +132,14 @@
#include <linux/spinlock.h>
+
+/* functions for pausing and resumming functions
+ * common mm's without using signals. These are used
+ * by the multithreaded elf core dump code in binfmt_elf.c*/
+extern void tcore_suspend_threads( void );
+extern void tcore_resume_threads( void );
+
+
/*
* This serializes "schedule()" and also protects
* the run-queue from deletions/modifications (but
diff -urN -X dontdiff linux-2.4.18/kernel/sched.c linux2418.tcore/kernel/sched.c
--- linux-2.4.18/kernel/sched.c Fri Dec 21 12:42:04 2001
+++ linux2418.tcore/kernel/sched.c Thu Jun 13 10:00:48 2002
@@ -33,6 +33,8 @@
#include <asm/uaccess.h>
#include <asm/mmu_context.h>
+#include <linux/elfcore.h>
+
extern void timer_bh(void);
extern void tqueue_bh(void);
extern void immediate_bh(void);
@@ -121,7 +123,7 @@
#else
#define idle_task(cpu) (&init_task)
-#define can_schedule(p,cpu) (1)
+#define can_schedule(p,cpu) ((p)->cpus_allowed & (1 << cpu))
#endif
@@ -851,6 +853,108 @@
}
void scheduling_functions_end_here(void) { }
+
+/*
+ * needed for accurate core dumps of multi-threaded applications.
+ * see binfmt_elf.c for more information.
+ */
+static void reschedule_other_cpus(void)
+{
+#ifdef CONFIG_SMP
+ int i, cpu;
+ struct task_struct *p;
+
+ for(i=0; i< smp_num_cpus; i++) {
+ cpu = cpu_logical_map(i);
+ p = cpu_curr(cpu);
+ if (p->processor != smp_processor_id()) {
+ p->need_resched = 1;
+ smp_send_reschedule(p->processor);
+ }
+ }
+#endif
+ return;
+}
+
+/* functions for pausing and resumming functions with out using signals */
+void tcore_suspend_threads(void)
+{
+ struct task_struct *p;
+
+//
+// grab all the rq_locks.
+// current is the process dumping core
+//
+
+ down_write(¤t->mm->mmap_sem);
+ // avoid potential race on >2 way SMP if 3 or more thread procs
+ // dump core at the same time.
+
+
+ /*
+ * brute force method uses the runqueue_lock contention. Grab this lock, and
+ * force a schedule call on all the other CPU's to get them spinning.
+ * spin_lock_prefetch(&runqueue_lock) <-- is this needed?
+ */
+ read_lock(&tasklist_lock);
+ spin_lock_irq(&runqueue_lock);
+
+ task_lock(current);
+ current->cpus_allowed = 1UL << current->processor;
+ // prevent migraion of dumping process making life complicated.
+ task_unlock(current);
+
+ reschedule_other_cpus();
+ // this is an optional IPI, but it makes for the most accurate core files possible.
+
+ for_each_task(p)
+ if (current->mm == p->mm && current != p) {
+ task_lock(p);
+ p->cpus_allowed = 0UL;
+ task_unlock(p);
+ /*
+ * forces yeild and keeps waking process from getting scheduled
+ * in. This will result in these processes getting swapped out and
+ * not swapped in by the scheduler if they have been sleeping.
+ */
+ }
+
+ spin_unlock_irq(&runqueue_lock);
+
+ /* let them all run again.. */
+ read_unlock(&tasklist_lock);
+
+ up_write(¤t->mm->mmap_sem);
+
+#ifdef CONFIG_SMP
+ /*
+ * now we syncronize on all the CPU's to make sure
+ * none of the other thread processes are running in
+ * and any lazy fpu register data has been captured
+ * from user space before we proceed.
+ */
+ smp_call_function(tcore_do_nothing, NULL, 1,1);
+#endif
+
+return;
+}
+
+void tcore_resume_threads(void)
+{
+ struct task_struct *p;
+
+ read_lock(&tasklist_lock);
+ for_each_task(p)
+ if (current->mm == p->mm && current != p){
+ task_lock(p);
+ p->cpus_allowed = 1UL << current->processor;
+ task_unlock(p);
+ }
+ read_unlock(&tasklist_lock);
+
+ return;
+}
+
#ifndef __alpha__
^ permalink raw reply
* Re: Linux 2.2.24-rc1
From: Pawel Kot @ 2002-12-17 0:15 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-kernel
In-Reply-To: <200212162018.gBGKIdP18149@devserv.devel.redhat.com>
On Mon, 16 Dec 2002, Alan Cox wrote:
> Linux 2.2.24-rc1
[...]
> o Fix misidentification of some AMD processors (Bruce Robson)
[...]
Is it the following chunk? (I can't find anything more appropriate)
@@ -1378,7 +1378,8 @@
return;
case X86_VENDOR_AMD:
- init_amd(c);
+ if(init_amd(c))
+ return;
return;
case X86_VENDOR_CENTAUR:
What does it fix?
pkot
--
mailto:pkot@linuxnews.pl :: mailto:pkot@slackware.pl
http://kt.linuxnews.pl/ :: Kernel Traffic po polsku
^ permalink raw reply
* Re: [BUG] module-init-tools 0.9.3, rmmod modules with '-'
From: Rusty Russell @ 2002-12-17 0:17 UTC (permalink / raw)
To: Zwane Mwaikambo; +Cc: vamsi, lkml
In-Reply-To: <Pine.LNX.4.50.0212161831340.1804-100000@montezuma.mastecende.com>
In message <Pine.LNX.4.50.0212161831340.1804-100000@montezuma.mastecende.com> y
ou write:
> On Tue, 17 Dec 2002, Rusty Russell wrote:
>
> > How did you get a module which has - in its name? The build system
> > *should* turn them into _'s.
>
> ALSA modules?
>
> -rw-r--r-- 1 root root 170125 Dec 15 00:10 snd-mixer-oss.ko
> -rw-r--r-- 1 root root 143685 Dec 15 00:10 snd-mpu401-uart.ko
> -rw-r--r-- 1 root root 312564 Dec 15 00:10 snd-opl3-lib.ko
> -rw-r--r-- 1 root root 194307 Dec 15 00:10 snd-opl3sa2.ko
> -rw-r--r-- 1 root root 612512 Dec 15 00:10 snd-opl3-synth.ko
> -rw-r--r-- 1 root root 1160272 Dec 15 00:10 snd-pcm.ko
>
> But they do get converted when we load ie snd-pcm turns into snd_pcm
Yes, the filenames are unchanged. But if you modprobe snd-mixer-oss,
you'll see snd_mixer_oss in /proc/modules. But rmmod "snd-mixer-oss"
works as expected. Basically, the kernel and tools see them as
equivalent: anything else is a bug, please report.
BTW, this was done for (1) simplicity, (2) so KBUILD_MODNAME can be
used to construct identifiers, and (3) so parameters when the module
is built-in have a consistent name.
Hope that clarifies!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply
* [BK SUMMARY] nix NGROUPS limit - re-send again
From: Timothy Hockin @ 2002-12-17 0:27 UTC (permalink / raw)
To: torvalds, linux-kernel
Linus,
This patch removes the hard NGROUPS limit. It has been in use in a similar
form on our systems for some time. I've sent it several times, and not heard
anything back from you. I've had no complaints from anyone about this version
of the patch.
There is a small change needed for glibc, and I will send that patch to the
glibc people when this gets pulled.
Unlike some prior versions of this patch, I have changed qsort() to a simple
non-recursive sort. Several people indicated that this change would solve
their objections. I have also changed the behavior of sys_setgroups to use an
inline array of gid_t for small sets of groups. Larger sets of groups use
kmalloc, and very large sets use vmalloc. This has turned up a big speed
increase for the (admittedly stupid) test of setgroups() in a loop with random
data and sets of 1-32 items, repeated hundreds of thousands of times, as well
as the tests of setgroups with random set sizes between 1 and 10000.
Lastly, this does not fixup all the architectures. I have or will soon have
other patchsets for that, which need to be reviewed by arch maintainers.
Tim
Please do a
bk pull http://suncobalt.bkbits.net/ngroups-2.5
This will update the following files:
fs/nfsd/auth.c | 11 +--
fs/proc/array.c | 2
include/asm-i386/param.h | 4 -
include/linux/init_task.h | 1
include/linux/kernel.h | 3
include/linux/limits.h | 3
include/linux/sched.h | 6 +
include/linux/sunrpc/svcauth.h | 3
kernel/exit.c | 7 +
kernel/fork.c | 7 +
kernel/sys.c | 145 ++++++++++++++++++++++++++++++++++-------
kernel/uid16.c | 64 +++++++++++++-----
lib/Makefile | 4 -
lib/bsearch.c | 49 +++++++++++++
net/sunrpc/svcauth_unix.c | 4 -
15 files changed, 257 insertions(+), 56 deletions(-)
through these ChangeSets (diffs in separate email):
<thockin@freakshow.cobalt.com> (02/12/16 1.888)
Remove the limit of 32 groups. We now have a per-task, dynamic array of
groups, which is kept sorted and refcounted. If the task has less than 32
groups, we behave like older kernels and use an inline array.
This ChangeSet incorporates all the core functionality. but does not fixup
all the incorrect architecture usages of groups. That will follow.
^ permalink raw reply
* [BK PATCH 1/1] nix NGROUPS limit - re-send again
From: Timothy Hockin @ 2002-12-17 0:27 UTC (permalink / raw)
To: torvalds, linux-kernel
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.887 -> 1.888
# include/linux/kernel.h 1.29 -> 1.30
# lib/Makefile 1.16 -> 1.17
# include/linux/init_task.h 1.19 -> 1.20
# kernel/fork.c 1.93 -> 1.94
# include/linux/sched.h 1.115 -> 1.116
# kernel/sys.c 1.38 -> 1.39
# include/asm-i386/param.h 1.2 -> 1.3
# include/linux/sunrpc/svcauth.h 1.4 -> 1.5
# kernel/uid16.c 1.4 -> 1.5
# fs/proc/array.c 1.35 -> 1.36
# net/sunrpc/svcauth_unix.c 1.9 -> 1.10
# kernel/exit.c 1.76 -> 1.77
# include/linux/limits.h 1.3 -> 1.4
# fs/nfsd/auth.c 1.1 -> 1.2
# (new) -> 1.1 lib/bsearch.c
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/12/16 thockin@freakshow.cobalt.com 1.888
# Remove the limit of 32 groups. We now have a per-task, dynamic array of
# groups, which is kept sorted and refcounted. If the task has less than 32
# groups, we behave like older kernels and use an inline array.
#
# This ChangeSet incorporates all the core functionality. but does not fixup
# all the incorrect architecture usages of groups. That will follow.
# --------------------------------------------
#
diff -Nru a/fs/nfsd/auth.c b/fs/nfsd/auth.c
--- a/fs/nfsd/auth.c Mon Dec 16 15:15:22 2002
+++ b/fs/nfsd/auth.c Mon Dec 16 15:15:22 2002
@@ -10,12 +10,15 @@
#include <linux/sunrpc/svcauth.h>
#include <linux/nfsd/nfsd.h>
+extern asmlinkage long sys_setgroups(int gidsetsize, gid_t *grouplist);
+
#define CAP_NFSD_MASK (CAP_FS_MASK|CAP_TO_MASK(CAP_SYS_RESOURCE))
void
nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
{
struct svc_cred *cred = &rqstp->rq_cred;
int i;
+ gid_t groups[SVC_CRED_NGROUPS];
if (rqstp->rq_userset)
return;
@@ -29,7 +32,7 @@
cred->cr_uid = exp->ex_anon_uid;
if (!cred->cr_gid)
cred->cr_gid = exp->ex_anon_gid;
- for (i = 0; i < NGROUPS; i++)
+ for (i = 0; i < SVC_CRED_NGROUPS; i++)
if (!cred->cr_groups[i])
cred->cr_groups[i] = exp->ex_anon_gid;
}
@@ -42,13 +45,13 @@
current->fsgid = cred->cr_gid;
else
current->fsgid = exp->ex_anon_gid;
- for (i = 0; i < NGROUPS; i++) {
+ for (i = 0; i < SVC_CRED_NGROUPS; i++) {
gid_t group = cred->cr_groups[i];
if (group == (gid_t) NOGROUP)
break;
- current->groups[i] = group;
+ groups[i] = group;
}
- current->ngroups = i;
+ sys_setgroups(i, groups);
if ((cred->cr_uid)) {
cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
diff -Nru a/fs/proc/array.c b/fs/proc/array.c
--- a/fs/proc/array.c Mon Dec 16 15:15:22 2002
+++ b/fs/proc/array.c Mon Dec 16 15:15:22 2002
@@ -172,7 +172,7 @@
p->files ? p->files->max_fds : 0);
task_unlock(p);
- for (g = 0; g < p->ngroups; g++)
+ for (g = 0; g < min(p->ngroups, OLD_NGROUPS); g++)
buffer += sprintf(buffer, "%d ", p->groups[g]);
buffer += sprintf(buffer, "\n");
diff -Nru a/include/asm-i386/param.h b/include/asm-i386/param.h
--- a/include/asm-i386/param.h Mon Dec 16 15:15:22 2002
+++ b/include/asm-i386/param.h Mon Dec 16 15:15:22 2002
@@ -13,10 +13,6 @@
#define EXEC_PAGESIZE 4096
-#ifndef NGROUPS
-#define NGROUPS 32
-#endif
-
#ifndef NOGROUP
#define NOGROUP (-1)
#endif
diff -Nru a/include/linux/init_task.h b/include/linux/init_task.h
--- a/include/linux/init_task.h Mon Dec 16 15:15:22 2002
+++ b/include/linux/init_task.h Mon Dec 16 15:15:22 2002
@@ -80,6 +80,7 @@
.real_timer = { \
.function = it_real_fn \
}, \
+ .ngroups = 0, \
.cap_effective = CAP_INIT_EFF_SET, \
.cap_inheritable = CAP_INIT_INH_SET, \
.cap_permitted = CAP_FULL_SET, \
diff -Nru a/include/linux/kernel.h b/include/linux/kernel.h
--- a/include/linux/kernel.h Mon Dec 16 15:15:22 2002
+++ b/include/linux/kernel.h Mon Dec 16 15:15:22 2002
@@ -221,4 +221,7 @@
#define __FUNCTION__ (__func__)
#endif
+void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *));
+
#endif
diff -Nru a/include/linux/limits.h b/include/linux/limits.h
--- a/include/linux/limits.h Mon Dec 16 15:15:22 2002
+++ b/include/linux/limits.h Mon Dec 16 15:15:22 2002
@@ -3,7 +3,6 @@
#define NR_OPEN 1024
-#define NGROUPS_MAX 32 /* supplemental group IDs are available */
#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
#define CHILD_MAX 999 /* no limit :-) */
#define OPEN_MAX 256 /* # open files a process may have */
@@ -18,5 +17,7 @@
#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
#define RTSIG_MAX 32
+
+#define OLD_NGROUPS 32 /* old limit of supplemental group IDs */
#endif
diff -Nru a/include/linux/sched.h b/include/linux/sched.h
--- a/include/linux/sched.h Mon Dec 16 15:15:22 2002
+++ b/include/linux/sched.h Mon Dec 16 15:15:22 2002
@@ -276,6 +276,8 @@
typedef struct prio_array prio_array_t;
struct backing_dev_info;
+#define NGROUPS_INLINE 32
+
struct task_struct {
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
struct thread_info *thread_info;
@@ -348,7 +350,9 @@
uid_t uid,euid,suid,fsuid;
gid_t gid,egid,sgid,fsgid;
int ngroups;
- gid_t groups[NGROUPS];
+ gid_t *groups;
+ gid_t groups_inline[NGROUPS_INLINE];
+ atomic_t *groups_refcount;
kernel_cap_t cap_effective, cap_inheritable, cap_permitted;
int keep_capabilities:1;
struct user_struct *user;
diff -Nru a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
--- a/include/linux/sunrpc/svcauth.h Mon Dec 16 15:15:22 2002
+++ b/include/linux/sunrpc/svcauth.h Mon Dec 16 15:15:22 2002
@@ -14,10 +14,11 @@
#include <linux/sunrpc/msg_prot.h>
#include <linux/sunrpc/cache.h>
+#define SVC_CRED_NGROUPS 32
struct svc_cred {
uid_t cr_uid;
gid_t cr_gid;
- gid_t cr_groups[NGROUPS];
+ gid_t cr_groups[SVC_CRED_NGROUPS];
};
struct svc_rqst; /* forward decl */
diff -Nru a/kernel/exit.c b/kernel/exit.c
--- a/kernel/exit.c Mon Dec 16 15:15:22 2002
+++ b/kernel/exit.c Mon Dec 16 15:15:22 2002
@@ -57,6 +57,7 @@
return proc_dentry;
}
+extern void groups_free(gid_t *groups, int gidsetsize);
void release_task(struct task_struct * p)
{
struct dentry *proc_dentry;
@@ -66,6 +67,12 @@
if (p != current)
wait_task_inactive(p);
+
+ if (p->ngroups > NGROUPS_INLINE
+ && atomic_dec_and_test(p->groups_refcount)) {
+ kfree(p->groups_refcount);
+ groups_free(p->groups, p->ngroups);
+ }
atomic_dec(&p->user->processes);
security_task_free(p);
diff -Nru a/kernel/fork.c b/kernel/fork.c
--- a/kernel/fork.c Mon Dec 16 15:15:22 2002
+++ b/kernel/fork.c Mon Dec 16 15:15:22 2002
@@ -834,6 +834,13 @@
*/
clear_tsk_thread_flag(p, TIF_SYSCALL_TRACE);
+ /* increment the groups ref count */
+ if (p->ngroups > NGROUPS_INLINE) {
+ atomic_inc(p->groups_refcount);
+ } else if (p->ngroups) {
+ p->groups = p->groups_inline;
+ }
+
/* Our parent execution domain becomes current domain
These must match for thread signalling to apply */
diff -Nru a/kernel/sys.c b/kernel/sys.c
--- a/kernel/sys.c Mon Dec 16 15:15:22 2002
+++ b/kernel/sys.c Mon Dec 16 15:15:22 2002
@@ -22,6 +22,9 @@
#include <linux/security.h>
#include <linux/dcookies.h>
#include <linux/suspend.h>
+#include <linux/vmalloc.h>
+#include <linux/slab.h>
+
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -1063,42 +1066,137 @@
return i;
}
+/* a simple shell-metzner sort */
+static void groupsort(gid_t *grouplist, int gidsetsize)
+{
+ int base, max, stride;
+
+ for (stride = 1; stride < gidsetsize; stride = 3 * stride + 1)
+ ; /* nothing */
+ stride /= 3;
+
+ while (stride) {
+ max = gidsetsize - stride;
+ for (base = 0; base < max; base++) {
+ int left = base;
+ gid_t tmp = grouplist[base + stride];
+ while (left >= 0 && tmp < grouplist[left]) {
+ grouplist[left] = grouplist[left + stride];
+ left -= stride;
+ }
+ grouplist[left + stride] = tmp;
+ }
+ stride /= 3;
+ }
+}
+
+static int gid_t_cmp(const void *a, const void *b)
+{
+ return *((gid_t *)a) - *((gid_t *)b);
+}
+
+#define GROUPS_KV_THRESH (2*EXEC_PAGESIZE/sizeof(gid_t))
+gid_t *groups_alloc(int gidsetsize)
+{
+ if (gidsetsize <= GROUPS_KV_THRESH)
+ return kmalloc(gidsetsize * sizeof(gid_t), GFP_KERNEL);
+ else
+ return vmalloc(gidsetsize * sizeof(gid_t));
+}
+
+void groups_free(gid_t *groups, int gidsetsize)
+{
+ if (gidsetsize <= NGROUPS_INLINE)
+ ; /* nothing */
+ else if (gidsetsize <= GROUPS_KV_THRESH)
+ kfree(groups);
+ else
+ vfree(groups);
+}
+
/*
- * SMP: Our groups are not shared. We can copy to/from them safely
+ * SMP: Our groups are copy-on-write. We can set them safely
* without another task interfering.
*/
-
-asmlinkage long sys_setgroups(int gidsetsize, gid_t *grouplist)
+int do_setgroups(int gidsetsize, gid_t *grouplist)
{
- gid_t groups[NGROUPS];
+ atomic_t *newrefcnt = NULL;
int retval;
- if (!capable(CAP_SETGID))
- return -EPERM;
- if ((unsigned) gidsetsize > NGROUPS)
- return -EINVAL;
- if(copy_from_user(groups, grouplist, gidsetsize * sizeof(gid_t)))
- return -EFAULT;
- retval = security_task_setgroups(gidsetsize, groups);
- if (retval)
+ BUG_ON(gidsetsize && !grouplist);
+
+ retval = security_task_setgroups(gidsetsize, grouplist);
+ if (retval) {
+ groups_free(grouplist, gidsetsize);
return retval;
- memcpy(current->groups, groups, gidsetsize * sizeof(gid_t));
+ }
+
+ if (gidsetsize > NGROUPS_INLINE) {
+ newrefcnt = kmalloc(sizeof(*newrefcnt), GFP_KERNEL);
+ if (!newrefcnt) {
+ groups_free(grouplist, gidsetsize);
+ return -ENOMEM;
+ }
+ atomic_set(newrefcnt, 1);
+ }
+ if (gidsetsize) {
+ /* sort the grouplist for faster searches */
+ groupsort(grouplist, gidsetsize);
+ }
+
+ /* disassociate ourselves from any shared group list */
+ if (current->ngroups > NGROUPS_INLINE
+ && atomic_dec_and_test(current->groups_refcount)) {
+ kfree(current->groups_refcount);
+ groups_free(current->groups, current->ngroups);
+ }
+
+ /* use the inline array for small numbers of groups */
+ if (gidsetsize <= NGROUPS_INLINE) {
+ memcpy(current->groups_inline, grouplist,
+ gidsetsize * sizeof(gid_t));
+ grouplist = current->groups_inline;
+ }
+
+ current->groups = grouplist;
+ current->groups_refcount = newrefcnt;
current->ngroups = gidsetsize;
+
return 0;
}
+
+asmlinkage long sys_setgroups(int gidsetsize, gid_t *grouplist)
+{
+ gid_t *groups = NULL;
+ gid_t groups_ar[NGROUPS_INLINE];
+
+ if (!capable(CAP_SETGID))
+ return -EPERM;
+ if (gidsetsize) {
+ if (gidsetsize <= NGROUPS_INLINE) {
+ groups = groups_ar;
+ } else {
+ groups = groups_alloc(gidsetsize);
+ if (!groups)
+ return -ENOMEM;
+ }
+
+ if (copy_from_user(groups, grouplist,
+ gidsetsize * sizeof(gid_t))) {
+ groups_free(groups, gidsetsize);
+ return -EFAULT;
+ }
+ }
+
+ return do_setgroups(gidsetsize, groups);
+}
static int supplemental_group_member(gid_t grp)
{
- int i = current->ngroups;
-
- if (i) {
- gid_t *groups = current->groups;
- do {
- if (*groups == grp)
- return 1;
- groups++;
- i--;
- } while (i);
+ if (current->ngroups) {
+ if (bsearch(&grp, current->groups, current->ngroups,
+ sizeof(gid_t), gid_t_cmp))
+ return 1;
}
return 0;
}
@@ -1393,3 +1491,4 @@
EXPORT_SYMBOL(unregister_reboot_notifier);
EXPORT_SYMBOL(in_group_p);
EXPORT_SYMBOL(in_egroup_p);
+EXPORT_SYMBOL(sys_setgroups);
diff -Nru a/kernel/uid16.c b/kernel/uid16.c
--- a/kernel/uid16.c Mon Dec 16 15:15:22 2002
+++ b/kernel/uid16.c Mon Dec 16 15:15:22 2002
@@ -13,6 +13,8 @@
#include <linux/init.h>
#include <linux/highuid.h>
#include <linux/security.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
#include <asm/uaccess.h>
@@ -107,45 +109,73 @@
return sys_setfsgid((gid_t)gid);
}
+extern gid_t *groups_alloc(int gidsetsize);
+extern void groups_free(gid_t *groups, int gidsetsize);
+extern int do_setgroups(int gidsetsize, gid_t *grouplist);
+
asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t *grouplist)
{
- old_gid_t groups[NGROUPS];
+ old_gid_t *groups;
int i,j;
if (gidsetsize < 0)
return -EINVAL;
i = current->ngroups;
- if (gidsetsize) {
+ if (i && gidsetsize) {
if (i > gidsetsize)
return -EINVAL;
+ groups = vmalloc(i * sizeof(old_gid_t));
+ if (!groups)
+ return -ENOMEM;
for(j=0;j<i;j++)
groups[j] = current->groups[j];
- if (copy_to_user(grouplist, groups, sizeof(old_gid_t)*i))
+ if (copy_to_user(grouplist, groups, sizeof(old_gid_t)*i)) {
+ vfree(groups);
return -EFAULT;
+ }
+ vfree(groups);
}
return i;
}
asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t *grouplist)
{
- old_gid_t groups[NGROUPS];
- gid_t new_groups[NGROUPS];
+ old_gid_t *groups;
+ gid_t *new_groups = NULL;
+ gid_t new_groups_ar[NGROUPS_INLINE];
int i;
if (!capable(CAP_SETGID))
return -EPERM;
- if ((unsigned) gidsetsize > NGROUPS)
- return -EINVAL;
- if (copy_from_user(groups, grouplist, gidsetsize * sizeof(old_gid_t)))
- return -EFAULT;
- for (i = 0 ; i < gidsetsize ; i++)
- new_groups[i] = (gid_t)groups[i];
- i = security_task_setgroups(gidsetsize, new_groups);
- if (i)
- return i;
- memcpy(current->groups, new_groups, gidsetsize * sizeof(gid_t));
- current->ngroups = gidsetsize;
- return 0;
+ if (gidsetsize) {
+ groups = vmalloc(gidsetsize * sizeof(old_gid_t));
+ if (!groups)
+ return -ENOMEM;
+
+ if (copy_from_user(groups, grouplist,
+ gidsetsize * sizeof(old_gid_t))) {
+ vfree(groups);
+ return -EFAULT;
+ }
+
+ if (gidsetsize <= NGROUPS_INLINE) {
+ new_groups = new_groups_ar;
+ } else {
+ new_groups = groups_alloc(gidsetsize);
+ if (!new_groups) {
+ vfree(groups);
+ return -ENOMEM;
+ }
+ }
+
+ for (i = 0; i < gidsetsize; i++)
+ new_groups[i] = (gid_t)groups[i];
+
+ vfree(groups);
+ }
+
+ /* this handles the allocated new_groups */
+ return do_setgroups(gidsetsize, new_groups);
}
asmlinkage long sys_getuid16(void)
diff -Nru a/lib/Makefile b/lib/Makefile
--- a/lib/Makefile Mon Dec 16 15:15:22 2002
+++ b/lib/Makefile Mon Dec 16 15:15:22 2002
@@ -9,11 +9,11 @@
L_TARGET := lib.a
export-objs := cmdline.o dec_and_lock.o rwsem-spinlock.o rwsem.o \
- crc32.o rbtree.o radix-tree.o kobject.o
+ crc32.o rbtree.o radix-tree.o kobject.o bsearch.o
obj-y := errno.o ctype.o string.o vsprintf.o brlock.o cmdline.o \
bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
- kobject.o
+ kobject.o bsearch.o
obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
diff -Nru a/lib/bsearch.c b/lib/bsearch.c
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/lib/bsearch.c Mon Dec 16 15:15:22 2002
@@ -0,0 +1,49 @@
+/* Copyright (C) 1991, 1992, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+/* Perform a binary search for KEY in BASE which has NMEMB elements
+ of SIZE bytes each. The comparisons are done by (*COMPAR)(). */
+void *
+bsearch(const void *key, const void *base, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *))
+{
+ size_t l, u, idx;
+ const void *p;
+ int comparison;
+
+ l = 0;
+ u = nmemb;
+ while (l < u) {
+ idx = (l + u) / 2;
+ p = (void *)(((const char *)base) + (idx * size));
+ comparison = (*compar)(key, p);
+ if (comparison < 0)
+ u = idx;
+ else if (comparison > 0)
+ l = idx + 1;
+ else
+ return (void *)p;
+ }
+
+ return NULL;
+}
+
+EXPORT_SYMBOL(bsearch);
diff -Nru a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
--- a/net/sunrpc/svcauth_unix.c Mon Dec 16 15:15:22 2002
+++ b/net/sunrpc/svcauth_unix.c Mon Dec 16 15:15:22 2002
@@ -401,11 +401,11 @@
if (slen > 16 || (len -= (slen + 2)*4) < 0)
goto badcred;
for (i = 0; i < slen; i++)
- if (i < NGROUPS)
+ if (i < SVC_CRED_NGROUPS)
cred->cr_groups[i] = ntohl(svc_getu32(argv));
else
svc_getu32(argv);
- if (i < NGROUPS)
+ if (i < SVC_CRED_NGROUPS)
cred->cr_groups[i] = NOGROUP;
if (svc_getu32(argv) != RPC_AUTH_NULL || svc_getu32(argv) != 0) {
^ permalink raw reply
* [U-Boot-Users] booting linux from u-boot - help!
From: My-Hong Vuong @ 2002-12-17 0:23 UTC (permalink / raw)
To: u-boot
Hi,
I've finally resolved my ethernet reset problem - we just happened to
be moving things arount on our development area, and found that upon
removal of the mpcbdm cable, our board no longer sporadically reset and
our ethernet worked just fine. Can anyone shed some light on this? I'm
open to suggestions and I'm sure users developing for custom boards
would also find this information useful.
Anyway, I'm now up to the stage of booting linux. i've tftp'd a
pImage, loaded it into flash and have tried to boot it using:
setenv bootargs root=/dev/hda1
bootm 04880000
## Booting image at 04880000 ...
Image Name: Linux-2.4.19-pre7
Created: 2002-12-16 8:04:21 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 599083 Bytes = 585 kB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
At this point, it hangs. I've double-checked
linux/include/asm-ppc/ppcboot.h
with u-boot/include/asm-ppc/ppcboot.h
and the only difference is the following line:
mon_fnc_t *bi_mon_fnc; /* Pointer to monitor functions */
which is required(?)
I've also tried it with the clocks_in_mhz turned on and off with no
avail.
I modified linux/arch/ppc/kernel/head_8xx.S to flash some LEDs on the
board at _start and that works, suggesting to me that at least the
memory map parsed to linux is ok. however, trying to flash our leds to
try and find out where our system hangs, it fails when i get to
start_here. it appears that the system crashes after the "rfi", which
enables our mmu. to "prove" this, we replaced the turn_on_mmu block
with a simple "b start_here". what could possibly be the problem
here??
in desperate need of help... and thanks in advance,
My Hong Vuong
^ permalink raw reply
* [Linux-ia64] Re: ia64 cache flushing?
From: Richard Henderson @ 2002-12-17 0:25 UTC (permalink / raw)
To: linux-ia64
In-Reply-To: <marc-linux-ia64-105590709805582@msgid-missing>
On Tue, Dec 17, 2002 at 10:22:11AM +1100, Rusty Russell wrote:
> Could someone who is Attuned with the way of ia64 linking and asm
> please look at this? It's a userspace framework which tests the 2.5
> module code (as modified by RTH to use shared objects rather than
> simple object files). You can see 9 architectures already done, but
> ia64 doesn't work, for reasons beyond my humble abilities.
This has nothing to do with the icache. The program crashes
the first time it calls through the PLT, *not* on the first
instruction it executes.
The PLT has been relocated incorrectly. More in a moment...
r~
^ permalink raw reply
* [Linux-ia64] Re: ia64 cache flushing?
From: Rusty Russell @ 2002-12-17 0:27 UTC (permalink / raw)
To: linux-ia64
In-Reply-To: <marc-linux-ia64-105590709805582@msgid-missing>
> Could someone who is Attuned with the way of ia64 linking and asm
> please look at this? It's a userspace framework which tests the 2.5
> module code (as modified by RTH to use shared objects rather than
> simple object files). You can see 9 architectures already done, but
> ia64 doesn't work, for reasons beyond my humble abilities.
>
> The idea is that once all the archs are finished, I put it in the
> kernel and push the change Linus. ia64 is the last "important" arch
> (and, naturally, the hardest 8).
>
> Thanks in advance!
> Rusty.
> --
> Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Sorry, that was a hacked version. Apply this patch.
diff -ur module-test-framework/Makefile module-test-framework-fixed/Makefile
--- module-test-framework/Makefile 2002-12-17 09:48:11.000000000 +1100
+++ module-test-framework-fixed/Makefile 2002-12-17 11:22:56.000000000 +1100
@@ -18,7 +18,7 @@
# Buggy binutils on PPC needs -fPIC
KLDFLAGS_ppc:-KCCFLAGS_ppc:+KCCFLAGS_ppc:=-fPIC
KLDFLAGS_ppc64:= -melf64ppc -Bsymbolic
KCCFLAGS_ppc64:= -mminimal-toc
diff -ur module-test-framework/mod.c module-test-framework-fixed/mod.c
--- module-test-framework/mod.c 2002-12-17 09:53:05.000000000 +1100
+++ module-test-framework-fixed/mod.c 2002-12-17 11:18:15.000000000 +1100
@@ -12,7 +12,6 @@
extern int __initfn(void);
extern void __exitfn(void);
-#if 0
/* We use the linker to do a lot of this work for us. */
struct module __this_module __attribute__((section("this_module"))) = {
.name = MODULE_NAME,
@@ -35,27 +34,3 @@
.exit = __exitfn,
#endif
};
-#else
-/* We use the linker to do a lot of this work for us. */
-struct module __this_module __attribute__((section("this_module"))) = {
- .name = MODULE_NAME,
- .symbols = { .owner = &__this_module,
- .start = __start___ksymtab,
- .end = __stop___ksymtab,
- },
- .extable = { .start = NULL,
- .end = NULL,
- },
- .param_start = __start___param,
- .param_end = __stop___param,
- .init = __initfn,
- .cut_here = __module_cut,
-#ifdef CONFIG_OBSOLETE_MODPARM
- .obsparam_start = NULL,
- .obsparam_end = NULL,
-#endif
-#ifdef CONFIG_MODULE_UNLOAD
- .exit = __exitfn,
-#endif
-};
-#endif
diff -ur module-test-framework/module.c module-test-framework-fixed/module.c
--- module-test-framework/module.c 2002-12-17 09:53:56.000000000 +1100
+++ module-test-framework-fixed/module.c 2002-12-17 11:22:28.000000000 +1100
@@ -637,13 +637,12 @@
sechdrs = (void *)hdr + hdr->e_shoff;
secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
for (i = 1; i < hdr->e_shnum; i++) {
- if (strcmp(secstrings+sechdrs[i].sh_name, ".strtab") = 0) {
- DEBUGP("String table in section %u\n", i);
- strtab = (void *)hdr + sechdrs[i].sh_offset;
- } else if (sechdrs[i].sh_type = SHT_SYMTAB) {
+ if (sechdrs[i].sh_type = SHT_SYMTAB) {
/* Internal symbols */
DEBUGP("Symbol table in section %u\n", i);
symindex = i;
+ strtab = (void *)hdr
+ + sechdrs[sechdrs[i].sh_link].sh_offset;
}
}
@@ -973,9 +972,6 @@
} else if (phdrs[i].p_type = PT_LINUX_MODULE)
me = loadaddr + phdrs[i].p_vaddr;
}
-#if 1
- me = loadaddr + 0x00000084;
-#endif
if (!me) {
printk(KERN_ERR "load_module: No module found\n");
err = -ENOEXEC;
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply
* Re: mouse grabbing gotcha (was: dosemu 1.1.3.9 user report)
From: Stas Sergeev @ 2002-12-17 0:31 UTC (permalink / raw)
To: linux-msdos
Hello.
Peter Jay Salzman wrote:
> i guess enlightenment traps cntl-alt-home, because the key combo won't
> let dosemu grab the mouse.
> however, it DOES work with twm.
Can you figure out a more reliable
combination then?
Set $_X_mgrab_key to, say, "Scroll_Lock"
or "Pause" and if there is something
that works everywhere, then I think the
default "Home" should be changed.
^ permalink raw reply
* Re: [PATCH] kexec for 2.5.52 [OSDL PLM]
From: Andy Pfiffer @ 2002-12-17 0:40 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: linux-kernel@vger.kernel.org
In-Reply-To: <m1of7lahkn.fsf@frodo.biederman.org>
On Mon, 2002-12-16 at 11:29, Eric W. Biederman wrote:
> > Is there a new kexec-tools package for this, or should the 1.8 rev
> > located here:
> > http://www.xmission.com/~ebiederm/files/kexec/
> > work okay?
>
> 1.8 should work.
Okay. Thanks.
> The old hwfixes should work as well. If the .48 version does not
> patch cleanly holler.
The hwfixes for .48 applied cleanly for me, so I tossed the patches into
OSDL's PLM hopper:
http://www.osdl.org/cgi-bin/plm?module=patch_info&patch_id=1043
http://www.osdl.org/cgi-bin/plm?module=patch_info&patch_id=1042
http://www.osdl.org/cgi-bin/plm?module=patch_info&patch_id=1041
http://www.osdl.org/cgi-bin/plm?module=patch_info&patch_id=1038
Legend for those that don't want to click on the URLs:
a) PLM ID #1043: changes CONFIG_KEXEC to y by default (a quirk of the
PLM infrastructure).
b) PLM ID #1042: .48 hwfixes for kexec
c) PLM ID #1041: base kexec for 2.5.52
d) PLM ID #1038: base 2.5.52 kernel
e) OSDL PLM: http://www.osdl.org/cgi-bin/plm/
Andy
^ permalink raw reply
* [PATCH] PCI: disable decoding while sizing BARs
From: Bjorn Helgaas @ 2002-12-17 0:41 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: mj, linux-kernel
While sizing BARs, devices are temporarily assigned ranges
that may conflict with other things in the system, like IOSAPICs.
Here's a detailed description of a hang that results from leaving
device decoding enabled while sizing the BARs:
https://lists.linuxia64.org/archives//linux-ia64/2002-April/003302.html
This patch applies to current 2.4 BitKeeper.
--- linux-2.4/drivers/pci/pci.c 2002-12-16 10:44:21.000000000 -0700
+++ testing/drivers/pci/pci.c 2002-12-16 17:22:26.000000000 -0700
@@ -1058,8 +1058,14 @@
{
unsigned int pos, reg, next;
u32 l, sz;
+ u16 cmd;
struct resource *res;
+ /* Disable I/O & memory decoding while we size the BARs. */
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ pci_write_config_word(dev, PCI_COMMAND,
+ cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
+
for(pos=0; pos<howmany; pos = next) {
next = pos+1;
res = &dev->resource[pos];
@@ -1131,6 +1137,8 @@
res->end = res->start + (unsigned long) sz;
}
}
+
+ pci_write_config_word(dev, PCI_COMMAND, cmd);
}
void __devinit pci_read_bridge_bases(struct pci_bus *child)
^ permalink raw reply
* [BK PATCH] USB changes for 2.4.21-pre1
From: Greg KH @ 2002-12-17 0:46 UTC (permalink / raw)
To: marcelo; +Cc: linux-usb-devel, linux-kernel
Hi,
Here are some USB updates for 2.4.21-pre1. It also includes the tipar char
driver which has been in the 2.5 tree for a while.
Please pull from: bk://linuxusb.bkbits.net/marcelo-2.4
The individual patches will be sent in follow up messages to this email
to you and the linux-usb-devel mailing list.
thanks,
greg k-h
Documentation/Configure.help | 66 +++
Documentation/tipar.txt | 93 ++++
MAINTAINERS | 10
drivers/char/Config.in | 1
drivers/char/Makefile | 1
drivers/char/tipar.c | 540 +++++++++++++++++++++++++++
drivers/usb/Config.in | 3
drivers/usb/hc_sl811.c | 2
drivers/usb/pegasus.c | 31 +
drivers/usb/pwc-ctrl.c | 38 -
drivers/usb/pwc-if.c | 406 ++++++++++++--------
drivers/usb/pwc-ioctl.h | 13
drivers/usb/pwc-uncompress.c | 24 -
drivers/usb/pwc.h | 9
drivers/usb/rtl8150.c | 53 ++
drivers/usb/serial/Config.in | 1
drivers/usb/serial/Makefile | 1
drivers/usb/serial/ftdi_sio.c | 31 +
drivers/usb/serial/ftdi_sio.h | 12
drivers/usb/serial/kobil_sct.c | 721 ++++++++++++++++++++++++++++++++++++-
drivers/usb/serial/kobil_sct.h | 60 +++
drivers/usb/storage/unusual_devs.h | 16
drivers/usb/uhci.c | 4
drivers/usb/usb.c | 14
drivers/usb/usbnet.c | 100 +++--
25 files changed, 1969 insertions(+), 281 deletions(-)
-----
ChangeSet@1.886, 2002-12-16 16:20:13-08:00, greg@kroah.com
Merge kroah.com:/home/greg/linux/BK/bleeding_edge-2.4
into kroah.com:/home/greg/linux/BK/gregkh-2.4
Documentation/Configure.help | 33 +++++++++++++++++++++++++++++++++
MAINTAINERS | 5 +++++
2 files changed, 38 insertions(+)
------
ChangeSet@1.811.1.18, 2002-12-16 12:00:21-08:00, greg@kroah.com
[PATCH] USB: uhci: fix formatting problem with last patch.
drivers/usb/uhci.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
------
ChangeSet@1.811.1.17, 2002-12-16 11:55:30-08:00, jkt@Helius.COM
[PATCH] uhci corruption on usb_submit_urb when already -EINPROGRESS
uhci corrupts a list, either uhci->urb_list or uhci->urb_remove_list,
when usb_submit_urb is called against an urb already in flight
(urb->status == -EINPROGRESS). yeah, i know you're not *supposed* to do
that but Real Programmers(tm) make Real Mistakes(tm) (and timeouts are
oh, so tricky!) and the code catches this case otherwise; unfortunately,
the INIT_LIST_HEAD has already hammered your list.
:{)}
drivers/usb/uhci.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
------
ChangeSet@1.811.1.16, 2002-12-16 11:55:18-08:00, david-b@pacbell.net
[PATCH] usbnet: framing, sync with 2.5
This patch matches the 2.5 patch I just submitted, except that
it keeps Pavel's table-based crc32 code since <linux/crc32.h>
says it's not for "bulk data" (which is what this driver does).
Plus some changes (ethtool) were forward ports from pre1.
- Addresses two issues Toby Milne reported against the Zaurus:
(a) if skbs had extra framing added (z, net1080, gl620a),
the original size (now too small) was used on tx;
(b) added FLAG_FRAMING_Z so rx packets had enough space
- Stubs in some PXA-250 support for non-Zaurus PDAs.
This is currently commented out; so far those PDAs
only run Linux for bleeding edge developers.
- Minor cleanups.
drivers/usb/Config.in | 2 -
drivers/usb/usbnet.c | 98 +++++++++++++++++++++++++++++++++++---------------
2 files changed, 70 insertions(+), 30 deletions(-)
------
ChangeSet@1.811.1.15, 2002-12-16 11:55:06-08:00, david-b@pacbell.net
[PATCH] remove CONFIG_USB_LONG_TIMEOUT
This matches 2.5.latest ... the config option isn't needed,
since neither timeout was actually as large as what the
USB spec says (5 seconds). It'll prevent some devices
from failing to enumerate (like MGE Ellips UPSes).
drivers/usb/Config.in | 1 -
drivers/usb/usb.c | 14 +++++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
------
ChangeSet@1.811.1.14, 2002-12-16 11:24:34-08:00, greg@kroah.com
USB: pwc driver: fix compile time warning
drivers/usb/pwc-if.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
------
ChangeSet@1.811.1.13, 2002-12-16 11:21:34-08:00, greg@kroah.com
Merge
drivers/usb/pwc-if.c | 197 +++++++++++++++++++++++++++++----------------------
1 files changed, 115 insertions(+), 82 deletions(-)
------
ChangeSet@1.811.2.1, 2002-12-16 11:18:15-08:00, arjanv@redhat.com
[PATCH] USB pwc deadlock fixes
drivers/usb/pwc-if.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
------
ChangeSet@1.811.1.12, 2002-12-16 10:45:23-08:00, nemosoft@smcc.demon.nl
[PATCH] USB: PWC 8.10 for 2.4.20
Well, two patches in one... These patches will bring the PWC (Philips
Webcam) driver in both 2.4.20 and 2.5.51 up to version 8.10. Functionally,
the two branches are the same (about 70% of the code is shared), but the
differences in kernel architecture are too large to handle with a few
#ifdefs.
This patch fixes the following (this are only the differences between 8.9
and 8.10):
* Fixed ID for QuickCam Notebook pro
* Added GREALSIZE ioctl() call
* Fixed bug in case PWCX was not loaded and invalid size was set
drivers/usb/pwc-ctrl.c | 38 ++++----
drivers/usb/pwc-if.c | 197 +++++++++++++++++++++++++------------------
drivers/usb/pwc-ioctl.h | 13 ++
drivers/usb/pwc-uncompress.c | 24 +----
drivers/usb/pwc.h | 9 +
5 files changed, 157 insertions(+), 124 deletions(-)
------
ChangeSet@1.811.1.11, 2002-12-13 09:30:44-08:00, petkan@rakia.dce.bg
[PATCH] USB: pegasus: the data for the control requests is now stored in DMA able memory.
drivers/usb/pegasus.c | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
------
ChangeSet@1.811.1.10, 2002-12-12 13:45:00-08:00, kuba@mareimbrium.org
[PATCH] USB: ftdi-sio update
Attached is a patch which updates ftdi sio driver with better (i.e. always
correct ;-) fractional divisor code. The previous one was an
oversimplification that would not always give the best approximation of the
divisor. It also became an internal static function -- exposing it as a (yet
another) macro was unnecessary.
drivers/usb/serial/ftdi_sio.c | 31 ++++++++++++++++++++++++++++++-
drivers/usb/serial/ftdi_sio.h | 12 ++----------
2 files changed, 32 insertions(+), 11 deletions(-)
------
ChangeSet@1.811.1.9, 2002-12-12 13:32:39-08:00, nobita@t-online.de
[PATCH] support for Sony Cybershot F717 digital camera / usb-storage
here is an id-patch to get the Sony Cybershot F717 6meg pixel digital
camera working with the standard usb-storage device driver.
drivers/usb/storage/unusual_devs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
------
ChangeSet@1.811.1.8, 2002-12-11 00:38:01-08:00, marekm@amelek.gda.pl
[PATCH] Datafab KECF-USB / Sagatek DCS-CF / Simpletech UCF-100
sorry to bother you again - now that 2.4.20 is out, is there any
chance to include this in 2.4.21? I've been trying since 2.4.19,
a few other UNUSUAL_DEV entries were added, but not this one...
The device works fine with the patch (and doesn't work at all without
it) for me and a few other people (devices with different "marketing"
names, the same vendor:device id), no one has reported any problems.
The patch has been in the 2.4-ac tree for a while, too.
drivers/usb/storage/unusual_devs.h | 12 ++++++++++++
1 files changed, 12 insertions(+)
------
ChangeSet@1.811.1.7, 2002-12-11 00:37:49-08:00, m.c.p@wolk-project.de
[PATCH] Eliminate warning in drivers/usb/hc_sl811.c
compile warning is:
#warning linux/malloc.h is deprecated, use linux/slab.h instead.
attached patch uses linux/slab.h instead, as adviced by above ;)
drivers/usb/hc_sl811.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
------
ChangeSet@1.811.1.6, 2002-12-11 00:37:38-08:00, stelian@popies.net
[PATCH] usbnet typo
There is a typo in the latest usbnet driver which disables
the compile of iPAQ specific code.
With the attached patch, the new driver recognises the iPAQ
and even works :*)
drivers/usb/usbnet.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
------
ChangeSet@1.811.1.5, 2002-12-11 00:37:26-08:00, greg@kroah.com
[PATCH] tipar: fix #include so the driver can compile.
drivers/char/tipar.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
------
ChangeSet@1.811.1.4, 2002-12-11 00:37:14-08:00, rlievin@free.fr
[PATCH] Add tipar char driver
Documentation/Configure.help | 22 +
Documentation/tipar.txt | 93 +++++++
MAINTAINERS | 5
drivers/char/Config.in | 1
drivers/char/Makefile | 1
drivers/char/tipar.c | 538 +++++++++++++++++++++++++++++++++++++++++++
6 files changed, 660 insertions(+)
------
ChangeSet@1.811.1.3, 2002-12-11 00:36:59-08:00, wahrenbruch@kobil.de
[PATCH] USB: kobil_sct driver bugfix
Here it is. For readers, connected via Adapter B (Kaan Pro, B1 Pro),
the driver starts now reading after open(), so that the PNP string doesn't
confuse the CT-API.
drivers/usb/serial/kobil_sct.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
------
ChangeSet@1.811.1.2, 2002-12-11 00:36:47-08:00, wahrenbruch@kobil.de
[PATCH] USB: add kobil_sct driver
Documentation/Configure.help | 11
drivers/usb/serial/Config.in | 1
drivers/usb/serial/Makefile | 1
drivers/usb/serial/kobil_sct.c | 711 +++++++++++++++++++++++++++++++++++++++++
drivers/usb/serial/kobil_sct.h | 60 +++
5 files changed, 784 insertions(+)
------
ChangeSet@1.811.1.1, 2002-12-11 00:36:25-08:00, petkan@mastika.dce.bg
[PATCH] set_mac_address is now added to the driver. thanks to Orjan Friberg <orjan.friberg@axis.com>
drivers/usb/rtl8150.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 49 insertions(+), 4 deletions(-)
------
^ permalink raw reply
* Re: Intel P6 vs P7 system call performance
From: Linus Torvalds @ 2002-12-17 0:47 UTC (permalink / raw)
To: Dave Jones, Ingo Molnar; +Cc: linux-kernel
In-Reply-To: <20021209193649.GC10316@suse.de>
On Mon, 9 Dec 2002, Dave Jones wrote:
>
> Time to look into an alternative like SYSCALL perhaps ?
Well, here's a very raw first try at using intel sysenter/sysexit.
It does actually work, I've done a "hello world" program that used
sysenter to enter the kernel, but kernel exit requires knowing where to
return to (the SYSENTER_RETURN define in entry.S), and I didn't set up a
fixmap entry for this yet, so I don't have a good value to return to yet.
But this, together with a fixmap entry that is user-readable (and thus
executable) that contains the "sysenter" instruction (and enough setup so
that %ebp points to the stack we want to return with), and together with
some debugging should get you there.
WARNING! I may be setting up the stack slightly incorrectly, since this
also hurls chunks when debugging. Dunno. Ingo, care to take a look?
Btw, that per-CPU sysenter entry-point is really clever of me, but it's
not strictly NMI-safe. There's a single-instruction window between having
started "sysenter" and having a valid kernel stack, and if an NMI comes in
at that point, the NMI will now have a bogus stack pointer.
That NMI problem is pretty fundamentally unfixable due to the stupid
sysenter semantics, but we could just make the NMI handlers be real
careful about it and fix it up if it happens.
Most of the diff here is actually moving around some of the segments,
since sysenter/sysexit wants them in one particular order. The setup code
to initialize sysenter is itself pretty trivial.
Linus
----
===== arch/i386/kernel/sysenter.c 1.1 vs edited =====
--- 1.1/arch/i386/kernel/sysenter.c Sat Dec 14 04:38:56 2002
+++ edited/arch/i386/kernel/sysenter.c 2002-12-16 16:37:32.000000000 -0800
@@ -0,0 +1,52 @@
+/*
+ * linux/arch/i386/kernel/sysenter.c
+ *
+ * (C) Copyright 2002 Linus Torvalds
+ *
+ * This file contains the needed initializations to support sysenter.
+ */
+
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/thread_info.h>
+#include <linux/gfp.h>
+
+#include <asm/cpufeature.h>
+#include <asm/msr.h>
+
+extern asmlinkage void sysenter_entry(void);
+
+static void __init enable_sep_cpu(void *info)
+{
+ unsigned long page = __get_free_page(GFP_ATOMIC);
+ int cpu = get_cpu();
+ unsigned long *esp0_ptr = &(init_tss + cpu)->esp0;
+ unsigned long rel32;
+
+ rel32 = (unsigned long) sysenter_entry - (page+11);
+
+
+ *(short *) (page+0) = 0x258b; /* movl xxxxx,%esp */
+ *(long **) (page+2) = esp0_ptr;
+ *(char *) (page+6) = 0xe9; /* jmp rl32 */
+ *(long *) (page+7) = rel32;
+
+ wrmsr(0x174, __KERNEL_CS, 0); /* SYSENTER_CS_MSR */
+ wrmsr(0x175, page+PAGE_SIZE, 0); /* SYSENTER_ESP_MSR */
+ wrmsr(0x176, page, 0); /* SYSENTER_EIP_MSR */
+
+ printk("Enabling SEP on CPU %d\n", cpu);
+ put_cpu();
+}
+
+static int __init sysenter_setup(void)
+{
+ if (!boot_cpu_has(X86_FEATURE_SEP))
+ return 0;
+
+ enable_sep_cpu(NULL);
+ smp_call_function(enable_sep_cpu, NULL, 1, 1);
+ return 0;
+}
+
+__initcall(sysenter_setup);
===== arch/i386/kernel/Makefile 1.30 vs edited =====
--- 1.30/arch/i386/kernel/Makefile Sat Dec 14 04:38:56 2002
+++ edited/arch/i386/kernel/Makefile Mon Dec 16 13:43:57 2002
@@ -29,6 +29,7 @@
obj-$(CONFIG_PROFILING) += profile.o
obj-$(CONFIG_EDD) += edd.o
obj-$(CONFIG_MODULES) += module.o
+obj-y += sysenter.o
EXTRA_AFLAGS := -traditional
===== arch/i386/kernel/entry.S 1.41 vs edited =====
--- 1.41/arch/i386/kernel/entry.S Fri Dec 6 09:43:43 2002
+++ edited/arch/i386/kernel/entry.S Mon Dec 16 16:17:47 2002
@@ -94,7 +94,7 @@
movl %edx, %ds; \
movl %edx, %es;
-#define RESTORE_ALL \
+#define RESTORE_REGS \
popl %ebx; \
popl %ecx; \
popl %edx; \
@@ -104,14 +104,25 @@
popl %eax; \
1: popl %ds; \
2: popl %es; \
- addl $4, %esp; \
-3: iret; \
.section .fixup,"ax"; \
-4: movl $0,(%esp); \
+3: movl $0,(%esp); \
jmp 1b; \
-5: movl $0,(%esp); \
+4: movl $0,(%esp); \
jmp 2b; \
-6: pushl %ss; \
+.previous; \
+.section __ex_table,"a";\
+ .align 4; \
+ .long 1b,3b; \
+ .long 2b,4b; \
+.previous
+
+
+#define RESTORE_ALL \
+ RESTORE_REGS \
+ addl $4, %esp; \
+1: iret; \
+.section .fixup,"ax"; \
+2: pushl %ss; \
popl %ds; \
pushl %ss; \
popl %es; \
@@ -120,11 +131,11 @@
.previous; \
.section __ex_table,"a";\
.align 4; \
- .long 1b,4b; \
- .long 2b,5b; \
- .long 3b,6b; \
+ .long 1b,2b; \
.previous
+
+
ENTRY(lcall7)
pushfl # We get a different stack layout with call
# gates, which has to be cleaned up later..
@@ -219,6 +230,39 @@
cli
jmp need_resched
#endif
+
+#define SYSENTER_RETURN 0
+
+ # sysenter call handler stub
+ ALIGN
+ENTRY(sysenter_entry)
+ sti
+ pushl $(__USER_DS)
+ pushl %ebp
+ pushfl
+ pushl $(__USER_CS)
+ pushl $SYSENTER_RETURN
+
+ pushl %eax
+ SAVE_ALL
+ GET_THREAD_INFO(%ebx)
+ cmpl $(NR_syscalls), %eax
+ jae syscall_badsys
+
+ testb $_TIF_SYSCALL_TRACE,TI_FLAGS(%ebx)
+ jnz syscall_trace_entry
+ call *sys_call_table(,%eax,4)
+ movl %eax,EAX(%esp)
+ cli
+ movl TI_FLAGS(%ebx), %ecx
+ testw $_TIF_ALLWORK_MASK, %cx
+ jne syscall_exit_work
+ RESTORE_REGS
+ movl 4(%esp),%edx
+ movl 16(%esp),%ecx
+ sti
+ sysexit
+
# system call handler stub
ALIGN
===== arch/i386/kernel/head.S 1.18 vs edited =====
--- 1.18/arch/i386/kernel/head.S Thu Dec 5 18:56:49 2002
+++ edited/arch/i386/kernel/head.S Mon Dec 16 14:14:44 2002
@@ -414,8 +414,8 @@
.quad 0x0000000000000000 /* 0x0b reserved */
.quad 0x0000000000000000 /* 0x13 reserved */
.quad 0x0000000000000000 /* 0x1b reserved */
- .quad 0x00cffa000000ffff /* 0x23 user 4GB code at 0x00000000 */
- .quad 0x00cff2000000ffff /* 0x2b user 4GB data at 0x00000000 */
+ .quad 0x0000000000000000 /* 0x20 unused */
+ .quad 0x0000000000000000 /* 0x28 unused */
.quad 0x0000000000000000 /* 0x33 TLS entry 1 */
.quad 0x0000000000000000 /* 0x3b TLS entry 2 */
.quad 0x0000000000000000 /* 0x43 TLS entry 3 */
@@ -425,22 +425,25 @@
.quad 0x00cf9a000000ffff /* 0x60 kernel 4GB code at 0x00000000 */
.quad 0x00cf92000000ffff /* 0x68 kernel 4GB data at 0x00000000 */
- .quad 0x0000000000000000 /* 0x70 TSS descriptor */
- .quad 0x0000000000000000 /* 0x78 LDT descriptor */
+ .quad 0x00cffa000000ffff /* 0x73 user 4GB code at 0x00000000 */
+ .quad 0x00cff2000000ffff /* 0x7b user 4GB data at 0x00000000 */
+
+ .quad 0x0000000000000000 /* 0x80 TSS descriptor */
+ .quad 0x0000000000000000 /* 0x88 LDT descriptor */
/* Segments used for calling PnP BIOS */
- .quad 0x00c09a0000000000 /* 0x80 32-bit code */
- .quad 0x00809a0000000000 /* 0x88 16-bit code */
- .quad 0x0080920000000000 /* 0x90 16-bit data */
- .quad 0x0080920000000000 /* 0x98 16-bit data */
+ .quad 0x00c09a0000000000 /* 0x90 32-bit code */
+ .quad 0x00809a0000000000 /* 0x98 16-bit code */
.quad 0x0080920000000000 /* 0xa0 16-bit data */
+ .quad 0x0080920000000000 /* 0xa8 16-bit data */
+ .quad 0x0080920000000000 /* 0xb0 16-bit data */
/*
* The APM segments have byte granularity and their bases
* and limits are set at run time.
*/
- .quad 0x00409a0000000000 /* 0xa8 APM CS code */
- .quad 0x00009a0000000000 /* 0xb0 APM CS 16 code (16 bit) */
- .quad 0x0040920000000000 /* 0xb8 APM DS data */
+ .quad 0x00409a0000000000 /* 0xb8 APM CS code */
+ .quad 0x00009a0000000000 /* 0xc0 APM CS 16 code (16 bit) */
+ .quad 0x0040920000000000 /* 0xc8 APM DS data */
#if CONFIG_SMP
.fill (NR_CPUS-1)*GDT_ENTRIES,8,0 /* other CPU's GDT */
===== include/asm-i386/segment.h 1.2 vs edited =====
--- 1.2/include/asm-i386/segment.h Mon Aug 12 10:56:27 2002
+++ edited/include/asm-i386/segment.h Mon Dec 16 14:08:09 2002
@@ -9,8 +9,8 @@
* 2 - reserved
* 3 - reserved
*
- * 4 - default user CS <==== new cacheline
- * 5 - default user DS
+ * 4 - unused <==== new cacheline
+ * 5 - unused
*
* ------- start of TLS (Thread-Local Storage) segments:
*
@@ -25,16 +25,18 @@
*
* 12 - kernel code segment <==== new cacheline
* 13 - kernel data segment
- * 14 - TSS
- * 15 - LDT
- * 16 - PNPBIOS support (16->32 gate)
- * 17 - PNPBIOS support
- * 18 - PNPBIOS support
+ * 14 - default user CS
+ * 15 - default user DS
+ * 16 - TSS
+ * 17 - LDT
+ * 18 - PNPBIOS support (16->32 gate)
* 19 - PNPBIOS support
* 20 - PNPBIOS support
- * 21 - APM BIOS support
- * 22 - APM BIOS support
- * 23 - APM BIOS support
+ * 21 - PNPBIOS support
+ * 22 - PNPBIOS support
+ * 23 - APM BIOS support
+ * 24 - APM BIOS support
+ * 25 - APM BIOS support
*/
#define GDT_ENTRY_TLS_ENTRIES 3
#define GDT_ENTRY_TLS_MIN 6
@@ -42,10 +44,10 @@
#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
-#define GDT_ENTRY_DEFAULT_USER_CS 4
+#define GDT_ENTRY_DEFAULT_USER_CS 14
#define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS * 8 + 3)
-#define GDT_ENTRY_DEFAULT_USER_DS 5
+#define GDT_ENTRY_DEFAULT_USER_DS 15
#define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS * 8 + 3)
#define GDT_ENTRY_KERNEL_BASE 12
@@ -56,14 +58,14 @@
#define GDT_ENTRY_KERNEL_DS (GDT_ENTRY_KERNEL_BASE + 1)
#define __KERNEL_DS (GDT_ENTRY_KERNEL_DS * 8)
-#define GDT_ENTRY_TSS (GDT_ENTRY_KERNEL_BASE + 2)
-#define GDT_ENTRY_LDT (GDT_ENTRY_KERNEL_BASE + 3)
+#define GDT_ENTRY_TSS (GDT_ENTRY_KERNEL_BASE + 4)
+#define GDT_ENTRY_LDT (GDT_ENTRY_KERNEL_BASE + 5)
-#define GDT_ENTRY_PNPBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 4)
-#define GDT_ENTRY_APMBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 9)
+#define GDT_ENTRY_PNPBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 6)
+#define GDT_ENTRY_APMBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 11)
/*
- * The GDT has 21 entries but we pad it to cacheline boundary:
+ * The GDT has 23 entries but we pad it to cacheline boundary:
*/
#define GDT_ENTRIES 24
^ permalink raw reply
* Re: Mailling list archive URL broken?
From: Ralf Baechle @ 2002-12-17 0:42 UTC (permalink / raw)
To: Peter Bieringer; +Cc: Maillist netdev
In-Reply-To: <70060000.1040055045@worker.muc.bieringer.de>
On Mon, Dec 16, 2002 at 05:10:45PM +0100, Peter Bieringer wrote:
> some time ago I found this archive URL:
>
> http://oss.sgi.com/projects/netdev/archive/
>
> Unfortunately, it's broken (forbidden). Temp failure or is archive
> moved? If second, pls. send me the new URL.
A glitch in the recent conversion from Majordomo to Ecartis, I just fixed
this.
This is just the URL of the mbox archives maintained by Ecartis. There's
also a webarchive ...
Ralf
^ permalink raw reply
* USB troubles in 2.5 kernels
From: André Cruz @ 2002-12-17 0:59 UTC (permalink / raw)
To: linux-kernel
Hello.
First of all if I do a make install in a 2.5 kernel without module support it still complains in the end about /lib/modules/2.5.52 not being a directory.
I have to mkdir it and then run make install.
The first problem is with kernel 2.5.50:
I think my CF/SM reader is detected at boot but when I issue a mount
/dev/sdc1 /mnt/ this appears and nothing happens after that:
SCSI device sdc: drive cache: write through
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage: 25 20 00 00 00 00 00 00 00 00 23 c0
usb-storage: Bulk command S 0x43425355 T 0x44 Trg 0 LUN 1 L 8 F 128 CL
10
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 8 bytes
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x44 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
SCSI device sdc: 31361 512-byte hdwr sectors (16 MB)
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE (6 bytes)
usb-storage: 1a 20 3f 00 04 00 00 00 00 ee 50 c0
usb-storage: Bulk command S 0x43425355 T 0x45 Trg 0 LUN 1 L 4 F 128 CL 6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 4 bytes
drivers/usb/host/uhci-hcd.c: uhci_result_common() failed with status
500000
[ef324270] link (2f324212) element (2f325040)
0: [ef325040] link (00000001) e3 IOC Stalled Babble Length=3 MaxLen=3
DT0 EndPt=2 Dev=3, PID=69(IN) (buf=0050ee00)
drivers/usb/core/hcd.c: giveback urb ef2c7660 status -75 len 4
usb-storage: Status code -75; transferred 4/4
usb-storage: -- unknown error
usb-storage: Bulk data transfer result 0x3
usb-storage: -- transport indicates error, resetting
usb-storage: Bulk reset requested
drivers/usb/core/message.c: usb_control/bulk_msg: timeout
usb 1-2: wait for giveback urb ee34a380
usb-storage: command_abort() called
usb-storage: usb_stor_abort_transport called
dmesg
usb-storage: act_altsetting is 0
usb-storage: id_index calculated to be: 94
usb-storage: Array length appears to be: 96
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0xef2c8e34 Out: 0xef2c8e20 Int: 0x00000000
(Period 0)
usb-storage: New GUID 0aec5010aec501000001a003
usb-storage: GetMaxLUN command result is 1, data is 1
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
usb-storage: Allocating usb_ctrlrequest
usb-storage: Allocating URB
usb-storage: Allocating scatter-gather request block
usb-storage: *** thread sleeping.
scsi2 : SCSI emulation for USB Mass Storage devices
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage: 12 00 00 00 24 00 00 00 87 e4 23 c0
usb-storage: Bulk command S 0x43425355 T 0x11 Trg 0 LUN 0 L 36 F 128 CL
6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 36 bytes
usb-storage: Status code 0; transferred 36/36
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x11 R 0 Stat 0x0
usb-storage: Fixing INQUIRY data to show SCSI rev 2 - was 0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
Vendor: Model: USB Storage-SMC Rev: 0212
Type: Direct-Access ANSI SCSI revision: 02
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Faking INQUIRY command for EVPD
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Faking INQUIRY command for EVPD
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage: 12 20 00 00 24 00 00 00 87 e4 23 c0
usb-storage: Bulk command S 0x43425355 T 0x14 Trg 0 LUN 1 L 36 F 128 CL
6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 36 bytes
usb-storage: Status code 0; transferred 36/36
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x14 R 0 Stat 0x0
usb-storage: Fixing INQUIRY data to show SCSI rev 2 - was 0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
Vendor: Model: USB Storage-CFC Rev: 0212
Type: Direct-Access ANSI SCSI revision: 02
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Faking INQUIRY command for EVPD
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Faking INQUIRY command for EVPD
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad LUN (0/2)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (1/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (2/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (3/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (4/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (5/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (6/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (7/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage: 00 00 00 00 00 00 00 00 00 00 23 c0
usb-storage: Bulk command S 0x43425355 T 0x1f Trg 0 LUN 0 L 0 F 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x1f R 0 Stat 0x1
usb-storage: -- transport indicates command failure
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: Bulk command S 0x43425355 T 0x1f Trg 0 LUN 0 L 18 F 128 CL
6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 18 bytes
usb-storage: Status code 0; transferred 18/18
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x1f R 0 Stat 0x0
usb-storage: -- Result from auto-sense is 0
usb-storage: -- code: 0x70, key: 0x2, ASC: 0x3a, ASCQ: 0x0
usb-storage: Not Ready: Medium not present
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE (6 bytes)
usb-storage: 1a 08 08 00 80 00 00 00 00 00 23 c0
usb-storage: Bulk command S 0x43425355 T 0x20 Trg 0 LUN 0 L 128 F 128 CL
6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 128 bytes
usb-storage: Status code 0; transferred 8/128
usb-storage: -- transferred only 8 bytes
usb-storage: Bulk data transfer result 0x1
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x20 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
SCSI device sdb: drive cache: write through
Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage: 00 20 00 00 00 00 00 00 00 00 23 c0
usb-storage: Bulk command S 0x43425355 T 0x21 Trg 0 LUN 1 L 0 F 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x21 R 0 Stat 0x1
usb-storage: -- transport indicates command failure
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: Bulk command S 0x43425355 T 0x21 Trg 0 LUN 1 L 18 F 128 CL
6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 18 bytes
usb-storage: Status code 0; transferred 18/18
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x21 R 0 Stat 0x0
usb-storage: -- Result from auto-sense is 0
usb-storage: -- code: 0x70, key: 0x2, ASC: 0x3a, ASCQ: 0x0
usb-storage: Not Ready: Medium not present
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE (6 bytes)
usb-storage: 1a 28 08 00 80 00 00 00 00 00 23 c0
usb-storage: Bulk command S 0x43425355 T 0x22 Trg 0 LUN 1 L 128 F 128 CL
6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 128 bytes
usb-storage: Status code 0; transferred 8/128
usb-storage: -- transferred only 8 bytes
usb-storage: Bulk data transfer result 0x1
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x22 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
SCSI device sdc: drive cache: write through
Attached scsi removable disk sdc at scsi2, channel 0, id 0, lun 1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
The second problem started with > 2.5.50
At boot this happens:
usb-storage: act_altsetting is 0
usb-storage: id_index calculated to be: 95
usb-storage: Array length appears to be: 97
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0xef283ef4 Out: 0xef283ee0 Int: 0x00000000
(Period 0)
usb-storage: New GUID 0aec5010aec501000001a003
Unable to handle kernel NULL pointer dereference at virtual address
00000002
printing eip:
c02aaede
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0060:[<c02aaede>] Not tainted
EFLAGS: 00010202
eax: 00000001 ebx: 00000020 ecx: ef283ee0 edx: 00000000
esi: 00000000 edi: ef283ef4 ebp: ef280600 esp: efc5bd4c
ds: 0068 es: 0068 ss: 0068
Process khubd (pid: 4, threadinfo=efc5a000 task=c17af240)
Stack: ef280600 00000000 00000174 0001a003 00000000 efb2aa00 ef288560
ef280604
c174b968 c03d624c c0137541 c174b968 00000000 c174b9b8 00000000
00000246
c03d624c 000001ff effe83d0 00000000 eeb09ea0 eeb09098 c01623d0
eeb09ea0
Call Trace: [<c0137541>] [<c01623d0>] [<c013a38e>] [<c028ff07>]
[<c0200c65>] [<c0200cff>] [<c0200ed4>] [<c01fff70>] [<c029119c>]
[<c0293546>] [<c02939be>] [<c0122265>] [<c0293a65>] [<c011e4c0>]
[<c0293a30>] [<c0109249>]
Code: 0f b6 46 02 24 0f 88 85 9e 00 00 00 0f b6 46 06 8d 75 30 88
Can anyone help with any of these problems? Also a backport of this
driver to 2.4 would be very good. I can't use 2.5 for production yet.
Can anyone at least tell me which driver has to be backported?
Thanks!
--
André Cruz <afafc@rnl.ist.utl.pt>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.