[PATCH v18 3/7] target/ppc: Handle NMI guest exit

2020-01-01 Thread Ganesh Goudar
From: Aravinda Prasad Memory error such as bit flips that cannot be corrected by hardware are passed on to the kernel for handling. If the memory address in error belongs to guest then the guest kernel is responsible for taking suitable action. Patch [1] enhances KVM to exit guest with exit

[PATCH v18 7/7] ppc: spapr: Activate the FWNMI functionality

2020-01-01 Thread Ganesh Goudar
From: Aravinda Prasad This patch sets the default value of SPAPR_CAP_FWNMI_MCE to SPAPR_CAP_ON for machine type 4.2. Signed-off-by: Aravinda Prasad --- hw/ppc/spapr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index

[PATCH v18 5/7] ppc: spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls

2020-01-01 Thread Ganesh Goudar
From: Aravinda Prasad This patch adds support in QEMU to handle "ibm,nmi-register" and "ibm,nmi-interlock" RTAS calls. The machine check notification address is saved when the OS issues "ibm,nmi-register" RTAS call. This patch also handles the case when multiple processors experience machine

[PATCH v18 1/7] Wrapper function to wait on condition for the main loop mutex

2020-01-01 Thread Ganesh Goudar
From: Aravinda Prasad Introduce a wrapper function to wait on condition for the main loop mutex. This function atomically releases the main loop mutex and causes the calling thread to block on the condition. This wrapper is required because qemu_global_mutex is a static variable. Signed-off-by:

[PATCH v18 6/7] migration: Include migration support for machine check handling

