[Qemu-commits] [qemu/qemu] 5cb0e7: target/riscv: Fix mcycle/minstret increment behavior

2024-01-08 Thread Peter Maydell via Qemu-commits
  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 5cb0e7abe1635cb82e0033260dac2b910d142f8c
  
https://github.com/qemu/qemu/commit/5cb0e7abe1635cb82e0033260dac2b910d142f8c
  Author: Xu Lu 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M target/riscv/csr.c

  Log Message:
  ---
  target/riscv: Fix mcycle/minstret increment behavior

The mcycle/minstret counter's stop flag is mistakenly updated on a copy
on stack. Thus the counter increments even when the CY/IR bit in the
mcountinhibit register is set. This commit corrects its behavior.

Fixes: 3780e33732f88 (target/riscv: Support mcycle/minstret write operation)
Signed-off-by: Xu Lu 
Reviewed-by: Daniel Henrique Barboza 
Signed-off-by: Michael Tokarev 


  Commit: 4ad87cd4b2254197b7ac12e3da824854e6a90f8f
  
https://github.com/qemu/qemu/commit/4ad87cd4b2254197b7ac12e3da824854e6a90f8f
  Author: Michael Tokarev 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M chardev/char.c

  Log Message:
  ---
  chardev/char.c: fix "abstract device type" error message

Current error message:

 qemu-system-x86_64: -chardev spice,id=foo: Parameter 'driver' expects an 
abstract device type

while in fact the meaning is in reverse, -chardev expects
a non-abstract device type.

Fixes: 777357d758d9 ("chardev: qom-ify" 2016-12-07)
Signed-off-by: Michael Tokarev 
Reviewed-by: Zhao Liu 


  Commit: 09a36158c283f7448d1b00fdbb6634f05d27f922
  
https://github.com/qemu/qemu/commit/09a36158c283f7448d1b00fdbb6634f05d27f922
  Author: Michael Tokarev 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M audio/audio.c

  Log Message:
  ---
  audio/audio.c: remove trailing newline in error_setg

error_setg() appends newline to the formatted message.
Fixes: cb94ff5f80c5 ("audio: propagate Error * out of audio_init")

Signed-off-by: Michael Tokarev 
Reviewed-by: Philippe Mathieu-Daudé 


  Commit: 0c7ffc977195c1f71c8132eb5616827e589d4a0f
  
https://github.com/qemu/qemu/commit/0c7ffc977195c1f71c8132eb5616827e589d4a0f
  Author: Bin Meng 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M hw/net/cadence_gem.c

  Log Message:
  ---
  hw/net: cadence_gem: Fix MDIO_OP_xxx values

Testing upstream U-Boot with 'sifive_u' machine we see:

  => dhcp
  ethernet@1009: PHY present at 0
  Could not get PHY for ethernet@1009: addr 0
  phy_connect failed

This has been working till QEMU 8.1 but broken since QEMU 8.2.

