Re: Debugging scsi abort handling ?

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 14:26, Hans de Goede ha scritto: Then, blk_complete_request will do nothing because its call to blk_mark_rq_complete returns true. All this, of course, as long as -scsi_done is called _before_ eh_abort returns. What about calling scsi_done after eh_abort if eh_abort

Re: Debugging scsi abort handling ?

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 16:17, Hannes Reinecke ha scritto: As mentioned earlier, as soon as SCSI EH is invoked control is assumed to be transferred back to the SCSI midlayer. How the midlayer interprets any return value from the various eh_XX callbacks is immaterial to the LLDD. So even if the

Re: Debugging scsi abort handling ?

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 17:50, Elliott, Robert (Server Storage) ha scritto: Is the block layer prevented from issuing a new command with the same tag before the error handling is finished? Tags are chosen by the LLDs, so it's up to it to pick the right tags. Paolo -- To unsubscribe from this list: send

Re: Debugging scsi abort handling ?

2014-08-29 Thread Paolo Bonzini
Il 29/08/2014 08:08, Hannes Reinecke ha scritto: No. FAILED for any eh_abort_cmd() means that the TMF hasn't been sent. So the midlayer escalates to the next EH step. The command will only ever be re-issued once EH completes. Then the answer to Hans's question is yes. It is legal to call

Re: [PATCH] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT

2014-10-09 Thread Paolo Bonzini
Il 09/10/2014 06:14, Nicholas A. Bellinger ha scritto: AFAICT from qemu code, the ioctl VHOST_SCSI_CLEAR_ENDPOINT is always called during shutdown in order to release the endpoint and drop this new configfs dependency. As far as I can see, the only path leading to the ioctl is

Re: [PATCH] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT

2014-10-09 Thread Paolo Bonzini
Il 09/10/2014 10:49, Paolo Bonzini ha scritto: It does not happen if you close QEMU with SIGTERM, ctrl-c, or with the quit command, because no attempt is done to bring down the VM data structures (or free memory, or close file descriptors) in case of a fatal exit. The kernel should do

Re: [PATCH 2/2] virtio_scsi: support multi hw queue of blk-mq

2014-11-10 Thread Paolo Bonzini
On 09/11/2014 17:57, Ming Lei wrote: Since virtio_scsi has supported multi virtqueue already, it is natural to map virtque to hw-queue of blk-mq. Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/scsi/virtio_scsi.c | 154

Re: [PATCH 2/3] sd: Disable discard_zeroes_data for UNMAP

2014-11-10 Thread Paolo Bonzini
sd_config_discard(sdkp, SD_LBP_DISABLE); } Reviewed-by: Paolo Bonzini pbonz...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [PATCH 2/2] virtio_scsi: support multi hw queue of blk-mq

2014-11-11 Thread Paolo Bonzini
On 10/11/2014 17:05, Christoph Hellwig wrote: a) there is no multiath support for it, and we simply can't break existing setups that use. b) there is no support for I/O schedulers at all. This might be okay for virtio-scsi, where in general you have a host scheduler, but for

Re: [PATCH V1] virtio_scsi: support multi hw queue of blk-mq

2014-11-17 Thread Paolo Bonzini
On 15/11/2014 04:47, Ming Lei wrote: Since virtio_scsi has supported multi virtqueue already, it is natural to map the virtque to hw-queue of blk-mq. Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Ming Lei ming@canonical.com --- V1: - support non-mq too drivers/scsi

Re: [PATCH 01/10] esp_scsi: spellcheck 'driver'

2014-11-21 Thread Paolo Bonzini
/esp_scsi.h +++ b/drivers/scsi/esp_scsi.h @@ -1,4 +1,4 @@ -/* esp_scsi.h: Defines and structures for the ESP drier. +/* esp_scsi.h: Defines and structures for the ESP driver. * * Copyright (C) 2007 David S. Miller (da...@davemloft.net) */ A good start. :) Reviewed-by: Paolo Bonzini pbonz

Re: [PATCH 02/10] esp_scsi: make number of tags configurable

2014-11-21 Thread Paolo Bonzini
num_tags; struct list_headesp_cmd_pool; Reviewed-by: Paolo Bonzini pbonz...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH 04/10] esp_scsi: debug event and command