2020-01-01 Thread Ganesh Goudar
From: Aravinda Prasad This patch includes migration support for machine check handling. Especially this patch blocks VM migration requests until the machine check error handling is complete as these errors are specific to the source hardware and is irrelevant on the target hardware. [Do not set

[PATCH v18 2/7] ppc: spapr: Introduce FWNMI capability

2020-01-01 Thread Ganesh Goudar
From: Aravinda Prasad Introduce fwnmi an spapr capability and validate it against the kernels existing capability by trying to enable it. [eliminate cap_ppc_fwnmi, add fwnmi cap to migration state and reprhase the commit message] Signed-off-by: Ganesh Goudar Signed-off-by: Aravinda Prasad

[PATCH v18 0/7] target-ppc/spapr: Add FWNMI support in QEMU for PowerKM guests

2020-01-01 Thread Ganesh Goudar
This patch set adds support for FWNMI in PowerKVM guests. System errors such as SLB multihit and memory errors that cannot be corrected by hardware is passed on to the kernel for handling by raising machine check exception (an NMI). Upon such machine check exceptions, if the address in error

[PATCH v18 4/7] target/ppc: Build rtas error log upon an MCE

2020-01-01 Thread Ganesh Goudar
From: Aravinda Prasad Upon a machine check exception (MCE) in a guest address space, KVM causes a guest exit to enable QEMU to build and pass the error to the guest in the PAPR defined rtas error log format. This patch builds the rtas error log, copies it to the rtas_addr and then invokes the

Re: [PATCH ppc-for-5.0 1/1] ppc/spapr: Don't call KVM_SVM_OFF ioctl on TCG

2020-01-01 Thread David Gibson
On Thu, Jan 02, 2020 at 11:11:55AM +0530, Bharata B Rao wrote: > Invoking KVM_SVM_OFF ioctl for TCG guests will lead to a QEMU crash. > Fix this by ensuring that we don't call KVM_SVM_OFF ioctl on TCG. > > Reported-by: Alexey Kardashevskiy > Fixes: 4930c1966249 ("ppc/spapr: Support reboot of

sysbus usb xhci

2020-01-01 Thread Sai Pavan Boddu
Hi Gred, We are seeing of options to reuse the hcd-xhci model and use it over system bus interface rather than pci. (for Xilinx ZynqMP SOC, usb emulation) Are there any plans of implementing a sysbus device ? if none it would be good if provided few pointers to start. Im looking at

Re: [PATCH 1/2] virtio: reset region cache when on queue deletion

2020-01-01 Thread Yuri Benditovich
On Thu, Jan 2, 2020 at 1:50 AM Michael S. Tsirkin wrote: > On Thu, Dec 26, 2019 at 11:29:50AM +0200, Yuri Benditovich wrote: > > On Thu, Dec 26, 2019 at 10:58 AM Jason Wang wrote: > > > > > > > > > On 2019/12/26 下午12:36, Yuri Benditovich wrote: > > > >

Re: [PATCH 2/2] virtio-net: delete also control queue when TX/RX deleted

2020-01-01 Thread Yuri Benditovich
On Thu, Jan 2, 2020 at 1:43 AM Michael S. Tsirkin wrote: > On Thu, Dec 26, 2019 at 06:36:49AM +0200, Yuri Benditovich wrote: > > https://bugzilla.redhat.com/show_bug.cgi?id=1708480 > > If the control queue is not deleted together with TX/RX, it > > later will be ignored in freeing cache

[PATCH ppc-for-5.0 1/1] ppc/spapr: Don't call KVM_SVM_OFF ioctl on TCG

2020-01-01 Thread Bharata B Rao
Invoking KVM_SVM_OFF ioctl for TCG guests will lead to a QEMU crash. Fix this by ensuring that we don't call KVM_SVM_OFF ioctl on TCG. Reported-by: Alexey Kardashevskiy Fixes: 4930c1966249 ("ppc/spapr: Support reboot of secure pseries guest") Signed-off-by: Bharata B Rao --- target/ppc/kvm.c |

Re: [PATCH v4 ppc-for-5.0 2/2] ppc/spapr: Support reboot of secure pseries guest

2020-01-01 Thread Alexey Kardashevskiy
On 19/12/2019 14:14, Bharata B Rao wrote: > A pseries guest can be run as a secure guest on Ultravisor-enabled > POWER platforms. When such a secure guest is reset, we need to > release/reset a few resources both on ultravisor and hypervisor side. > This is achieved by invoking this new ioctl

Re: [PATCH 11/14] hw/ppc/Kconfig: Only select FDT helper for machines using it

2020-01-01 Thread David Gibson
On Tue, Dec 31, 2019 at 07:32:13PM +0100, Philippe Mathieu-Daudé wrote: > Not all machines use the ppc_create_page_sizes_prop() helper. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson > --- > Can Kconfig can restrict to TARGET_PPC64? > --- > hw/ppc/Kconfig | 10

Re: [PATCH] vfio/pci: Don't remove irqchip notifier if not registered

2020-01-01 Thread David Gibson
On Tue, Dec 31, 2019 at 08:39:15AM -0500, Peter Xu wrote: > The kvm irqchip notifier is only registered if the device supports > INTx, however it's unconditionally removed. If the assigned device > does not support INTx, this will cause QEMU to crash when unplugging > the device from the system.

Re: [PATCH 13/14] hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF

2020-01-01 Thread David Gibson
On Tue, Dec 31, 2019 at 07:32:15PM +0100, Philippe Mathieu-Daudé wrote: > Only the OpenBIOS and SLOF firmwares use the CHRP NVRAM layout. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson > --- > hw/nvram/Kconfig | 4 > hw/nvram/Makefile.objs | 2 +- >

Re: [PATCH 07/14] hw/ppc/Kconfig: Let the Sam460ex board use the PowerPC 405 devices

2020-01-01 Thread David Gibson
On Tue, Dec 31, 2019 at 07:32:09PM +0100, Philippe Mathieu-Daudé wrote: > When configured with --without-default-devices, the build fails: > > LINKppc-softmmu/qemu-system-ppc > /usr/bin/ld: hw/ppc/sam460ex.o: in function `sam460ex_init': > hw/ppc/sam460ex.c:313: undefined reference to

Re: [PATCH 10/14] hw/ppc/Kconfig: Only select fw_cfg with machines using OpenBIOS

2020-01-01 Thread David Gibson
On Tue, Dec 31, 2019 at 07:32:12PM +0100, Philippe Mathieu-Daudé wrote: > The fw_cfg helpers are only used by machines using OpenBIOS. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson > --- > Cc: Mark Cave-Ayland > Cc: "Hervé Poussineau" > --- > hw/ppc/Kconfig | 6

Re: [PATCH 06/14] hw/ppc/Kconfig: Restrict the MPC I2C controller to e500-based platforms

2020-01-01 Thread David Gibson
On Tue, Dec 31, 2019 at 07:32:08PM +0100, Philippe Mathieu-Daudé wrote: > Only the PowerPC e500-based platforms use the MPC I2C controller. > Do not build it for the other machines. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson > --- > default-configs/ppc-softmmu.mak | 1 -

Re: [PATCH 09/14] hw/ppc/Makefile: Simplify the sPAPR PCI objects rule

2020-01-01 Thread David Gibson
On Tue, Dec 31, 2019 at 07:32:11PM +0100, Philippe Mathieu-Daudé wrote: > The CONFIG_PSERIES already selects CONFIG_PCI. > Simplify the Makefile rules. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson > --- > hw/ppc/Makefile.objs | 5 + > 1 file changed, 1 insertion(+), 4

Re: [PATCH 08/14] hw/ppc/Kconfig: Let the Xilinx Virtex5 ML507 use the PPC-440 devices

2020-01-01 Thread David Gibson
On Tue, Dec 31, 2019 at 07:32:10PM +0100, Philippe Mathieu-Daudé wrote: > When configured with --without-default-devices, the build fails: > > LINKppc-softmmu/qemu-system-ppc > /usr/bin/ld: hw/ppc/virtex_ml507.o: in function `ppc440_init_xilinx': > hw/ppc/virtex_ml507.c:112: undefined

Re: [BUG qemu 4.0] segfault when unplugging virtio-blk-pci device

2020-01-01 Thread Eryu Guan
On Tue, Dec 31, 2019 at 11:51:35AM +0100, Igor Mammedov wrote: > On Tue, 31 Dec 2019 18:34:34 +0800 > Eryu Guan wrote: > > > Hi, > > > > I'm using qemu 4.0 and hit segfault when tearing down kata sandbox, I > > think it's because io completion hits use-after-free when device is > > already

Re: [PATCH v2 1/4] tcg: Search includes from the project root source directory

2020-01-01 Thread David Gibson
On Wed, Jan 01, 2020 at 12:23:00PM +0100, Philippe Mathieu-Daudé wrote: > We currently search both the root and the tcg/ directories for tcg > files: > > $ git grep '#include "tcg/' | wc -l > 28 > > $ git grep '#include "tcg[^/]' | wc -l > 94 > > To simplify the preprocessor search

Re: [PATCH v2 2/4] tcg: Search includes in the parent source directory

2020-01-01 Thread David Gibson
On Wed, Jan 01, 2020 at 12:23:01PM +0100, Philippe Mathieu-Daudé wrote: > All the *.inc.c files included by tcg/$TARGET/tcg-target.inc.c > are in tcg/, their parent directory. To simplify the preprocessor > search path, include the relative parent path: '..'. > > Patch created mechanically by

Re: [PATCH 1/2] virtio: reset region cache when on queue deletion

2020-01-01 Thread Michael S. Tsirkin
On Thu, Dec 26, 2019 at 11:29:50AM +0200, Yuri Benditovich wrote: > On Thu, Dec 26, 2019 at 10:58 AM Jason Wang wrote: > > > > > > On 2019/12/26 下午12:36, Yuri Benditovich wrote: > > > https://bugzilla.redhat.com/show_bug.cgi?id=1708480 > > > Fix leak of region reference that prevents complete > >

Re: [PATCH 2/2] virtio-net: delete also control queue when TX/RX deleted

2020-01-01 Thread Michael S. Tsirkin
On Thu, Dec 26, 2019 at 06:36:49AM +0200, Yuri Benditovich wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1708480 > If the control queue is not deleted together with TX/RX, it > later will be ignored in freeing cache resources and hot > unplug will not be completed. > > Signed-off-by: Yuri

Re: [PATCH v2 2/2] ide: Fix incorrect handling of some PRDTs in ide_dma_cb()

2020-01-01 Thread Alexander Popov
On 24.12.2019 07:18, Alexander Popov wrote: > On 24.12.2019 03:20, John Snow wrote: >> On 12/19/19 10:01 AM, Kevin Wolf wrote: >>> >>> John, what do you think? >>> >> >> I've been out to lunch for a little while. There are some issues that I >> recall with IDE, but couldn't find the time to fix

[Bug 1858046] [NEW] qemu-aarch64 hangs on cptofs during a build of NixOS SD card image

2020-01-01 Thread Ryan Lahfa
Public bug reported: First, thank you for this incredible project. While following this guide to build my own image of NixOS: https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_QEMU on ARM Aarch64. I encountered a very strange behavior, qemu is correctly used and build most of the binaries

[PATCH] q800: map reset function to poweroff of some random kernel

2020-01-01 Thread Jason A. Donenfeld
This commit is intentionally ridiculous. Currently calling `reboot(RB_AUTOBOOT);` in Linux will result in arch/m68k/mac/misc.c's mac_reset function being called. That in turn looks at the rombase (or uses 0x4080 is there's no rombase), adds 0xa, and jumps to that address. In the kernels I'm

