Re: [Qemu-devel] [PATCH v8 5/6] ppc: spapr: Enable FWNMI capability

2019-05-09 Thread David Gibson
On Mon, Apr 22, 2019 at 12:33:35PM +0530, Aravinda Prasad wrote: > Enable the KVM capability KVM_CAP_PPC_FWNMI so that > the KVM causes guest exit with NMI as exit reason > when it encounters a machine check exception on the > address belonging to a guest. Without this capability > enabled, KVM red

Re: [Qemu-devel] [PATCH v8 6/6] migration: Block migration while handling machine check

2019-05-09 Thread David Gibson
On Mon, Apr 22, 2019 at 12:33:45PM +0530, Aravinda Prasad wrote: > Block VM migration requests until the machine check > error handling is complete as (i) these errors are > specific to the source hardware and is irrelevant on > the target hardware, (ii) these errors cause data > corruption and sho

Re: [Qemu-devel] [PATCH v1 05/23] semihosting: enable chardev backed output

2019-05-09 Thread Alex Bennée
Richard Henderson writes: > On 5/9/19 9:58 AM, Alex Bennée wrote: >> @@ -51,12 +51,18 @@ static inline const char *semihosting_get_cmdline(void) >> { >> return NULL; >> } >> + >> +static inline Chardev *semihosting_get_chardev(void) >> +{ >> +return NULL; >> +} > > Isn't the point of

Re: [Qemu-devel] [Qemu-ppc] [PATCH v8 3/6] target/ppc: Handle NMI guest exit

2019-05-09 Thread David Gibson
On Wed, Apr 24, 2019 at 10:20:42AM +0530, Aravinda Prasad wrote: 65;5601;1c> > > On Tuesday 23 April 2019 12:23 PM, David Gibson wrote: > > On Mon, Apr 22, 2019 at 12:33:16PM +0530, Aravinda Prasad wrote: > >> Memory error such as bit flips that cannot be corrected > >> by hardware are passed on

Re: [Qemu-devel] [PATCH v8 4/6] target/ppc: Build rtas error log upon an MCE

2019-05-09 Thread David Gibson
On Mon, Apr 22, 2019 at 12:33:26PM +0530, Aravinda Prasad wrote: > 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,

Re: [Qemu-devel] [PATCH 2/3] ramfb enhancement

2019-05-09 Thread Hou Qiming
> Only allow one resolution change per guest boot, which prevents a > > crash when the guest writes garbage to the configuration space (e.g. > > when rebooting). > > Hmm? Did you see that happen in practice? > It is not easy to write to fw_cfg by accident ... > > Yes, this does happen in practice

Re: [Qemu-devel] [QEMU-PPC] [PATCH 11/13] target/ppc: Implement hcall H_COPY_TOFROM_GUEST

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:14PM +1000, Suraj Jitindar Singh wrote: > The hcall H_COPY_TOFROM_GUEST of used by a guest acting as a nested > hypervisor to access quadrants since quadrant access is hypervisor > privileged. > > Translate the guest address to be accessed, map the memory and perform

Re: [Qemu-devel] [QEMU-PPC] [PATCH 10/13] target/ppc: Implement hcall H_TLB_INVALIDATE

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:13PM +1000, Suraj Jitindar Singh wrote: > The hcall H_TLB_INVALIDATE is used by a guest acting as a nested > hypervisor to perform partition scoped tlb invalidation since these > instructions are hypervisor privileged. > > Check the arguments are valid and then invali

Re: [Qemu-devel] [QEMU-PPC] [PATCH 13/13] target/ppc: Enable SPAPR_CAP_NESTED_KVM_HV under tcg

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:16PM +1000, Suraj Jitindar Singh wrote: > It is now possible to use nested kvm-hv under tcg, thus allow for it to > be enabled. > > Note that nested kvm-hv requires that rc updates to ptes be done by > software, otherwise the page tables get out of sync. So disable ha

Re: [Qemu-devel] [QEMU-PPC] [PATCH 12/13] target/ppc: Introduce POWER9 DD2.2 cpu type

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:15PM +1000, Suraj Jitindar Singh wrote: > Introduce a POWER9 DD2.2 cpu type with pvr 0x004E1202. > > A DD2.2 POWER9 cpu type is needed to enable kvm for pseries tcg guests > since it means they will use the H_ENTER_NESTED hcall to run a guest > rather than trying the

Re: [Qemu-devel] [PATCH 0/3] Export machine type deprecation info through QMP

2019-05-09 Thread Markus Armbruster
Eduardo Habkost writes: > On Thu, May 09, 2019 at 05:08:11PM +0100, Daniel P. Berrangé wrote: >> On Thu, May 09, 2019 at 12:52:47PM -0300, Eduardo Habkost wrote: >> > On Thu, May 09, 2019 at 10:14:52AM +0100, Daniel P. Berrangé wrote: >> > > On Thu, May 09, 2019 at 10:31:46AM +0200, Markus Armbru