2014-11-21 Thread Paolo Bonzini
); switch (esp-event) { case ESP_EVENT_CHECK_PHASE: switch (esp-sreg ESP_STAT_PMASK) { Reviewed-by: Paolo Bonzini pbonz...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More

Re: [PATCH 03/10] esp_scsi: convert to dev_printk

2014-11-21 Thread Paolo Bonzini
-by: Paolo Bonzini pbonz...@redhat.com Paolo -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 05/10] esp_scsi: read status registers

2014-11-21 Thread Paolo Bonzini
On 21/11/2014 10:27, Hannes Reinecke wrote: A read to ESP_INTRPT will clear ESP_STATUS and ESP_SSTEP. So read all status registers in one go to avoid losing information. (ESP_STAT_TCNT is actually kept in the status register, it is cleared by writing TCLO/MID/HI). Reviewed-by: Paolo Bonzini

Re: [PATCH 07/10] esp: Use FIFO for command submission

2014-11-21 Thread Paolo Bonzini
On 21/11/2014 10:27, Hannes Reinecke wrote: The am53c974 has a design flaw causing it to throw an DMA interrupt whenever a DMA transmission completed, even though DMA interrupt reporting is disabled. This confuses the esp routines as it would register a DMA interrupt whenever a cdb has been

Re: [PATCH 10/10] esp: enable CONFIG2_FENAB for am53c974

2014-11-21 Thread Paolo Bonzini
On 21/11/2014 10:27, Hannes Reinecke wrote: CONFIG2_FENAB ('feature enable') changed definition between chip revisions, from 'Latch SCSI Phase' to 'Latch SCSI Phase, display chip ID upon reset, and enable 24 bit addresses'. So only enable it for am53c974 where we know what it's doing.

Re: [PATCH 08/10] am53c974: BLAST residual handling

2014-11-21 Thread Paolo Bonzini
On 21/11/2014 10:27, Hannes Reinecke wrote: The am53c974 has an design issue where a single byte might be left in the SCSI FIFO after a DMA transfer. As the handling code is currently untested add a WARN_ON() statement here. Signed-off-by: Hannes Reinecke h...@suse.de ---

Re: [PATCH 09/10] esp: correctly detect am53c974

2014-11-21 Thread Paolo Bonzini
config1; u8 config2; + u8 config4; u8 scsi_id; u32 scsi_id_mask; Reviewed-by: Paolo Bonzini pbonz...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH 06/10] scsi: add 'am53c974' driver

2014-11-21 Thread Paolo Bonzini
On 21/11/2014 10:27, Hannes Reinecke wrote: This patch adds a new implementation for the Tekram DC-390T / AMD AM53c974 SCSI controller, based on the generic esp_scsi infrastructure. Signed-off-by: Hannes Reinecke h...@suse.de --- drivers/scsi/Kconfig| 18 ++ drivers/scsi/Makefile

Re: [PATCH 06/10] scsi: add 'am53c974' driver

2014-11-21 Thread Paolo Bonzini
Oops, hit send too early. A small nit: On 21/11/2014 10:27, Hannes Reinecke wrote: +static void pci_esp_dma_drain(struct esp *esp) +{ + u8 resid; + int lim = 1000; + + + if ((esp-sreg ESP_STAT_PMASK) == ESP_DOP || + (esp-sreg ESP_STAT_PMASK) == ESP_DIP) +

Re: [PATCH 07/10] esp: Use FIFO for command submission

2014-11-21 Thread Paolo Bonzini
On 21/11/2014 11:38, Hannes Reinecke wrote: esp-msg_out_len = 0; *p++ = IDENTIFY(0, lun); @@ -648,12 +651,21 @@ static void esp_autosense(struct esp *esp, struct esp_cmd_entry *ent) esp_write_tgt_sync(esp, tgt); esp_write_tgt_config3(esp, tgt); - val = (p -

Re: [PATCH 10/10] esp: enable CONFIG2_FENAB for am53c974

2014-11-21 Thread Paolo Bonzini
On 21/11/2014 11:22, Hannes Reinecke wrote: On 11/21/2014 11:08 AM, Paolo Bonzini wrote: On 21/11/2014 10:27, Hannes Reinecke wrote: CONFIG2_FENAB ('feature enable') changed definition between chip revisions, from 'Latch SCSI Phase' to 'Latch SCSI Phase, display chip ID upon reset

Re: [PATCH 06/12] esp_scsi: use FIFO for command submission

2014-11-21 Thread Paolo Bonzini
ESP_FLAG_USE_FIFO0x0040 u8 select_state; #define ESP_SELECT_NONE 0x00 /* Not selecting */ Reviewed-by: Paolo Bonzini pbonz...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord

Re: [PATCH] SCSI: SD: set max_ws_blocks as max_unmap_blocks if it isn't provided

2014-12-05 Thread Paolo Bonzini
) sd_config_discard(sdkp, SD_LBP_WS16); else if (sdkp-lbpws10) sd_config_discard(sdkp, SD_LBP_WS10); This is the right fix. Ming, how do you reproduce the QEMU bug? Acked-by: Paolo Bonzini pbonz...@redhat.com -- To unsubscribe from

Re: [PATCH] SCSI: SD: set max_ws_blocks as max_unmap_blocks if it isn't provided

2014-12-05 Thread Paolo Bonzini
On 05/12/2014 14:05, Ming Lei wrote: [ 50.112885] sd 0:0:1:0: [sda] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 50.113859] sd 0:0:1:0: [sda] Sense Key : Illegal Request [current] [ 50.113859] sd 0:0:1:0: [sda] Add. Sense: Invalid field in cdb [ 50.113859] sd 0:0:1:0:

