Re: [PATCH] dma-helpers: Fix iovec alignment

2024-04-16 Thread Stefan Fritsch
adding John Snow to CC because he investigated this in 2020. On Fri, 12 Apr 2024, Eric Blake wrote: > On Fri, Apr 12, 2024 at 10:06:17AM +0200, Stefan Fritsch wrote: > > Commit 99868af3d0 changed the hardcoded constant BDRV_SECTOR_SIZE to a > > dynamic field 'align' but i

[PATCH] dma-helpers: Fix iovec alignment

2024-04-12 Thread Stefan Fritsch
in uncommon configurations, e.g. with icount enabled or when reading from disk directly to device memory. Fixes: 99868af3d0a75cf6 ("dma-helpers: explicitly pass alignment into DMA helpers") Signed-off-by: Stefan Fritsch --- system/dma-helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2

Re: [Qemu-devel] [PATCH v2 8/8] usb-ccid: Reduce logging at level WARN

2017-07-27 Thread Stefan Fritsch
On Thu, 20 Jul 2017, Stefan Fritsch wrote: > Thanks for the review. > > On Thu, 20 Jul 2017, Marc-André Lureau wrote: > > > On Thu, Jul 20, 2017 at 11:04 AM Stefan Fritsch <s...@sfritsch.de> wrote: > > > > > From: Stefan Fritsch <stefan_frit...@genua.d

Re: [Qemu-devel] [PATCH v2 1/8] usb-ccid: Add support to dump all USB packets