Re: [PATCH 66/86] ppc:ppc440_bamboo/sam460ex: drop RAM size fixup

2020-01-01 Thread BALATON Zoltan
On Wed, 1 Jan 2020, Philippe Mathieu-Daudé wrote: On 1/1/20 12:54 PM, BALATON Zoltan wrote: On Tue, 31 Dec 2019, Igor Mammedov wrote: If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so

Re: [PATCH 05/14] hw/i2c/Kconfig: Add an entry for the SMBus

2020-01-01 Thread Philippe Mathieu-Daudé
On 1/1/20 5:15 PM, Corey Minyard wrote: On Wed, Jan 01, 2020 at 11:25:42AM +0100, Philippe Mathieu-Daudé wrote: On 12/31/19 8:16 PM, Corey Minyard wrote: On Tue, Dec 31, 2019 at 07:32:07PM +0100, Philippe Mathieu-Daudé wrote: The System Management Bus is more or less a derivative of the I2C

Re: [PATCH 05/14] hw/i2c/Kconfig: Add an entry for the SMBus

2020-01-01 Thread Corey Minyard
On Wed, Jan 01, 2020 at 11:25:42AM +0100, Philippe Mathieu-Daudé wrote: > On 12/31/19 8:16 PM, Corey Minyard wrote: > > On Tue, Dec 31, 2019 at 07:32:07PM +0100, Philippe Mathieu-Daudé wrote: > > > The System Management Bus is more or less a derivative of the I2C > > > bus, thus the Kconfig entry