Re: [PATCH 1/3] libata: Whitelist SSDs that are known to properly return zeroes after TRIM

2014-12-05 Thread Paolo Bonzini
On 07/11/2014 06:08, Martin K. Petersen wrote: The whitelist is only meant as a starting point and is by no means comprehensive: - All intel SSD models except for 510 - Micron M5* - Samsung SSDs - Seagate SSDs Signed-off-by: Martin K. Petersen martin.peter...@oracle.com

[PATCH v2 2/3] scsi: create an all-zero filter for scanners

2012-09-25 Thread Paolo Bonzini
Using /dev/sg for scanners is blocked from unprivileged users. Reimplement this using customizable command filters, so that the sysfs knobs will work in this case too. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: OOM check [Alan Cox

Re: [PATCH 0/2] virtio-scsi fixes for 3.6

2012-10-01 Thread Paolo Bonzini
Il 26/07/2012 15:28, Paolo Bonzini ha scritto: James, patch 1 fixes scanning of LUNs whose number is greater than 255. QEMU passes a max_lun of 16383 (because it uses SAM numbering) but in Linux it must become 32768 (because LUNs above 255 are relocated to 16640). Patch 2 is a resubmission

Re: [PATCH] [SCSI] virtio-scsi: Initialize scatterlist structure.

2012-10-01 Thread Paolo Bonzini
Il 20/08/2012 16:05, Paolo Bonzini ha scritto: Il 20/08/2012 16:04, Richard W.M. Jones ha scritto: From: Richard W.M. Jones rjo...@redhat.com The sg struct is used without being initialized. https://bugzilla.redhat.com/show_bug.cgi?id=847548 Signed-off-by: Richard W.M. Jones rjo

Re: [PATCH] [SCSI] virtio-scsi: Initialize scatterlist structure.

2012-10-01 Thread Paolo Bonzini
Il 01/10/2012 15:18, Richard W.M. Jones ha scritto: On Mon, Oct 01, 2012 at 03:13:01PM +0200, Paolo Bonzini wrote: Il 20/08/2012 16:05, Paolo Bonzini ha scritto: Il 20/08/2012 16:04, Richard W.M. Jones ha scritto: From: Richard W.M. Jones rjo...@redhat.com The sg struct is used without being

Re: [PATCH 0/2] virtio-scsi fixes for 3.6

2012-10-02 Thread Paolo Bonzini
Il 02/10/2012 10:18, James Bottomley ha scritto: On Mon, 2012-10-01 at 15:11 +0200, Paolo Bonzini wrote: Il 26/07/2012 15:28, Paolo Bonzini ha scritto: James, patch 1 fixes scanning of LUNs whose number is greater than 255. QEMU passes a max_lun of 16383 (because it uses SAM numbering

[PATCH 0/3] virtio-scsi updates for 3.7

2012-10-02 Thread Paolo Bonzini
James, here is a resend of the three pending patches for virtio-scsi, with the bugfix first. Thanks, Paolo Paolo Bonzini (2): virtio-scsi: fix LUNs greater than 255 virtio-scsi: support online resizing of disks Richard W.M. Jones (1): virtio-scsi: initialize scatterlist structure

[PATCH 1/3] virtio-scsi: initialize scatterlist structure

2012-10-02 Thread Paolo Bonzini
From: Richard W.M. Jones rjo...@redhat.com The sg struct is used without being initialized, which breaks when CONFIG_DEBUG_SG is enabled. Cc: sta...@vger.kernel.org Signed-off-by: Richard W.M. Jones rjo...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi

[PATCH 3/3] virtio-scsi: support online resizing of disks

2012-10-02 Thread Paolo Bonzini
capacity change from 22548578304 to 23622320128 Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 31 ++- include/linux/virtio_scsi.h |2 ++ 2 files changed, 32 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b

[PATCH 2/3] virtio-scsi: fix LUNs greater than 255

2012-10-02 Thread Paolo Bonzini
with the flat format. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 7554d78..a7cf726 100644 --- a/drivers/scsi/virtio_scsi.c +++ b

Re: [PATCH v2 0/3] block: add queue-private command filter, editable via sysfs

2012-10-04 Thread Paolo Bonzini
Il 25/09/2012 17:30, Paolo Bonzini ha scritto: The set of use cases for SG_IO is quite variable that no single filter can accomodate all of them. The current filter is tailored very much to CD burning, and includes many MMC-specific commands that may have other meanings in different standards

Re: [PATCH v2 0/3] block: add queue-private command filter, editable via sysfs

2012-10-19 Thread Paolo Bonzini
In one use case, the administrator then needs the ability to configure devices easily, for example to be much more restrictive on non-MMC devices. It must be done with the same tools it uses for other aspects of the policy---which will be a combination of DAC (Unix permissions and ACLs)

Re: [PATCH 0/5] virtio-scsi: create a separate workqueue

2012-11-07 Thread Paolo Bonzini
variable gfp_mask virtio-scsi: use pr_err instead of printk virtio-scsi: create a separate work queue for virtio-scsi virtio-scsi: tidy up the goto label in init() Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Rusty Russell ru

Re: [PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-09 Thread Paolo Bonzini
tgt-tgt_lock while invoking the calls to virtio_ring.c:virtqueue_add_buf() and friends. This bug was originally introduced in v3.5-rc7 code with: commit 2bd37f0fde99cbf8b78fb55f1128e8c3a63cf1da Author: Paolo Bonzini pbonz...@redhat.com Date: Wed Jun 13 16:56:34 2012 +0200 [SCSI

Re: [PATCH] virtio_scsi: fix memory leak on full queue condition.

2012-11-09 Thread Paolo Bonzini
: return ret; Acked-by: Paolo Bonzini pbonz...@redhat.com Paolo -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-09 Thread Paolo Bonzini
Il 09/11/2012 20:31, Nicholas A. Bellinger ha scritto: That's done on purpose. After you do virtqueue_add_buf, you don't need the sg list anymore, nor the lock that protects it. The cover letter is at https://lkml.org/lkml/2012/6/13/295 and had this text: This series reorganizes the

Re: [PATCH] USB enclosures seem to require read(16) with 2TB drives

2012-11-12 Thread Paolo Bonzini
Il 12/11/2012 12:33, James Bottomley ha scritto: On Fri, 2012-11-09 at 11:08 -0500, Jason J. Herne wrote: diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 13b8bcd..6ff785e 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@

Re: [PATCH] USB enclosures seem to require read(16) with 2TB drives

2012-11-12 Thread Paolo Bonzini
Il 12/11/2012 16:10, James Bottomley ha scritto: Actually it only turns it on for large capacity drives, as said in the comment. sdp-force_read_16 only matters for 2TB drives: If you follow the discussion, we'll need to turn it on for some drives regardless of size. Even if the two

[PATCH v3 0/2] add per-device sysfs knob to enable unrestricted, unprivileged SG_IO

2012-11-13 Thread Paolo Bonzini
was NACKed). Ok for 3.8? v2-v3: change bitmap filter to boolean Paolo Bonzini (2): sg_io: pass request_queue to blk_verify_command sg_io: introduce unpriv_sgio queue flag block/blk-sysfs.c | 32 block/bsg.c|2 +- block/scsi_ioctl.c |9

[PATCH v3 2/2] sg_io: introduce unpriv_sgio queue flag

2012-11-13 Thread Paolo Bonzini
: Ric Wheeler rwhee...@redhat.com Cc: Tejun Heo t...@kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v2-v3: change bitmap filter to boolean block/blk-sysfs.c | 32 block/scsi_ioctl.c |2 +- include/linux/blkdev.h |3 +++ 3

[PATCH v3 1/2] sg_io: pass request_queue to blk_verify_command

2012-11-13 Thread Paolo Bonzini
...@redhat.com Cc: Tejun Heo t...@kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v2-v3: separated from block: add back queue-private command filter block/bsg.c|2 +- block/scsi_ioctl.c |7 --- drivers/scsi/sg.c |3 ++- include/linux/blkdev.h

Re: [PATCH] Use SCSI read/write(16) with 2TB drives

2012-11-13 Thread Paolo Bonzini
Il 14/11/2012 01:54, Jason J. Herne ha scritto: blk_queue_physical_block_size(sdp-request_queue, sdkp-physical_block_size); sdkp-device-sector_size = sector_size; + + /* Use read/write(16) for 2TB disks */ + sdp-use_16_for_rw =

Re: [PATCH 2/3] target: Add max_write_same_len device attribute

2012-11-16 Thread Paolo Bonzini
Il 15/11/2012 20:23, Nicholas A. Bellinger ha scritto: This patch adds a new max_write_same_len device attribute for use with WRITE_SAME w/ UNMAP=0 backend emulation. Also, update block limits VPD emulation code in spc_emulate_evpd_b0() to set the default MAXIMUM WRITE SAME

Re: [PATCH 3/3] target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation support

2012-11-19 Thread Paolo Bonzini
Il 15/11/2012 21:01, Elliott, Robert (Server Storage) ha scritto: WRITE SAME always has a payload, regardless of the UNMAP bit value. For WRITE SAME with UNMAP=0, it's extremely important; that's how what to write is specified. For WRITE SAME with UNMAP=1, the device server is required to

Re: [PATCH] scsi_ram: a RAM-based SCSI driver

2012-12-06 Thread Paolo Bonzini
Il 05/12/2012 17:45, Kirill A. Shutemov ha scritto: From: Kirill A. Shutemov kirill.shute...@linux.intel.com This driver is intended to run as fast as possible, hence the options to discard writes and reads. It's designed to let us find latency issues elsewhere in the storage stack (eg

Re: [PATCH] scsi_ram: a RAM-based SCSI driver

2012-12-07 Thread Paolo Bonzini
Il 07/12/2012 12:20, Kirill A. Shutemov ha scritto: Is this that much faster than scsi-debug? The discarding options surely can be added there. scsi_ram is about 9% faster (without fake_rw/throw_away_*) on my machine: There are two main differences in the data path: - scsi_debug uses

Re: [PATCH v3 0/2] add per-device sysfs knob to enable unrestricted, unprivileged SG_IO

2012-12-17 Thread Paolo Bonzini
Il 13/11/2012 18:25, Paolo Bonzini ha scritto: Privilege restrictions for SG_IO right now apply without distinction to all devices, based on the single capability CAP_SYS_RAWIO. This is a very broad capability, and makes it difficult to give SG_IO access to trusted clients that need access

[PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Paolo Bonzini
because we do not set the affinity directly---we only provide a hint to the irqbalanced running in userspace. Dynamically changing the affinity only works if the userspace applies the hint fast enough. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: improved comments and commit

[PATCH v2 2/5] virtio-scsi: use functions for piecewise composition of buffers

2012-12-18 Thread Paolo Bonzini
in this patches and in the next ones. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: new drivers/scsi/virtio_scsi.c | 94 +++ 1 files changed, 42 insertions(+), 52 deletions(-) diff

[PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Paolo Bonzini
is not needed in virtio-blk, because it does all the work of the upper SCSI layers itself in the blk_map_rq_sg call. Then it simply hands the resulting scatterlist to virtqueue_add_buf. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: new drivers/virtio/virtio_ring.c | 205

[PATCH v2 4/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function

2012-12-18 Thread Paolo Bonzini
This will be needed soon in order to retrieve the per-target struct. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c

[PATCH v2 0/5] Multiqueue virtio-scsi, and API for piecewise buffer submission

2012-12-18 Thread Paolo Bonzini
. Paolo Bonzini (5): virtio: add functions for piecewise addition of buffers virtio-scsi: use functions for piecewise composition of buffers virtio-scsi: redo allocation of target data virtio-scsi: pass struct virtio_scsi to virtqueue completion function virtio-scsi: introduce multiqueue

Re: [PATCH v2 2/5] virtio-scsi: use functions for piecewise composition of buffers

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 14:37, Michael S. Tsirkin ha scritto: On Tue, Dec 18, 2012 at 01:32:49PM +0100, Paolo Bonzini wrote: Using the new virtio_scsi_add_sg function lets us simplify the queueing path. In particular, all data protected by the tgt_lock is just gone (multiqueue will find a new use

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 14:36, Michael S. Tsirkin ha scritto: Some comments without arguing about whether the performance benefit is worth it. On Tue, Dec 18, 2012 at 01:32:48PM +0100, Paolo Bonzini wrote: diff --git a/include/linux/virtio.h b/include/linux/virtio.h index cf8adb1..39d56c4 100644

Re: [PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 14:57, Michael S. Tsirkin ha scritto: -static int virtscsi_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc) +static int virtscsi_queuecommand(struct virtio_scsi *vscsi, + struct virtio_scsi_target_state *tgt, +

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 14:59, Michael S. Tsirkin ha scritto: Can't we track state internally to the virtqueue? Exposing it seems to buy us nothing since you can't call add_buf between start and end anyway. I wanted to keep the state for these functions separate from the rest. I don't think it makes

Re: [PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 16:03, Michael S. Tsirkin ha scritto: On Tue, Dec 18, 2012 at 03:08:08PM +0100, Paolo Bonzini wrote: Il 18/12/2012 14:57, Michael S. Tsirkin ha scritto: -static int virtscsi_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc) +static int virtscsi_queuecommand(struct

Re: [PATCH v2 0/5] Multiqueue virtio-scsi, and API for piecewise buffer submission

2012-12-19 Thread Paolo Bonzini
Il 18/12/2012 23:18, Rolf Eike Beer ha scritto: Paolo Bonzini wrote: Hi all, this series adds multiqueue support to the virtio-scsi driver, based on Jason Wang's work on virtio-net. It uses a simple queue steering algorithm that expects one queue per CPU. LUNs in the same target always

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-03 Thread Paolo Bonzini
Il 02/01/2013 06:03, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires the caller to provide all the buffers in a single call; 2) it does not support chained scatterlists: the buffers must be provided

Ping^2 Re: [PATCH v3 0/2] add per-device sysfs knob to enable unrestricted, unprivileged SG_IO

2013-01-04 Thread Paolo Bonzini
Il 17/12/2012 15:27, Paolo Bonzini ha scritto: Il 13/11/2012 18:25, Paolo Bonzini ha scritto: Privilege restrictions for SG_IO right now apply without distinction to all devices, based on the single capability CAP_SYS_RAWIO. This is a very broad capability, and makes it difficult to give

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-07 Thread Paolo Bonzini
Il 07/01/2013 01:02, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: Il 02/01/2013 06:03, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires the caller to provide all the buffers

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-10 Thread Paolo Bonzini
Il 08/01/2013 01:12, Rusty Russell ha scritto: Unfortunately, that cannot work because not all architectures support chained scatterlists. WHAT? I can't figure out what an arch needs to do to support this? It needs to use the iterator functions in its DMA driver. But we don't care

Re: [PATCH 0/3] target: Fix zero-length regressions in v3.8-rc1 code

2013-01-30 Thread Paolo Bonzini
Il 29/01/2013 23:26, Nicholas A. Bellinger ha scritto: From: Nicholas Bellinger n...@linux-iscsi.org Hi folks, The following are a handful of zero-length CDB regression bugfixes to address breakage introduced by the recent sense_reason_t conversion in v3.8-rc1 code, which incorrectly

[PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-02-06 Thread Paolo Bonzini
the large #if 0'd list of commands that the kernel does not pass though. Marked blk_set_cmd_filter_defaults as __init. Paolo Bonzini (14): sg_io: pass request_queue to blk_verify_command sg_io: reorganize list of allowed commands sg_io: use different default filters for each device

[PATCH v2 14/14] sg_io: use unpriv_sgio to disable whitelisting for scanners

2013-02-06 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/scsi_scan.c | 12 +++- drivers/scsi/sg.c|3 --- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 86940f3..702b0ef 100644 --- a/drivers/scsi

[PATCH v2 12/14] sg_io: remove remnants of sysfs SG_IO filters

2013-02-06 Thread Paolo Bonzini
Some defines and structs remained when support was removed for SG_IO filters in sysfs. Remove them. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- include/linux/genhd.h |9

[PATCH v2 13/14] sg_io: introduce unpriv_sgio queue flag

2013-02-06 Thread Paolo Bonzini
permissions. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Documentation/block/queue-sysfs.txt |8 block/blk-sysfs.c | 33

[PATCH v2 09/14] sg_io: whitelist a few more commands for disks

2013-02-06 Thread Paolo Bonzini
-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: leave out the commands listed in the commit message block/scsi_ioctl.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index a9c2caf..e100ee3 100644 --- a/block

[PATCH v2 04/14] sg_io: resolve conflicts between commands assigned to multiple classes (CVE-2012-4542)

2013-02-06 Thread Paolo Bonzini
: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/block/scsi_ioctl.c b/block

[PATCH v2 08/14] sg_io: whitelist a few more commands for tapes

2013-02-06 Thread Paolo Bonzini
: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 30 +- 1 files changed, 25 insertions(+), 5 deletions(-) diff --git a/block

[PATCH v2 07/14] sg_io: whitelist a few more commands for media changers

2013-02-06 Thread Paolo Bonzini
...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 21 - 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index fa2a1fc..8cda426 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c

[PATCH v2 06/14] sg_io: whitelist another command for multimedia devices

2013-02-06 Thread Paolo Bonzini
...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: leave out PLAY AUDIO(12), SERVICE ACTION IN(12) block/scsi_ioctl.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index e71cd42..fa2a1fc 100644

[PATCH v2 10/14] sg_io: whitelist a few obsolete commands

2013-02-06 Thread Paolo Bonzini
These are added to their own section of the table, together with SEEK(10) which has always been permitted. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c

[PATCH v2 03/14] sg_io: use different default filters for each device class

2013-02-06 Thread Paolo Bonzini
@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 14 +- drivers/scsi/scsi_scan.c |2 ++ include/linux/blkdev.h |2 +- include/scsi/scsi.h |1 + 4 files changed, 9 insertions(+), 10

[PATCH v2 02/14] sg_io: reorganize list of allowed commands

2013-02-06 Thread Paolo Bonzini
Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: do not use C++ commands, add definitions for missing types in include/scsi/scsi.h block/scsi_ioctl.c | 210 --- include/scsi/scsi.h |2

Re: [PATCH 2/2] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-02-06 Thread Paolo Bonzini
Il 16/01/2013 04:55, Wanlong Gao ha scritto: Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. You need to be careful to get_online_cpus() and put_online_cpus() here, so CPUs can't go up and down in the middle of operations. In particular,

[PATCH v3 1/5] virtio-scsi: redo allocation of target data

2013-02-12 Thread Paolo Bonzini
array member at the end of struct virtio_scsi, because we will place the virtqueues there in the next patches. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 39 --- 1 files changed, 12 insertions

[PATCH v3 2/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function

2013-02-12 Thread Paolo Bonzini
This will be needed soon in order to retrieve the per-target struct. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c

[PATCH v3 4/5] virtio-scsi: introduce multiqueue support

2013-02-12 Thread Paolo Bonzini
-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 269 +++- 1 files changed, 240 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 3d77210..a2bdae1 100644 --- a/drivers/scsi

[PATCH v3 3/5] virtio-scsi: push vq lock/unlock into virtscsi_vq_done

2013-02-12 Thread Paolo Bonzini
Avoid duplicated code in all of the callers. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 +- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi

[PATCH v3 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-02-12 Thread Paolo Bonzini
__virtscsi_set_affinity - Paolo ] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 31 +++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index a2bdae1..733307a 100644 --- a/drivers

[PATCH v3 0/5] virtio-scsi multiqueue

2013-02-12 Thread Paolo Bonzini
probably be easier to get it in via Rusty's tree because of the prerequisites. James, can I get your Acked-by? Paolo Paolo Bonzini (4): virtio-scsi: redo allocation of target data virtio-scsi: pass struct virtio_scsi to virtqueue completion function virtio-scsi: push vq lock/unlock

Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-02-13 Thread Paolo Bonzini
Il 13/02/2013 16:35, Douglas Gilbert ha scritto: Ping? I'm not even sure what tree this should host these patches... You are whitelisting SCSI commands so obviously the SCSI tree and the patch spills over into the block tree. Yeah, an Acked-by is in order but it's not clear from whom and

Re: [PATCH v3 0/5] virtio-scsi multiqueue

2013-02-18 Thread Paolo Bonzini
Il 18/02/2013 10:32, Wanlong Gao ha scritto: Ok for 3.9? It would probably be easier to get it in via Rusty's tree because of the prerequisites. James, can I get your Acked-by? I can't apply this series on top of Rusty's virtio-next, I missed something or needed rebase them ? It's on top

Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-02-20 Thread Paolo Bonzini
Il 06/02/2013 16:15, Paolo Bonzini ha scritto: This series regards the whitelist that is used for the SG_IO ioctl. This whitelist has three problems: * the bitmap of allowed commands is designed for MMC devices (roughly, play/burn CDs without requiring root) but some opcodes overlap

Re: [GIT PULL] Final round of SCSI updates for the 3.8+ merge window

2013-03-01 Thread Paolo Bonzini
Il 01/03/2013 14:27, Douglas Gilbert ha scritto: What is the status of the: - scsi: 64-bit LUN support [v2] - SG_SCSI_RESET ioctl: add no_escalate values [v2] patches? Also: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542) Paolo -- To

Re: [PATCH V4 1/5] virtio-scsi: redo allocation of target data

2013-03-11 Thread Paolo Bonzini
at the end of struct virtio_scsi. But we do not do that, because we will place the virtqueues there in the next patches. Paolo Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com -- To unsubscribe from this list

Re: Potential out-of-bounds access in drivers/scsi/sd.c

2013-09-04 Thread Paolo Bonzini
Il 04/09/2013 16:32, Alan Stern ha scritto: On Wed, 4 Sep 2013, Dmitry Vyukov wrote: Hi, We are working on a memory error detector AddressSanitizer for Linux kernel (https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel), it can detect use-after-free and

Re: [PATCH] SCSI: Fix potential out-of-bounds access in drivers/scsi/sd.c

2013-09-06 Thread Paolo Bonzini
be present, but the buffer size is limited to 512 bytes. Signed-off-by: Alan Stern st...@rowland.harvard.edu Reported-by: Dmitry Vyukov dvyu...@google.com CC: sta...@vger.kernel.org Reviewed-by: Paolo Bonzini pbonz...@redhat.com --- [as1709] drivers/scsi/sd.c | 11

Re: SCSI's heuristics for enabling WRITE SAME still need work [was: dm mpath: disable WRITE SAME if it fails]

2013-09-24 Thread Paolo Bonzini
Il 21/09/2013 00:03, Martin K. Petersen ha scritto: The major headache here of course is that WRITE SAME is inherently destructive. We can't just fire off one during discovery and see if it works. For WRITE you can issue a command with a transfer length of 0 to see if things work. But

Re: [PATCH] virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze

2013-10-28 Thread Paolo Bonzini
; + + err = register_hotcpu_notifier(vscsi-nb); + if (err) + vdev-config-del_vqs(vdev); - return virtscsi_init(vdev, vscsi); + return err; } #endif Reviewed-by: Paolo Bonzini pbonz...@redhat.com Cc: sta...@vger.kernel.org -- To unsubscribe from this list

Re: [PATCH 2/2] target_core_spc: bounds check for spc_emulate_inquiry()

2013-12-20 Thread Paolo Bonzini
Il 20/12/2013 07:47, Hannes Reinecke ha scritto: How about changing the local buffer to heap memory instead, and bumping SE_INQUIRY_BUF to 1024 bytes..? Ok. But then we should have a quick check at the start if (cmd-data_length SE_INQUIRY_BUF) len = cmd-data_length else len =

Re: [PATCH 04/17] scsi: avoid useless free_list lock roundtrips

2014-02-07 Thread Paolo Bonzini
); - if (likely(cmd != NULL)) + if (cmd) scsi_pool_free_command(shost-cmd_pool, cmd); put_device(dev); Reviewed-by: Paolo Bonzini pbonz...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord

Re: [PATCH 06/17] scsi: add support for per-host cmd pools

2014-02-07 Thread Paolo Bonzini
Il 05/02/2014 13:39, Christoph Hellwig ha scritto: + pool = scsi_find_host_cmd_pool(shost); Should you have a WARN_ON somewhere if shost-hostt-cmd_size shost-unchecked_isa_dma? Apart from this, Reviewed-by: Paolo Bonzini pbonz...@redhat.com Paolo + if (!pool

<    1   2   3   4   >