]> Git Repo - qemu.git/log
qemu.git
6 years agotarget/m68k: add a mechanism to automatically free TCGv
Laurent Vivier [Mon, 19 Mar 2018 11:35:44 +0000 (12:35 +0100)]
target/m68k: add a mechanism to automatically free TCGv

SRC_EA() and gen_extend() can return either a temporary
TCGv or a memory allocated one. Mark them when they are
allocated, and free them automatically at end of the
instruction translation.

We want to free locally allocated TCGv to avoid
overflow in sequence like:

  0xc00ae406:  movel %fp@(-132),%fp@(-268)
  0xc00ae40c:  movel %fp@(-128),%fp@(-264)
  0xc00ae412:  movel %fp@(-20),%fp@(-212)
  0xc00ae418:  movel %fp@(-16),%fp@(-208)
  0xc00ae41e:  movel %fp@(-60),%fp@(-220)
  0xc00ae424:  movel %fp@(-56),%fp@(-216)
  0xc00ae42a:  movel %fp@(-124),%fp@(-252)
  0xc00ae430:  movel %fp@(-120),%fp@(-248)
  0xc00ae436:  movel %fp@(-12),%fp@(-260)
  0xc00ae43c:  movel %fp@(-8),%fp@(-256)
  0xc00ae442:  movel %fp@(-52),%fp@(-276)
  0xc00ae448:  movel %fp@(-48),%fp@(-272)
  ...

That can fill a lot of TCGv entries in a sequence,
especially since 15fa08f845 ("tcg: Dynamically allocate TCGOps")
we have no limit to fill the TCGOps cache and we can fill
the entire TCG variables array and overflow it.

Suggested-by: Richard Henderson <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20180319113544[email protected]>

6 years agotarget/m68k: add DisasContext parameter to gen_extend()
Laurent Vivier [Mon, 19 Mar 2018 11:35:43 +0000 (12:35 +0100)]
target/m68k: add DisasContext parameter to gen_extend()

This parameter will be needed to manage automatic release
of temporary allocated TCG variables.

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20180319113544[email protected]>

6 years agoMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request...
Peter Maydell [Thu, 15 Mar 2018 17:58:28 +0000 (17:58 +0000)]
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging

# gpg: Signature made Tue 13 Mar 2018 17:33:03 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <[email protected]>"
# gpg:                 aka "Laurent Vivier <[email protected]>"
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-2.12-pull-request:
  linux-user: init_guest_space: Add a comment about search strategy
  linux-user: init_guest_space: Don't try to align if we'll reject it
  linux-user: init_guest_space: Clean up control flow a bit
  linux-user: init_guest_commpage: Add a comment about size check
  linux-user: init_guest_space: Clarify page alignment logic
  linux-user: init_guest_space: Correctly handle guest_start in commpage initialization
  linux-user: init_guest_space: Clean up if we can't initialize the commpage
  linux-user: Rename validate_guest_space => init_guest_commpage
  linux-user: Use #if to only call validate_guest_space for 32-bit ARM target
  qemu-binfmt-conf.sh: add qemu-xtensa
  linux-user: drop unused target_msync function
  linux-user: fix target_mprotect/target_munmap error return values
  linux-user: fix assertion in shmdt
  linux-user: fix mmap/munmap/mprotect/mremap/shmat
  linux-user: Support f_flags in statfs when available.
  linux-user: allows to use "--systemd ALL" with qemu-binfmt-conf.sh
  linux-user: Remove the unused "not implemented" signal handling stubs
  linux-user: Drop unicore32 code

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream-sev' into staging
Peter Maydell [Thu, 15 Mar 2018 16:49:29 +0000 (16:49 +0000)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream-sev' into staging

* Migrate MSR_SMI_COUNT (Liran)
* Update kernel headers (Gerd, myself)
* SEV support (Brijesh)

I have not tested non-x86 compilation, but I reordered the SEV patches
so that all non-x86-specific changes go first to catch any possible
issues (which weren't there anyway :)).

# gpg: Signature made Tue 13 Mar 2018 16:37:06 GMT
# gpg:                using RSA key BFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <[email protected]>"
# gpg:                 aka "Paolo Bonzini <[email protected]>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream-sev: (22 commits)
  sev/i386: add sev_get_capabilities()
  sev/i386: qmp: add query-sev-capabilities command
  sev/i386: qmp: add query-sev-launch-measure command
  sev/i386: hmp: add 'info sev' command
  cpu/i386: populate CPUID 0x8000_001F when SEV is active
  sev/i386: add migration blocker
  sev/i386: finalize the SEV guest launch flow
  sev/i386: add support to LAUNCH_MEASURE command
  target/i386: encrypt bios rom
  sev/i386: add command to encrypt guest memory region
  sev/i386: add command to create launch memory encryption context
  sev/i386: register the guest memory range which may contain encrypted data
  sev/i386: add command to initialize the memory encryption context
  include: add psp-sev.h header file
  sev/i386: qmp: add query-sev command
  target/i386: add Secure Encrypted Virtualization (SEV) object
  kvm: introduce memory encryption APIs
  kvm: add memory encryption context
  docs: add AMD Secure Encrypted Virtualization (SEV)
  machine: add memory-encryption option
  ...

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/stsquad/tags/pull-travis-speedup-130318-1'...
Peter Maydell [Thu, 15 Mar 2018 14:48:09 +0000 (14:48 +0000)]
Merge remote-tracking branch 'remotes/stsquad/tags/pull-travis-speedup-130318-1' into staging

Some updates to reduce timeouts in Travis

# gpg: Signature made Tue 13 Mar 2018 16:44:46 GMT
# gpg:                using RSA key FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <[email protected]>"
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-travis-speedup-130318-1:
  .travis.yml: add --disable-user with the rest of the disables
  .travis.yml: split default config into system and user
  .travis.yml: drop setting default log output

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into...
Peter Maydell [Thu, 15 Mar 2018 10:00:25 +0000 (10:00 +0000)]
Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into staging

# gpg: Signature made Tue 13 Mar 2018 15:58:42 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <[email protected]>"
# gpg:                 aka "Laurent Vivier <[email protected]>"
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier/tags/m68k-for-2.12-pull-request:
  target/m68k: implement fcosh
  target/m68k: implement fsinh
  target/m68k: implement ftanh
  target/m68k: implement fatanh
  target/m68k: implement facos
  target/m68k: implement fasin
  target/m68k: implement fatan
  target/m68k: implement fsincos
  target/m68k: implement fcos
  target/m68k: implement fsin
  target/m68k: implement ftan

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging
Peter Maydell [Tue, 13 Mar 2018 18:29:28 +0000 (18:29 +0000)]
Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging

# gpg: Signature made Tue 13 Mar 2018 12:28:21 GMT
# gpg:                using RSA key BDBE7B27C0DE3057
# gpg: Good signature from "Jeffrey Cody <[email protected]>"
# gpg:                 aka "Jeffrey Cody <[email protected]>"
# gpg:                 aka "Jeffrey Cody <[email protected]>"
# Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057

* remotes/cody/tags/block-pull-request:
  block: include original filename when reporting invalid URIs

Signed-off-by: Peter Maydell <[email protected]>
6 years agosev/i386: add sev_get_capabilities()
Brijesh Singh [Thu, 8 Mar 2018 12:49:00 +0000 (06:49 -0600)]
sev/i386: add sev_get_capabilities()

The function can be used to get the current SEV capabilities.
The capabilities include platform diffie-hellman key (pdh) and certificate
chain. The key can be provided to the external entities which wants to
establish a trusted channel between SEV firmware and guest owner.

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: qmp: add query-sev-capabilities command
Brijesh Singh [Thu, 8 Mar 2018 12:48:59 +0000 (06:48 -0600)]
sev/i386: qmp: add query-sev-capabilities command

The command can be used by libvirt to query the SEV capabilities.

Cc: "Daniel P. Berrangé" <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Markus Armbruster <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: qmp: add query-sev-launch-measure command
Brijesh Singh [Thu, 8 Mar 2018 12:48:56 +0000 (06:48 -0600)]
sev/i386: qmp: add query-sev-launch-measure command

The command can be used by libvirt to retrieve the measurement of SEV guest.
This measurement is a signature of the memory contents that was encrypted
through the LAUNCH_UPDATE_DATA.

Cc: "Daniel P. Berrangé" <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: hmp: add 'info sev' command
Brijesh Singh [Thu, 8 Mar 2018 12:48:47 +0000 (06:48 -0600)]
sev/i386: hmp: add 'info sev' command

The command can be used to show the SEV information when memory
encryption is enabled on AMD platform.

Cc: Eric Blake <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Markus Armbruster <[email protected]>
Reviewed-by: "Dr. David Alan Gilbert" <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agocpu/i386: populate CPUID 0x8000_001F when SEV is active
Brijesh Singh [Thu, 8 Mar 2018 12:48:58 +0000 (06:48 -0600)]
cpu/i386: populate CPUID 0x8000_001F when SEV is active

When SEV is enabled, CPUID 0x8000_001F should provide additional
information regarding the feature (such as which page table bit is used
to mark the pages as encrypted etc).

The details for memory encryption CPUID is available in AMD APM
(https://support.amd.com/TechDocs/24594.pdf) Section E.4.17

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: add migration blocker
Brijesh Singh [Thu, 8 Mar 2018 12:48:57 +0000 (06:48 -0600)]
sev/i386: add migration blocker

SEV guest migration is not implemented yet.

Signed-off-by: Brijesh Singh <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: finalize the SEV guest launch flow
Brijesh Singh [Thu, 8 Mar 2018 12:48:52 +0000 (06:48 -0600)]
sev/i386: finalize the SEV guest launch flow

SEV launch flow requires us to issue LAUNCH_FINISH command before guest
is ready to run.

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: add support to LAUNCH_MEASURE command
Brijesh Singh [Thu, 8 Mar 2018 12:48:51 +0000 (06:48 -0600)]
sev/i386: add support to LAUNCH_MEASURE command

During machine creation we encrypted the guest bios image, the
LAUNCH_MEASURE command can be used to retrieve the measurement of
the encrypted memory region. This measurement is a signature of
the memory contents that can be sent to the guest owner as an
attestation that the memory was encrypted correctly by the firmware.
VM management tools like libvirt can query the measurement using
query-sev-launch-measure QMP command.

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agotarget/i386: encrypt bios rom
Brijesh Singh [Thu, 8 Mar 2018 12:48:50 +0000 (06:48 -0600)]
target/i386: encrypt bios rom

SEV requires that guest bios must be encrypted before booting the guest.

Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: add command to encrypt guest memory region
Brijesh Singh [Thu, 8 Mar 2018 12:48:49 +0000 (06:48 -0600)]
sev/i386: add command to encrypt guest memory region

The KVM_SEV_LAUNCH_UPDATE_DATA command is used to encrypt a guest memory
region using the VM Encryption Key created using LAUNCH_START.

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: add command to create launch memory encryption context
Brijesh Singh [Thu, 8 Mar 2018 12:48:48 +0000 (06:48 -0600)]
sev/i386: add command to create launch memory encryption context

The KVM_SEV_LAUNCH_START command creates a new VM encryption key (VEK).
The encryption key created with the command will be used for encrypting
the bootstrap images (such as guest bios).

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: register the guest memory range which may contain encrypted data
Brijesh Singh [Thu, 8 Mar 2018 12:48:45 +0000 (06:48 -0600)]
sev/i386: register the guest memory range which may contain encrypted data

When SEV is enabled, the hardware encryption engine uses a tweak such
that the two identical plaintext at different location will have a
different ciphertexts. So swapping or moving a ciphertexts of two guest
pages will not result in plaintexts being swapped. Hence relocating
a physical backing pages of the SEV guest will require some additional
steps in KVM driver. The KVM_MEMORY_ENCRYPT_{UN,}REG_REGION ioctl can be
used to register/unregister the guest memory region which may contain the
encrypted data. KVM driver will internally handle the relocating physical
backing pages of registered memory regions.

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agosev/i386: add command to initialize the memory encryption context
Brijesh Singh [Thu, 8 Mar 2018 12:48:44 +0000 (06:48 -0600)]
sev/i386: add command to initialize the memory encryption context

When memory encryption is enabled, KVM_SEV_INIT command is used to
initialize the platform. The command loads the SEV related persistent
data from non-volatile storage and initializes the platform context.
This command should be first issued before invoking any other guest
commands provided by the SEV firmware.

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into...
Peter Maydell [Tue, 13 Mar 2018 16:26:44 +0000 (16:26 +0000)]
Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging

Python queue, 2018-03-12

# gpg: Signature made Mon 12 Mar 2018 22:10:36 GMT
# gpg:                using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <[email protected]>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/python-next-pull-request:
  device-crash-test: Use 'python' binary
  qmp.py: Encode json data before sending
  qemu.py: Use items() instead of iteritems()
  device-crash-test: New known crashes

Signed-off-by: Peter Maydell <[email protected]>
6 years ago.travis.yml: add --disable-user with the rest of the disables
Alex Bennée [Tue, 13 Mar 2018 15:24:22 +0000 (15:24 +0000)]
.travis.yml: add --disable-user with the rest of the disables

As all the disabled features only affect system emulation we might as
well disable user mode to save compile time.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
6 years ago.travis.yml: split default config into system and user
Alex Bennée [Tue, 13 Mar 2018 14:20:55 +0000 (14:20 +0000)]
.travis.yml: split default config into system and user

As the build times have risen we keep timing out. Split the default
config into system and user builds.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
6 years ago.travis.yml: drop setting default log output
Alex Bennée [Tue, 13 Mar 2018 14:18:06 +0000 (14:18 +0000)]
.travis.yml: drop setting default log output

The log backend is the default one, we don't need to explicitly set it.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
6 years agotarget/m68k: implement fcosh
Laurent Vivier [Mon, 12 Mar 2018 20:27:28 +0000 (21:27 +0100)]
target/m68k: implement fcosh

Using a local m68k  floatx80_cosh()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement fsinh
Laurent Vivier [Mon, 12 Mar 2018 20:27:27 +0000 (21:27 +0100)]
target/m68k: implement fsinh

Using a local m68k floatx80_sinh()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement ftanh
Laurent Vivier [Mon, 12 Mar 2018 20:27:26 +0000 (21:27 +0100)]
target/m68k: implement ftanh

Using local m68k floatx80_tanh() and floatx80_etoxm1()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement fatanh
Laurent Vivier [Mon, 12 Mar 2018 20:27:25 +0000 (21:27 +0100)]
target/m68k: implement fatanh

Using a local m68k floatx80_atanh()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement facos
Laurent Vivier [Mon, 12 Mar 2018 20:27:24 +0000 (21:27 +0100)]
target/m68k: implement facos

Using a local m68k floatx80_acos()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement fasin
Laurent Vivier [Mon, 12 Mar 2018 20:27:23 +0000 (21:27 +0100)]
target/m68k: implement fasin

Using a local m68k floatx80_asin()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement fatan
Laurent Vivier [Mon, 12 Mar 2018 20:27:22 +0000 (21:27 +0100)]
target/m68k: implement fatan

Using a local m68k floatx80_atan()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement fsincos
Laurent Vivier [Mon, 12 Mar 2018 20:27:21 +0000 (21:27 +0100)]
target/m68k: implement fsincos

using floatx80_sin() and floatx80_cos()

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement fcos
Laurent Vivier [Mon, 12 Mar 2018 20:27:20 +0000 (21:27 +0100)]
target/m68k: implement fcos

Using a local m68k floatx80_cos()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement fsin
Laurent Vivier [Mon, 12 Mar 2018 20:27:19 +0000 (21:27 +0100)]
target/m68k: implement fsin

Using a local m68k floatx80_sin()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agotarget/m68k: implement ftan
Laurent Vivier [Mon, 12 Mar 2018 20:27:18 +0000 (21:27 +0100)]
target/m68k: implement ftan

Using a local m68k floatx80_tan()
[copied from previous:
Written by Andreas Grabher for Previous, NeXT Computer Emulator.]

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20180312202728[email protected]>

6 years agolinux-user: init_guest_space: Add a comment about search strategy
Luke Shumaker [Thu, 28 Dec 2017 18:08:12 +0000 (13:08 -0500)]
linux-user: init_guest_space: Add a comment about search strategy

Signed-off-by: Luke Shumaker <[email protected]>
Message-Id: <20171228180814[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
Peter Maydell [Tue, 13 Mar 2018 14:02:47 +0000 (14:02 +0000)]
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging

x86 queue, 2018-03-12

* Intel Processor Trace support
* KVM_HINTS_DEDICATED

# gpg: Signature made Mon 12 Mar 2018 19:58:39 GMT
# gpg:                using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <[email protected]>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-next-pull-request:
  i386: Add support to get/set/migrate Intel Processor Trace feature
  i386: Add Intel Processor Trace feature support
  target-i386: add KVM_HINTS_DEDICATED performance hint

Signed-off-by: Peter Maydell <[email protected]>
6 years agolinux-user: init_guest_space: Don't try to align if we'll reject it
Luke Shumaker [Thu, 28 Dec 2017 18:08:11 +0000 (13:08 -0500)]
linux-user: init_guest_space: Don't try to align if we'll reject it

If the ensure-alignment code gets triggered, then the
"if (host_start && real_start != current_start)" check will always trigger,
so save 2 syscalls and put that check first.

Note that we can't just switch to using MAP_FIXED for that check, because
then we couldn't differentiate between a failure because "there isn't
enough space" and "there isn't enough space *here*".

Signed-off-by: Luke Shumaker <[email protected]>
Message-Id: <20171228180814[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agolinux-user: init_guest_space: Clean up control flow a bit
Luke Shumaker [Thu, 28 Dec 2017 18:08:10 +0000 (13:08 -0500)]
linux-user: init_guest_space: Clean up control flow a bit

Instead of doing

        if (check1) {
            if (check2) {
               success;
            }
        }

        retry;

Do a clearer

        if (!check1) {
           goto try_again;
        }

        if (!check2) {
           goto try_again;
        }

        success;

    try_again:
        retry;

Besides being clearer, this makes it easier to insert more checks that
need to trigger a retry on check failure, or rearrange them, or anything
like that.

Because some indentation is changing, "ignore space change" may be useful
for viewing this patch.

Signed-off-by: Luke Shumaker <[email protected]>
Message-Id: <20171228180814[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
[lv: modified to try again fi valid == 0, not valid == -1 (error case)]
Signed-off-by: Laurent Vivier <[email protected]>
6 years agoblock: include original filename when reporting invalid URIs
Daniel P. Berrangé [Tue, 6 Feb 2018 10:52:04 +0000 (10:52 +0000)]
block: include original filename when reporting invalid URIs

Consider passing a JSON based block driver to "qemu-img commit"

$ qemu-img commit 'json:{"driver":"qcow2","file":{"driver":"gluster",\
                  "volume":"gv0","path":"sn1.qcow2",
                  "server":[{"type":\
  "tcp","host":"10.73.199.197","port":"24007"}]},}'

Currently it will commit the content and then report an incredibly
useless error message when trying to re-open the committed image:

  qemu-img: invalid URI
  Usage: file=gluster[+transport]://[host[:port]]volume/path[?socket=...][,file.debug=N][,file.logfile=/path/filename.log]

With this fix we get:

  qemu-img: invalid URI json:{"server.0.host": "10.73.199.197",
      "driver": "gluster", "path": "luks.qcow2", "server.0.type":
      "tcp", "server.0.port": "24007", "volume": "gv0"}

Of course the root cause problem still exists, but now we know
what actually needs fixing.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180206105204[email protected]
Signed-off-by: Jeff Cody <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/famz/tags/staging-pull-request' into staging
Peter Maydell [Tue, 13 Mar 2018 11:42:45 +0000 (11:42 +0000)]
Merge remote-tracking branch 'remotes/famz/tags/staging-pull-request' into staging

docker patches

# gpg: Signature made Mon 12 Mar 2018 17:25:57 GMT
# gpg:                using RSA key CA35624C6A9171C6
# gpg: Good signature from "Fam Zheng <[email protected]>"
# Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6

* remotes/famz/tags/staging-pull-request:
  tests: make docker-test-debug@fedora run sanitizers

Signed-off-by: Peter Maydell <[email protected]>
6 years agoinclude: add psp-sev.h header file
Brijesh Singh [Tue, 13 Mar 2018 08:50:56 +0000 (09:50 +0100)]
include: add psp-sev.h header file

The header file provide the ioctl command and structure to communicate
with /dev/sev device.

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
6 years agosev/i386: qmp: add query-sev command
Brijesh Singh [Thu, 8 Mar 2018 12:48:42 +0000 (06:48 -0600)]
sev/i386: qmp: add query-sev command

The QMP query command can used to retrieve the SEV information when
memory encryption is enabled on AMD platform.

Cc: Eric Blake <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agotarget/i386: add Secure Encrypted Virtualization (SEV) object
Brijesh Singh [Thu, 8 Mar 2018 12:48:41 +0000 (06:48 -0600)]
target/i386: add Secure Encrypted Virtualization (SEV) object

Add a new memory encryption object 'sev-guest'. The object will be used
to create encrypted VMs on AMD EPYC CPU. The object provides the properties
to pass guest owner's public Diffie-hellman key, guest policy and session
information required to create the memory encryption context within the
SEV firmware.

e.g to launch SEV guest
 # $QEMU \
    -object sev-guest,id=sev0 \
    -machine ....,memory-encryption=sev0

Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agokvm: introduce memory encryption APIs
Brijesh Singh [Thu, 8 Mar 2018 12:48:46 +0000 (06:48 -0600)]
kvm: introduce memory encryption APIs

Inorder to integerate the Secure Encryption Virtualization (SEV) support
add few high-level memory encryption APIs which can be used for encrypting
the guest memory region.

Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agokvm: add memory encryption context
Brijesh Singh [Thu, 8 Mar 2018 12:48:44 +0000 (06:48 -0600)]
kvm: add memory encryption context

Split from a patch by Brijesh Singh ([email protected]).

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
6 years agodocs: add AMD Secure Encrypted Virtualization (SEV)
Brijesh Singh [Thu, 8 Mar 2018 12:48:40 +0000 (06:48 -0600)]
docs: add AMD Secure Encrypted Virtualization (SEV)

Create a documentation entry to describe the AMD Secure Encrypted
Virtualization (SEV) feature.

Cc: Paolo Bonzini <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agomachine: add memory-encryption option
Brijesh Singh [Thu, 8 Mar 2018 12:48:38 +0000 (06:48 -0600)]
machine: add memory-encryption option

When CPU supports memory encryption feature, the property can be used to
specify the encryption object to use when launching an encrypted guest.

Cc: Paolo Bonzini <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Signed-off-by: Brijesh Singh <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agoKVM: x86: Add support for save/load MSR_SMI_COUNT
Liran Alon [Tue, 27 Feb 2018 10:22:12 +0000 (12:22 +0200)]
KVM: x86: Add support for save/load MSR_SMI_COUNT

This MSR returns the number of #SMIs that occurred on
CPU since boot.

KVM commit 52797bf9a875 ("KVM: x86: Add emulation of MSR_SMI_COUNT")
introduced support for emulating this MSR.

This commit adds support for QEMU to save/load this
MSR for migration purposes.

Signed-off-by: Liran Alon <[email protected]>
Reviewed-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
6 years agoupdate Linux headers to 4.16-rc5
Paolo Bonzini [Tue, 13 Mar 2018 08:38:18 +0000 (09:38 +0100)]
update Linux headers to 4.16-rc5

Note that VIRTIO_GPU_CAPSET_VIRGL2 was added manually so it has to be added
manually after re-running scripts/update-linux-headers.sh.

Signed-off-by: Paolo Bonzini <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Tue, 13 Mar 2018 10:49:02 +0000 (10:49 +0000)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

# gpg: Signature made Mon 12 Mar 2018 16:01:16 GMT
# gpg:                using RSA key 9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>"
# gpg:                 aka "Stefan Hajnoczi <[email protected]>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  block: make BDRV_POLL_WHILE() re-entrancy safe

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Peter Maydell [Tue, 13 Mar 2018 09:43:43 +0000 (09:43 +0000)]
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging

# gpg: Signature made Mon 12 Mar 2018 15:59:54 GMT
# gpg:                using RSA key 9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>"
# gpg:                 aka "Stefan Hajnoczi <[email protected]>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/tracing-pull-request:
  trace: only permit standard C types and fixed size integer types
  trace: remove use of QEMU specific types from trace probes
  trace: include filename when printing parser error messages
  simpletrace: fix timestamp argument type
  log-for-trace.h: Split out parts of log.h used by trace.h

Signed-off-by: Peter Maydell <[email protected]>
6 years agodevice-crash-test: Use 'python' binary
Eduardo Habkost [Mon, 12 Mar 2018 18:55:03 +0000 (15:55 -0300)]
device-crash-test: Use 'python' binary

Now the script works with Python 3, so we can use the 'python'
binary provided by the system.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180312185503[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoqmp.py: Encode json data before sending
Eduardo Habkost [Mon, 12 Mar 2018 18:55:02 +0000 (15:55 -0300)]
qmp.py: Encode json data before sending

On Python 3, json.dumps() return a str object, which can't be
sent directly through a socket and must be encoded into a bytes
object.  Use .encode('utf-8'), which will work on both Python 2
and Python 3.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180312185503[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoqemu.py: Use items() instead of iteritems()
Eduardo Habkost [Mon, 12 Mar 2018 18:55:01 +0000 (15:55 -0300)]
qemu.py: Use items() instead of iteritems()

items() is less efficient on Python 2.x, but makes the code work
on both Python 2 and Python 3.

Cc: Lukáš Doktor <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: Cleber Rosa <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180312185503[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agodevice-crash-test: New known crashes
Eduardo Habkost [Fri, 9 Mar 2018 20:28:23 +0000 (17:28 -0300)]
device-crash-test: New known crashes

We are not running the script on "make check" yet, and additional
bugs were introduced recently in the tree.

Whitelist the new crashes while we investigate, to allow us to
run device-crash-test on "make check" as soon as possible to
prevent new bugs.

Cc: Pavel Pisa <[email protected]>
Cc: John Snow <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180309202827[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/kraxel/tags/usb-20180312-pull-request' into...
Peter Maydell [Mon, 12 Mar 2018 19:40:43 +0000 (19:40 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180312-pull-request' into staging

usbredir: reorder fields in USBRedirDevice to reduce padding

# gpg: Signature made Mon 12 Mar 2018 11:05:19 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/usb-20180312-pull-request:
  usbredir: reorder fields in USBRedirDevice to reduce padding

Signed-off-by: Peter Maydell <[email protected]>
6 years agoi386: Add support to get/set/migrate Intel Processor Trace feature
Chao Peng [Sun, 4 Mar 2018 16:48:36 +0000 (00:48 +0800)]
i386: Add support to get/set/migrate Intel Processor Trace feature

Add Intel Processor Trace related definition. It also add
corresponding part to kvm_get/set_msr and vmstate.

Signed-off-by: Chao Peng <[email protected]>
Signed-off-by: Luwei Kang <[email protected]>
Message-Id: <1520182116[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoi386: Add Intel Processor Trace feature support
Chao Peng [Sun, 4 Mar 2018 16:48:35 +0000 (00:48 +0800)]
i386: Add Intel Processor Trace feature support

Expose Intel Processor Trace feature to guest.

To make Intel PT live migration safe and get same CPUID information
with same CPU model on diffrent host. CPUID[14] is constant in this
patch. Intel PT use EPT is first supported in IceLake, the CPUID[14]
get on this machine as default value. Intel PT would be disabled
if any machine don't support this minial feature list.

Signed-off-by: Chao Peng <[email protected]>
Signed-off-by: Luwei Kang <[email protected]>
Message-Id: <1520182116[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agotarget-i386: add KVM_HINTS_DEDICATED performance hint
Wanpeng Li [Fri, 9 Feb 2018 14:15:25 +0000 (06:15 -0800)]
target-i386: add KVM_HINTS_DEDICATED performance hint

Add KVM_HINTS_DEDICATED performance hint, guest checks this feature bit
to determine if they run on dedicated vCPUs, allowing optimizations such
as usage of qspinlocks.

Cc: Paolo Bonzini <[email protected]>
Cc: Radim Krčmář <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Wanpeng Li <[email protected]>
Message-Id: <1518185725[email protected]>
[ehabkost: Renamed property to kvm-hint-dedicated]
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/kraxel/tags/vga-20180312-pull-request' into...
Peter Maydell [Mon, 12 Mar 2018 18:35:37 +0000 (18:35 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20180312-pull-request' into staging

7cdc61becd vga: fix region calculation

# gpg: Signature made Mon 12 Mar 2018 10:59:24 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20180312-pull-request:
  vga: fix region calculation

Signed-off-by: Peter Maydell <[email protected]>
6 years agotests: make docker-test-debug@fedora run sanitizers
Marc-André Lureau [Mon, 12 Mar 2018 12:08:48 +0000 (13:08 +0100)]
tests: make docker-test-debug@fedora run sanitizers

Since --enable-debug no longer enable sanitizers, we need explicit
--enable-sanitizers.

llvm package is required for llvm-symbolizer, to get symbols in
backtraces.

Add make V=1 to get details about failing tests.

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20180312120849[email protected]>
Signed-off-by: Fam Zheng <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/kraxel/tags/audio-20180312-pull-request' into...
Peter Maydell [Mon, 12 Mar 2018 16:14:37 +0000 (16:14 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20180312-pull-request' into staging

modules: use gmodule-export.
audio: add driver registry, enable module builds.

# gpg: Signature made Mon 12 Mar 2018 10:42:19 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20180312-pull-request:
  audio/sdl: build as module
  audio/pulseaudio: build as module
  audio/oss: build as module
  audio/alsa: build as module
  build: enable audio modules
  audio: add module loading support
  audio: add driver registry
  modules: use gmodule-export

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20180312-pull-request' into...
Peter Maydell [Mon, 12 Mar 2018 14:06:23 +0000 (14:06 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180312-pull-request' into staging

gtk,spice: add dmabuf support.
sdl,vnc,gtk: bugfixes.
ui/qapi: add device ID and head parameters to screendump.
build: try improve handling of clang warnings.

# gpg: Signature made Mon 12 Mar 2018 09:13:28 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20180312-pull-request:
  qapi: Add device ID and head parameters to screendump
  spice: add cursor_dmabuf support
  spice: add scanout_dmabuf support
  spice: drop dprint() debug logging
  vnc: deal with surface NULL pointers
  ui/gtk-egl: add cursor_dmabuf support
  ui/gtk-egl: add scanout_dmabuf support
  ui/gtk: use GtkGlArea on wayland only
  ui/opengl: Makefile cleanup
  ui/gtk: group gtk.mo declarations in Makefile
  ui/gtk: make GtkGlArea usage a runtime option
  sdl: workaround bug in sdl 2.0.8 headers
  make: switch language file build to be gtk module aware
  build: try improve handling of clang warnings

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20180309a' into...
Peter Maydell [Mon, 12 Mar 2018 13:21:53 +0000 (13:21 +0000)]
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20180309a' into staging

Migration pull 2018-03-09

# gpg: Signature made Fri 09 Mar 2018 17:52:46 GMT
# gpg:                using RSA key 0516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <[email protected]>"
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7

* remotes/dgilbert/tags/pull-migration-20180309a:
  tests: Silence migration-test 'bad' test
  migration: fix applying wrong capabilities
  migration/block: rename MAX_INFLIGHT_IO to MAX_IO_BUFFERS
  migration/block: reset dirty bitmap before read in bulk phase
  migration: do not transfer ram during bulk storage migration
  migration: fix minor finalize leak

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180309' into...
Peter Maydell [Mon, 12 Mar 2018 11:47:52 +0000 (11:47 +0000)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180309' into staging

target-arm queue:
 * i.MX: Add i.MX7 SOC implementation and i.MX7 Sabre board
 * Report the correct core count in A53 L2CTLR on the ZynqMP board
 * linux-user: preliminary SVE support work (signal handling)
 * hw/arm/boot: fix memory leak in case of error loading ELF file
 * hw/arm/boot: avoid reading off end of buffer if passed very
   small image file
 * hw/arm: Use more CONFIG switches for the object files
 * target/arm: Add "-cpu max" support
 * hw/arm/virt: Support -machine gic-version=max
 * hw/sd: improve debug tracing
 * hw/sd: sdcard: Add the Tuning Command (CMD 19)
 * MAINTAINERS: add Philippe as odd-fixes maintainer for SD

# gpg: Signature made Fri 09 Mar 2018 17:24:23 GMT
# gpg:                using RSA key 3C2525ED14360CDE
# gpg: Good signature from "Peter Maydell <[email protected]>"
# gpg:                 aka "Peter Maydell <[email protected]>"
# gpg:                 aka "Peter Maydell <[email protected]>"
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20180309: (25 commits)
  MAINTAINERS: Add entries for SD (SDHCI, SDBus, SDCard)
  sdhci: Fix a typo in comment
  sdcard: Add the Tuning Command (CMD19)
  sdcard: Display which protocol is used when tracing (SD or SPI)
  sdcard: Display command name when tracing CMD/ACMD
  sdcard: Do not trace CMD55, except when we already expect an ACMD
  hw/arm/virt: Support -machine gic-version=max
  hw/arm/virt: Add "max" to the list of CPU types "virt" supports
  target/arm: Make 'any' CPU just an alias for 'max'
  target/arm: Add "-cpu max" support
  target/arm: Move definition of 'host' cpu type into cpu.c
  target/arm: Query host CPU features on-demand at instance init
  arm: avoid heap-buffer-overflow in load_aarch64_image
  arm: fix load ELF error leak
  hw/arm: Use more CONFIG switches for the object files
  aarch64-linux-user: Add support for SVE signal frame records
  aarch64-linux-user: Add support for EXTRA signal frame records
  aarch64-linux-user: Remove struct target_aux_context
  aarch64-linux-user: Split out helpers for guest signal handling
  linux-user: Implement aarch64 PR_SVE_SET/GET_VL
  ...

Signed-off-by: Peter Maydell <[email protected]>
6 years agotrace: only permit standard C types and fixed size integer types
Daniel P. Berrangé [Thu, 8 Mar 2018 15:55:24 +0000 (15:55 +0000)]
trace: only permit standard C types and fixed size integer types

Some trace backends will compile code based on the declared trace
events. It should not be assumed that the backends can resolve any QEMU
specific typedefs. So trace events should restrict their argument
types to the standard C types and fixed size integer types. Any complex
pointer types can be declared as "void *" for purposes of trace events,
since nothing will be dereferencing these pointer arguments.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-id: 20180308155524[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
6 years agotrace: remove use of QEMU specific types from trace probes
Daniel P. Berrangé [Thu, 8 Mar 2018 15:55:23 +0000 (15:55 +0000)]
trace: remove use of QEMU specific types from trace probes

Any compound structs / unions / etc, should always be declared as
'void *' pointers, since it cannot be assumed that trace backends
are able to resolve QEMU typedefs.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-id: 20180308155524[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
6 years agotrace: include filename when printing parser error messages
Daniel P. Berrangé [Tue, 6 Mar 2018 15:46:50 +0000 (15:46 +0000)]
trace: include filename when printing parser error messages

Improves error messages from:

  ValueError: Error on line 72: need more than 1 value to unpack

To

  ValueError: Error at /home/berrange/src/virt/qemu/trace-events:72:
    need more than 1 value to unpack

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180306154650[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
6 years agosimpletrace: fix timestamp argument type
Stefan Hajnoczi [Thu, 22 Feb 2018 16:39:01 +0000 (16:39 +0000)]
simpletrace: fix timestamp argument type

The timestamp argument to a trace event method is documented as follows:

  The method can also take a timestamp argument before the trace event
  arguments:

    def runstate_set(self, timestamp, new_state):
        ...

  Timestamps have the uint64_t type and are in nanoseconds.

In reality methods with a timestamp argument actually receive a tuple
like (123456789,) as the timestamp argument.  This is due to a bug in
simpletrace.py.

This patch unpacks the tuple so that methods receive the correct
timestamp argument type.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Message-id: 20180222163901[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
6 years agolog-for-trace.h: Split out parts of log.h used by trace.h
Peter Maydell [Tue, 13 Feb 2018 14:00:29 +0000 (14:00 +0000)]
log-for-trace.h: Split out parts of log.h used by trace.h

A persistent build problem we see is where a source file
accidentally omits the #include of log.h. This slips through
local developer testing because if you configure with the
default (log) trace backend trace.h will pull in log.h for you.
Compilation fails only if some other backend is selected.

To make this error cause a compile failure regardless of
the configured trace backend, split out the parts of log.h
that trace.h requires into a new log-for-trace.h header.
Since almost all manual uses of the log.h functions will
use constants or functions which aren't in log-for-trace.h,
this will let us catch missing #include "qemu/log.h" more
consistently.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: 20180213140029[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
6 years agoblock: make BDRV_POLL_WHILE() re-entrancy safe
Stefan Hajnoczi [Wed, 7 Mar 2018 12:46:19 +0000 (12:46 +0000)]
block: make BDRV_POLL_WHILE() re-entrancy safe

Nested BDRV_POLL_WHILE() calls can occur.  Currently
assert(!wait_->wakeup) fails in AIO_WAIT_WHILE() when this happens.

This patch converts the bool wait_->need_kick flag to an unsigned
wait_->num_waiters counter.

Nesting works correctly because outer AIO_WAIT_WHILE() callers evaluate
the condition again after the inner caller completes (invoking the inner
caller counts as aio_poll() progress).

Reported-by: "fuweiwei (C)" <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
Message-id: 20180307124619[email protected]
Cc: Paolo Bonzini <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
6 years agovga: fix region calculation
Gerd Hoffmann [Fri, 9 Mar 2018 14:37:04 +0000 (15:37 +0100)]
vga: fix region calculation

Typically the scanline length and the line offset are identical.  But
in case they are not our calculation for region_end is incorrect.  Using
line_offset is fine for all scanlines, except the last one where we have
to use the actual scanline length.

Fixes: CVE-2018-7550
Reported-by: Ross Lagerwall <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Prasad J Pandit <[email protected]>
Tested-by: Ross Lagerwall <[email protected]>
Message-id: 20180309143704[email protected]

6 years agousbredir: reorder fields in USBRedirDevice to reduce padding
zhenwei.pi [Tue, 6 Mar 2018 06:46:21 +0000 (14:46 +0800)]
usbredir: reorder fields in USBRedirDevice to reduce padding

Changing the current ordering saves 8 bytes per entry in x86_64.

Signed-off-by: zhenwei.pi <[email protected]>
Message-id: 1520318781[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
6 years agoaudio/sdl: build as module
Gerd Hoffmann [Tue, 6 Mar 2018 07:40:53 +0000 (08:40 +0100)]
audio/sdl: build as module

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306074053[email protected]

6 years agoaudio/pulseaudio: build as module
Gerd Hoffmann [Tue, 6 Mar 2018 07:40:52 +0000 (08:40 +0100)]
audio/pulseaudio: build as module

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306074053[email protected]

6 years agoaudio/oss: build as module
Gerd Hoffmann [Tue, 6 Mar 2018 07:40:51 +0000 (08:40 +0100)]
audio/oss: build as module

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306074053[email protected]

6 years agoaudio/alsa: build as module
Gerd Hoffmann [Tue, 6 Mar 2018 07:40:50 +0000 (08:40 +0100)]
audio/alsa: build as module

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306074053[email protected]

6 years agobuild: enable audio modules
Gerd Hoffmann [Tue, 6 Mar 2018 07:40:49 +0000 (08:40 +0100)]
build: enable audio modules

Add audio/ to common-obj-m variable.

Also run both audio and ui variables through unnest-vars.
This avoids sdl.mo (exists in both audio/ and ui/) name clashes.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306074053[email protected]

6 years agoaudio: add module loading support
Gerd Hoffmann [Tue, 6 Mar 2018 07:40:48 +0000 (08:40 +0100)]
audio: add module loading support

Make audio_driver_lookup() try load the module in case it doesn't find
the driver in the registry.  Also load all modules for -audio-help, so
the help output includes the help text for modular audio drivers.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-id: 20180306074053[email protected]

6 years agoaudio: add driver registry
Gerd Hoffmann [Tue, 6 Mar 2018 07:40:47 +0000 (08:40 +0100)]
audio: add driver registry

Add registry for audio drivers, using the existing audio_driver struct.
Make all drivers register themself.  The old list of audio_driver struct
pointers is now a list of audio driver names, specifying the priority
(aka probe order) in case no driver is explicitly asked for.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-id: 20180306074053[email protected]

6 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Mon, 12 Mar 2018 10:08:09 +0000 (10:08 +0000)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches

# gpg: Signature made Fri 09 Mar 2018 15:09:20 GMT
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <[email protected]>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream: (56 commits)
  qemu-iotests: fix 203 migration completion race
  iotests: Tweak 030 in order to trigger a race condition with parallel jobs
  iotests: Skip test for ENOMEM error
  iotests: Mark all tests executable
  iotests: Test creating overlay when guest running
  qemu-iotests: Test ssh image creation over QMP
  qemu-iotests: Test qcow2 over file image creation with QMP
  block: Fail bdrv_truncate() with negative size
  file-posix: Fix no-op bdrv_truncate() with falloc preallocation
  ssh: Support .bdrv_co_create
  ssh: Pass BlockdevOptionsSsh to connect_to_ssh()
  ssh: QAPIfy host-key-check option
  ssh: Use QAPI BlockdevOptionsSsh object
  sheepdog: Support .bdrv_co_create
  sheepdog: QAPIfy "redundancy" create option
  nfs: Support .bdrv_co_create
  nfs: Use QAPI options in nfs_client_open()
  rbd: Use qemu_rbd_connect() in qemu_rbd_do_create()
  rbd: Assign s->snap/image_name in qemu_rbd_open()
  rbd: Support .bdrv_co_create
  ...

Signed-off-by: Peter Maydell <[email protected]>
6 years agomodules: use gmodule-export
Gerd Hoffmann [Thu, 8 Mar 2018 08:53:00 +0000 (09:53 +0100)]
modules: use gmodule-export

As we want qemu symbols be exported to modules we should use the
gmodule-export-2.0 pkg-config instead of gmodule-2.0.

Cc: Marc-André Lureau <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180308085301[email protected]

6 years agoqapi: Add device ID and head parameters to screendump
Thomas Huth [Mon, 5 Mar 2018 16:37:48 +0000 (17:37 +0100)]
qapi: Add device ID and head parameters to screendump

QEMU's screendump command can only take dumps from the primary display.
When using multiple VGA cards, there is no way to get a dump from a
secondary card or other display heads yet. So let's add a 'device' and
a 'head' parameter to the HMP and QMP commands to be able to specify
alternative devices and heads with the screendump command, too.

Reviewed-by: Daniel P. Berrangé <[email protected]>
Acked-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 1520267868[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
6 years agospice: add cursor_dmabuf support
Gerd Hoffmann [Thu, 8 Mar 2018 09:06:17 +0000 (10:06 +0100)]
spice: add cursor_dmabuf support

Add support for cursor dmabufs.  qemu has to render the cursor for
that, so in case a cursor is present qemu allocates a new dmabuf, blits
the scanout, blends in the pointer and passes on the new dmabuf to
spice-server.  Without cursor qemu continues to simply pass on the
scanout dmabuf as-is.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-id: 20180308090618[email protected]

6 years agospice: add scanout_dmabuf support
Gerd Hoffmann [Thu, 8 Mar 2018 09:06:16 +0000 (10:06 +0100)]
spice: add scanout_dmabuf support

Add support for scanout dmabufs.  Just
pass them through to spice-server.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-id: 20180308090618[email protected]

6 years agospice: drop dprint() debug logging
Gerd Hoffmann [Thu, 8 Mar 2018 09:06:15 +0000 (10:06 +0100)]
spice: drop dprint() debug logging

Some calls are deleted, some are converted into tracepoints.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-id: 20180308090618[email protected]

6 years agovnc: deal with surface NULL pointers
Gerd Hoffmann [Thu, 8 Mar 2018 16:18:03 +0000 (17:18 +0100)]
vnc: deal with surface NULL pointers

Secondary displays in multihead setups are allowed to have a NULL
DisplaySurface.  Typically user interfaces handle this by hiding the
window which shows the display in question.

This isn't an option for vnc though because it simply hasn't a concept
of windows or outputs.  So handle the situation by showing a placeholder
DisplaySurface instead.  Also check in console_select whenever a surface
is preset in the first place before requesting an update.

This fixes a segfault which can be triggered by switching to an unused
display (via vtrl-alt-<nr>) in a multihead setup, for example using
-device virtio-vga,max_outputs=2.

Cc: Christian Borntraeger <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Christian Borntraeger <[email protected]>
Message-id: 20180308161803[email protected]

6 years agoui/gtk-egl: add cursor_dmabuf support
Gerd Hoffmann [Tue, 6 Mar 2018 09:09:51 +0000 (10:09 +0100)]
ui/gtk-egl: add cursor_dmabuf support

Add support for cursor dmabufs to gtk-egl.  Just blend in the cursor
(if we have one) when rendering the dmabuf.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306090951[email protected]

6 years agoui/gtk-egl: add scanout_dmabuf support
Gerd Hoffmann [Tue, 6 Mar 2018 09:09:50 +0000 (10:09 +0100)]
ui/gtk-egl: add scanout_dmabuf support

Add support for dmabuf scanouts to gtk-egl.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306090951[email protected]

6 years agoui/gtk: use GtkGlArea on wayland only
Gerd Hoffmann [Tue, 6 Mar 2018 09:09:49 +0000 (10:09 +0100)]
ui/gtk: use GtkGlArea on wayland only

For dma-buf support we need a egl context.  The gtk x11 backend uses glx
contexts though.  We can't use the GtkGlArea widget on x11 because of
that, so use our own gtk-egl code instead.  wayland continues to use
the GtkGlArea widget.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306090951[email protected]

6 years agoui/opengl: Makefile cleanup
Gerd Hoffmann [Tue, 6 Mar 2018 09:09:48 +0000 (10:09 +0100)]
ui/opengl: Makefile cleanup

With gtk.mo bits moved away we don't need the ifeq any more.
Also add missing opengl libs for some objects.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306090951[email protected]

6 years agoui/gtk: group gtk.mo declarations in Makefile
Gerd Hoffmann [Tue, 6 Mar 2018 09:09:47 +0000 (10:09 +0100)]
ui/gtk: group gtk.mo declarations in Makefile

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306090951[email protected]

6 years agoui/gtk: make GtkGlArea usage a runtime option
Gerd Hoffmann [Tue, 6 Mar 2018 09:09:46 +0000 (10:09 +0100)]
ui/gtk: make GtkGlArea usage a runtime option

Compile in both gtk-egl and gtk-gl-area, then allow to choose at runtime
instead of compile time which opengl variant we want use.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20180306090951[email protected]

6 years agosdl: workaround bug in sdl 2.0.8 headers
Gerd Hoffmann [Wed, 7 Mar 2018 15:42:57 +0000 (16:42 +0100)]
sdl: workaround bug in sdl 2.0.8 headers

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892087

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-id: 20180307154258[email protected]

6 years agomake: switch language file build to be gtk module aware
Bruce Rogers [Wed, 7 Mar 2018 15:55:17 +0000 (08:55 -0700)]
make: switch language file build to be gtk module aware

Now that gtk support builds as a module, CONFIG_GTK changed from
y to m. Adjust Makefile correspondingly.

Signed-off-by: Bruce Rogers <[email protected]>
Message-id: 20180307155517[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
6 years agobuild: try improve handling of clang warnings
Gerd Hoffmann [Fri, 9 Mar 2018 13:59:45 +0000 (14:59 +0100)]
build: try improve handling of clang warnings

This patch disables the pragma diagnostic -Wunused-but-set-variable for
clang in util/coroutine-ucontext.c.

This in turn allows us to remove it from the configure check, so the
CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE will succeed for clang.

With that in place clang builds (linux) will use -Werror by default,
which breaks the build due to warning about unaligned struct members.

Just turning off this warning isn't a good idea as it indicates
portability problems.  So make it a warning again, using
-Wno-error=address-of-packed-member.  That way it doesn't break the
build but still shows up in the logs.

Now clang builds qemu without errors.  Well, almost.  There are some
left in the rdma code.  Leaving that to the rdma people.  All others can
use --disable-rdma to workarounds this.

Cc: Peter Maydell <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Message-Id: <20180309135945[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
6 years agolinux-user: init_guest_commpage: Add a comment about size check
Luke Shumaker [Thu, 28 Dec 2017 18:08:09 +0000 (13:08 -0500)]
linux-user: init_guest_commpage: Add a comment about size check

Signed-off-by: Luke Shumaker <[email protected]>
Message-Id: <20171228180814[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agolinux-user: init_guest_space: Clarify page alignment logic
Luke Shumaker [Thu, 28 Dec 2017 18:08:08 +0000 (13:08 -0500)]
linux-user: init_guest_space: Clarify page alignment logic

There are 3 parts to this change:
 - Add a comment showing the relative sizes and positions of the blocks of
   memory
 - introduce and use new aligned_{start,size} instead of adjusting
   real_{start_size}
 - When we clean up (on failure), munmap(real_start, real_size) instead of
   munmap(aligned_start, aligned_size).  It *shouldn't* make any
   difference, but I will admit that this does mean we are making the
   syscall with different values, so this isn't quite a no-op patch.

Signed-off-by: Luke Shumaker <[email protected]>
Message-Id: <20171228180814[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agolinux-user: init_guest_space: Correctly handle guest_start in commpage initialization
Luke Shumaker [Thu, 28 Dec 2017 18:08:07 +0000 (13:08 -0500)]
linux-user: init_guest_space: Correctly handle guest_start in commpage initialization

init_guest_commpage  needs to check if the mapped space, which ends at
real_start+real_size overlaps with where it needs to put the commpage,
which is (assuming sane qemu_host_page_size) guest_base + 0xffff000, where
guest_base is real_start - guest_start.

    [guest_base][       0xffff0000      ][commpage]
    [guest_base][guest_start][real_size] [commpage]
    [       real_start      ][real_size] [commpage]
                                        ^
                                 fail if this gap < 0

Since init_guest_commpage wants to do everything relative to guest_base
(rather than real_start), it obviously needs to be comparing 0xffff0000
against guest_start+real_size, not just real_size.

This bug has been present since 806d102141b99d4f1e55a97d68b7ea8c8ba3129f in
2012, but guest_start is usually 0, and prior to v2.11 real_size was
usually much smaller than 0xffff0000, so it was uncommon for it to have
made a difference.

Signed-off-by: Luke Shumaker <[email protected]>
Message-Id: <20171228180814[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
This page took 0.093433 seconds and 4 git commands to generate.