Re: [PATCH 66/86] ppc:ppc440_bamboo/sam460ex: drop RAM size fixup

2020-01-01 Thread Philippe Mathieu-Daudé
On 1/1/20 12:54 PM, BALATON Zoltan wrote: On Tue, 31 Dec 2019, Igor Mammedov wrote: If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up

Re: [PATCH 07/14] hw/ppc/Kconfig: Let the Sam460ex board use the PowerPC 405 devices

2020-01-01 Thread Philippe Mathieu-Daudé
On 1/1/20 12:29 PM, BALATON Zoltan wrote: On Tue, 31 Dec 2019, Philippe Mathieu-Daudé wrote: When configured with --without-default-devices, the build fails:    LINK    ppc-softmmu/qemu-system-ppc  /usr/bin/ld: hw/ppc/sam460ex.o: in function `sam460ex_init':  hw/ppc/sam460ex.c:313: undefined

Re: [PATCH 66/86] ppc:ppc440_bamboo/sam460ex: drop RAM size fixup

2020-01-01 Thread BALATON Zoltan
On Tue, 31 Dec 2019, Igor Mammedov wrote: If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to

Re: [PATCH 07/14] hw/ppc/Kconfig: Let the Sam460ex board use the PowerPC 405 devices

2020-01-01 Thread BALATON Zoltan
On Tue, 31 Dec 2019, Philippe Mathieu-Daudé wrote: When configured with --without-default-devices, the build fails: LINKppc-softmmu/qemu-system-ppc /usr/bin/ld: hw/ppc/sam460ex.o: in function `sam460ex_init': hw/ppc/sam460ex.c:313: undefined reference to `ppc4xx_plb_init' /usr/bin/ld:

