Re: [Qemu-devel] [PATCH v3 0/3] hmp: fix "dump-quest-memory" segfault

2017-09-12 Thread David Gibson
On Tue, Sep 12, 2017 at 04:36:30PM +0100, Dr. David Alan Gilbert wrote:
> * Thomas Huth (th...@redhat.com) wrote:
> > On 12.09.2017 16:46, Greg Kurz wrote:
> > > On Tue, 12 Sep 2017 16:01:46 +0200
> > > Laurent Vivier  wrote:
> > > 
> > >> Fix aarch64 and ppc when dump-guest-memory is
> > >> used with none machine type and no CPU.
> > >>
> > >> The other machine types don't have the problem.
> > >>
> > >> Update test-hmp, to test none machine type
> > >> with (2 MB) and without memory, and add a test
> > >> to test dump-quest-memory without filter parameters
> > >> (it needs the fix from Cornelia Huck to work)
> > >>
> > >> v3:
> > >>   - remove blank line after a comment
> > >>   - forbid memory dump when there is no CPU
> > >>
> > > 
> > > So in the end, we would forbid dump on aarch64 and
> > > ppc, while it is allowed on i386... I don't really
> > > care about which behavior is more appropriate but
> > > I guess they should be consistent at least.
> > 
> > It's kind of consistent: Allow it on architectures with fixed endianess,
> > but disallow it on architectures without fixed endianess ;-)
> 
> Another way to put it is that you can dump unless you need
> information about the CPU.
> 
> It also makes me wonder what happens on those CPUs that can
> change their endianness dynamically.

We already have code for that on ppc, we actually look in on the CPU's
mode register at dump time to decide which.  Theoretically that could
still be tricked, but in the almost-always case of boot an OS which
sets the endianness then leaves it there, it should be fine.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


signature.asc
Description: PGP signature


Re: [Qemu-devel] [PATCH v3 0/3] hmp: fix "dump-quest-memory" segfault

2017-09-12 Thread Dr. David Alan Gilbert
* Thomas Huth (th...@redhat.com) wrote:
> On 12.09.2017 16:46, Greg Kurz wrote:
> > On Tue, 12 Sep 2017 16:01:46 +0200
> > Laurent Vivier  wrote:
> > 
> >> Fix aarch64 and ppc when dump-guest-memory is
> >> used with none machine type and no CPU.
> >>
> >> The other machine types don't have the problem.
> >>
> >> Update test-hmp, to test none machine type
> >> with (2 MB) and without memory, and add a test
> >> to test dump-quest-memory without filter parameters
> >> (it needs the fix from Cornelia Huck to work)
> >>
> >> v3:
> >>   - remove blank line after a comment
> >>   - forbid memory dump when there is no CPU
> >>
> > 
> > So in the end, we would forbid dump on aarch64 and
> > ppc, while it is allowed on i386... I don't really
> > care about which behavior is more appropriate but
> > I guess they should be consistent at least.
> 
> It's kind of consistent: Allow it on architectures with fixed endianess,
> but disallow it on architectures without fixed endianess ;-)

Another way to put it is that you can dump unless you need
information about the CPU.

It also makes me wonder what happens on those CPUs that can
change their endianness dynamically.

(I'm not fussed either way as long as it doesn't crash;
'none' is full of corner cases)

Dave

> Honestly, it should not matter - we're talking here about the "none"
> machine without a CPU ... as long as it does not crash, there is no need
> for a working "dump-guest-memory" function here.
> 
>  Thomas
> 


--
Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK



Re: [Qemu-devel] [PATCH v3 0/3] hmp: fix "dump-quest-memory" segfault

2017-09-12 Thread Greg Kurz
On Tue, 12 Sep 2017 16:51:46 +0200
Thomas Huth  wrote:

