[PATCH] target/i386: correctly mask SSE4a bit indices in register operands

2022-09-18 Thread Paolo Bonzini
SSE4a instructions EXTRQ and INSERTQ have two bit index operands, that can be immediates or taken from an XMM register. In both cases, the fields are 6-bit wide and the top two bits in the byte are ignored. translate.c is doing that correctly for the immediate case, but not for the XMM case, so f

Re: [PATCH v3 03/20] ppc4xx_sdram: Get rid of the init RAM hack

2022-09-18 Thread Cédric Le Goater
On 9/14/22 20:25, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/14/22 13:44, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/13/22 21:52, BALATON Zoltan wrote: The do_init parameter of ppc4xx_sdram_init() is used to map memory regions that is

Re: [PATCH v3 03/20] ppc4xx_sdram: Get rid of the init RAM hack

2022-09-18 Thread Cédric Le Goater
On 9/14/22 20:32, BALATON Zoltan wrote: On Wed, 14 Sep 2022, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/14/22 13:44, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/13/22 21:52, BALATON Zoltan wrote: The do_init parameter of ppc4xx_sdram_i

[PATCH] target/i386: fix INSERTQ implementation

2022-09-18 Thread Paolo Bonzini
INSERTQ is defined to not modify any bits in the lower 64 bits of the destination, other than the ones being replaced with bits from the source operand. QEMU instead is using unshifted bits from the source for those bits. Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h| 10 +-

[PATCH] target/riscv: Check the correct exception cause in vector GDB stub

2022-09-18 Thread frank . chang
From: Frank Chang After RISCVException enum is introduced, riscv_csrrw_debug() returns RISCV_EXCP_NONE to indicate there's no error. RISC-V vector GDB stub should check the result against RISCV_EXCP_NONE instead of value 0. Otherwise, 'E14' packet would be incorrectly reported for vector CSRs whe

Re: [PATCH 0/3] Add qemu-img checksum command using blkhash

2022-09-18 Thread Nir Soffer
ping Kevin, Hanna, I hope you have time to take a look. https://lists.nongnu.org/archive/html/qemu-block/2022-09/msg00021.html On Thu, Sep 1, 2022 at 5:32 PM Nir Soffer wrote: > > Since blkhash is available only via copr now, the new command is added as > optional feature, built only if blkhas

Re: [PATCH v4 14/21] ppc440_sdram: Move RAM size check to ppc440_sdram_init

2022-09-18 Thread BALATON Zoltan
On Sun, 18 Sep 2022, Philippe Mathieu-Daudé wrote: On 14/9/22 13:34, BALATON Zoltan wrote: Move the check for valid memory sizes from board to sdram controller init. Board now only checks for additional restrictions imposed by firmware then sdram init checks for valid sizes for SoC. Signed-off-

Re: [PATCH v3 03/20] ppc4xx_sdram: Get rid of the init RAM hack

2022-09-18 Thread BALATON Zoltan
On Sun, 18 Sep 2022, Cédric Le Goater wrote: On 9/14/22 20:32, BALATON Zoltan wrote: On Wed, 14 Sep 2022, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/14/22 13:44, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/13/22 21:52, BALATON Zoltan w

Re: [PATCH v3 03/20] ppc4xx_sdram: Get rid of the init RAM hack

2022-09-18 Thread BALATON Zoltan
On Sun, 18 Sep 2022, BALATON Zoltan wrote: On Sun, 18 Sep 2022, Cédric Le Goater wrote: On 9/14/22 20:32, BALATON Zoltan wrote: On Wed, 14 Sep 2022, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/14/22 13:44, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goate

Re: [Bug 1772165] Re: arm raspi2/raspi3 emulation has no USB support

2022-09-18 Thread Philippe Mathieu-Daudé via
On Tue, Feb 22, 2022 at 3:15 PM Carlo Bramini <1772...@bugs.launchpad.net> wrote: > > I'm also trying to run QEMU for emulating Raspberry PI, but I'm still unable > to make working external USB devices like keyboard and mouse. > Unlike previous users, I'm not using a linux distro but Microsoft Win

Re: [PATCH 01/11] hw/ppc/meson: Allow e500 boards to be enabled separately

2022-09-18 Thread Philippe Mathieu-Daudé via
On 15/9/22 17:25, Bernhard Beschow wrote: Gives users more fine-grained control over what should be compiled into QEMU. Signed-off-by: Bernhard Beschow --- configs/devices/ppc-softmmu/default.mak | 3 ++- hw/ppc/Kconfig | 8 hw/ppc/meson.build

Re: [PATCH 02/11] hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx

2022-09-18 Thread Philippe Mathieu-Daudé via
On 15/9/22 17:25, Bernhard Beschow wrote: Having a dedicated config switch makes dependency handling cleaner. Signed-off-by: Bernhard Beschow --- hw/gpio/Kconfig | 3 +++ hw/gpio/meson.build | 2 +- hw/ppc/Kconfig | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) Reviewed-b

Re: [PATCH 03/11] docs/system/ppc/ppce500: Add heading for networking chapter

2022-09-18 Thread Philippe Mathieu-Daudé
On 15/9/22 17:25, Bernhard Beschow wrote: The sudden change of topics is slightly confusing and makes the networking information less visible. So separate the networking chapter to improve comprehensibility. Signed-off-by: Bernhard Beschow --- docs/system/ppc/ppce500.rst | 3 +++ 1 file chan

Re: [PATCH 05/11] hw/ppc/e500: Remove if statement which is now always true

2022-09-18 Thread Philippe Mathieu-Daudé via
On 15/9/22 17:25, Bernhard Beschow wrote: Now that the MPC8544DS board also has a platform bus, the if statement was always true. s/was/is/. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 30 ++ hw/ppc/e500.h

Re: [PATCH 08/11] hw/sd/sdhci-internal: Unexport ESDHC defines

2022-09-18 Thread Philippe Mathieu-Daudé via
On 15/9/22 17:25, Bernhard Beschow wrote: These defines aren't used outside of sdhci.c, so can be defined there. Signed-off-by: Bernhard Beschow --- hw/sd/sdhci-internal.h | 20 hw/sd/sdhci.c | 19 +++ 2 files changed, 19 insertions(+), 20 delet

Re: [PATCH 00/11] ppc/e500: Add support for two types of flash, cleanup

2022-09-18 Thread Philippe Mathieu-Daudé via
On 15/9/22 17:25, Bernhard Beschow wrote: This series adds support for -pflash and direct SD card access to the PPC e500 boards. The idea is to increase compatibility with "real" firmware images where only the bare minimum of drivers is compiled in. The series is structured as follows: Patches

[PATCH] ui/console: fix three double frees in png_save()

2022-09-18 Thread Volker Rümelin
The png_destroy_write_struct() function frees all memory used by libpng. Don't use the glib auto cleanup mechanism to free the memory allocated by libpng again. For the pixman image, use only the auto cleanup mechanism and remove the qemu_pixman_image_unref() function call to prevent another double

[PATCH 8/8] Ping : hw/gpio Fix license statements in avr_gpio

2022-09-18 Thread Heecheol Yang
I send this patch to continue our works discussed about two years ago. Due to my personal issue, I couldn't noticed that there were some issues in license statements in the code. I am very sorry for my late response and politely request to check this patch. Signed-off-by: Heecheol Yang --- hw

Re: [PATCH v11 11/21] jobs: group together API calls under the same job lock

2022-09-18 Thread Emanuele Giuseppe Esposito
Am 14/09/2022 um 14:36 schrieb Vladimir Sementsov-Ogievskiy: > On 8/26/22 16:20, Emanuele Giuseppe Esposito wrote: >> Now that the API offers also _locked() functions, take advantage >> of it and give also the caller control to take the lock and call >> _locked functions. >> >> This makes sense

Re: [PATCH v11 13/21] jobs: protect job.aio_context with BQL and job_mutex

2022-09-18 Thread Emanuele Giuseppe Esposito
Am 14/09/2022 um 15:25 schrieb Vladimir Sementsov-Ogievskiy: > On 8/26/22 16:20, Emanuele Giuseppe Esposito wrote: >> In order to make it thread safe, implement a "fake rwlock", >> where we allow reads under BQL *or* job_mutex held, but >> writes only under BQL *and* job_mutex. >> >> The only wr