[PATCH v2 3/4] tcg: Move TCG headers to include/tcg/

2020-01-01 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- {tcg => include/tcg}/tcg-gvec-desc.h | 0 {tcg => include/tcg}/tcg-mo.h| 0 {tcg => include/tcg}/tcg-op-gvec.h | 0 {tcg => include/tcg}/tcg-op.h| 0 {tcg => include/tcg}/tcg-opc.h | 0 {tcg => include/tcg}/tcg.h | 0

[PATCH v2 2/4] tcg: Search includes in the parent source directory

2020-01-01 Thread Philippe Mathieu-Daudé
All the *.inc.c files included by tcg/$TARGET/tcg-target.inc.c are in tcg/, their parent directory. To simplify the preprocessor search path, include the relative parent path: '..'. Patch created mechanically by running: $ for x in tcg-pool.inc.c tcg-ldst.inc.c; do \ sed -i "s,#include

[PATCH v2 4/4] configure: Remove tcg/ from the preprocessor include search list

2020-01-01 Thread Philippe Mathieu-Daudé
All tcg includes are relative to the repository root directory, we can safely remove the tcg/ directory from the include search path list. Signed-off-by: Philippe Mathieu-Daudé --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 940bf9e87a..74dad08580

[PATCH v2 1/4] tcg: Search includes from the project root source directory

2020-01-01 Thread Philippe Mathieu-Daudé
We currently search both the root and the tcg/ directories for tcg files: $ git grep '#include "tcg/' | wc -l 28 $ git grep '#include "tcg[^/]' | wc -l 94 To simplify the preprocessor search path, unify by expliciting the tcg/ directory. Patch created mechanically by running: $ for

[PATCH v2 0/4] tcg: Include tcg files using tcg/ dirname, reduce cpp search path list

2020-01-01 Thread Philippe Mathieu-Daudé
Noticed we could clean this while reviewing Richard patch last night: https://www.mail-archive.com/qemu-devel@nongnu.org/msg667606.html Since v1: - moved headers to include/tcg/ (Paolo) - include in .inc.c relative to parent (Stefan) v1:

Re: [PATCH 12/14] hw/nvram/Kconfig: Add an entry for the NMC93xx EEPROM

2020-01-01 Thread Philippe Mathieu-Daudé
On 12/31/19 7:32 PM, Philippe Mathieu-Daudé wrote: The NMC93xx EEPROM is only used by few NIC cards and the Am53C974 SCSI controller. Signed-off-by: Philippe Mathieu-Daudé --- Cc: Stefan Weil --- hw/net/Kconfig | 2 ++ hw/nvram/Kconfig | 4 hw/nvram/Makefile.objs | 2 +-

Re: [PATCH 05/14] hw/i2c/Kconfig: Add an entry for the SMBus

2020-01-01 Thread Philippe Mathieu-Daudé
On 12/31/19 8:16 PM, Corey Minyard wrote: On Tue, Dec 31, 2019 at 07:32:07PM +0100, Philippe Mathieu-Daudé wrote: The System Management Bus is more or less a derivative of the I2C bus, thus the Kconfig entry depends of I2C. Not all boards providing an I2C bus support SMBus. Use two different