qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] f607dc: hw/net/imx_fec: return 0xffff when ac


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] f607dc: hw/net/imx_fec: return 0xffff when accessing non-e...
Date: Sun, 30 May 2021 10:33:35 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: f607dce2ed0a78bee3da6482c7abe58a80df2974
      
https://github.com/qemu/qemu/commit/f607dce2ed0a78bee3da6482c7abe58a80df2974
  Author: Guenter Roeck <linux@roeck-us.net>
  Date:   2021-05-27 (Thu, 27 May 2021)

  Changed paths:
    M hw/net/imx_fec.c
    M hw/net/trace-events

  Log Message:
  -----------
  hw/net/imx_fec: return 0xffff when accessing non-existing PHY

If a PHY does not exist, attempts to read from it should return 0xffff.
Otherwise the Linux kernel will believe that a PHY is there and select
the non-existing PHY. This in turn will result in network errors later
on since the real PHY is not selected or configured.

Since reading from or writing to a non-existing PHY is not an emulation
error, replace guest error messages with traces.

Fixes: 461c51ad4275 ("Add a phy-num property to the i.MX FEC emulator")
Cc: Jean-Christophe Dubois <jcd@tribudubois.net>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 1e157667d7657418b68fadb5cc016c6804e17501
      
https://github.com/qemu/qemu/commit/1e157667d7657418b68fadb5cc016c6804e17501
  Author: Laurent Vivier <lvivier@redhat.com>
  Date:   2021-05-27 (Thu, 27 May 2021)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: failover: add missing remove_migration_state_change_notifier()

In the failover case configuration, virtio_net_device_realize() uses an
add_migration_state_change_notifier() to add a state notifier, but this
notifier is not removed by the unrealize function when the virtio-net
card is unplugged.

If the card is unplugged and a migration is started, the notifier is
called and as it is not valid anymore QEMU crashes.

This patch fixes the problem by adding the
remove_migration_state_change_notifier() in virtio_net_device_unrealize().

The problem can be reproduced with:

  $ qemu-system-x86_64 -enable-kvm -m 1g -M q35 \
    -device pcie-root-port,slot=4,id=root1 \
    -device pcie-root-port,slot=5,id=root2 \
    -device virtio-net-pci,id=net1,mac=52:54:00:6f:55:cc,failover=on,bus=root1 \
    -monitor stdio disk.qcow2
  (qemu) device_del net1
  (qemu) migrate "exec:gzip -c > STATEFILE.gz"

  Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
  0x0000000000000000 in ?? ()
  (gdb) bt
  #0  0x0000000000000000 in  ()
  #1  0x0000555555d726d7 in notifier_list_notify (...)
      at .../util/notify.c:39
  #2  0x0000555555842c1a in migrate_fd_connect (...)
      at .../migration/migration.c:3975
  #3  0x0000555555950f7d in migration_channel_connect (...)
      error@entry=0x0) at .../migration/channel.c:107
  #4  0x0000555555910922 in exec_start_outgoing_migration (...)
      at .../migration/exec.c:42

Reported-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 4f8a39494aded9f2026a26b137378ea2ee3d5338
      
https://github.com/qemu/qemu/commit/4f8a39494aded9f2026a26b137378ea2ee3d5338
  Author: Brad Smith <brad@comstyle.com>
  Date:   2021-05-27 (Thu, 27 May 2021)

  Changed paths:
    M net/tap-bsd.c

  Log Message:
  -----------
  tap-bsd: Remove special casing for older OpenBSD releases

OpenBSD added support for tap(4) 10 releases ago.

Remove the special casing for older releases.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: a648df38898ddbad1bd6d71a6680b3788f6528b2
      
https://github.com/qemu/qemu/commit/a648df38898ddbad1bd6d71a6680b3788f6528b2
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-05-28 (Fri, 28 May 2021)

  Changed paths:
    M hw/net/imx_fec.c
    M hw/net/trace-events
    M hw/net/virtio-net.c
    M net/tap-bsd.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into 
staging

# gpg: Signature made Thu 27 May 2021 04:06:17 BST
# gpg:                using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) 
<jasowang@redhat.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  tap-bsd: Remove special casing for older OpenBSD releases
  virtio-net: failover: add missing remove_migration_state_change_notifier()
  hw/net/imx_fec: return 0xffff when accessing non-existing PHY

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/62c0ac5041e9...a648df38898d



reply via email to

[Prev in Thread] Current Thread [Next in Thread]