[patch 4/6] ps3: Disk Storage Driver
From: Geert Uytterhoeven <[EMAIL PROTECTED]> Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather CC: Geoff Levand <[EMAIL PROTECTED]> Signed-off-by: Geert Uytterhoeven <[EMAIL PROTECTED]> --- v3: - Cleanup #includes - Kill PS3DISK_MAJOR, always use zero to obtain a dynamic major - Group LV1 API related stuff - Kill empty ps3disk_open - Reset ps3disk_priv(dev) to NULL during cleanup - Move call to put_disk() down - Pass the interrupt handler to ps3stor_setup(), so it doesn't have to be overridden later - Fold ps3disk_read_write_sectors() into ps3disk_submit_request_sg() - Identify the hard drive capacity and model name during probing v2: - Don't use `default y' in Kconfig - Remove the thread for handling requests - Set up sysfs links between block device and PS3 system device: o /sys/block/ps3da/device -> ../../devices/ps3_system/sb_02 o /sys/devices/ps3_system/sb_02/block:ps3da -> ../../../block/ps3da - Fix all FIXMEs - Implement proper barrier support - Call add_disk_randomness() - Add a test to verify we are running on a PS3 - Fix error path in ps3disk_init() - Fix cleanup order in ps3disk_exit() arch/powerpc/platforms/ps3/Kconfig | 10 drivers/block/Makefile |1 drivers/block/ps3disk.c| 623 + 3 files changed, 634 insertions(+) --- a/arch/powerpc/platforms/ps3/Kconfig +++ b/arch/powerpc/platforms/ps3/Kconfig @@ -102,4 +102,14 @@ config PS3_STORAGE depends on PPC_PS3 tristate +config PS3_DISK + tristate "PS3 Disk Storage Driver" + depends on PPC_PS3 && BLOCK + select PS3_STORAGE + help + Include support for the PS3 Disk Storage. + + This support is required to access the PS3 hard disk. + In general, all users will say Y or M. + endmenu --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -29,3 +29,4 @@ obj-$(CONFIG_VIODASD) += viodasd.o obj-$(CONFIG_BLK_DEV_SX8) += sx8.o obj-$(CONFIG_BLK_DEV_UB) += ub.o +obj-$(CONFIG_PS3_DISK) += ps3disk.o --- /dev/null +++ b/drivers/block/ps3disk.c @@ -0,0 +1,623 @@ +/* + * PS3 Disk Storage Driver + * + * Copyright (C) 2007 Sony Computer Entertainment Inc. + * Copyright 2007 Sony Corp. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published + * by the Free Software Foundation; version 2 of the License. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include + +#include +#include +#include + + +#define DEVICE_NAME"ps3disk" + +#define BOUNCE_SIZE(64*1024) + +#define PS3DISK_MAX_DISKS 16 +#define PS3DISK_MINORS 16 + +#define KERNEL_SECTOR_SIZE 512 + + +#define PS3DISK_NAME "ps3d%c" + + +struct ps3disk_private { + spinlock_t lock;/* Request queue spinlock */ + struct request_queue *queue; + struct gendisk *gendisk; + unsigned int blocking_factor; + struct request *req; + u64 raw_capacity; + unsigned char model[ATA_ID_PROD_LEN+1]; +}; +#define ps3disk_priv(dev) ((dev)->sbd.core.driver_data) + + +#define LV1_STORAGE_SEND_ATA_COMMAND (2) +#define LV1_STORAGE_ATA_HDDOUT (0x23) + +struct lv1_ata_cmnd_block { + u16 features; + u16 sector_count; + u16 LBA_low; + u16 LBA_mid; + u16 LBA_high; + u8 device; + u8 command; + u32 is_ext; + u32 proto; + u32 in_out; + u32 size; + u64 buffer; + u32 arglen; +}; + +enum lv1_ata_proto { + NON_DATA_PROTO = 0, + PIO_DATA_IN_PROTO = 1, + PIO_DATA_OUT_PROTO = 2, + DMA_PROTO = 3 +}; + +enum lv1_ata_in_out { + DIR_WRITE = 0, /* memory -> device */ + DIR_READ = 1/* device -> memory */ +}; + +static int ps3disk_major; + + +static struct block_device_operations ps3disk_fops = { + .owner = THIS_MODULE, +}; + + +static void ps3disk_scatter_gather(struct ps3_storage_device *dev, + struct request *req, int gather) +{ + unsigned int sectors = 0, offset = 0; + struct bio *bio; +
[patch 4/6] ps3: Disk Storage Driver
From: Geert Uytterhoeven [EMAIL PROTECTED] Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather CC: Geoff Levand [EMAIL PROTECTED] Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED] --- v3: - Cleanup #includes - Kill PS3DISK_MAJOR, always use zero to obtain a dynamic major - Group LV1 API related stuff - Kill empty ps3disk_open - Reset ps3disk_priv(dev) to NULL during cleanup - Move call to put_disk() down - Pass the interrupt handler to ps3stor_setup(), so it doesn't have to be overridden later - Fold ps3disk_read_write_sectors() into ps3disk_submit_request_sg() - Identify the hard drive capacity and model name during probing v2: - Don't use `default y' in Kconfig - Remove the thread for handling requests - Set up sysfs links between block device and PS3 system device: o /sys/block/ps3da/device - ../../devices/ps3_system/sb_02 o /sys/devices/ps3_system/sb_02/block:ps3da - ../../../block/ps3da - Fix all FIXMEs - Implement proper barrier support - Call add_disk_randomness() - Add a test to verify we are running on a PS3 - Fix error path in ps3disk_init() - Fix cleanup order in ps3disk_exit() arch/powerpc/platforms/ps3/Kconfig | 10 drivers/block/Makefile |1 drivers/block/ps3disk.c| 623 + 3 files changed, 634 insertions(+) --- a/arch/powerpc/platforms/ps3/Kconfig +++ b/arch/powerpc/platforms/ps3/Kconfig @@ -102,4 +102,14 @@ config PS3_STORAGE depends on PPC_PS3 tristate +config PS3_DISK + tristate PS3 Disk Storage Driver + depends on PPC_PS3 BLOCK + select PS3_STORAGE + help + Include support for the PS3 Disk Storage. + + This support is required to access the PS3 hard disk. + In general, all users will say Y or M. + endmenu --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -29,3 +29,4 @@ obj-$(CONFIG_VIODASD) += viodasd.o obj-$(CONFIG_BLK_DEV_SX8) += sx8.o obj-$(CONFIG_BLK_DEV_UB) += ub.o +obj-$(CONFIG_PS3_DISK) += ps3disk.o --- /dev/null +++ b/drivers/block/ps3disk.c @@ -0,0 +1,623 @@ +/* + * PS3 Disk Storage Driver + * + * Copyright (C) 2007 Sony Computer Entertainment Inc. + * Copyright 2007 Sony Corp. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published + * by the Free Software Foundation; version 2 of the License. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include linux/ata.h +#include linux/blkdev.h + +#include asm/lv1call.h +#include asm/ps3stor.h +#include asm/firmware.h + + +#define DEVICE_NAMEps3disk + +#define BOUNCE_SIZE(64*1024) + +#define PS3DISK_MAX_DISKS 16 +#define PS3DISK_MINORS 16 + +#define KERNEL_SECTOR_SIZE 512 + + +#define PS3DISK_NAME ps3d%c + + +struct ps3disk_private { + spinlock_t lock;/* Request queue spinlock */ + struct request_queue *queue; + struct gendisk *gendisk; + unsigned int blocking_factor; + struct request *req; + u64 raw_capacity; + unsigned char model[ATA_ID_PROD_LEN+1]; +}; +#define ps3disk_priv(dev) ((dev)-sbd.core.driver_data) + + +#define LV1_STORAGE_SEND_ATA_COMMAND (2) +#define LV1_STORAGE_ATA_HDDOUT (0x23) + +struct lv1_ata_cmnd_block { + u16 features; + u16 sector_count; + u16 LBA_low; + u16 LBA_mid; + u16 LBA_high; + u8 device; + u8 command; + u32 is_ext; + u32 proto; + u32 in_out; + u32 size; + u64 buffer; + u32 arglen; +}; + +enum lv1_ata_proto { + NON_DATA_PROTO = 0, + PIO_DATA_IN_PROTO = 1, + PIO_DATA_OUT_PROTO = 2, + DMA_PROTO = 3 +}; + +enum lv1_ata_in_out { + DIR_WRITE = 0, /* memory - device */ + DIR_READ = 1/* device - memory */ +}; + +static int ps3disk_major; + + +static struct block_device_operations ps3disk_fops = { + .owner = THIS_MODULE, +}; + + +static void ps3disk_scatter_gather(struct ps3_storage_device *dev, + struct request *req, int gather) +{ + unsigned int sectors = 0, offset
Re: [patch 4/6] ps3: Disk Storage Driver
On Tue, Jun 19, 2007 at 02:51:25PM +0200, Geert Uytterhoeven wrote: > On Tue, 19 Jun 2007, Christoph Hellwig wrote: > > On Fri, Jun 15, 2007 at 01:39:23PM +0200, Geert Uytterhoeven wrote: > > > From: Geert Uytterhoeven <[EMAIL PROTECTED]> > > > > > > Add a Disk Storage Driver for the PS3: > > > - Implemented as a block device driver with a dynamic major > > > - Disk names (and partitions) are of the format ps3d%c(%u) > > > - Uses software scatter-gather with a 64 KiB bounce buffer as the > > > hypervisor > > > doesn't support scatter-gather > > > > Looks good to me. Only nitpicks are: > > > > - ps3disk_priv should probably be an inline function instead of a macro > > I used a macro because you can do > > ps3disk_pri(dev) = ...; I'm not exactly a fan of macros used as lvalues, but if you really want this it can go in. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Tue, 19 Jun 2007, Christoph Hellwig wrote: > On Fri, Jun 15, 2007 at 01:39:23PM +0200, Geert Uytterhoeven wrote: > > From: Geert Uytterhoeven <[EMAIL PROTECTED]> > > > > Add a Disk Storage Driver for the PS3: > > - Implemented as a block device driver with a dynamic major > > - Disk names (and partitions) are of the format ps3d%c(%u) > > - Uses software scatter-gather with a 64 KiB bounce buffer as the > > hypervisor > > doesn't support scatter-gather > > Looks good to me. Only nitpicks are: > > - ps3disk_priv should probably be an inline function instead of a macro I used a macro because you can do ps3disk_pri(dev) = ...; With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
On Mon, Jun 18, 2007 at 11:07:31PM -0700, David Miller wrote: > The main disk I/O block read and write is done using descriptors > sent to the disk server. SCSI pass-through is provided (optionally) > so that disk analysis tools can do things like MODE_SENSE on the > disk. SG_IO can easily be implemented for block devices. See cciss in current mainline for an example. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Mon, 18 Jun 2007, David Miller wrote: > What I really care about is what will work transparently for existing > userspace. In particular, distribution installers and existing tools > like fdisk. > > When a slice it being exported, it's not being exported like that so > that the client can just spam a disk label into it, it's for exporting > one slice. So we might want (using the scsi naming as an arbitrary > example case) /dev/sda1 to be created but not /dev/sda > > How exactly do you envision this kind of thing working? How do distribution installers handle USB disks and memory cards? Some tend to be partitioned, some don't. With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
From: Christoph Hellwig <[EMAIL PROTECTED]> Date: Tue, 19 Jun 2007 07:56:29 +0200 > A SCSI pass through is of course perfectly fine. If you have a separate > block passthrough that has additional magic a separate block driver is > the way to go because it actually is simpler than a scsi driver decoding > command blocks and translating them to deep magic. The ps3 storage > drivers this thread discussed are a good example for that. We now > have a very nice and simple disk, scsi and flash chardev driver each > that don't include abstractions layers and cruft. Combine that with > their initial scsi layer driver that was full of internal dispatches > because each of these device types speaks a completely different command > set. That's how I'm currently writing my virtual disk client driver for the Sun LDOMS stuff, as a block device. The remaining issues are the partitioning (which we're discussing in another thread) and how to export the scsi passthru support in such a non-scsi block driver. The main disk I/O block read and write is done using descriptors sent to the disk server. SCSI pass-through is provided (optionally) so that disk analysis tools can do things like MODE_SENSE on the disk. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Christoph Hellwig <[EMAIL PROTECTED]> Date: Tue, 19 Jun 2007 07:53:58 +0200 > On Fri, Jun 15, 2007 at 02:19:17PM -0700, David Miller wrote: > > Another quirk I have to deal with is that under LDOMs you > > can export full disks and also just slices. So I'll have > > to get down into the partition machinery to support that > > somehow. > > What's the problem with that? Partition machinery is perfectly > fine with just getting a raw disk without a partition table, > and it obviously doesn't care if the raw disk it sees is part > of a partition on the storage server. Applications care :-) One way of managing the partition table is by asking the storage server for it. It supports giving back something that looks like the Sun partition table layout, and also something that's EFI based. But the client can ignore that and read/write the partition table itself. What I really care about is what will work transparently for existing userspace. In particular, distribution installers and existing tools like fdisk. When a slice it being exported, it's not being exported like that so that the client can just spam a disk label into it, it's for exporting one slice. So we might want (using the scsi naming as an arbitrary example case) /dev/sda1 to be created but not /dev/sda How exactly do you envision this kind of thing working? Supporting the disk-server-provided partition table management means providing ioctls() or whatever interface to get/set the table. I had one idea to intercept reads/writes to the first block(s) and translating those into partition management commands to the disk server, but that is just too ugly to live. :-) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Christoph Hellwig [EMAIL PROTECTED] Date: Tue, 19 Jun 2007 07:53:58 +0200 On Fri, Jun 15, 2007 at 02:19:17PM -0700, David Miller wrote: Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. What's the problem with that? Partition machinery is perfectly fine with just getting a raw disk without a partition table, and it obviously doesn't care if the raw disk it sees is part of a partition on the storage server. Applications care :-) One way of managing the partition table is by asking the storage server for it. It supports giving back something that looks like the Sun partition table layout, and also something that's EFI based. But the client can ignore that and read/write the partition table itself. What I really care about is what will work transparently for existing userspace. In particular, distribution installers and existing tools like fdisk. When a slice it being exported, it's not being exported like that so that the client can just spam a disk label into it, it's for exporting one slice. So we might want (using the scsi naming as an arbitrary example case) /dev/sda1 to be created but not /dev/sda How exactly do you envision this kind of thing working? Supporting the disk-server-provided partition table management means providing ioctls() or whatever interface to get/set the table. I had one idea to intercept reads/writes to the first block(s) and translating those into partition management commands to the disk server, but that is just too ugly to live. :-) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Christoph Hellwig [EMAIL PROTECTED] Date: Tue, 19 Jun 2007 07:56:29 +0200 A SCSI pass through is of course perfectly fine. If you have a separate block passthrough that has additional magic a separate block driver is the way to go because it actually is simpler than a scsi driver decoding command blocks and translating them to deep magic. The ps3 storage drivers this thread discussed are a good example for that. We now have a very nice and simple disk, scsi and flash chardev driver each that don't include abstractions layers and cruft. Combine that with their initial scsi layer driver that was full of internal dispatches because each of these device types speaks a completely different command set. That's how I'm currently writing my virtual disk client driver for the Sun LDOMS stuff, as a block device. The remaining issues are the partitioning (which we're discussing in another thread) and how to export the scsi passthru support in such a non-scsi block driver. The main disk I/O block read and write is done using descriptors sent to the disk server. SCSI pass-through is provided (optionally) so that disk analysis tools can do things like MODE_SENSE on the disk. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Mon, 18 Jun 2007, David Miller wrote: What I really care about is what will work transparently for existing userspace. In particular, distribution installers and existing tools like fdisk. When a slice it being exported, it's not being exported like that so that the client can just spam a disk label into it, it's for exporting one slice. So we might want (using the scsi naming as an arbitrary example case) /dev/sda1 to be created but not /dev/sda How exactly do you envision this kind of thing working? How do distribution installers handle USB disks and memory cards? Some tend to be partitioned, some don't. With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
On Mon, Jun 18, 2007 at 11:07:31PM -0700, David Miller wrote: The main disk I/O block read and write is done using descriptors sent to the disk server. SCSI pass-through is provided (optionally) so that disk analysis tools can do things like MODE_SENSE on the disk. SG_IO can easily be implemented for block devices. See cciss in current mainline for an example. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Tue, 19 Jun 2007, Christoph Hellwig wrote: On Fri, Jun 15, 2007 at 01:39:23PM +0200, Geert Uytterhoeven wrote: From: Geert Uytterhoeven [EMAIL PROTECTED] Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather Looks good to me. Only nitpicks are: - ps3disk_priv should probably be an inline function instead of a macro I used a macro because you can do ps3disk_pri(dev) = ...; With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
On Tue, Jun 19, 2007 at 02:51:25PM +0200, Geert Uytterhoeven wrote: On Tue, 19 Jun 2007, Christoph Hellwig wrote: On Fri, Jun 15, 2007 at 01:39:23PM +0200, Geert Uytterhoeven wrote: From: Geert Uytterhoeven [EMAIL PROTECTED] Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather Looks good to me. Only nitpicks are: - ps3disk_priv should probably be an inline function instead of a macro I used a macro because you can do ps3disk_pri(dev) = ...; I'm not exactly a fan of macros used as lvalues, but if you really want this it can go in. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, Jun 15, 2007 at 04:08:58PM -0700, David Miller wrote: > That's not gonna work, it's a totally different model. > > I have a predefined protocol over hypervisor provided "channels" and > page flipping also done by the hypervisor for the bulk data transfer. > For the client side I cannot change the hypervisor nor the server > speaking on the other end. And when I do write a server I do want > it to be able to speak to all of the existing clients. > > There's SCSI command pass through as well, as I keep mentioning as > it's an important reason I don't want to go with any of the non-SCSI > solutions (other than perhaps ATA) being suggested. A SCSI pass through is of course perfectly fine. If you have a separate block passthrough that has additional magic a separate block driver is the way to go because it actually is simpler than a scsi driver decoding command blocks and translating them to deep magic. The ps3 storage drivers this thread discussed are a good example for that. We now have a very nice and simple disk, scsi and flash chardev driver each that don't include abstractions layers and cruft. Combine that with their initial scsi layer driver that was full of internal dispatches because each of these device types speaks a completely different command set. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, Jun 15, 2007 at 02:19:17PM -0700, David Miller wrote: > Another quirk I have to deal with is that under LDOMs you > can export full disks and also just slices. So I'll have > to get down into the partition machinery to support that > somehow. What's the problem with that? Partition machinery is perfectly fine with just getting a raw disk without a partition table, and it obviously doesn't care if the raw disk it sees is part of a partition on the storage server. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, Jun 15, 2007 at 01:39:23PM +0200, Geert Uytterhoeven wrote: > From: Geert Uytterhoeven <[EMAIL PROTECTED]> > > Add a Disk Storage Driver for the PS3: > - Implemented as a block device driver with a dynamic major > - Disk names (and partitions) are of the format ps3d%c(%u) > - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor > doesn't support scatter-gather Looks good to me. Only nitpicks are: - ps3disk_priv should probably be an inline function instead of a macro - ps3disk_open is not needed at all and should be removed completely. - please remove PS3DISK_MAJOR - and just pass 0 to register_blkdev. Passing 0 to get an unassigned dev_t range is the normal convention and giving it a suprising symbolic names makes reading the code a little harder. - put_disk in ps3disk_remove should be done after you finished tearing down the device, not before - calling free_irq directly followed by request_irq in ps3disk_probe looks rather dumb. I'd rather move the request_irq out of ps3stor_setup into the low-level driver. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, Jun 15, 2007 at 02:19:17PM -0700, David Miller wrote: Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. What's the problem with that? Partition machinery is perfectly fine with just getting a raw disk without a partition table, and it obviously doesn't care if the raw disk it sees is part of a partition on the storage server. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, Jun 15, 2007 at 01:39:23PM +0200, Geert Uytterhoeven wrote: From: Geert Uytterhoeven [EMAIL PROTECTED] Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather Looks good to me. Only nitpicks are: - ps3disk_priv should probably be an inline function instead of a macro - ps3disk_open is not needed at all and should be removed completely. - please remove PS3DISK_MAJOR - and just pass 0 to register_blkdev. Passing 0 to get an unassigned dev_t range is the normal convention and giving it a suprising symbolic names makes reading the code a little harder. - put_disk in ps3disk_remove should be done after you finished tearing down the device, not before - calling free_irq directly followed by request_irq in ps3disk_probe looks rather dumb. I'd rather move the request_irq out of ps3stor_setup into the low-level driver. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, Jun 15, 2007 at 04:08:58PM -0700, David Miller wrote: That's not gonna work, it's a totally different model. I have a predefined protocol over hypervisor provided channels and page flipping also done by the hypervisor for the bulk data transfer. For the client side I cannot change the hypervisor nor the server speaking on the other end. And when I do write a server I do want it to be able to speak to all of the existing clients. There's SCSI command pass through as well, as I keep mentioning as it's an important reason I don't want to go with any of the non-SCSI solutions (other than perhaps ATA) being suggested. A SCSI pass through is of course perfectly fine. If you have a separate block passthrough that has additional magic a separate block driver is the way to go because it actually is simpler than a scsi driver decoding command blocks and translating them to deep magic. The ps3 storage drivers this thread discussed are a good example for that. We now have a very nice and simple disk, scsi and flash chardev driver each that don't include abstractions layers and cruft. Combine that with their initial scsi layer driver that was full of internal dispatches because each of these device types speaks a completely different command set. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 15 Jun 2007, David Miller wrote: > From: Alan Cox <[EMAIL PROTECTED]> > Date: Fri, 15 Jun 2007 17:15:45 +0100 > > > > > Any particular reason why this is done as a separate block device driver > > > > rather than as SCSI? > > > > > > Because no new fake SCSI drivers are accepted anymore. > > > > Where did drivers/ata come from ;) > > > > How about making it a fake ata driver if James is being fussy 8) > > That sounds like a good idea for my virtual I/O case on > Niagara too actually :-) > > Another quirk I have to deal with is that under LDOMs you > can export full disks and also just slices. So I'll have > to get down into the partition machinery to support that > somehow. The PS3 hypervisor also splits each device in regions (cfr. partitions), with different access rights depending the OS that runs on top of it. The old virtual SCSI driver treated each region as a separate LUN. As currently only one region can be accessed by Linux anyway, I didn't bother supporting multiple accessible regions in the new storage drivers. With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 15 Jun 2007, David Miller wrote: From: Alan Cox [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 17:15:45 +0100 Any particular reason why this is done as a separate block device driver rather than as SCSI? Because no new fake SCSI drivers are accepted anymore. Where did drivers/ata come from ;) How about making it a fake ata driver if James is being fussy 8) That sounds like a good idea for my virtual I/O case on Niagara too actually :-) Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. The PS3 hypervisor also splits each device in regions (cfr. partitions), with different access rights depending the OS that runs on top of it. The old virtual SCSI driver treated each region as a separate LUN. As currently only one region can be accessed by Linux anyway, I didn't bother supporting multiple accessible regions in the new storage drivers. With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
From: James Bottomley <[EMAIL PROTECTED]> Date: Fri, 15 Jun 2007 16:28:03 -0700 > On Fri, 2007-06-15 at 16:08 -0700, David Miller wrote: > > From: James Bottomley <[EMAIL PROTECTED]> > > Date: Fri, 15 Jun 2007 15:40:42 -0700 > > > > > On Fri, 2007-06-15 at 14:19 -0700, David Miller wrote: > > > > Another quirk I have to deal with is that under LDOMs you > > > > can export full disks and also just slices. So I'll have > > > > to get down into the partition machinery to support that > > > > somehow. > > > > > > For this, it sounds like you might find nbd a more enticing > > > proposition ... it already is partition independent and is basically a > > > block to net socket exporter. > > > > That's not gonna work, it's a totally different model. > > > > I have a predefined protocol over hypervisor provided "channels" and > > page flipping also done by the hypervisor for the bulk data transfer. > > For the client side I cannot change the hypervisor nor the server > > speaking on the other end. And when I do write a server I do want > > it to be able to speak to all of the existing clients. > > > > There's SCSI command pass through as well, as I keep mentioning as > > it's an important reason I don't want to go with any of the non-SCSI > > solutions (other than perhaps ATA) being suggested. > > Then sure, use SCSI ... the ibmvscsi client originally talked to some > type of hypervisor interface too before IBM extracted it and open > sourced the server. If actual SCSI commands are going in somewhere ... > be it a real device, a RAID firmware emulation or a hypervisor input, > then I'm happy with the driver being in SCSI. For normal block I/O it's just raw copies over the provided protocol. But the service exports a service by which raw SCSI commands can be sent, for things like disk fault probing and stuff like that. It's not for block I/O, it's for "all the funny stuff" scsi comands are used for outside of actual data transfers. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 2007-06-15 at 16:08 -0700, David Miller wrote: > From: James Bottomley <[EMAIL PROTECTED]> > Date: Fri, 15 Jun 2007 15:40:42 -0700 > > > On Fri, 2007-06-15 at 14:19 -0700, David Miller wrote: > > > Another quirk I have to deal with is that under LDOMs you > > > can export full disks and also just slices. So I'll have > > > to get down into the partition machinery to support that > > > somehow. > > > > For this, it sounds like you might find nbd a more enticing > > proposition ... it already is partition independent and is basically a > > block to net socket exporter. > > That's not gonna work, it's a totally different model. > > I have a predefined protocol over hypervisor provided "channels" and > page flipping also done by the hypervisor for the bulk data transfer. > For the client side I cannot change the hypervisor nor the server > speaking on the other end. And when I do write a server I do want > it to be able to speak to all of the existing clients. > > There's SCSI command pass through as well, as I keep mentioning as > it's an important reason I don't want to go with any of the non-SCSI > solutions (other than perhaps ATA) being suggested. Then sure, use SCSI ... the ibmvscsi client originally talked to some type of hypervisor interface too before IBM extracted it and open sourced the server. If actual SCSI commands are going in somewhere ... be it a real device, a RAID firmware emulation or a hypervisor input, then I'm happy with the driver being in SCSI. James - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: James Bottomley <[EMAIL PROTECTED]> Date: Fri, 15 Jun 2007 15:40:42 -0700 > On Fri, 2007-06-15 at 14:19 -0700, David Miller wrote: > > Another quirk I have to deal with is that under LDOMs you > > can export full disks and also just slices. So I'll have > > to get down into the partition machinery to support that > > somehow. > > For this, it sounds like you might find nbd a more enticing > proposition ... it already is partition independent and is basically a > block to net socket exporter. That's not gonna work, it's a totally different model. I have a predefined protocol over hypervisor provided "channels" and page flipping also done by the hypervisor for the bulk data transfer. For the client side I cannot change the hypervisor nor the server speaking on the other end. And when I do write a server I do want it to be able to speak to all of the existing clients. There's SCSI command pass through as well, as I keep mentioning as it's an important reason I don't want to go with any of the non-SCSI solutions (other than perhaps ATA) being suggested. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
> That sounds like a good idea for my virtual I/O case on > Niagara too actually :-) It was actually meant semi-seriously in that drivers/ata sits on top of the abstract parts of drivers/scsi which James keeps asking for someone to get split properly off and which would sort all these out. > Another quirk I have to deal with is that under LDOMs you > can export full disks and also just slices. So I'll have > to get down into the partition machinery to support that > somehow. If your slices don't fit the PC worldview you might want to look at dmraid and just use device mapper to handle them. It is a lot more flexible and we could actually bin all our partition code and use this but for back compatibility. Alan - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 2007-06-15 at 14:19 -0700, David Miller wrote: > From: Alan Cox <[EMAIL PROTECTED]> > Date: Fri, 15 Jun 2007 17:15:45 +0100 > > > > > Any particular reason why this is done as a separate block device driver > > > > rather than as SCSI? > > > > > > Because no new fake SCSI drivers are accepted anymore. > > > > Where did drivers/ata come from ;) > > > > How about making it a fake ata driver if James is being fussy 8) > > That sounds like a good idea for my virtual I/O case on > Niagara too actually :-) I have no objections to VIO servers speaking SCSI ... if you want to do that, I suggest you look at an existing example, like drivers/scsi/ibmvscsi (the actual communication piece is very ppc hypervisor specific, though). However, I do strongly believe that using SCSI for devices which truly aren't SCSI (i.e. you have to code a shim in the driver between the SCSI commands and whatever your device speaks) is wrong ... if SCSI has features that the generic block layer doesn't, then we need to move the function from SCSI to block to give you access ... in theory this was the rationale for having libata as the last "fake" SCSI driver, so we could identify this functionality and begin to move it. > Another quirk I have to deal with is that under LDOMs you > can export full disks and also just slices. So I'll have > to get down into the partition machinery to support that > somehow. For this, it sounds like you might find nbd a more enticing proposition ... it already is partition independent and is basically a block to net socket exporter. James - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Jeff Garzik <[EMAIL PROTECTED]> Date: Fri, 15 Jun 2007 17:50:50 -0400 > FWIW that's why libata followed the path it did: faking SCSI required > the least amount of code for the maximal amount of existing storage > driver and platform installer support. > > Well, that and the fact that ATAPI is really SCSI, but that's offtopic > for this thread. :) Yep I absolutely understand that, and for my case as well it's nearly always SCSI underneath that's why you can send SCSI commands passthru to the virtual disk server if you like. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
David Miller wrote: It's senseless to make people build new major/minor numbers for all these new quirky storage drivers. People have to add support for the new major number to installers and all kinds of other tools. FWIW that's why libata followed the path it did: faking SCSI required the least amount of code for the maximal amount of existing storage driver and platform installer support. Well, that and the fact that ATAPI is really SCSI, but that's offtopic for this thread. :) Jeff - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Jeff Garzik <[EMAIL PROTECTED]> Date: Fri, 15 Jun 2007 17:28:31 -0400 > David Miller wrote: > > If the SCSI guys were smart, there would be a totally generic helper > > layer that allows anyone to hook into the SCSI layer as a virtual SCSI > > disk provider in like 10 lines of code. :-) > > The SCSI target code gives you the capability to do that (the SCSI > transport part, the virtual storage part is easy from there). I don't get to control the server side in my case, I'm a client talking to something with a pre-determined interface. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
David Miller wrote: From: Geert Uytterhoeven <[EMAIL PROTECTED]> Because no new fake SCSI drivers are accepted anymore. If you can access the firmware/hypervisor code, have that provide SCSI. Then the Linux driver piece is easy, obvious and flexible SCSI, and is not "fake." If the SCSI guys were smart, there would be a totally generic helper layer that allows anyone to hook into the SCSI layer as a virtual SCSI disk provider in like 10 lines of code. :-) The SCSI target code gives you the capability to do that (the SCSI transport part, the virtual storage part is easy from there). Jeff - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Alan Cox <[EMAIL PROTECTED]> Date: Fri, 15 Jun 2007 17:15:45 +0100 > > > Any particular reason why this is done as a separate block device driver > > > rather than as SCSI? > > > > Because no new fake SCSI drivers are accepted anymore. > > Where did drivers/ata come from ;) > > How about making it a fake ata driver if James is being fussy 8) That sounds like a good idea for my virtual I/O case on Niagara too actually :-) Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Geert Uytterhoeven <[EMAIL PROTECTED]> Date: Fri, 15 Jun 2007 16:43:05 +0200 (CEST) > On Fri, 15 Jun 2007, David Woodhouse wrote: > > On Fri, 2007-06-15 at 13:39 +0200, Geert Uytterhoeven wrote: > > > Add a Disk Storage Driver for the PS3: > > > - Implemented as a block device driver with a dynamic major > > > - Disk names (and partitions) are of the format ps3d%c(%u) > > > - Uses software scatter-gather with a 64 KiB bounce buffer as the > > > hypervisor > > > doesn't support scatter-gather > > > > Any particular reason why this is done as a separate block device driver > > rather than as SCSI? > > Because no new fake SCSI drivers are accepted anymore. I'm strongly divided on this issue as I'm about to hit the same exact thing for Sun Logical Domains on sparc64 Niagara systems. In fact the interface I get to use allows SCSI commands to be sent pass-through to the device, even though the basic virtual I/O API is purely block I/O based. It's senseless to make people build new major/minor numbers for all these new quirky storage drivers. People have to add support for the new major number to installers and all kinds of other tools. If the SCSI guys were smart, there would be a totally generic helper layer that allows anyone to hook into the SCSI layer as a virtual SCSI disk provider in like 10 lines of code. :-) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 15 Jun 2007, Alan Cox wrote: > > > Any particular reason why this is done as a separate block device driver > > > rather than as SCSI? > > > > Because no new fake SCSI drivers are accepted anymore. > > Where did drivers/ata come from ;) I was told that one got in just before the moratorium on fake SCSI. > How about making it a fake ata driver if James is being fussy 8) I don't think Christoph likes fake ATA drivers neither ;-) With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
> > Any particular reason why this is done as a separate block device driver > > rather than as SCSI? > > Because no new fake SCSI drivers are accepted anymore. Where did drivers/ata come from ;) How about making it a fake ata driver if James is being fussy 8) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 15 Jun 2007, David Woodhouse wrote: > On Fri, 2007-06-15 at 13:39 +0200, Geert Uytterhoeven wrote: > > Add a Disk Storage Driver for the PS3: > > - Implemented as a block device driver with a dynamic major > > - Disk names (and partitions) are of the format ps3d%c(%u) > > - Uses software scatter-gather with a 64 KiB bounce buffer as the > > hypervisor > > doesn't support scatter-gather > > Any particular reason why this is done as a separate block device driver > rather than as SCSI? Because no new fake SCSI drivers are accepted anymore. With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
On Friday 15 June 2007, David Woodhouse wrote: > > On Fri, 2007-06-15 at 13:39 +0200, Geert Uytterhoeven wrote: > > Add a Disk Storage Driver for the PS3: > > - Implemented as a block device driver with a dynamic major > > - Disk names (and partitions) are of the format ps3d%c(%u) > > - Uses software scatter-gather with a 64 KiB bounce buffer as the > > hypervisor > > doesn't support scatter-gather > > Any particular reason why this is done as a separate block device driver > rather than as SCSI? Because the hypervisor interface is based on tranferring blocks, not based on SCSI commands like the one for the optical storage drive. The first version of this driver actually was based on SCSI command emulation, and in an earlier round of reviews it was decided to rewrite it to use the simpler block interface directly. Arnd <>< - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 2007-06-15 at 13:39 +0200, Geert Uytterhoeven wrote: > Add a Disk Storage Driver for the PS3: > - Implemented as a block device driver with a dynamic major > - Disk names (and partitions) are of the format ps3d%c(%u) > - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor > doesn't support scatter-gather Any particular reason why this is done as a separate block device driver rather than as SCSI? -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[patch 4/6] ps3: Disk Storage Driver
From: Geert Uytterhoeven <[EMAIL PROTECTED]> Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather CC: Geoff Levand <[EMAIL PROTECTED]> Signed-off-by: Geert Uytterhoeven <[EMAIL PROTECTED]> --- Changes since previous submission: o Don't use `default y' in Kconfig o Remove the thread for handling requests o Set up sysfs links between block device and PS3 system device: . /sys/block/ps3da/device -> ../../devices/ps3_system/sb_02 . /sys/devices/ps3_system/sb_02/block:ps3da -> ../../../block/ps3da o Fix all FIXMEs o Implement proper barrier support o Call add_disk_randomness() o Add a test to verify we are running on a PS3 o Fix error path in ps3disk_init() o Fix cleanup order in ps3disk_exit() arch/powerpc/platforms/ps3/Kconfig | 10 drivers/block/Makefile |1 drivers/block/ps3disk.c| 526 + 3 files changed, 537 insertions(+) --- a/arch/powerpc/platforms/ps3/Kconfig +++ b/arch/powerpc/platforms/ps3/Kconfig @@ -102,4 +102,14 @@ config PS3_STORAGE depends on PPC_PS3 tristate +config PS3_DISK + tristate "PS3 Disk Storage Driver" + depends on PPC_PS3 && BLOCK + select PS3_STORAGE + help + Include support for the PS3 Disk Storage. + + This support is required to access the PS3 hard disk. + In general, all users will say Y or M. + endmenu --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -29,3 +29,4 @@ obj-$(CONFIG_VIODASD) += viodasd.o obj-$(CONFIG_BLK_DEV_SX8) += sx8.o obj-$(CONFIG_BLK_DEV_UB) += ub.o +obj-$(CONFIG_PS3_DISK) += ps3disk.o --- /dev/null +++ b/drivers/block/ps3disk.c @@ -0,0 +1,526 @@ +/* + * PS3 Disk Storage Driver + * + * Copyright (C) 2007 Sony Computer Entertainment Inc. + * Copyright 2007 Sony Corp. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published + * by the Free Software Foundation; version 2 of the License. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +#define DEVICE_NAME"ps3disk" + +#define BOUNCE_SIZE(64*1024) + +#define PS3DISK_MAJOR 0 + +#define PS3DISK_MAX_DISKS 16 +#define PS3DISK_MINORS 16 + +#define KERNEL_SECTOR_SIZE 512 + + +#define PS3DISK_NAME "ps3d%c" + +#define LV1_STORAGE_ATA_HDDOUT (0x23) + + +struct ps3disk_private { + spinlock_t lock;/* Request queue spinlock */ + struct request_queue *queue; + struct gendisk *gendisk; + unsigned int blocking_factor; + struct request *req; +}; +#define ps3disk_priv(dev) ((dev)->sbd.core.driver_data) + +static int ps3disk_major = PS3DISK_MAJOR; + + +static int ps3disk_open(struct inode *inode, struct file *file) +{ + struct ps3_storage_device *dev = inode->i_bdev->bd_disk->private_data; + + file->private_data = dev; + return 0; +} + +static struct block_device_operations ps3disk_fops = { + .owner = THIS_MODULE, + .open = ps3disk_open, +}; + + +static void ps3disk_scatter_gather(struct ps3_storage_device *dev, + struct request *req, int gather) +{ + unsigned int sectors = 0, offset = 0; + struct bio *bio; + sector_t sector; + struct bio_vec *bvec; + unsigned int i = 0, j; + size_t size; + void *buf; + + rq_for_each_bio(bio, req) { + sector = bio->bi_sector; + dev_dbg(>sbd.core, + "%s:%u: bio %u: %u segs %u sectors from %lu\n", + __func__, __LINE__, i, bio_segments(bio), + bio_sectors(bio), sector); + bio_for_each_segment(bvec, bio, j) { + size = bio_cur_sectors(bio)*KERNEL_SECTOR_SIZE; + buf = __bio_kmap_atomic(bio, j, KM_USER0); + if (gather) + memcpy(dev->bounce_buf+offset, buf, size); + else + memcpy(buf, dev->bounce_buf+offset, size); +
[patch 4/6] ps3: Disk Storage Driver
From: Geert Uytterhoeven [EMAIL PROTECTED] Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather CC: Geoff Levand [EMAIL PROTECTED] Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED] --- Changes since previous submission: o Don't use `default y' in Kconfig o Remove the thread for handling requests o Set up sysfs links between block device and PS3 system device: . /sys/block/ps3da/device - ../../devices/ps3_system/sb_02 . /sys/devices/ps3_system/sb_02/block:ps3da - ../../../block/ps3da o Fix all FIXMEs o Implement proper barrier support o Call add_disk_randomness() o Add a test to verify we are running on a PS3 o Fix error path in ps3disk_init() o Fix cleanup order in ps3disk_exit() arch/powerpc/platforms/ps3/Kconfig | 10 drivers/block/Makefile |1 drivers/block/ps3disk.c| 526 + 3 files changed, 537 insertions(+) --- a/arch/powerpc/platforms/ps3/Kconfig +++ b/arch/powerpc/platforms/ps3/Kconfig @@ -102,4 +102,14 @@ config PS3_STORAGE depends on PPC_PS3 tristate +config PS3_DISK + tristate PS3 Disk Storage Driver + depends on PPC_PS3 BLOCK + select PS3_STORAGE + help + Include support for the PS3 Disk Storage. + + This support is required to access the PS3 hard disk. + In general, all users will say Y or M. + endmenu --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -29,3 +29,4 @@ obj-$(CONFIG_VIODASD) += viodasd.o obj-$(CONFIG_BLK_DEV_SX8) += sx8.o obj-$(CONFIG_BLK_DEV_UB) += ub.o +obj-$(CONFIG_PS3_DISK) += ps3disk.o --- /dev/null +++ b/drivers/block/ps3disk.c @@ -0,0 +1,526 @@ +/* + * PS3 Disk Storage Driver + * + * Copyright (C) 2007 Sony Computer Entertainment Inc. + * Copyright 2007 Sony Corp. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published + * by the Free Software Foundation; version 2 of the License. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include linux/dma-mapping.h +#include linux/blkdev.h +#include linux/freezer.h +#include linux/hdreg.h +#include linux/interrupt.h +#include linux/kthread.h + +#include asm/lv1call.h +#include asm/ps3stor.h +#include asm/firmware.h + + +#define DEVICE_NAMEps3disk + +#define BOUNCE_SIZE(64*1024) + +#define PS3DISK_MAJOR 0 + +#define PS3DISK_MAX_DISKS 16 +#define PS3DISK_MINORS 16 + +#define KERNEL_SECTOR_SIZE 512 + + +#define PS3DISK_NAME ps3d%c + +#define LV1_STORAGE_ATA_HDDOUT (0x23) + + +struct ps3disk_private { + spinlock_t lock;/* Request queue spinlock */ + struct request_queue *queue; + struct gendisk *gendisk; + unsigned int blocking_factor; + struct request *req; +}; +#define ps3disk_priv(dev) ((dev)-sbd.core.driver_data) + +static int ps3disk_major = PS3DISK_MAJOR; + + +static int ps3disk_open(struct inode *inode, struct file *file) +{ + struct ps3_storage_device *dev = inode-i_bdev-bd_disk-private_data; + + file-private_data = dev; + return 0; +} + +static struct block_device_operations ps3disk_fops = { + .owner = THIS_MODULE, + .open = ps3disk_open, +}; + + +static void ps3disk_scatter_gather(struct ps3_storage_device *dev, + struct request *req, int gather) +{ + unsigned int sectors = 0, offset = 0; + struct bio *bio; + sector_t sector; + struct bio_vec *bvec; + unsigned int i = 0, j; + size_t size; + void *buf; + + rq_for_each_bio(bio, req) { + sector = bio-bi_sector; + dev_dbg(dev-sbd.core, + %s:%u: bio %u: %u segs %u sectors from %lu\n, + __func__, __LINE__, i, bio_segments(bio), + bio_sectors(bio), sector); + bio_for_each_segment(bvec, bio, j) { + size = bio_cur_sectors(bio)*KERNEL_SECTOR_SIZE; + buf = __bio_kmap_atomic(bio, j, KM_USER0); + if (gather) + memcpy(dev-bounce_buf+offset, buf, size); +
Re: [patch 4/6] ps3: Disk Storage Driver
On Friday 15 June 2007, David Woodhouse wrote: On Fri, 2007-06-15 at 13:39 +0200, Geert Uytterhoeven wrote: Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather Any particular reason why this is done as a separate block device driver rather than as SCSI? Because the hypervisor interface is based on tranferring blocks, not based on SCSI commands like the one for the optical storage drive. The first version of this driver actually was based on SCSI command emulation, and in an earlier round of reviews it was decided to rewrite it to use the simpler block interface directly. Arnd - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 2007-06-15 at 13:39 +0200, Geert Uytterhoeven wrote: Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather Any particular reason why this is done as a separate block device driver rather than as SCSI? -- dwmw2 - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 15 Jun 2007, David Woodhouse wrote: On Fri, 2007-06-15 at 13:39 +0200, Geert Uytterhoeven wrote: Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather Any particular reason why this is done as a separate block device driver rather than as SCSI? Because no new fake SCSI drivers are accepted anymore. With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
Any particular reason why this is done as a separate block device driver rather than as SCSI? Because no new fake SCSI drivers are accepted anymore. Where did drivers/ata come from ;) How about making it a fake ata driver if James is being fussy 8) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 15 Jun 2007, Alan Cox wrote: Any particular reason why this is done as a separate block device driver rather than as SCSI? Because no new fake SCSI drivers are accepted anymore. Where did drivers/ata come from ;) I was told that one got in just before the moratorium on fake SCSI. How about making it a fake ata driver if James is being fussy 8) I don't think Christoph likes fake ATA drivers neither ;-) With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
Re: [patch 4/6] ps3: Disk Storage Driver
From: Geert Uytterhoeven [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 16:43:05 +0200 (CEST) On Fri, 15 Jun 2007, David Woodhouse wrote: On Fri, 2007-06-15 at 13:39 +0200, Geert Uytterhoeven wrote: Add a Disk Storage Driver for the PS3: - Implemented as a block device driver with a dynamic major - Disk names (and partitions) are of the format ps3d%c(%u) - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor doesn't support scatter-gather Any particular reason why this is done as a separate block device driver rather than as SCSI? Because no new fake SCSI drivers are accepted anymore. I'm strongly divided on this issue as I'm about to hit the same exact thing for Sun Logical Domains on sparc64 Niagara systems. In fact the interface I get to use allows SCSI commands to be sent pass-through to the device, even though the basic virtual I/O API is purely block I/O based. It's senseless to make people build new major/minor numbers for all these new quirky storage drivers. People have to add support for the new major number to installers and all kinds of other tools. If the SCSI guys were smart, there would be a totally generic helper layer that allows anyone to hook into the SCSI layer as a virtual SCSI disk provider in like 10 lines of code. :-) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Alan Cox [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 17:15:45 +0100 Any particular reason why this is done as a separate block device driver rather than as SCSI? Because no new fake SCSI drivers are accepted anymore. Where did drivers/ata come from ;) How about making it a fake ata driver if James is being fussy 8) That sounds like a good idea for my virtual I/O case on Niagara too actually :-) Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
David Miller wrote: From: Geert Uytterhoeven [EMAIL PROTECTED] Because no new fake SCSI drivers are accepted anymore. If you can access the firmware/hypervisor code, have that provide SCSI. Then the Linux driver piece is easy, obvious and flexible SCSI, and is not fake. If the SCSI guys were smart, there would be a totally generic helper layer that allows anyone to hook into the SCSI layer as a virtual SCSI disk provider in like 10 lines of code. :-) The SCSI target code gives you the capability to do that (the SCSI transport part, the virtual storage part is easy from there). Jeff - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Jeff Garzik [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 17:28:31 -0400 David Miller wrote: If the SCSI guys were smart, there would be a totally generic helper layer that allows anyone to hook into the SCSI layer as a virtual SCSI disk provider in like 10 lines of code. :-) The SCSI target code gives you the capability to do that (the SCSI transport part, the virtual storage part is easy from there). I don't get to control the server side in my case, I'm a client talking to something with a pre-determined interface. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
David Miller wrote: It's senseless to make people build new major/minor numbers for all these new quirky storage drivers. People have to add support for the new major number to installers and all kinds of other tools. FWIW that's why libata followed the path it did: faking SCSI required the least amount of code for the maximal amount of existing storage driver and platform installer support. Well, that and the fact that ATAPI is really SCSI, but that's offtopic for this thread. :) Jeff - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: Jeff Garzik [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 17:50:50 -0400 FWIW that's why libata followed the path it did: faking SCSI required the least amount of code for the maximal amount of existing storage driver and platform installer support. Well, that and the fact that ATAPI is really SCSI, but that's offtopic for this thread. :) Yep I absolutely understand that, and for my case as well it's nearly always SCSI underneath that's why you can send SCSI commands passthru to the virtual disk server if you like. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 2007-06-15 at 14:19 -0700, David Miller wrote: From: Alan Cox [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 17:15:45 +0100 Any particular reason why this is done as a separate block device driver rather than as SCSI? Because no new fake SCSI drivers are accepted anymore. Where did drivers/ata come from ;) How about making it a fake ata driver if James is being fussy 8) That sounds like a good idea for my virtual I/O case on Niagara too actually :-) I have no objections to VIO servers speaking SCSI ... if you want to do that, I suggest you look at an existing example, like drivers/scsi/ibmvscsi (the actual communication piece is very ppc hypervisor specific, though). However, I do strongly believe that using SCSI for devices which truly aren't SCSI (i.e. you have to code a shim in the driver between the SCSI commands and whatever your device speaks) is wrong ... if SCSI has features that the generic block layer doesn't, then we need to move the function from SCSI to block to give you access ... in theory this was the rationale for having libata as the last fake SCSI driver, so we could identify this functionality and begin to move it. Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. For this, it sounds like you might find nbd a more enticing proposition ... it already is partition independent and is basically a block to net socket exporter. James - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
That sounds like a good idea for my virtual I/O case on Niagara too actually :-) It was actually meant semi-seriously in that drivers/ata sits on top of the abstract parts of drivers/scsi which James keeps asking for someone to get split properly off and which would sort all these out. Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. If your slices don't fit the PC worldview you might want to look at dmraid and just use device mapper to handle them. It is a lot more flexible and we could actually bin all our partition code and use this but for back compatibility. Alan - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: James Bottomley [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 15:40:42 -0700 On Fri, 2007-06-15 at 14:19 -0700, David Miller wrote: Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. For this, it sounds like you might find nbd a more enticing proposition ... it already is partition independent and is basically a block to net socket exporter. That's not gonna work, it's a totally different model. I have a predefined protocol over hypervisor provided channels and page flipping also done by the hypervisor for the bulk data transfer. For the client side I cannot change the hypervisor nor the server speaking on the other end. And when I do write a server I do want it to be able to speak to all of the existing clients. There's SCSI command pass through as well, as I keep mentioning as it's an important reason I don't want to go with any of the non-SCSI solutions (other than perhaps ATA) being suggested. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
On Fri, 2007-06-15 at 16:08 -0700, David Miller wrote: From: James Bottomley [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 15:40:42 -0700 On Fri, 2007-06-15 at 14:19 -0700, David Miller wrote: Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. For this, it sounds like you might find nbd a more enticing proposition ... it already is partition independent and is basically a block to net socket exporter. That's not gonna work, it's a totally different model. I have a predefined protocol over hypervisor provided channels and page flipping also done by the hypervisor for the bulk data transfer. For the client side I cannot change the hypervisor nor the server speaking on the other end. And when I do write a server I do want it to be able to speak to all of the existing clients. There's SCSI command pass through as well, as I keep mentioning as it's an important reason I don't want to go with any of the non-SCSI solutions (other than perhaps ATA) being suggested. Then sure, use SCSI ... the ibmvscsi client originally talked to some type of hypervisor interface too before IBM extracted it and open sourced the server. If actual SCSI commands are going in somewhere ... be it a real device, a RAID firmware emulation or a hypervisor input, then I'm happy with the driver being in SCSI. James - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 4/6] ps3: Disk Storage Driver
From: James Bottomley [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 16:28:03 -0700 On Fri, 2007-06-15 at 16:08 -0700, David Miller wrote: From: James Bottomley [EMAIL PROTECTED] Date: Fri, 15 Jun 2007 15:40:42 -0700 On Fri, 2007-06-15 at 14:19 -0700, David Miller wrote: Another quirk I have to deal with is that under LDOMs you can export full disks and also just slices. So I'll have to get down into the partition machinery to support that somehow. For this, it sounds like you might find nbd a more enticing proposition ... it already is partition independent and is basically a block to net socket exporter. That's not gonna work, it's a totally different model. I have a predefined protocol over hypervisor provided channels and page flipping also done by the hypervisor for the bulk data transfer. For the client side I cannot change the hypervisor nor the server speaking on the other end. And when I do write a server I do want it to be able to speak to all of the existing clients. There's SCSI command pass through as well, as I keep mentioning as it's an important reason I don't want to go with any of the non-SCSI solutions (other than perhaps ATA) being suggested. Then sure, use SCSI ... the ibmvscsi client originally talked to some type of hypervisor interface too before IBM extracted it and open sourced the server. If actual SCSI commands are going in somewhere ... be it a real device, a RAID firmware emulation or a hypervisor input, then I'm happy with the driver being in SCSI. For normal block I/O it's just raw copies over the provided protocol. But the service exports a service by which raw SCSI commands can be sent, for things like disk fault probing and stuff like that. It's not for block I/O, it's for all the funny stuff scsi comands are used for outside of actual data transfers. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/