Re: [PATCH v11 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-09-18 Thread Emanuele Giuseppe Esposito
Am 15/09/2022 um 16:52 schrieb Vladimir Sementsov-Ogievskiy: > On 8/26/22 16:21, Emanuele Giuseppe Esposito wrote: >> Change the job_{lock/unlock} and macros to use job_mutex. >> >> Now that they are not nop anymore, remove the aiocontext >> to avoid deadlocks. >> >> Therefore: >> - when possibl

Re: [PATCH v11 21/21] job: remove unused functions

2022-09-18 Thread Emanuele Giuseppe Esposito
Am 14/09/2022 um 16:28 schrieb Vladimir Sementsov-Ogievskiy: > On 8/26/22 16:21, Emanuele Giuseppe Esposito wrote: >> These public functions are not used anywhere, thus can be dropped. >> Also, since this is the final job API that doesn't use AioContext >> lock and replaces it with job_lock, adj

Re: [PATCH] ui/console: fix three double frees in png_save()

2022-09-18 Thread Philippe Mathieu-Daudé via
+Kshitij On Sun, Sep 18, 2022 at 6:24 PM Volker Rümelin wrote: > > The png_destroy_write_struct() function frees all memory used by > libpng. Don't use the glib auto cleanup mechanism to free the > memory allocated by libpng again. For the pixman image, use only the > auto cleanup mechanism and r

Re: [PULL 00/12] linux-user patches

2022-09-18 Thread Helge Deller
On 9/17/22 22:11, Stefan Hajnoczi wrote: On Sat, 17 Sept 2022 at 15:31, Philippe Mathieu-Daudé wrote: On 17/9/22 16:26, Stefan Hajnoczi wrote: The close_range(2) man page says: close_range() first appeared in Linux 5.9. Library support was added in glibc in version 2.34. The qemu-user GitLa

Re: [PATCH 07/42] hw/intc/i8259: Introduce i8259 proxy "isa-pic"

2022-09-18 Thread Mark Cave-Ayland
On 01/09/2022 17:25, Bernhard Beschow wrote: Having an i8259 proxy allows for ISA PICs to be created and wired up in southbridges. This is especially interesting for PIIX3 for two reasons: First, the southbridge doesn't need to care about the virtualization technology used (KVM, TCG, Xen) due to

Re: [PATCH 14/42] hw/isa/piix3: Modernize reset handling

2022-09-18 Thread Mark Cave-Ayland
On 01/09/2022 17:25, Bernhard Beschow wrote: Rather than registering the reset handler via a function which appends the handler to a global list, prefer to implement it as a virtual method - PIIX4 does the same already. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 8 +++- 1 file

[PATCH v3 00/12] linux-user: Add more syscalls, enhance tracing & logging enhancements

2022-09-18 Thread Helge Deller
Here is a bunch of patches for linux-user. Most of them add missing syscalls and enhance the tracing/logging. Some of the patches are target-hppa specific. I've tested those on productive hppa debian buildd servers (running qemu-user). Thanks! Helge Changes to v2: - Fix build of close_range() an

[PATCH v3 09/12] linux-user: Add strace for clock_nanosleep()

2022-09-18 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.c| 15 +++ linux-user/strace.list | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 2f539845bb..6f818212d5 100644 --- a/linux-user/strace.c +++ b/linux-user/str

[PATCH v3 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-18 Thread Helge Deller
Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which use newer glibc versions. Signed-off-by: Helge Deller --- linux-user/strace.c| 53 ++ linux-user/strace.list | 4 2 files cha

[PATCH v3 03/12] linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls

2022-09-18 Thread Helge Deller
I noticed those were missing when running the glib2.0 testsuite. Add the syscalls including the strace output. Signed-off-by: Helge Deller --- linux-user/strace.c| 28 linux-user/strace.list | 9 + linux-user/syscall.c | 34

[PATCH v3 11/12] linux-user: Add close_range() syscall

2022-09-18 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.list | 3 +++ linux-user/syscall.c | 16 2 files changed, 19 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 215d971b2a..ad9ef94689 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.l

[PATCH v3 01/12] linux-user: Add missing signals in strace output

2022-09-18 Thread Helge Deller
Some of the guest signal numbers are currently not converted to their representative names in the strace output, e.g. SIGVTALRM. This patch introduces a smart way to generate and keep in sync the host-to-guest and guest-to-host signal conversion tables for usage in the qemu signal and strace code.

[PATCH v3 10/12] linux-user: Show timespec on strace for futex()

2022-09-18 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 6f818212d5..b6b9abaea4 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3714,11 +3714,20 @@ print_futex

[PATCH v3 12/12] linux-user: Add parameters of getrandom() syscall for strace

2022-09-18 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index ad9ef94689..97d8ccadac 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -355,7 +355,7 @@ { TARGET_NR

[PATCH v3 08/12] linux-user/hppa: Set TASK_UNMAPPED_BASE to 0xfa000000 for hppa arch

2022-09-18 Thread Helge Deller
On the parisc architecture the stack grows upwards. Move the TASK_UNMAPPED_BASE to high memory area as it's done by the kernel on physical machines. Signed-off-by: Helge Deller --- linux-user/mmap.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/mmap.c b/linux-user/mmap.c ind

[PATCH v3 04/12] linux-user: Log failing executable in EXCP_DUMP()

2022-09-18 Thread Helge Deller
Enhance the EXCP_DUMP() macro to print out the failing program too. During debugging it's sometimes hard to track down the actual failing program if you are e.g. building a whole debian package. Signed-off-by: Helge Deller --- linux-user/cpu_loop-common.h | 2 ++ 1 file changed, 2 insertions(+)

[PATCH v3 05/12] linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info

2022-09-18 Thread Helge Deller
Enhance the hppa linux-user cpu_loop() to show more debugging info on hard errors. Signed-off-by: Helge Deller --- linux-user/hppa/cpu_loop.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 64263c3dc4..1ef3b46

[PATCH v3 06/12] linux-user/hppa: Dump IIR on register dump

2022-09-18 Thread Helge Deller
Include the IIR register (which holds the opcode of the failing instruction) when dumping the hppa registers. Signed-off-by: Helge Deller --- target/hppa/helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index e2758d8df

[PATCH v3 07/12] linux-user: Fix strace of chmod() if mode == 0

2022-09-18 Thread Helge Deller
If the mode parameter of chmod() is zero, this value isn't shown when stracing a program: chmod("filename",) This patch fixes it up to show the zero-value as well: chmod("filename",000) Signed-off-by: Helge Deller --- linux-user/strace.c | 5 + 1 file changed, 5 insertions(+) diff -

Re: [PATCH 26/42] hw/isa/piix4: Make PIIX4's ACPI and USB functions optional

2022-09-18 Thread Mark Cave-Ayland
On 01/09/2022 17:25, Bernhard Beschow wrote: This aligns PIIX4 with PIIX3. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 44 hw/mips/malta.c | 6 -- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/hw/isa/piix4.c b/h

Re: [PATCH 39/42] hw/isa/piix: Unexport PIIXState

2022-09-18 Thread Mark Cave-Ayland
On 01/09/2022 17:26, Bernhard Beschow wrote: The - deliberately exported - components can still be accessed via QOM properties. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 52 + include/hw/southbridge/piix.h | 54 --

Re: [PATCH 00/42] Consolidate PIIX south bridges

2022-09-18 Thread Mark Cave-Ayland
On 01/09/2022 17:25, Bernhard Beschow wrote: This series consolidates the implementations of the PIIX3 and PIIX4 south bridges and is an extended version of [1]. The motivation is to share as much code as possible and to bring both device models to feature parity such that perhaps PIIX4 can beco

[PATCH v5 04/21] ppc4xx: Use Ppc4xxSdramBank in ppc4xx_sdram_banks()

2022-09-18 Thread BALATON Zoltan
Change ppc4xx_sdram_banks() to take one Ppc4xxSdramBank array instead of the separate arrays and adjust ppc4xx_sdram_init() and ppc440_sdram_init() accordingly as well as machines using these. Signed-off-by: BALATON Zoltan Reviewed-by: Cédric Le Goater --- v2: Use pointer for ram_banks in the pr

[PATCH v5 01/21] ppc440_bamboo: Remove unnecessary memsets

2022-09-18 Thread BALATON Zoltan
In ppc4xx_sdram_init() the struct is allocated with g_new0() so no need to clear its elements. In the bamboo machine init memset can be replaced with array initialiser which is shorter. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_bamboo.c | 6 ++ hw/ppc/ppc4xx_devs.c | 8 ++-- 2 fi

[PATCH v5 00/21] ppc4xx_sdram QOMify and clean ups

2022-09-18 Thread BALATON Zoltan
This is the end of the QOMify series started by Cédric. This series handles the SDRAM controller models to clean them up, QOMify and unify them and at least partially clean up the mess that has accumulated around these in the past. This includes the not yet merged patches from the last series and n

[PATCH v5 02/21] ppc4xx: Introduce Ppc4xxSdramBank struct

2022-09-18 Thread BALATON Zoltan
Instead of storing sdram bank parameters in unrelated arrays put them in a struct so it's clear they belong to the same bank and simplify the state struct using this bank type. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc440_uc.c | 49 +--

[PATCH v5 03/21] ppc4xx_sdram: Get rid of the init RAM hack

2022-09-18 Thread BALATON Zoltan
The do_init parameter of ppc4xx_sdram_init() is used to map memory regions that is normally done by the firmware by programming the SDRAM controller. Do this from board code emulating what firmware would do when booting a kernel directly from -kernel without a firmware so we can get rid of this do_

[PATCH v5 07/21] ppc4xx_sdram: QOM'ify

2022-09-18 Thread BALATON Zoltan
Change the ppc4xx_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr. This is mostly modelling the DDR SDRAM controller found in the 440EP (used on the bamboo board) but also backward compatible with the older DDR controllers on some 405 SoCs so we also use i

[PATCH v5 05/21] ppc440_bamboo: Add missing 4 MiB valid memory size

2022-09-18 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Cédric Le Goater --- hw/ppc/ppc440_bamboo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index edfb8c9709..7ec7c7c43d 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c

[PATCH v5 11/21] ppc440_sdram: Get rid of the init RAM hack

2022-09-18 Thread BALATON Zoltan
Remove the do_init parameter of ppc440_sdram_init and enable SDRAM controller from the board. Firmware does this so it may only be needed when booting with -kernel without firmware but we enable SDRAM unconditionally to preserve previous behaviour. Signed-off-by: BALATON Zoltan --- v5: Add functi

[PATCH v5 08/21] ppc4xx_sdram: Drop extra zeros for readability

2022-09-18 Thread BALATON Zoltan
Constants that are written zero padded for no good reason are hard to read, it's easier to see what is meant if it's just 0 or 1 instead. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc4xx_devs.c | 40 1 file changed, 20

[PATCH v5 09/21] ppc440_sdram: Split off map/unmap of sdram banks for later reuse

2022-09-18 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 33 + 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 8eae4ad9f0..900b7ab998 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -23,6 +23,7

[PATCH v5 06/21] ppc4xx_sdram: Move size check to ppc4xx_sdram_init()

2022-09-18 Thread BALATON Zoltan
Instead of checking if memory size is valid in board code move this check to ppc4xx_sdram_init() as this is a restriction imposed by the SDRAM controller. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc405.h | 2 -- hw/ppc/ppc405_boards.c | 10

[PATCH v5 17/21] ppc4xx_sdram: Use hwaddr for memory bank size

2022-09-18 Thread BALATON Zoltan
This resolves the target_ulong dependency that's clearly wrong and was also noted in a fixme comment. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc4xx_sdram.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/ppc/ppc4xx_sdr

[PATCH v5 12/21] ppc440_sdram: Rename local variable for readability

2022-09-18 Thread BALATON Zoltan
Rename local sdram variable in ppc440_sdram_init to s for readability. Signed-off-by: BALATON Zoltan Reviewed-by: Cédric Le Goater --- hw/ppc/ppc440_uc.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440

[PATCH v5 10/21] ppc440_sdram: Implement enable bit in the DDR2 SDRAM

2022-09-18 Thread BALATON Zoltan
To allow removing the do_init hack we need to improve the DDR2 SDRAM controller model to handle the enable/disable bit that it ignored so far. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --gi

[PATCH v5 16/21] ppc4xx_sdram: Move ppc4xx DDR and DDR2 SDRAM controller models together

2022-09-18 Thread BALATON Zoltan
Move the PPC4xx DDR and DDR2 SDRAM contrller models into a new file called ppc4xx_sdram to separate from other device models and put them in one place allowing sharing some code between them. Signed-off-by: BALATON Zoltan --- hw/ppc/meson.build | 3 +- hw/ppc/ppc440_uc.c | 332 --

[PATCH v5 21/21] ppc4xx_sdram: Add errp parameter to ppc4xx_sdram_banks()

2022-09-18 Thread BALATON Zoltan
Do not exit from ppc4xx_sdram_banks() but report error via an errp parameter instead. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc4xx_sdram.c | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/hw/ppc/ppc4xx_sdram

[PATCH v5 13/21] ppc4xx_sdram: Rename functions to prevent name clashes

2022-09-18 Thread BALATON Zoltan
Rename functions to avoid name clashes when moving the DDR2 controller model currently called ppc440_sdram to ppc4xx_devs. This also more clearly shows which function belongs to which model. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc405_boards.c | 2 +- h

[PATCH v5 14/21] ppc440_sdram: Move RAM size check to ppc440_sdram_init

2022-09-18 Thread BALATON Zoltan
Move the check for valid memory sizes from board to sdram controller init. This adds the missing valid memory sizes of 4 GiB, 16 and 8 MiB to the DoC and the board now only checks for additional restrictions imposed by its firmware then sdram init checks for valid sizes for SoC. Signed-off-by: BAL

[PATCH v5 18/21] ppc4xx_sdram: Rename local state variable for brevity

2022-09-18 Thread BALATON Zoltan
Rename the sdram local state variable to s in dcr read/write functions and reset methods for better readability and to match realize methods. Other places not converted will be changed or removed in subsequent patches. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc4xx_sdram.c | 158 +++

Re: [PATCH v3 06/12] linux-user/hppa: Dump IIR on register dump

2022-09-18 Thread Philippe Mathieu-Daudé via
On 18/9/22 21:45, Helge Deller wrote: Include the IIR register (which holds the opcode of the failing instruction) when dumping the hppa registers. Signed-off-by: Helge Deller --- target/hppa/helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu

[PATCH v5 19/21] ppc4xx_sdram: Generalise bank setup

2022-09-18 Thread BALATON Zoltan
Currently only base and size are set on initial bank creation and bcr value is computed on mapping the region. Set bcr at init so the bcr encoding method becomes local to the controller model and mapping and unmapping can operate on the bank so it can be shared between different controller models.

[PATCH v5 15/21] ppc440_sdram: QOM'ify

2022-09-18 Thread BALATON Zoltan
Change the ppc440_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr2. This is mostly modelling the DDR2 SDRAM controller found in the 460EX (used on the sam460ex board). Newer SoCs (regardless of their PPC core, e.g. 405EX) may have this controller but we on

Re: [PATCH v5 00/21] ppc4xx_sdram QOMify and clean ups

2022-09-18 Thread Philippe Mathieu-Daudé via
On 18/9/22 22:24, BALATON Zoltan wrote: This is the end of the QOMify series started by Cédric. This series handles the SDRAM controller models to clean them up, QOMify and unify them and at least partially clean up the mess that has accumulated around these in the past. This includes the not yet

[PATCH v5 20/21] ppc4xx_sdram: Convert DDR SDRAM controller to new bank handling

2022-09-18 Thread BALATON Zoltan
Use the generic bank handling introduced in previous patch in the DDR SDRAM controller too. This also fixes previously broken region unmap due to sdram_ddr_unmap_bcr() ignoring container region so it crashed with an assert when the guest tried to disable the controller. Signed-off-by: BALATON Zolt

Re: [PATCH v5 09/21] ppc440_sdram: Split off map/unmap of sdram banks for later reuse

2022-09-18 Thread Philippe Mathieu-Daudé via
On 18/9/22 22:24, BALATON Zoltan wrote: Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 33 + 1 file changed, 21 insertions(+), 12 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v3 04/12] linux-user: Log failing executable in EXCP_DUMP()

2022-09-18 Thread Philippe Mathieu-Daudé via
On 18/9/22 21:45, Helge Deller wrote: Enhance the EXCP_DUMP() macro to print out the failing program too. During debugging it's sometimes hard to track down the actual failing program if you are e.g. building a whole debian package. Signed-off-by: Helge Deller --- linux-user/cpu_loop-common.h

Re: [PATCH v3 12/12] linux-user: Add parameters of getrandom() syscall for strace

2022-09-18 Thread Philippe Mathieu-Daudé via
On 18/9/22 21:45, Helge Deller wrote: Signed-off-by: Helge Deller --- linux-user/strace.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index ad9ef94689..97d8ccadac 100644 --- a/linux-user/strace.list +++ b/linux-user/st

Re: [PATCH v3 07/12] linux-user: Fix strace of chmod() if mode == 0

2022-09-18 Thread Philippe Mathieu-Daudé via
On 18/9/22 21:45, Helge Deller wrote: If the mode parameter of chmod() is zero, this value isn't shown when stracing a program: chmod("filename",) This patch fixes it up to show the zero-value as well: chmod("filename",000) Signed-off-by: Helge Deller --- linux-user/strace.c | 5 +++

Re: [PATCH v5 18/21] ppc4xx_sdram: Rename local state variable for brevity

2022-09-18 Thread Philippe Mathieu-Daudé via
On 18/9/22 22:24, BALATON Zoltan wrote: Rename the sdram local state variable to s in dcr read/write functions and reset methods for better readability and to match realize methods. Other places not converted will be changed or removed in subsequent patches. Signed-off-by: BALATON Zoltan ---

Re: [PATCH v5 16/21] ppc4xx_sdram: Move ppc4xx DDR and DDR2 SDRAM controller models together

2022-09-18 Thread Philippe Mathieu-Daudé via
Hi Zoltan, On 18/9/22 22:24, BALATON Zoltan wrote: Move the PPC4xx DDR and DDR2 SDRAM contrller models into a new file called ppc4xx_sdram to separate from other device models and put them in one place allowing sharing some code between them. Signed-off-by: BALATON Zoltan --- hw/ppc/meson.bu

Re: [PATCH v5 16/21] ppc4xx_sdram: Move ppc4xx DDR and DDR2 SDRAM controller models together

2022-09-18 Thread BALATON Zoltan
On Sun, 18 Sep 2022, Philippe Mathieu-Daudé wrote: Hi Zoltan, On 18/9/22 22:24, BALATON Zoltan wrote: Move the PPC4xx DDR and DDR2 SDRAM contrller models into a new file called ppc4xx_sdram to separate from other device models and put them in one place allowing sharing some code between them.

Re: [PATCH 39/42] hw/isa/piix: Unexport PIIXState

2022-09-18 Thread Bernhard Beschow
Am 18. September 2022 20:21:09 UTC schrieb Mark Cave-Ayland : >On 01/09/2022 17:26, Bernhard Beschow wrote: > >> The - deliberately exported - components can still be accessed >> via QOM properties. >> >> Signed-off-by: Bernhard Beschow >> --- >> hw/isa/piix.c | 52

Re: [PATCH v3 03/20] ppc4xx_sdram: Get rid of the init RAM hack

2022-09-18 Thread BALATON Zoltan
On Sun, 18 Sep 2022, Cédric Le Goater wrote: On 9/14/22 20:25, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/14/22 13:44, BALATON Zoltan wrote: On Wed, 14 Sep 2022, Cédric Le Goater wrote: On 9/13/22 21:52, BALATON Zoltan wrote: The do_init parameter of ppc4xx_sdram

Re: [PATCH v5 16/21] ppc4xx_sdram: Move ppc4xx DDR and DDR2 SDRAM controller models together

2022-09-18 Thread Philippe Mathieu-Daudé via
On 18/9/22 23:24, BALATON Zoltan wrote: On Sun, 18 Sep 2022, Philippe Mathieu-Daudé wrote: Hi Zoltan, On 18/9/22 22:24, BALATON Zoltan wrote: Move the PPC4xx DDR and DDR2 SDRAM contrller models into a new file called ppc4xx_sdram to separate from other device models and put them in one place a

Re: [PATCH 05/42] hw/isa/piix3: Create USB controller in host device

2022-09-18 Thread Bernhard Beschow
Am 1. September 2022 19:13:22 UTC schrieb "Philippe Mathieu-Daudé" : >On 1/9/22 18:25, Bernhard Beschow wrote: >> The USB controller is an integral part of PIIX3 (function 2). So create >> it as part of the south bridge. >> >> Note that the USB function is optional in QEMU. This is why it gets >>

Re: [PATCH 26/42] hw/isa/piix4: Make PIIX4's ACPI and USB functions optional

2022-09-18 Thread Bernhard Beschow
Am 18. September 2022 20:10:51 UTC schrieb Mark Cave-Ayland : >On 01/09/2022 17:25, Bernhard Beschow wrote: > >> This aligns PIIX4 with PIIX3. >> >> Signed-off-by: Bernhard Beschow >> --- >> hw/isa/piix4.c | 44 >> hw/mips/malta.c | 6 -- >>

Re: [PATCH 00/42] Consolidate PIIX south bridges

2022-09-18 Thread Bernhard Beschow
Am 18. September 2022 20:22:55 UTC schrieb Mark Cave-Ayland : >On 01/09/2022 17:25, Bernhard Beschow wrote: > >> This series consolidates the implementations of the PIIX3 and PIIX4 south >> bridges and is an extended version of [1]. The motivation is to share as much >> code as possible and to bri

Re: [PATCH v9 1/7] include: add zoned device structs

2022-09-18 Thread Sam Li
Stefan Hajnoczi 于2022年9月18日周日 04:17写道: > > On Thu, Sep 15, 2022 at 06:06:38PM +0800, Sam Li wrote: > > Eric Blake 于2022年9月15日周四 16:05写道: > > > > > > On Sat, Sep 10, 2022 at 01:27:53PM +0800, Sam Li wrote: > > > > Signed-off-by: Sam Li > > > > Reviewed-by: Stefan Hajnoczi > > > > Reviewed-by: Da

[PATCH 0/4] Add a new backend for cryptodev

2022-09-18 Thread Lei He
This patch adds a new backend called LKCF to cryptodev, LKCF stands for Linux Kernel Cryptography Framework. If a cryptographic accelerator that supports LKCF is installed on the the host (you can see which algorithms are supported in host's LKCF by executing 'cat /proc/crypto'), then RSA operation

[PATCH 2/4] crypto: Support DER encodings

2022-09-18 Thread Lei He
Add encoding interfaces for DER encoding: 1. support decoding of 'bit string', 'octet string', 'object id' and 'context specific tag' for DER encoder. 2. implemented a simple DER encoder. 3. add more testsuits for DER encoder. Signed-off-by: lei he --- crypto/der.c | 307

[PATCH 1/4] virtio-crypto: Support asynchronous mode

2022-09-18 Thread Lei He
virtio-crypto: Modify the current interface of virtio-crypto device to support asynchronous mode. Signed-off-by: lei he --- backends/cryptodev-builtin.c| 69 ++--- backends/cryptodev-vhost-user.c | 51 +-- backends/cryptodev.c| 44 +++--- hw/virtio/virtio-crypto.c

[PATCH 4/4] cryptodev: Add a lkcf-backend for cryptodev

2022-09-18 Thread Lei He
cryptodev: Added a new type of backend named lkcf-backend for cryptodev. This backend upload asymmetric keys to linux kernel, and let kernel do the accelerations if possible. The lkcf stands for Linux Kernel Cryptography Framework. Signed-off-by: lei he --- backends/cryptodev-lkcf.c | 640 +

[PATCH 3/4] crypto: Support export akcipher to pkcs8

2022-09-18 Thread Lei He
crypto: support export RSA private keys with PKCS#8 standard. So that users can upload this private key to linux kernel. Signed-off-by: lei he --- crypto/akcipher.c | 17 + crypto/rsakey.c | 42 ++ crypto/rsakey.h

Re: [PATCH v6 2/2] i386: Add notify VM exit support

2022-09-18 Thread Chenyi Qiang
On 9/17/2022 5:57 AM, Peter Xu wrote: On Thu, Sep 15, 2022 at 05:28:39PM +0800, Chenyi Qiang wrote: There are cases that malicious virtual machine can cause CPU stuck (due to event windows don't open up), e.g., infinite loop in microcode when nested #AC (CVE-2015-5307). No event window means

Re: [PATCH v6 2/2] i386: Add notify VM exit support

2022-09-18 Thread Xiaoyao Li
On 9/19/2022 1:46 PM, Chenyi Qiang wrote: Not sure some warning would be also useful here, but I really don't know the whole context so I can't tell whether there can easily be false positives to pollute qemu log. The false positive case is not easy to happen unless some potential issues in s

[PATCH v2] ui/console: fix three double frees in png_save()

2022-09-18 Thread Volker Rümelin
The png_destroy_write_struct() function frees all memory used by libpng. Don't use the glib auto cleanup mechanism to free the memory allocated by libpng again. For the pixman image, use only the auto cleanup mechanism and remove the qemu_pixman_image_unref() function call to prevent another double

[PATCH v9 2/4] target/riscv: smstateen check for h/s/envcfg

2022-09-18 Thread Mayuresh Chitale
Accesses to henvcfg, henvcfgh and senvcfg are allowed only if the corresponding bit in mstateen0/hstateen0 is enabled. Otherwise an illegal instruction trap is generated. Signed-off-by: Mayuresh Chitale Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis --- target/riscv/csr.c | 87 +++

[PATCH v9 1/4] target/riscv: Add smstateen support

2022-09-18 Thread Mayuresh Chitale
Smstateen extension specifies a mechanism to close the potential covert channels that could cause security issues. This patch adds the CSRs defined in the specification and the corresponding predicates and read/write functions. Signed-off-by: Mayuresh Chitale --- target/riscv/cpu.h | 4 +

[PATCH v9 0/4] RISC-V Smstateen support

2022-09-18 Thread Mayuresh Chitale
This series adds support for the Smstateen specification which provides a mechanism to plug the potential covert channels which are opened by extensions that add to processor state that may not get context-switched. Currently access to *envcfg registers and floating point(fcsr) is controlled via sm

[PATCH v9 3/4] target/riscv: smstateen check for fcsr

2022-09-18 Thread Mayuresh Chitale
If smstateen is implemented and sstateen0.fcsr is clear then the floating point operations must return illegal instruction exception or virtual instruction trap, if relevant. Signed-off-by: Mayuresh Chitale --- target/riscv/csr.c| 23 + target/riscv/insn_trans

Re: [PATCH v3 1/1] monitor/hmp: print trace as option in help for log command

2022-09-18 Thread Dongli Zhang
Hi Markus, On 9/17/22 2:44 PM, Philippe Mathieu-Daudé via wrote: > Hi Markus, > > On 2/9/22 14:24, Markus Armbruster wrote: >> Dongli Zhang writes: >> >>> The below is printed when printing help information in qemu-system-x86_64 >>> command line, and when CONFIG_TRACE_LOG is enabled: >>> >>> ---

[PATCH v9 4/4] target/riscv: smstateen knobs

2022-09-18 Thread Mayuresh Chitale
Add knobs to allow users to enable smstateen and also export it via the ISA extension string. Signed-off-by: Mayuresh Chitale Reviewed-by: Weiwei Li --- target/riscv/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index aee14a239a..1252ca71b3 1