Re: [Qemu-devel] [PATCH 3/3] ramfb enhancement

2019-05-09 Thread Marcel Apfelbaum
On 5/10/19 5:20 AM, Hou Qiming wrote: > Please format the commit subject with a prefix and do not use the same > subject for all the pacthes > in the series, for this patch it can be something like: I'll resend the patches with improved title lines after other issues are cleared. Thanks for

[Qemu-devel] [Bug 1828508] [NEW] qemu-img created VMDK files lead to "Unsupported or invalid disk type 7"

2019-05-09 Thread Jake Mikelson
Public bug reported: Using qemu-img version 3.1.50 (v3.1.0-13607-geb2db0f7ba-dirty) on a Windows 10 machine. Converting a VHD to VMDK. qemu-img.exe convert "c:\test\AppD-VM01.vhd" -O vmdk -o adapter_type=buslogic -p "c:\test\AppD-VM01.vmdk" I have also tried: qemu-img.exe convert "c:\test\AppD-

Re: [Qemu-devel] [PATCH 0/3] Export machine type deprecation info through QMP

2019-05-09 Thread Markus Armbruster
Eduardo Habkost writes: > On Thu, May 09, 2019 at 10:14:52AM +0100, Daniel P. Berrangé wrote: >> On Thu, May 09, 2019 at 10:31:46AM +0200, Markus Armbruster wrote: >> > We've wandered into the QAPI vs. QOM swamp. Cc: Paolo. >> > >> > Eduardo Habkost writes: >> > >> > > On Wed, May 08, 2019 at

[Qemu-devel] [Bug 1828507] [NEW] qemu-system-ppc64 smp crash on manual reset