Fixes: 1b09eeb122aa ("hw/net/cadence_gem: use FIELD to describe PHYMNTNC 
register fields")
Reported-by: Heinrich Schuchardt 
Signed-off-by: Bin Meng 
Reviewed-by: Philippe Mathieu-Daudé 
Tested-by: Heinrich Schuchardt 
Signed-off-by: Michael Tokarev 


  Commit: 2c5107e1b455d4a157124f021826ead4e04b4aea
  
https://github.com/qemu/qemu/commit/2c5107e1b455d4a157124f021826ead4e04b4aea
  Author: Max Erenberg 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M hw/misc/edu.c

  Log Message:
  ---
  edu: fix DMA range upper bound check

The edu_check_range function checks that start <= end1 < end2, where
end1 is the upper bound (exclusive) of the guest-supplied DMA range and
end2 is the upper bound (exclusive) of the device's allowed DMA range.
When the guest tries to transfer exactly DMA_SIZE (4096) bytes, end1
will be equal to end2, so the check fails and QEMU aborts with this
puzzling error message (newlines added for formatting):

  qemu: hardware error: EDU: DMA range
0x0004-0x00040fff out of bounds
   (0x0004-0x00040fff)!

By checking end1 <= end2 instead, guests will be allowed to transfer
exactly 4096 bytes. It is not necessary to explicitly check for
start <= end1 because the previous two checks (within(addr, start, end2)
and end1 > addr) imply start < end1.

Fixes: b30934cb52a7 ("hw: misc, add educational driver", 2015-01-21)
Signed-off-by: Max Erenberg 
Signed-off-by: Michael Tokarev 


  Commit: 8a780cd212647a6013c8ea59e0929dad996e2c54
  
https://github.com/qemu/qemu/commit/8a780cd212647a6013c8ea59e0929dad996e2c54
  Author: Samuel Tardieu 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M docs/system/arm/palm.rst
M docs/system/arm/xscale.rst
M docs/system/devices/can.rst

  Log Message:
  ---
  docs: use "buses" rather than "busses"

If "busses" might be encountered as a plural of "bus" (5 instances),
the correct spelling is "buses" (26 instances). Fixing those 5
instances makes the doc more consistent.

Signed-off-by: Samuel Tardieu 
Reviewed-by: Philippe Mathieu-Daudé 
Reviewed-by: Pavel Pisa 
Reviewed-by: Zhao Liu 
Signed-off-by: Michael Tokarev 


  Commit: 001a013ea3f125d2ec0e709b5765754149d8d968
  
https://github.com/qemu/qemu/commit/001a013ea3f125d2ec0e709b5765754149d8d968
  Author: Cédric Le Goater 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M hw/vfio/container.c
M hw/vfio/spapr.c
M 

[Qemu-commits] [qemu/qemu] 5cb0e7: target/riscv: Fix mcycle/minstret increment behavior

2024-01-08 Thread Peter Maydell via Qemu-commits
  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 5cb0e7abe1635cb82e0033260dac2b910d142f8c
  
https://github.com/qemu/qemu/commit/5cb0e7abe1635cb82e0033260dac2b910d142f8c
  Author: Xu Lu 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M target/riscv/csr.c

  Log Message:
  ---
  target/riscv: Fix mcycle/minstret increment behavior

The mcycle/minstret counter's stop flag is mistakenly updated on a copy
on stack. Thus the counter increments even when the CY/IR bit in the
mcountinhibit register is set. This commit corrects its behavior.

Fixes: 3780e33732f88 (target/riscv: Support mcycle/minstret write operation)
Signed-off-by: Xu Lu 
Reviewed-by: Daniel Henrique Barboza 
Signed-off-by: Michael Tokarev 


  Commit: 4ad87cd4b2254197b7ac12e3da824854e6a90f8f
  
https://github.com/qemu/qemu/commit/4ad87cd4b2254197b7ac12e3da824854e6a90f8f
  Author: Michael Tokarev 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M chardev/char.c

  Log Message:
  ---
  chardev/char.c: fix "abstract device type" error message

Current error message:

 qemu-system-x86_64: -chardev spice,id=foo: Parameter 'driver' expects an 
abstract device type

while in fact the meaning is in reverse, -chardev expects
a non-abstract device type.

Fixes: 777357d758d9 ("chardev: qom-ify" 2016-12-07)
Signed-off-by: Michael Tokarev 
Reviewed-by: Zhao Liu 


  Commit: 09a36158c283f7448d1b00fdbb6634f05d27f922
  
https://github.com/qemu/qemu/commit/09a36158c283f7448d1b00fdbb6634f05d27f922
  Author: Michael Tokarev 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M audio/audio.c

  Log Message:
  ---
  audio/audio.c: remove trailing newline in error_setg

error_setg() appends newline to the formatted message.
Fixes: cb94ff5f80c5 ("audio: propagate Error * out of audio_init")

Signed-off-by: Michael Tokarev 
Reviewed-by: Philippe Mathieu-Daudé 


  Commit: 0c7ffc977195c1f71c8132eb5616827e589d4a0f
  
https://github.com/qemu/qemu/commit/0c7ffc977195c1f71c8132eb5616827e589d4a0f
  Author: Bin Meng 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M hw/net/cadence_gem.c

  Log Message:
  ---
  hw/net: cadence_gem: Fix MDIO_OP_xxx values

Testing upstream U-Boot with 'sifive_u' machine we see:

  => dhcp
  ethernet@1009: PHY present at 0
  Could not get PHY for ethernet@1009: addr 0
  phy_connect failed

This has been working till QEMU 8.1 but broken since QEMU 8.2.

Fixes: 1b09eeb122aa ("hw/net/cadence_gem: use FIELD to describe PHYMNTNC 
register fields")
Reported-by: Heinrich Schuchardt 
Signed-off-by: Bin Meng 
Reviewed-by: Philippe Mathieu-Daudé 
Tested-by: Heinrich Schuchardt 
Signed-off-by: Michael Tokarev 


  Commit: 2c5107e1b455d4a157124f021826ead4e04b4aea
  
https://github.com/qemu/qemu/commit/2c5107e1b455d4a157124f021826ead4e04b4aea
  Author: Max Erenberg 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M hw/misc/edu.c

  Log Message:
  ---
  edu: fix DMA range upper bound check

The edu_check_range function checks that start <= end1 < end2, where
end1 is the upper bound (exclusive) of the guest-supplied DMA range and
end2 is the upper bound (exclusive) of the device's allowed DMA range.
When the guest tries to transfer exactly DMA_SIZE (4096) bytes, end1
will be equal to end2, so the check fails and QEMU aborts with this
puzzling error message (newlines added for formatting):

  qemu: hardware error: EDU: DMA range
0x0004-0x00040fff out of bounds
   (0x0004-0x00040fff)!

By checking end1 <= end2 instead, guests will be allowed to transfer
exactly 4096 bytes. It is not necessary to explicitly check for
start <= end1 because the previous two checks (within(addr, start, end2)
and end1 > addr) imply start < end1.

Fixes: b30934cb52a7 ("hw: misc, add educational driver", 2015-01-21)
Signed-off-by: Max Erenberg 
Signed-off-by: Michael Tokarev 


  Commit: 8a780cd212647a6013c8ea59e0929dad996e2c54
  
https://github.com/qemu/qemu/commit/8a780cd212647a6013c8ea59e0929dad996e2c54
  Author: Samuel Tardieu 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M docs/system/arm/palm.rst
M docs/system/arm/xscale.rst
M docs/system/devices/can.rst

  Log Message:
  ---
  docs: use "buses" rather than "busses"

If "busses" might be encountered as a plural of "bus" (5 instances),
the correct spelling is "buses" (26 instances). Fixing those 5
instances makes the doc more consistent.

Signed-off-by: Samuel Tardieu 
Reviewed-by: Philippe Mathieu-Daudé 
Reviewed-by: Pavel Pisa 
Reviewed-by: Zhao Liu 
Signed-off-by: Michael Tokarev 


  Commit: 001a013ea3f125d2ec0e709b5765754149d8d968
  
https://github.com/qemu/qemu/commit/001a013ea3f125d2ec0e709b5765754149d8d968
  Author: Cédric Le Goater 
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
M hw/vfio/container.c
M hw/vfio/spapr.c
M