2017-07-27 Thread Stefan Fritsch
On Fri, 21 Jul 2017, Gerd Hoffmann wrote: > > index bef1f03c42..624dc2c447 100644 > > --- a/hw/usb/dev-smartcard-reader.c > > +++ b/hw/usb/dev-smartcard-reader.c > > @@ -54,9 +54,25 @@ do { \ > >  #define D_INFO 2 > >  #define D_MORE_INFO 3 > >  #define D_VERBOSE 4 > > +#define D_TRACE 5 > >

Re: [Qemu-devel] [PATCH] acpi: Add emulated sleep button

2017-07-20 Thread Stefan Fritsch
On Thu, 20 Jul 2017, Eric Blake wrote: > On 07/20/2017 04:31 AM, Stefan Fritsch wrote: > > From: Stefan Fritsch <stefan_frit...@genua.de> > > > > Add an ACPI sleep button and QMP/HMP commands to trigger it. A sleep > > button is a so called "fixed

Re: [Qemu-devel] [PATCH v2 8/8] usb-ccid: Reduce logging at level WARN

2017-07-20 Thread Stefan Fritsch
Thanks for the review. On Thu, 20 Jul 2017, Marc-André Lureau wrote: > On Thu, Jul 20, 2017 at 11:04 AM Stefan Fritsch <s...@sfritsch.de> wrote: > > > From: Stefan Fritsch <stefan_frit...@genua.de> > > > > Change all DPRINTF()s using (1 == WARN)

Re: [Qemu-devel] [PATCH v2 5/8] usb-ccid: Fix USB descriptor

2017-07-20 Thread Stefan Fritsch
On Thu, 20 Jul 2017, Marc-André Lureau wrote: > On Thu, Jul 20, 2017 at 11:09 AM Stefan Fritsch <s...@sfritsch.de> wrote: > > > From: Stefan Fritsch <stefan_frit...@genua.de> > > > > - We want to support both T=0 and T=1. Additionally, note that all > &

[Qemu-devel] [PATCH] acpi: Add emulated sleep button

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> Add an ACPI sleep button and QMP/HMP commands to trigger it. A sleep button is a so called "fixed hardware feature", which makes it more suitable for putting the system to sleep than a laptop lid, for example. The sleep bu

[Qemu-devel] [PATCH v2 3/8] usb-ccid: Set protocol parameters based on card ATR

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> For the ATR interface bytes encoding see ISO/IEC 7816-3. For the interpretation of the protocol parameter block see the CCID specification. - Values that are not present in the ATR default to zero. - TA_1 is used to fill bmFindexDindex. - Th

[Qemu-devel] [PATCH v2 5/8] usb-ccid: Fix USB descriptor

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> - We want to support both T=0 and T=1. Additionally, note that all fields in USB descriptors are little endian and the supported protocols are in the lowest byte the of the 32-Bit dwProtocols field. - We want APDU level exchanges. This sa

[Qemu-devel] [PATCH v2 6/8] usb-ccid: Fix chaining fields in CCID USB messages

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> Incoming packets should never need chaining (bChainParamter => 0). If they ever do we will have to fix this later. Zero is still better than an uninitialized value. Warn if outgoing packets try to use chaining (wLevelParameter != 0). As we

[Qemu-devel] [PATCH v2 1/8] usb-ccid: Add support to dump all USB packets

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> The dump can be activated by the debug command line option for the device like this "qemu ... -dev usb,ccid,debug=5" While there move the short read debug message to a higher debug level. It triggers very often and makes debug o

[Qemu-devel] [PATCH v2 7/8] usb-ccid: Increase ccid max APDU size

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> The emulated ccid smartcard reader has a fixed limit for APDUs from the card. Increase this to 1024. We have seen software that tries to use 768 byte APDUs. Signed-off-by: Stefan Fritsch <stefan_frit...@genua.de> --- hw/usb/dev-smartc

[Qemu-devel] [PATCH v2 8/8] usb-ccid: Reduce logging at level WARN

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> Change all DPRINTF()s using (1 == WARN) to use symbolic constants. Most of these DPRINTFs are now only logging at higher log levels. This allows to use ccid's debug level 1 == WARN in normal operation. Signed-off-by: Stefan Fritsch <st

[Qemu-devel] [PATCH v2 0/8] usb-ccid: Misc fixes and T=1 support

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> Sorry, I have accidentally sent an old patchset that was missing one fix. This set of changes contains fixes and extensions to allow to use ccid card passthru with a physical cardos smartcard using the T=1 protocol. Unfortunately, our vscard

[Qemu-devel] [PATCH v2 4/8] usb-ccid: Fix ATR parsing

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> - The number of parameter set TA_i...TD_i is unlimited. The list ends if TD_i is not present or the high nibble is zero. - If at least one protocol in any of the TD bytes is non-zero, the ATR must have a checksum. - Add a missing length

[Qemu-devel] [PATCH v2 2/8] usb-ccid: Fix USB packet generation for 64-Bytes sized packets.

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> An USB transfer must be terminated by a packet that is shorter than the maximum USB packet size (usually 64Byte) reported by the device in its descriptor(s). Thus if the last packet of a transfer is exactly 64-Bytes long, we must send an addi

[Qemu-devel] [PATCH 5/8] usb-ccid: Fix USB descriptor

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> - We want to support both T=0 and T=1. Additionally, note that all fields in USB descriptors are little endian and the supported protocols are in the lowest byte the of the 32-Bit dwProtocols field. - We want APDU level exchanges. This sa

[Qemu-devel] [PATCH 6/8] usb-ccid: Fix chaining fields in CCID USB messages

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> Incoming packets should never need chaining (bChainParamter => 0). If they ever do we will have to fix this later. Zero is still better than an uninitialized value. Warn if outgoing packets try to use chaining (wLevelParameter != 0). As we

[Qemu-devel] [PATCH 8/8] usb-ccid: Reduce logging at level WARN

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> Change all DPRINTF()s using (1 == WARN) to use symbolic constants. Most of these DPRINTFs are now only logging at higher log levels. This allows to use ccid's debug level 1 == WARN in normal operation. Signed-off-by: Stefan Fritsch <st

[Qemu-devel] [PATCH 3/8] usb-ccid: Set protocol parameters based on card ATR

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> For the ATR interface bytes encoding see ISO/IEC 7816-3. For the interpretation of the protocol parameter block see the CCID specification. - Values that are not present in the ATR default to zero. - TA_1 is used to fill bmFindexDindex. - Th

[Qemu-devel] [PATCH 2/8] usb-ccid: Fix USB packet generation for 64-Bytes sized packets.

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> An USB transfer must be terminated by a packet that is shorter than the maximum USB packet size (usually 64Byte) reported by the device in its descriptor(s). Thus if the last packet of a transfer is exactly 64-Bytes long, we must send an addi

[Qemu-devel] [PATCH 4/8] usb-ccid: Fix ATR parsing

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> - The number of parameter set TA_i...TD_i is unlimited. The list ends if TD_i is not present or the high nibble is zero. - If at least one protocol in any of the TD bytes is non-zero, the ATR must have a checksum. - Add a missing length

[Qemu-devel] [PATCH 1/8] usb-ccid: Add support to dump all USB packets

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> The dump can be activated by the debug command line option for the device like this "qemu ... -dev usb,ccid,debug=5" While there move the short read debug message to a higher debug level. It triggers very often and makes debug o

[Qemu-devel] [PATCH 7/8] usb-ccid: Increase ccid max APDU size

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> The emulated ccid smartcard reader has a fixed limit for APDUs from the card. Increase this to 1024. We have seen software that tries to use 768 byte APDUs. Signed-off-by: Stefan Fritsch <stefan_frit...@genua.de> --- hw/usb/dev-smartc

[Qemu-devel] [PATCH 0/8] usb-ccid: Misc fixes and T=1 support

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> This set of changes contains fixes and extensions to allow to use ccid card passthru with a physical smartcard using the T=1 protocol. Unfortunately, our vscard client program ist not public, therefore it is difficult for other people t

[Qemu-devel] [PATCH] vmxcap: Fix output formatting

2017-07-20 Thread Stefan Fritsch
From: Stefan Fritsch <stefan_frit...@genua.de> One string is longer than 40 chars. Set the field width to 50. Signed-off-by: Stefan Fritsch <stefan_frit...@genua.de> --- scripts/kvm/vmxcap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kvm/vmxcap b

Re: [Qemu-devel] [PATCH v2] Add chardev-send-break monitor command

2017-07-19 Thread Stefan Fritsch
On Wed, 19 Jul 2017, Thomas Huth wrote: > On 11.06.2017 09:48, Stefan Fritsch wrote: > > Sending a break on a serial console can be useful for debugging the > > guest. But not all chardev backends support sending breaks (only telnet > > and mux do). The chardev-send-break c

Re: [Qemu-devel] [PATCH v2] Add chardev-send-break monitor command

2017-06-30 Thread Stefan Fritsch
On Thursday, 29 June 2017 16:00:54 CEST Dr. David Alan Gilbert wrote: > * Eric Blake (ebl...@redhat.com) wrote: > > On 06/11/2017 02:48 AM, Stefan Fritsch wrote: > > > Sending a break on a serial console can be useful for debugging the > > > guest. But not all chard

[Qemu-devel] [PATCH v2] Add chardev-send-break monitor command

2017-06-11 Thread Stefan Fritsch
Sending a break on a serial console can be useful for debugging the guest. But not all chardev backends support sending breaks (only telnet and mux do). The chardev-send-break command allows to send a break even if using other backends. Signed-off-by: Stefan Fritsch <s...@sfritsch.de>

Re: [Qemu-devel] [PATCH] Add chardev-send-break monitor command

2017-06-06 Thread Stefan Fritsch
On Tue, 6 Jun 2017, Markus Armbruster wrote: > >> Is there an obvious test that we can enhance to add coverage of the new > >> QMP command? > > > > You could have a new test covering hw/char/serial.c, but I wouldn't let > > that hold the patch. > > Holding patches is pretty much the only leverage

[Qemu-devel] [PATCH] Add chardev-send-break monitor command

2017-06-05 Thread Stefan Fritsch
Sending a break on a serial console can be useful for debugging the guest. But not all chardev backends support sending breaks (only telnet and mux do). The chardev-send-break command allows to send a break even if using other backends. Signed-off-by: Stefan Fritsch <s...@sfritsch

Re: [Qemu-devel] [PATCH] virtio-net: Do not filter VLANs without F_CTRL_VLAN

2014-03-19 Thread Stefan Fritsch
Hi, Am Dienstag, 25. Februar 2014, 11:06:33 schrieb Amos Kong: On Wed, Feb 12, 2014 at 10:46:28PM +0100, Stefan Fritsch wrote: If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all VLAN-tagged packets but send them to the guest. AFAICS, no fix has been committed, yet

Re: [Qemu-devel] [PATCH] virtio-net: Do not filter VLANs without F_CTRL_VLAN

2014-02-23 Thread Stefan Fritsch
On Fri, 21 Feb 2014, Amos Kong wrote: On Wed, Feb 12, 2014 at 10:46:28PM +0100, Stefan Fritsch wrote: If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all VLAN-tagged packets but send them to the guest. Can we just update receive_filter() to filter out VLAN-tagged packets

Re: [Qemu-devel] [PATCH] virtio-net: Do not filter VLANs without F_CTRL_VLAN

2014-02-17 Thread Stefan Fritsch
On Sun, 16 Feb 2014, Michael S. Tsirkin wrote: On Wed, Feb 12, 2014 at 10:46:28PM +0100, Stefan Fritsch wrote: If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all VLAN-tagged packets but send them to the guest. Signed-off-by: Stefan Fritsch s...@sfritsch.de Thanks

[Qemu-devel] [PATCH] virtio-net: Do not filter VLANs without F_CTRL_VLAN

2014-02-12 Thread Stefan Fritsch
If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all VLAN-tagged packets but send them to the guest. Signed-off-by: Stefan Fritsch s...@sfritsch.de --- This time CCing the maintainers. This fixes VLANs with OpenBSD guests (and probably NetBSD, too, because the OpenBSD driver

[Qemu-devel] virtio-net VLAN filtering bug

2014-02-05 Thread Stefan Fritsch
Hi, if the feature VIRTIO_NET_F_CTRL_VLAN is not negotiated, virtio-net should not filter VLANs. That means it should send all packets to the guest instead of dropping all packets that have any VLAN id. The following patch fixes the issue. Cheers, Stefan --- a/hw/net/virtio-net.c +++