2019-05-09 Thread Amol Surati
Public bug reported: Host Environment: x86_64 Linux v5.0.2 QEMU emulator version 4.0.50 (v4.0.0-354-g812b835fb4) SLOF: Build Date = Jan 14 2019 18:00:39 FW Version = git-a5b428e1c1eae703 Problem: Qemu crash immediately after a manual reset (this is not the initial

Re: [Qemu-devel] [PULL 10/19] tests/boot_linux_console: increase timeout

2019-05-09 Thread Gerd Hoffmann
Hi, > I also think that approach #1 is simpler and saner, but thinking about > where we're going with the test runner development, I started to have > doubts about it. The reason is that we're adding parallel and multi > environment (process, machine, container) execution capabilities to the >

Re: [Qemu-devel] [PATCH] net/slirp: fix the error message when the prefix len is invalid

2019-05-09 Thread Markus Armbruster
Stefano Garzarella writes: > On Thu, May 09, 2019 at 04:54:35PM +0200, Markus Armbruster wrote: >> Stefano Garzarella writes: >> >> > Add a missing parentheses at the end of the error message, >> > when we have an invalid prefix len. >> > >> > Signed-off-by: Stefano Garzarella >> > --- >> > n

[Qemu-devel] [PATCH] tests/libqtest: Remove unused global_qtest-related wrapper functions

2019-05-09 Thread Thomas Huth
A bunch of the wrapper functions that use global_qtest are not used anymore. Remove them to avoid that they are used in new code again. Signed-off-by: Thomas Huth --- tests/libqtest.c | 11 + tests/libqtest.h | 108 --- 2 files changed, 1 insertio

Re: [Qemu-devel] [PATCH 3/3] ramfb enhancement

2019-05-09 Thread Gerd Hoffmann
> --- a/hw/vfio/pci.c > +++ b/hw/vfio/pci.c > @@ -3080,8 +3080,10 @@ static void vfio_realize(PCIDevice *pdev, Error > **errp) > error_setg(errp, "xres and yres properties require > display=on"); > goto out_teardown; > } > -if (vdev->dpy->edid_regs == NULL

Re: [Qemu-devel] [PATCH 2/3] ramfb enhancement

2019-05-09 Thread Gerd Hoffmann
On Thu, May 09, 2019 at 03:58:02PM +0800, Hou Qiming wrote: > Only allow one resolution change per guest boot, which prevents a > crash when the guest writes garbage to the configuration space (e.g. > when rebooting). Hmm? Did you see that happen in practice? It is not easy to write to fw_cfg by

Re: [Qemu-devel] [PATCH 1/3] ramfb enhancement

2019-05-09 Thread Gerd Hoffmann
On Thu, May 09, 2019 at 03:57:24PM +0800, Hou Qiming wrote: > Pulled back the `qemu_create_displaysurface_guestmem` function to create > the display surface so that the guest memory gets properly unmaped. > > Signed-off-by: HOU Qiming > --- > hw/display/ramfb.c | 53 +

Re: [Qemu-devel] [PATCH v1 22/23] tests/qemu-iotests: re-format output to for make check-block

2019-05-09 Thread Thomas Huth
On 09/05/2019 18.59, Alex Bennée wrote: > This attempts to clean-up the output to better match the output of the > rest of the QEMU check system. This includes: > > - formatting as " TESTiotest: nnn" > - calculating time diff at the end > - only dumping config on failure > > Signed-off

Re: [Qemu-devel] [PATCH v3 7/7] tests: Run the iotests during "make check" again

2019-05-09 Thread Thomas Huth
On 09/05/2019 20.08, Max Reitz wrote: > On 02.05.19 10:45, Thomas Huth wrote: >> People often forget to run the iotests before submitting patches or >> pull requests - this is likely due to the fact that we do not run the >> tests during our mandatory "make check" tests yet. Now that we've got >> a

Re: [Qemu-devel] [PATCH 00/13] tests/vm: serial console autoinstall, misc fixes.

2019-05-09 Thread Gerd Hoffmann
On Thu, May 09, 2019 at 08:52:23PM +0200, Kamil Rytarowski wrote: > On 08.05.2019 10:56, Gerd Hoffmann wrote: > > This patch series changes the way virtual machines for test builds are > > managed. They are created locally on the developer machine now. The > > installer is booted on the serial co

[Qemu-devel] [PATCH v2 8/8] scripts/qemu-binfmt-conf: Update for sparc64

2019-05-09 Thread Richard Henderson
Also note that we were missing the qemu_target_list entry for plain sparc; fix that at the same time. Signed-off-by: Richard Henderson --- scripts/qemu-binfmt-conf.sh | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-con

[Qemu-devel] [PATCH v2 7/8] linux-user/sparc: Flush register windows before clone

2019-05-09 Thread Richard Henderson
As seen as the very first instruction of sys_clone in the kernel. Ideally this would be done in or before cpu_copy, and not with a separate explicit test vs the syscall number, but this is a more minimal solution. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 3 +++ 1 file

[Qemu-devel] [PATCH v2 2/8] linux-user: Pass the parent env to cpu_clone_regs

2019-05-09 Thread Richard Henderson
Implementing clone for sparc requires that we make modifications to both the parent and child cpu state. In all other cases, the new argument can be ignored. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/aarch64/target_cpu.h| 3 ++- linux-user/alpha/target_cpu.h

[Qemu-devel] [PATCH v2 4/8] linux-user/sparc: Use WREG constants in sparc/target_cpu.h

2019-05-09 Thread Richard Henderson
This fixes a naming bug wherein we used "UREG_FP" to access the stack pointer. OTOH, the "UREG_FP" constant was also defined incorrectly such that it *did* reference the stack pointer. Signed-off-by: Richard Henderson --- linux-user/sparc/target_cpu.h | 10 ++ 1 file changed, 2 insertio

[Qemu-devel] [PATCH v2 5/8] linux-user/sparc: Use WREG constants in sparc/signal.c

2019-05-09 Thread Richard Henderson
Remove the incorrectly defined UREG constants. Maddeningly, in some cases we used the correct constant getting the env register wrong, and in other cases we used the incorrect constant getting the env register right. In the case of getcontext/setcontext, we are aided by the fact that the "other"

[Qemu-devel] [PATCH v2 3/8] target/sparc: Define an enumeration for accessing env->regwptr

2019-05-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 33 + 1 file changed, 33 insertions(+) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 85b9665ccc..08f7d1a3c6 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -31,6 +31,39 @@ /*#def

[Qemu-devel] [PATCH v2 0/8] linux-user sparc fixes

2019-05-09 Thread Richard Henderson
Version 1 was posted back in July 2018. Oops. ;-) https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg05788.html --- v1 cover letter There are at least 4 separate bugs preventing clone from working. (1) cpu_copy left both cpus sharing the same register window (!) (2) cpu_clone_regs did

[Qemu-devel] [PATCH v2 6/8] linux-user/sparc: Fix cpu_clone_regs

2019-05-09 Thread Richard Henderson
We failed to set the secondary return value in %o1 we failed to advance the PC past the syscall, we failed to adjust regwptr into the new structure, we stored the stack pointer into the wrong register. Signed-off-by: Richard Henderson --- linux-user/sparc/target_cpu.h | 28 ++

[Qemu-devel] [PATCH v2 1/8] linux-user: Disallow setting newsp for fork

2019-05-09 Thread Richard Henderson
Or really, just clone devolving into fork. This should not ever happen in practice. We do want to reserve calling cpu_clone_regs for the case in which we are actually performing a clone. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/syscall.c | 7 +-- 1 file cha

Re: [Qemu-devel] [QEMU-PPC] [PATCH 05/13] target/ppc: Add privileged message send facilities

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:08PM +1000, Suraj Jitindar Singh wrote: > Privileged message send facilities exist on POWER8 processors and later > and include a register and instructions which can be used to generate, > observe/modify the state of and clear privileged doorbell exceptions as > descri

Re: [Qemu-devel] [QEMU-PPC] [PATCH 08/13] target/ppc: Implement hcall H_SET_PARTITION_TABLE

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:11PM +1000, Suraj Jitindar Singh wrote: > The hcall H_SET_PARTITION_TABLE is used by a guest acting as a nested > hypervisor to register the partition table entry for one of its guests > with the real hypervisor. > > Implement this hcall for a spapr guest. > > Signed

Re: [Qemu-devel] [QEMU-PPC] [PATCH 07/13] target/ppc: Handle partition scoped radix tree translation

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:10PM +1000, Suraj Jitindar Singh wrote: > Radix tree translation is a 2 step process: > > Process Scoped Translation: > Effective Address (EA) -> Virtual Address (VA) > > Paritition Scoped Translation: > Virtual Address (VA) -> Real Address (RA) > > Performed based

Re: [Qemu-devel] [PATCH v3 16/27] target/ppc: Convert to CPUClass::tlb_fill

2019-05-09 Thread David Gibson
On Thu, May 09, 2019 at 03:26:20PM -0700, Richard Henderson wrote: > Cc: qemu-...@nongnu.org > Cc: David Gibson > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson Acked-by: David Gibson > --- > target/ppc/cpu.h| 7 +++ > target/ppc/mmu_helper.c | 22

Re: [Qemu-devel] [PATCH] Fix typo on "info pic" monitor cmd output for xive

2019-05-09 Thread David Gibson
On Thu, May 09, 2019 at 01:37:50PM +0530, sathn...@linux.vnet.ibm.com wrote: > From: Satheesh Rajendran > > Instead of LISN i.e "Logical Interrupt Source Number" as per > Xive PAPR document "info pic" prints as LSIN, let's fix it. > > Signed-off-by: Satheesh Rajendran Applied to ppc-for-4.1, t

Re: [Qemu-devel] [QEMU-PPC] [PATCH 09/13] target/ppc: Implement hcall H_ENTER_NESTED

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:12PM +1000, Suraj Jitindar Singh wrote: > The hcall H_ENTER_NESTED is used by a guest acting as a nested > hypervisor to provide the state of one of its guests which it would > like the real hypervisor to load onto the cpu and execute on its behalf. > > The hcall take

Re: [Qemu-devel] [QEMU-PPC] [PATCH 06/13] target/ppc: Enforce that the root page directory size must be at least 5

2019-05-09 Thread David Gibson
On Fri, May 03, 2019 at 03:53:09PM +1000, Suraj Jitindar Singh wrote: > According to the ISA the root page directory size of a radix tree for > either process or partition scoped translation must be >= 5. > > Thus add this to the list of conditions checked when validating the > partition table ent

Re: [Qemu-devel] [PATCH v2 1/2] vfio/mdev: add version attribute for mdev device

2019-05-09 Thread Yan Zhao
On Thu, May 09, 2019 at 11:24:49PM +0800, Cornelia Huck wrote: > On Wed, 8 May 2019 07:57:05 -0400 > Yan Zhao wrote: > > > On Tue, May 07, 2019 at 05:19:54PM +0800, Cornelia Huck wrote: > > > On Sun, 5 May 2019 21:49:04 -0400 > > > Yan Zhao wrote: > > > > > > > version attribute is used to c

Re: [Qemu-devel] [PATCH 3/3] ramfb enhancement

2019-05-09 Thread Hou Qiming
> Please format the commit subject with a prefix and do not use the same > subject for all the pacthes > in the series, for this patch it can be something like: I'll resend the patches with improved title lines after other issues are cleared. Thanks for the advice. > Will this result in a silent

Re: [Qemu-devel] [PATCH 0/3] Optimize COLO related codes and description

2019-05-09 Thread Zhang, Chen
Hi Dave, I noticed that you have reviewed all the patches in this series, can you queue it? Thanks Zhang Chen > -Original Message- > From: Zhang, Chen > Sent: Friday, April 26, 2019 5:07 PM > To: Laurent Vivier ; Dr. David Alan Gilbert > ; Juan Quintela ; zhanghailiang > ; Markus Armbr

[Qemu-devel] [PATCH v5 22/24] target/arm: Implement ARMv8.5-RNG

2019-05-09 Thread Richard Henderson
Cc: qemu-...@nongnu.org Cc: Peter Maydell Signed-off-by: Richard Henderson --- v3: Log errors with -d unimp, for lack of a better flag. --- target/arm/cpu.h| 5 + target/arm/cpu64.c | 1 + target/arm/helper.c | 44 3 files changed, 50 inser

[Qemu-devel] [PATCH v5 03/24] crypto: Reverse code blocks in random-platform.c

2019-05-09 Thread Richard Henderson
Use #ifdef _WIN32 instead of #ifndef _WIN32. This will make other tests easier to sequence. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- crypto/random-platform.c | 35 +-- 1

[Qemu-devel] [PATCH v5 01/24] configure: Link test before auto-enabling crypto libraries

2019-05-09 Thread Richard Henderson
At least ubuntu 18.04 does not package static gnutls libraries. At least Fedora 30 does not ship static nettle and gcrypt libraries. Signed-off-by: Richard Henderson --- v5: Include nettle, gcrypt. --- configure | 72 +-- 1 file changed, 44 ins

[Qemu-devel] [PATCH v5 10/24] util: Add qemu_guest_getrandom and associated routines

2019-05-09 Thread Richard Henderson
This routine is intended to produce high-quality random numbers to the guest. Normally, such numbers are crypto quality from the host, but a command-line option can force the use of a fully deterministic sequence for use while debugging. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-

[Qemu-devel] [PATCH v5 16/24] linux-user: Remove srand call

2019-05-09 Thread Richard Henderson
We no longer use rand() within linux-user. Cc: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/main.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index e455bff1b7..5d1c6a115b 100644 ---

[Qemu-devel] [PATCH v5 21/24] target/arm: Put all PAC keys into a structure

2019-05-09 Thread Richard Henderson
This allows us to use a single syscall to initialize them all. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/cpu.h | 12 +++- linux-user/aarch64/cpu_loop.c | 6 +- linux-user/syscall.c | 10 +++

[Qemu-devel] [PATCH v5 17/24] aspeed/scu: Use qemu_guest_getrandom_nofail

2019-05-09 Thread Richard Henderson
The random number is intended for use by the guest. As such, we should honor the -seed argument for reproducibility. Use the *_nofail routine instead of rolling our own error handling locally. Cc: qemu-...@nongnu.org Cc: Andrew Jeffery Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-

[Qemu-devel] [PATCH v5 19/24] hw/misc/bcm2835_rng: Use qemu_guest_getrandom_nofail

2019-05-09 Thread Richard Henderson
The random number is intended for use by the guest. As such, we should honor the -seed argument for reproducibility. Use the *_nofail routine instead of rolling our own error handling locally. Cc: qemu-...@nongnu.org Cc: Andrew Baumann Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-

[Qemu-devel] [PATCH v5 08/24] ui/vnc: Split out authentication_failed

2019-05-09 Thread Richard Henderson
There were 3 copies of this code, one of which used the wrong data size for the failure indicator. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- ui/vnc.c | 37 +++

[Qemu-devel] [PATCH v5 18/24] hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail

2019-05-09 Thread Richard Henderson
The random number is intended for use by the guest. As such, we should honor the -seed argument for reproducibility. Use the *_nofail routine instead of error_abort directly. Cc: qemu-...@nongnu.org Reviewed-by: Laurent Vivier Reviewed-by: Joel Stanley Signed-off-by: Richard Henderson --- hw

[Qemu-devel] [PATCH v5 15/24] linux-user/aarch64: Use qemu_guest_getrandom for PAUTH keys

2019-05-09 Thread Richard Henderson
Use a better interface for random numbers than rand() * 3. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/aarch64/target_syscall.h | 2 -- linux-user/aarch64/cpu_loop.c | 29 ++- linux-user/syscall.

[Qemu-devel] [PATCH v5 11/24] cpus: Initialize pseudo-random seeds for all guest cpus

2019-05-09 Thread Richard Henderson
When the -seed option is given, call qemu_guest_random_seed_main, putting the subsystem into deterministic mode. Pass derived seeds to each cpu created; which is a no-op unless the subsystem is in deterministic mode. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: D

[Qemu-devel] [PATCH v5 07/24] crypto: Change the qcrypto_random_bytes buffer type to void*

2019-05-09 Thread Richard Henderson
Using uint8_t* merely requires useless casts for use with other types to be filled with randomness. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- include/crypto/random.h | 2 +- crypto/random-gcrypt.c |

[Qemu-devel] [PATCH v5 24/24] target/i386: Implement CPUID_EXT_RDRAND

2019-05-09 Thread Richard Henderson
We now have an interface for guest visible random numbers. Cc: Paolo Bonzini Reviewed-by: Eduardo Habkost Signed-off-by: Richard Henderson --- target/i386/helper.h | 2 ++ target/i386/cpu.c| 5 ++-- target/i386/int_helper.c | 21 +++ target/i386/translate.c | 55

[Qemu-devel] [PATCH v5 14/24] linux-user: Use qemu_guest_getrandom_nofail for AT_RANDOM

2019-05-09 Thread Richard Henderson
Use a better interface for random numbers than rand * 16. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/elfload.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfl

[Qemu-devel] [PATCH v5 12/24] linux-user: Initialize pseudo-random seeds for all guest cpus

2019-05-09 Thread Richard Henderson
When the -seed option is given, call qemu_guest_random_seed_main, putting the subsystem into deterministic mode. Pass derived seeds to each cpu created during clone; which is a no-op unless the subsystem is in deterministic mode. Cc: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off

[Qemu-devel] [PATCH v5 13/24] linux-user: Call qcrypto_init if not using -seed

2019-05-09 Thread Richard Henderson
Cc: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/main.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 7e704845c0..e455bff1b7 100644 --- a/linux-

[Qemu-devel] [PATCH v5 04/24] crypto: Do not fail for EINTR during qcrypto_random_bytes

2019-05-09 Thread Richard Henderson
We can always get EINTR for read; /dev/urandom is no exception. Rearrange the order of tests for likelihood; allow degenerate buflen==0 case to perform a no-op zero-length read. This means that the normal success path is a straight line with a single test for success. Reviewed-by: Laurent Vivier

[Qemu-devel] [PATCH v5 05/24] crypto: Use O_CLOEXEC in qcrypto_random_init

2019-05-09 Thread Richard Henderson
Avoids leaking the /dev/urandom fd into any child processes. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- crypto/random-platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cr

[Qemu-devel] [PATCH v5 23/24] target/ppc: Use qemu_guest_getrandom for DARN

2019-05-09 Thread Richard Henderson
We now have an interface for guest visible random numbers. Acked-by: David Gibson Signed-off-by: Richard Henderson --- v5: Do not loop for darn64; use sizeof. --- target/ppc/int_helper.c | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git

[Qemu-devel] [PATCH v5 06/24] crypto: Use getrandom for qcrypto_random_bytes

2019-05-09 Thread Richard Henderson
Prefer it to direct use of /dev/urandom. Reviewed-by: Laurent Vivier Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- v3: If getrandom is not present, fall back on /dev/(u)random. --- crypto/random-platform.c | 37 - configure

[Qemu-devel] [PATCH v5 20/24] hw/misc/exynos4210_rng: Use qemu_guest_getrandom

2019-05-09 Thread Richard Henderson
The random number is intended for use by the guest. As such, we should honor the -seed argument for reproducibility. Cc: qemu-...@nongnu.org Cc: Igor Mitsyanko Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- hw/misc/exynos4210_rng.c | 11 +

[Qemu-devel] [PATCH v5 02/24] crypto: Merge crypto-obj-y into libqemuutil.a

2019-05-09 Thread Richard Henderson
We will shortly need this in the user-only binaries, so drop the split into system and tools binaries. This also means that crypto-aes-obj-y can be merged back into crypto-obj-y. Cc: Daniel P. Berrangé Signed-off-by: Richard Henderson --- Makefile | 12 +--- Makefile.objs

[Qemu-devel] [PATCH v5 00/24] Add qemu_getrandom and ARMv8.5-RNG etc

2019-05-09 Thread Richard Henderson
Patches without review/ack: 0001-configure-Link-test-before-auto-enabling-crypto-l.patch 0002-crypto-Merge-crypto-obj-y-into-libqemuutil.a.patch 0022-target-arm-Implement-ARMv8.5-RNG.patch Changes since v4: * Do not autoenable nettle or gcrypt if linking is broken. Fixes --static on fedora 3

[Qemu-devel] [PATCH v5 09/24] ui/vnc: Use gcrypto_random_bytes for start_auth_vnc

2019-05-09 Thread Richard Henderson
Use a better interface for random numbers than rand(). Fail gracefully if for some reason we cannot use the crypto system. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- v2: Use qcrypto_random_bytes, not qemu_

Re: [Qemu-devel] [PATCH v3 2/2] docs: add Security chapter to the documentation

2019-05-09 Thread Li Qiang
Stefan Hajnoczi 于2019年5月9日周四 下午8:20写道: > This new chapter in the QEMU documentation covers the security > requirements that QEMU is designed to meet and principles for securely > deploying QEMU. > > It is just a starting point that can be extended in the future with more > information. > > Signed

Re: [Qemu-devel] [PATCH v3 1/2] docs: add Secure Coding Practices to developer docs

2019-05-09 Thread Li Qiang
Stefan Hajnoczi 于2019年5月9日周四 下午8:20写道: > At KVM Forum 2018 I gave a presentation on security in QEMU: > https://www.youtube.com/watch?v=YAdRf_hwxU8 (video) > https://vmsplice.net/~stefan/stefanha-kvm-forum-2018.pdf (slides) > > This patch adds a guide to secure coding practices. This document >

Re: [Qemu-devel] [PATCH v2 00/10] refactor cpu topo into machine properties

2019-05-09 Thread Like Xu
On 2019/5/6 16:33, Like Xu wrote: This patch series make existing cores/threads/sockets into machine properties and get rid of global smp_* variables they use currently. The purpose of getting rid of globals is disentangle layer violations and let's do it one step at a time by replacing the smp_

Re: [Qemu-devel] [PATCH v1 16/23] tests/qemu-iotests/005: Add a sanity check for large sparse file support

2019-05-09 Thread Richard Henderson
On 5/9/19 9:59 AM, Alex Bennée wrote: > From: Thomas Huth > > "check -raw 005" fails when running on certain filesystems - these do not > support such large sparse files. Use the same check as in test 220 to > skip the test in this case. > > Suggested-by: Eric Blake > Reviewed-by: Eric Blake >

Re: [Qemu-devel] [PATCH v1 12/23] .travis.yml: enable aarch64-softmmu and alpha-softmmu tcg tests

2019-05-09 Thread Richard Henderson
On 5/9/19 9:59 AM, Alex Bennée wrote: > Signed-off-by: Alex Bennée > --- > .travis.yml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [Qemu-devel] [PATCH v1 06/23] editorconfig: add settings for .s/.S files

2019-05-09 Thread Richard Henderson
On 5/9/19 9:58 AM, Alex Bennée wrote: > We are starting to add assembler foe tests/tcg so lets make sure we > get the mode right. > > Signed-off-by: Alex Bennée > --- > .editorconfig | 5 + > 1 file changed, 5 insertions(+) Yay, thanks! Reviewed-by: Richard Henderson r~

[Qemu-devel] [PATCH v3 20/27] target/sparc: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: Artyom Tarasenko Cc: Mark Cave-Ayland Signed-off-by: Richard Henderson --- v2: Keep user-only, sparc32, and sparc64 tlb_fill separate. v3: Assert !probe for sparc32. --- target/sparc/cpu.h | 5 ++-- target/sparc/cpu.c | 5 ++-- target/sparc/ldst_helper.c | 11 +--- tar

[Qemu-devel] [PATCH v3 21/27] target/tilegx: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/tilegx/cpu.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index b9d37105fa..b209c55387 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@

Re: [Qemu-devel] [PATCH v1 05/23] semihosting: enable chardev backed output

2019-05-09 Thread Richard Henderson
On 5/9/19 9:58 AM, Alex Bennée wrote: > @@ -51,12 +51,18 @@ static inline const char *semihosting_get_cmdline(void) > { > return NULL; > } > + > +static inline Chardev *semihosting_get_chardev(void) > +{ > +return NULL; > +} Isn't the point of this function to avoid... > -

[Qemu-devel] [PATCH v3 18/27] target/s390x: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: qemu-s3...@nongnu.org Cc: Cornelia Huck Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- v2: Keep user-only and system tlb_fill separate. --- target/s390x/internal.h| 5 +-- target/s390x/cpu.c | 5 ++- target/s390x/excp_helper.c | 73

[Qemu-devel] [PATCH v3 16/27] target/ppc: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: qemu-...@nongnu.org Cc: David Gibson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/ppc/cpu.h| 7 +++ target/ppc/mmu_helper.c | 22 +- target/ppc/translate_init.inc.c | 5 ++--- target/ppc/user_only_helper.c | 14 ++

[Qemu-devel] [PATCH v3 09/27] target/microblaze: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: Edgar E. Iglesias Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v2: Keep user-only and system tlb_fill separate. --- target/microblaze/cpu.h | 5 +- target/microblaze/cpu.c | 5 +- target/microblaze/helper.c| 107 ++ targ

[Qemu-devel] [PATCH v3 25/27] tcg: Use CPUClass::tlb_fill in cputlb.c

2019-05-09 Thread Richard Henderson
We can now use the CPUClass hook instead of a named function. Create a static tlb_fill function to avoid other changes within cputlb.c. This also isolates the asserts within. Remove the named tlb_fill function from all of the targets. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Da

[Qemu-devel] [PATCH v3 23/27] target/unicore32: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Remove the user-only functions, as we no longer have a user-only config. Cc: Guan Xuetao Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/unicore32/cpu.h | 5 +++-- target/unicore32/cpu.c | 5 + target/unicore32/helper.c| 23 ---

[Qemu-devel] [PATCH v3 08/27] target/m68k: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: Laurent Vivier Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 5 ++- target/m68k/cpu.c | 2 +- target/m68k/helper.c| 87 ++--- target/m68k/op_helper.c | 15 --- 4 files changed, 50 insertions(+),

[Qemu-devel] [PATCH v3 27/27] tcg: Use tlb_fill probe from tlb_vaddr_to_host

2019-05-09 Thread Richard Henderson
Most of the existing users would continue around a loop which would fault the tlb entry in via a normal load/store. But for AArch64 SVE we have an existing emulation bug wherein we would mark the first element of a no-fault vector load as faulted (within the FFR, not via exception) just because we

[Qemu-devel] [PATCH v3 24/27] target/xtensa: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: Max Filippov Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v2: Keep user-only and system tlb_fill separate. --- target/xtensa/cpu.h| 5 +++-- target/xtensa/cpu.c| 5 ++--- target/xtensa/helper.c | 39 ++- 3 files changed, 31 in

[Qemu-devel] [PATCH v3 07/27] target/lm32: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: Michael Walle Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/lm32/cpu.h | 5 +++-- target/lm32/cpu.c | 5 ++--- target/lm32/helper.c| 12 +--- target/lm32/op_helper.c | 16 4 files changed, 14 insertions(+), 24 deletions(-)

[Qemu-devel] [PATCH v3 17/27] target/riscv: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Note that env->pc is removed from the qemu_log as that value is garbage. The PC isn't recovered until cpu_restore_state, called from cpu_loop_exit_restore, called from riscv_raise_exception. Cc: qemu-ri...@nongnu.org Cc: Palmer Dabbelt Reviewed-by: Alistair Francis Signed-off-by: Richard Henders

[Qemu-devel] [PATCH v3 05/27] target/hppa: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/hppa/cpu.h| 8 target/hppa/cpu.c| 5 ++--- target/hppa/mem_helper.c | 22 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a

[Qemu-devel] [PATCH v3 26/27] tcg: Remove CPUClass::handle_mmu_fault

2019-05-09 Thread Richard Henderson
This hook is now completely replaced by tlb_fill. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/qom/cpu.h | 3 --- accel/tcg/user-exec.c | 13 +++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/includ

[Qemu-devel] [PATCH v3 11/27] target/mips: Tidy control flow in mips_cpu_handle_mmu_fault

2019-05-09 Thread Richard Henderson
Since the only non-negative TLBRET_* value is TLBRET_MATCH, the subsequent test for ret < 0 is useless. Use early return to allow subsequent blocks to be unindented. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/mips/helper.c | 54 -

[Qemu-devel] [PATCH v3 14/27] target/nios2: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Remove the leftover debugging cpu_dump_state. Cc: Chris Wulff Cc: Marek Vasut Signed-off-by: Richard Henderson --- v2: Keep user-only and system tlb_fill separate. --- target/nios2/cpu.h| 5 +- target/nios2/cpu.c| 5 +- target/nios2/helper.c | 176 +-

[Qemu-devel] [PATCH v3 19/27] target/sh4: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/sh4/cpu.h | 5 +- target/sh4/cpu.c | 5 +- target/sh4/helper.c| 197 - target/sh4/op_helper.c | 12 --- 4 files changed, 101 insertions(+), 118

[Qemu-devel] [PATCH v3 15/27] target/openrisc: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Cc: Stafford Horne Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/openrisc/cpu.h | 5 ++-- target/openrisc/cpu.c | 5 ++-- target/openrisc/mmu.c | 65 ++- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/target/op

[Qemu-devel] [PATCH v3 12/27] target/mips: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Note that env->active_tc.PC is removed from the qemu_log as that value is garbage. The PC isn't recovered until cpu_restore_state, called from cpu_loop_exit_restore, called from do_raise_exception_err. Cc: Aleksandar Markovic Cc: Aleksandar Rikalo Reviewed-by: Philippe Mathieu-Daudé Signed-off

[Qemu-devel] [PATCH v3 22/27] target/tricore: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Acked-by: Bastian Koppelmann Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/tricore/cpu.h | 6 +++--- target/tricore/cpu.c | 1 + target/tricore/helper.c| 27 +++ target/tricore/op_helper.c | 26 -- 4 file

[Qemu-devel] [PATCH v3 01/27] tcg: Add CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
This hook will replace the (user-only mode specific) handle_mmu_fault hook, and the (system mode specific) tlb_fill function. The handle_mmu_fault hook was written as if there was a valid way to recover from an mmu fault, and had 3 possible return states. In reality, the only valid action is to ra

[Qemu-devel] [PATCH v3 06/27] target/i386: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
We do not support probing, but we do not need it yet either. Cc: Paolo Bonzini Cc: Eduardo Habkost Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/i386/cpu.h | 5 ++-- target/i386/cpu.c | 5 ++-- target/i386/excp_helper.c | 61 +

[Qemu-devel] [PATCH v3 04/27] target/cris: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Remove dumping of cpu state. Remove logging of PC, as that value is garbage until cpu_restore_state. Cc: Edgar E. Iglesias Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/cris/cpu.h | 5 +-- target/cris/cpu.c | 5 ++- target/cris/helper.c| 67 +

[Qemu-devel] [PATCH v3 02/27] target/alpha: Convert to CPUClass::tlb_fill

2019-05-09 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v2: Keep user-only and system tlb_fill separate. --- target/alpha/cpu.h| 5 +++-- target/alpha/cpu.c| 5 ++--- target/alpha/helper.c | 30 +- tar

[Qemu-devel] [PATCH v3 10/27] target/mips: Pass a valid error to raise_mmu_exception for user-only

2019-05-09 Thread Richard Henderson
At present we give ret = 0, or TLBRET_MATCH. This gets matched by the default case, which falls through to TLBRET_BADADDR. However, it makes more sense to use a proper value. All of the tlb-related exceptions are handled identically in cpu_loop.c, so TLBRET_BADADDR is as good as any other. Retai

  1   2   3   4   >