> On 12.09.2017 16:46, Greg Kurz wrote:
> > On Tue, 12 Sep 2017 16:01:46 +0200
> > Laurent Vivier  wrote:
> >   
> >> Fix aarch64 and ppc when dump-guest-memory is
> >> used with none machine type and no CPU.
> >>
> >> The other machine types don't have the problem.
> >>
> >> Update test-hmp, to test none machine type
> >> with (2 MB) and without memory, and add a test
> >> to test dump-quest-memory without filter parameters
> >> (it needs the fix from Cornelia Huck to work)
> >>
> >> v3:
> >>   - remove blank line after a comment
> >>   - forbid memory dump when there is no CPU
> >>  
> > 
> > So in the end, we would forbid dump on aarch64 and
> > ppc, while it is allowed on i386... I don't really
> > care about which behavior is more appropriate but
> > I guess they should be consistent at least.  
> 
> It's kind of consistent: Allow it on architectures with fixed endianess,
> but disallow it on architectures without fixed endianess ;-)
> 

Heh, fun and true: only these ones need first_cpu to guess the endianess,
in case it isn't the default... but the CPU may also be needed to guess
32 or 64 bits.

Let's just hope no one ever tries to add yet another endian-changing
abomination with 32/64-bit support in QEMU :P


> Honestly, it should not matter - we're talking here about the "none"
> machine without a CPU ... as long as it does not crash, there is no need
> for a working "dump-guest-memory" function here.
> 

Erroring out in dump_init() if nr_cpus == 0, before calling the target
specific code would be neater IMHO.

Cheers,

--
Greg

>  Thomas
> 



pgpjnIcp9Zsh_.pgp
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH v3 0/3] hmp: fix "dump-quest-memory" segfault

2017-09-12 Thread Greg Kurz
On Tue, 12 Sep 2017 16:01:46 +0200
Laurent Vivier  wrote:

> Fix aarch64 and ppc when dump-guest-memory is
> used with none machine type and no CPU.
> 
> The other machine types don't have the problem.
> 
> Update test-hmp, to test none machine type
> with (2 MB) and without memory, and add a test
> to test dump-quest-memory without filter parameters
> (it needs the fix from Cornelia Huck to work)
> 
> v3:
>   - remove blank line after a comment
>   - forbid memory dump when there is no CPU
> 

So in the end, we would forbid dump on aarch64 and
ppc, while it is allowed on i386... I don't really
care about which behavior is more appropriate but
I guess they should be consistent at least.

Cc'ing some x86 and HMP people.

> v2:
>   - add arm fix
>   - update test-hmp
> 
> Laurent Vivier (3):
>   hmp: fix "dump-quest-memory" segfault (ppc)
>   hmp: fix "dump-quest-memory" segfault (arm)
>   tests/hmp: test "none" machine with memory
> 
>  target/arm/arch_dump.c | 11 +--
>  target/ppc/arch_dump.c | 11 +--
>  tests/test-hmp.c   |  4 
>  3 files changed, 22 insertions(+), 4 deletions(-)
> 



pgp8LWRGn2_5U.pgp
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH v3 0/3] hmp: fix "dump-quest-memory" segfault

2017-09-12 Thread Thomas Huth
On 12.09.2017 16:46, Greg Kurz wrote:
> On Tue, 12 Sep 2017 16:01:46 +0200
> Laurent Vivier  wrote:
> 
>> Fix aarch64 and ppc when dump-guest-memory is
>> used with none machine type and no CPU.
>>
>> The other machine types don't have the problem.
>>
>> Update test-hmp, to test none machine type
>> with (2 MB) and without memory, and add a test
>> to test dump-quest-memory without filter parameters
>> (it needs the fix from Cornelia Huck to work)
>>
>> v3:
>>   - remove blank line after a comment
>>   - forbid memory dump when there is no CPU
>>
> 
> So in the end, we would forbid dump on aarch64 and
> ppc, while it is allowed on i386... I don't really
> care about which behavior is more appropriate but
> I guess they should be consistent at least.

It's kind of consistent: Allow it on architectures with fixed endianess,
but disallow it on architectures without fixed endianess ;-)

Honestly, it should not matter - we're talking here about the "none"
machine without a CPU ... as long as it does not crash, there is no need
for a working "dump-guest-memory" function here.

 Thomas



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH v3 0/3] hmp: fix "dump-quest-memory" segfault

2017-09-12 Thread no-reply
Hi,

This series failed automatic build test. Please find the testing commands and
their output below. If you have docker installed, you can probably reproduce it
locally.

Subject: [Qemu-devel] [PATCH v3 0/3] hmp: fix "dump-quest-memory" segfault
Message-id: 20170912140149.7692-1-lviv...@redhat.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-quick@centos6
time make docker-test-build@min-glib
time make docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
298c97edfc tests/hmp: test "none" machine with memory
cc5c2de4e1 hmp: fix "dump-quest-memory" segfault (arm)
abb99ede26 hmp: fix "dump-quest-memory" segfault (ppc)

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-_vcsw470/src/dtc'...
Submodule path 'dtc': checked out '558cd81bdd432769b59bff01240c44f82cfb1a9d'
  BUILD   centos6
make[1]: Entering directory '/var/tmp/patchew-tester-tmp-_vcsw470/src'
  ARCHIVE qemu.tgz
  ARCHIVE dtc.tgz
  COPYRUNNER
RUN test-quick in qemu:centos6 
Packages installed:
SDL-devel-1.2.14-7.el6_7.1.x86_64
bison-2.4.1-5.el6.x86_64
bzip2-devel-1.0.5-7.el6_0.x86_64
ccache-3.1.6-2.el6.x86_64
csnappy-devel-0-6.20150729gitd7bc683.el6.x86_64
flex-2.5.35-9.el6.x86_64
gcc-4.4.7-18.el6.x86_64
git-1.7.1-8.el6.x86_64
glib2-devel-2.28.8-9.el6.x86_64
libepoxy-devel-1.2-3.el6.x86_64
libfdt-devel-1.4.0-1.el6.x86_64
librdmacm-devel-1.0.21-0.el6.x86_64
lzo-devel-2.03-3.1.el6_5.1.x86_64
make-3.81-23.el6.x86_64
mesa-libEGL-devel-11.0.7-4.el6.x86_64
mesa-libgbm-devel-11.0.7-4.el6.x86_64
package g++ is not installed
pixman-devel-0.32.8-1.el6.x86_64
spice-glib-devel-0.26-8.el6.x86_64
spice-server-devel-0.12.4-16.el6.x86_64
tar-1.23-15.el6_8.x86_64
vte-devel-0.25.1-9.el6.x86_64
xen-devel-4.6.3-15.el6.x86_64
zlib-devel-1.2.3-29.el6.x86_64

Environment variables:
PACKAGES=bison bzip2-devel ccache csnappy-devel flex g++
 gcc git glib2-devel libepoxy-devel libfdt-devel 
librdmacm-devel lzo-devel make mesa-libEGL-devel 
mesa-libgbm-devel pixman-devel SDL-devel spice-glib-devel 
spice-server-devel tar vte-devel xen-devel zlib-devel
HOSTNAME=2bf142b3ae50
TERM=xterm
MAKEFLAGS= -j8
HISTSIZE=1000
J=8
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
MAIL=/var/spool/mail/root
PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
LANG=en_US.UTF-8
TARGET_LIST=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
LOGNAME=root
LESSOPEN=||/usr/bin/lesspipe.sh %s
FEATURES= dtc
DEBUG=
G_BROKEN_FILENAMES=1
CCACHE_HASHDIR=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu 
--prefix=/var/tmp/qemu-build/install
No C++ compiler available; disabling C++ specific optional code
Install prefix/var/tmp/qemu-build/install
BIOS directory/var/tmp/qemu-build/install/share/qemu
binary directory  /var/tmp/qemu-build/install/bin
library directory /var/tmp/qemu-build/install/lib
module directory  /var/tmp/qemu-build/install/lib/qemu
libexec directory /var/tmp/qemu-build/install/libexec
include directory /var/tmp/qemu-build/install/include
config directory  /var/tmp/qemu-build/install/etc
local state directory   /var/tmp/qemu-build/install/var
Manual directory  /var/tmp/qemu-build/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path   /tmp/qemu-test/src
C compilercc
H