Re: [Qemu-devel] Patch to add helpful tracing output for driver authors in NVMe emulation

2017-10-09 Thread Markus Armbruster
Doug Gale writes: > I used exclamations as a concise way of indicating that the driver did > something nonsensical, or horribly invalid, like something likely to > cause a memory corruption, trying to start the controller with a > nonsense configuration, providing invalid PRDs or writing to > unr

Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration

2017-10-09 Thread Bharat Bhushan
Hi Alex, Eric, > -Original Message- > From: Qemu-devel [mailto:qemu-devel- > bounces+bharat.bhushan=nxp@nongnu.org] On Behalf Of Bharat > Bhushan > Sent: Friday, October 06, 2017 9:16 AM > To: Auger Eric ; Linu Cherian > > Cc: peter.mayd...@linaro.org; kevin.t...@intel.com; m...@redha

Re: [Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups

2017-10-09 Thread Mark Cave-Ayland
On 09/10/17 23:23, no-re...@patchew.org wrote: > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Type: series > Message-id: 1507583223-14819-1-git-send-email-mark.cave-ayl...@ilande.co.uk > Subject: [Qemu-devel] [PATCH 0/8] sun4m : sparc

Re: [Qemu-devel] [PATCH] oslib-posix: Fix compiler warning

2017-10-09 Thread Stefan Weil
Am 09.10.2017 um 23:58 schrieb Richard Henderson: > On 10/07/2017 08:55 AM, Stefan Weil wrote: >> +char *addr = memset_args->addr; >> +uint64_t numpages = memset_args->numpages; >> +uint64_t hpagesize = memset_args->hpagesize; >> +unsigned i; > > Match numpages prop

Re: [Qemu-devel] [PATCH v2 3/3] scripts: Remove debug parameter from QEMUMachine

2017-10-09 Thread Eduardo Habkost
On Sat, Oct 07, 2017 at 10:34:57AM +0200, Lukáš Doktor wrote: > Dne 5.10.2017 v 19:20 Eduardo Habkost napsal(a): > > All scripts that use the QEMUMachine and QEMUQtestMachine classes > > (device-crash-test, tests/migration/*, iotests.py, basevm.py) > > already configure logging. > > > > The basicC

Re: [Qemu-devel] [PATCH v2 2/3] scripts: Remove debug parameter from QEMUMonitorProtocol

2017-10-09 Thread Eduardo Habkost
On Sat, Oct 07, 2017 at 10:26:14AM +0200, Lukáš Doktor wrote: > Dne 5.10.2017 v 19:20 Eduardo Habkost napsal(a): > > Use logging module for the QMP debug messages. The only scripts > > that set debug=True are iotests.py and guestperf/engine.py, and > > they already call logging.basicConfig() to se

Re: [Qemu-devel] [PATCH v2 12/24] ppc: move '-cpu foo, compat=xxx' parsing into ppc_cpu_parse_featurestr()

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 09:50:59PM +0200, Igor Mammedov wrote: > there is a dedicated callback CPUClass::parse_features > which purpose is to convert -cpu features into a set of > global properties AND deal with compat/legacy features > that couldn't be directly translated into CPU's properties. >

Re: [Qemu-devel] [PATCH 07/42] tpm: move TPMSizedBuffer to tpm_tis.h

2017-10-09 Thread Stefan Berger
On 10/09/2017 06:55 PM, Marc-André Lureau wrote: Close to where it's being used. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- hw/tpm/tpm_tis.h | 5 + include/sysemu/tpm_backend.h | 5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --gi

Re: [Qemu-devel] [PATCH 06/42] tpm: remove tpm_register_driver()

2017-10-09 Thread Stefan Berger
On 10/09/2017 06:55 PM, Marc-André Lureau wrote: No more users of be_drivers[], drop that too. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- include/sysemu/tpm_backend.h | 1 - hw/tpm/tpm_emulator.c| 1 - hw/tpm/tpm_passthrough.c | 1 - tpm.c

Re: [Qemu-devel] [PATCH v2 00/24] generalize parsing of cpu_model (part 3/PPC)

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 09:50:47PM +0200, Igor Mammedov wrote: Applied to ppc-for-2.11. There was a small error in 19/24, which reverted pnv to defaulting to POWER9 v1.0 whereas I've recently changed it to v2.0. Rather than requiring a respin I adjusted that myself, and fixed the minor conflicts

Re: [Qemu-devel] [PATCH v2 1/3] qdev: store DeviceState's canonical path to use when unparenting

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 12:06:05PM -0500, Michael Roth wrote: > device_unparent(dev, ...) is called when a device is unparented, > either directly, or as a result of a parent device being > finalized, and handles some final cleanup for the device. Part > of this includes emiting a DEVICE_DELETED QM

Re: [Qemu-devel] [PATCH v2 3/3] qdev: defer DEVICE_DEL event until instance_finalize()

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 12:06:07PM -0500, Michael Roth wrote: > DEVICE_DEL is currently emitted when a Device is unparented, as > opposed to when it is finalized. The main design motivation for this > seems to be that after unparent()/unrealize(), the Device is no > longer visible to the guest, and

Re: [Qemu-devel] [PATCH v2 18/24] ppc: spapr: use generic cpu_model parsing

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 09:51:05PM +0200, Igor Mammedov wrote: > use generic cpu_model parsing introduced by > (6063d4c0f vl.c: convert cpu_model to cpu type and set of global properties > before machine_init()) > > it allows to: > * replace sPAPRMachineClass::tcg_default_cpu with > Machin

Re: [Qemu-devel] [PATCH v2 1/1] hw/ppc/spapr.c: abort unplug_request if previous unplug isn't done

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 06:11:36PM -0300, Daniel Henrique Barboza wrote: > LMB removal is completed only when the spapr_lmb_release callback > is called after all DRCs of the dimm are detached. During this > time, it is possible that a unplug request for the same dimm > arrives, trying to detach D

Re: [Qemu-devel] [PATCH v2 13/24] ppc: spapr: define core types statically

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 09:51:00PM +0200, Igor Mammedov wrote: > spapr core type definition doesn't have any fields that > require it to be defined at runtime. So replace code > that fills in TypeInfo at runtime with static TypeInfo > array that does the same at complie time. > > Signed-off-by: Ig

Re: [Qemu-devel] [PATCH v2 2/3] Revert "qdev: Free QemuOpts when the QOM path goes away"

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 12:06:06PM -0500, Michael Roth wrote: > This reverts commit abed886ec60cf239a03515cf0b30fb11fa964c44. > > This patch originally addressed an issue where a DEVICE_DELETED > event could be emitted (in device_unparent()) before a Device's > QemuOpts were cleaned up (in device_

[Qemu-devel] [PULL v2 6/8] qom: update doc comment for type_register[_static]()

2017-10-09 Thread Eduardo Habkost
From: Igor Mammedov type_register()/type_register_static() functions in current impl. can't fail returning 0, also none of the users check for error so update doc comment to reflect current behaviour. Suggested-by: Eduardo Habkost Signed-off-by: Igor Mammedov Message-Id: <1507111682-66171-2-gi

Re: [Qemu-devel] [PATCH 05/42] tpm: replace tpm_get_backend_driver() to drop be_drivers

2017-10-09 Thread Stefan Berger
On 10/09/2017 06:55 PM, Marc-André Lureau wrote: Use tpm_driver_find_by_type() instead. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- tpm.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tpm.c b/tpm.c index 04de8da5fd..ad2ed6a0da 10064

Re: [Qemu-devel] [PATCH v2 17/24] ppc: move ppc_cpu_lookup_alias() before its first user

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 09:51:04PM +0200, Igor Mammedov wrote: > next commit will drop ppc_cpu_lookup_alias() declaration from header > and make it static which will break its last user ppc_cpu_class_by_name() > since ppc_cpu_class_by_name() defined before ppc_cpu_lookup_alias(). > > To avoid this

[Qemu-devel] [PULL v2 7/8] vl: exit if maxcpus is negative

2017-10-09 Thread Eduardo Habkost
From: Seeteena Thoufeek Signed-off-by: Eduardo Habkost ---Steps to Reproduce--- When passed a negative number to 'maxcpus' parameter, Qemu aborts with a core dump. Run the following command with maxcpus argument as negative number ppc64-softmmu/qemu-system-ppc64 --nographic -vga none -machin

[Qemu-devel] [PULL v2 4/8] qemu-options: Deprecate -nodefconfig

2017-10-09 Thread Eduardo Habkost
Since 2012 (commit ba6212d8 "Eliminate cpus-x86_64.conf file") we have no default config files that would be disabled using -nodefconfig. Update documentation and document -nodefconfig as deprecated. Cc: Markus Armbruster Acked-by: Alistair Francis Signed-off-by: Eduardo Habkost Message-Id: <2

Re: [Qemu-devel] [PATCH v2 19/24] ppc: pnv: use generic cpu_model parsing

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 09:51:06PM +0200, Igor Mammedov wrote: > use common cpu_model prasing in vl.c and set default cpu_model > using generic MachineClass::default_cpu_type. > > Beside of switching to generic infrastructure it solves several > issues. > > * ppc_cpu_class_by_name() is used to d

[Qemu-devel] [PULL v2 2/8] machine: Add a valid_cpu_types property

2017-10-09 Thread Eduardo Habkost
From: Alistair Francis This patch add a MachineClass element that can be set in the machine C code to specify a list of supported CPU types. If the supported CPU types are specified the user enter CPU (by -cpu at runtime) is checked against the supported types and QEMU exits if they aren't suppor

[Qemu-devel] [PULL v2 5/8] config: qemu_config_parse() return number of config groups

2017-10-09 Thread Eduardo Habkost
Change qemu_config_parse() to return the number of config groups in success and -EINVAL on error. This will allow callers of qemu_config_parse() to check if something was really loaded from the config file. All existing callers of qemu_config_parse() and qemu_read_config_file() only check if the r

[Qemu-devel] [PULL v2 0/8] x86 and machine queue, 2017-10-09

2017-10-09 Thread Eduardo Habkost
Changes on v2: * Removed NUMA/ACPI patches until we figure out what's breaking the tests. (See: https://www.mail-archive.com/qemu-devel@nongnu.org/msg486368.html) Note that I didn't reproduce the failure yet. I am just removing those patches because they are the only ones touching ACPI c

[Qemu-devel] [PULL v2 3/8] vl: Eliminate defconfig variable

2017-10-09 Thread Eduardo Habkost
Both -nodefconfig and -no-user-config options do the same thing today, we only need one variable to keep track of them. Suggested-by: Markus Armbruster Acked-by: Alistair Francis Reviewed-by: Markus Armbruster Signed-off-by: Eduardo Habkost Message-Id: <20171004030025.7866-2-ehabk...@redhat.co

[Qemu-devel] [PULL v2 8/8] x86: Correct translation of some rdgsbase and wrgsbase encodings

2017-10-09 Thread Eduardo Habkost
From: Todd Eisenberger It looks like there was a transcription error when writing this code initially. The code previously only decoded src or dst of rax. This resolves https://bugs.launchpad.net/qemu/+bug/1719984. Signed-off-by: Todd Eisenberger Message-Id: Reviewed-by: Richard Henderson S

[Qemu-devel] [PULL v2 1/8] qom/cpu: move cpu_model null check to cpu_class_by_name()

2017-10-09 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé and clean every implementation. Suggested-by: Eduardo Habkost Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20170917232842.14544-1-f4...@amsat.org> Reviewed-by: Igor Mammedov Reviewed-by: Laurent Vivier Reviewed-by: Artyom Tarasenko Signed-off-by: Eduardo H

Re: [Qemu-devel] [PATCH 04/42] tpm: lookup tpm backend class in tpm_driver_find_by_type()

2017-10-09 Thread Stefan Berger
On 10/09/2017 06:55 PM, Marc-André Lureau wrote: One step towards removing TPMDriverOps and driver registration. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- tpm.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tpm.

Re: [Qemu-devel] [PATCH 02/42] tpm-tis: remove RAISE_STS_IRQ

2017-10-09 Thread Stefan Berger
On 10/09/2017 06:55 PM, Marc-André Lureau wrote: This look like temporary hacking code. It shouldn't be necessary in release code, or there should be a runtime option for it. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- hw/tpm/tpm_tis.c | 24 +---

Re: [Qemu-devel] [PATCH 03/42] tpm: make tpm_get_backend_driver() static

2017-10-09 Thread Stefan Berger
On 10/09/2017 06:55 PM, Marc-André Lureau wrote: No need to export the function. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- include/sysemu/tpm_backend.h | 1 - tpm.c| 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/inclu

Re: [Qemu-devel] [PATCH v6 2/4] hw/acpi-build: Make assignment statement of next_base easy to read

2017-10-09 Thread Dou Liyang
Hi Eduardo, At 10/10/2017 10:29 AM, Eduardo Habkost wrote: On Fri, Sep 01, 2017 at 10:10:03AM +0800, Dou Liyang wrote: It may be hard to read the assignment statement of "next_base", so S/next_base += (1ULL << 32) - pcms->below_4g_mem_size; /next_base = mem_base + mem_len; ... for readabilit

Re: [Qemu-devel] [PATCH 01/42] tpm-tis: remove unused hw_access argument

2017-10-09 Thread Stefan Berger
On 10/09/2017 06:55 PM, Marc-André Lureau wrote: This argument is always false, simplify the code. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- hw/tpm/tpm_tis.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/hw/tpm/tpm_tis.c b/hw/

Re: [Qemu-devel] [PATCH 00/42] TPM: code cleanup & CRB device

2017-10-09 Thread Stefan Berger
On 10/09/2017 06:55 PM, Marc-André Lureau wrote: Hi, I accumulated a series of patch doing some TPM code cleanup while doing review. I removed some dead code, simplified other parts, and tried to isolate implementation of the backend and frontend by using a new TPMIf interface. I solved a few is

Re: [Qemu-devel] [PATCH v6 2/4] hw/acpi-build: Make assignment statement of next_base easy to read

2017-10-09 Thread Eduardo Habkost
On Fri, Sep 01, 2017 at 10:10:03AM +0800, Dou Liyang wrote: > It may be hard to read the assignment statement of "next_base", so > > S/next_base += (1ULL << 32) - pcms->below_4g_mem_size; > /next_base = mem_base + mem_len; > > ... for readability. > > No functionality change. > > Signed-off-by

[Qemu-devel] [PULL v2 09/10] tpm: Move tpm_cleanup() to right place

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri As Emulator TPM backend uses chardev, tpm cleanup should happen before chardev similar to other vhost-users. Signed-off-by: Amarnath Valluri Reviewed-by: Stefan Berger Signed-off-by: Stefan Berger --- tpm.c | 1 - vl.c | 1 + 2 files changed, 1 insertion(+), 1 deletio

[Qemu-devel] [PULL v2 04/10] tpm-backend: Made few interface methods optional

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri This allows backend implementations left optional interface methods. For mandatory methods assertion checks added. Took the opportunity to remove unused methods: - tpm_backend_get_desc() - TPMDriverOps->handle_startup_error Signed-off-by: Amarnath Valluri Reviewed-by:

[Qemu-devel] [PULL v2 08/10] tpm: Added support for TPM emulator

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri This change introduces a new TPM backend driver that can communicate with swtpm(software TPM emulator) using unix domain socket interface. QEMU talks to the TPM emulator using QEMU's socket-based chardev backend device. Swtpm uses two Unix sockets for communications, one f

[Qemu-devel] [PULL v2 03/10] tpm-backend: Initialize and free data members in it's own methods

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri Initialize and free TPMBackend data members in it's own instance_init() and instance_finalize methods. Took the opportunity to remove unneeded destroy() method from TpmDriverOps interface as TPMBackend is a Qemu Object, we can use object_unref() inplace of tpm_backend_dest

[Qemu-devel] [PULL v2 07/10] tpm-passthrough: move reusable code to utils

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri Signed-off-by: Amarnath Valluri Reviewed-by: Stefan Berger Reviewed-by: Marc-André Lureau Signed-off-by: Stefan Berger --- hw/tpm/tpm_passthrough.c | 64 hw/tpm/tpm_util.c| 25 +++ hw/tpm/tpm_util

[Qemu-devel] [PULL v2 06/10] tpm-backend: Move realloc_buffer() implementation to tpm-tis model

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri buffer reallocation is very unlikely to be backend specific. Hence move inside the tis. Signed-off-by: Amarnath Valluri Reviewed-by: Stefan Berger Reviewed-by: Marc-André Lureau Signed-off-by: Stefan Berger --- backends/tpm.c | 9 - hw/tpm/tpm_p

[Qemu-devel] [PULL v2 10/10] specs: Describe the TPM support in QEMU

2017-10-09 Thread Stefan Berger
This patch adds a description of the current TPM support in QEMU to the specs. Several public specs are referenced via their landing page on the trustedcomputinggroup.org website. Signed-off-by: Stefan Berger Reviewed-by: Laszlo Ersek --- docs/specs/tpm.txt | 123 ++

[Qemu-devel] [PULL v2 05/10] tpm-backend: Add new API to read backend TpmInfo

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri TPM configuration options are backend implementation details and shall not be part of base TPMBackend object, and these shall not be accessed directly outside of the class, hence added a new interface method, get_tpm_options() to TPMDriverOps., which shall be implemented by

[Qemu-devel] [PULL v2 01/10] tpm-backend: Remove unneeded member variable from backend class

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri TPMDriverOps inside TPMBackend is not required, as it is supposed to be a class member. The only possible reason for keeping in TPMBackend was, to get the backend type in tpm.c where dedicated backend api, tpm_backend_get_type() is present. Signed-off-by: Amarnath Valluri

[Qemu-devel] [PULL v2 02/10] tpm-backend: Move thread handling inside TPMBackend

2017-10-09 Thread Stefan Berger
From: Amarnath Valluri Move thread handling inside TPMBackend, this way backend implementations need not to maintain their own thread life cycle, instead they needs to implement 'handle_request()' class method that always been called from a thread. This change made tpm_backend_int.h kind of usel

[Qemu-devel] [PULL v2 00/10] Merge tpm 2017/10/04

2017-10-09 Thread Stefan Berger
The following changes since commit d147f7e815f97cb477e223586bcb80c316ae10ea: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-10-03 16:27:24 +0100) are available in the git repository at: git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-10-04-

Re: [Qemu-devel] [PULL 00/23] Queued TCG patches

2017-10-09 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20171010005600.28735-1-richard.hender...@linaro.org Subject: [Qemu-devel] [PULL 00/23] Queued TCG patches === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(git log

Re: [Qemu-devel] [PATCH v4 11/43] tcg: define CF_PARALLEL and use it for TB hashing along with CF_COUNT_MASK

2017-10-09 Thread Richard Henderson
On 10/09/2017 12:24 PM, Emilio G. Cota wrote: > On Thu, Oct 05, 2017 at 19:24:16 -0400, Emilio G. Cota wrote: >> I'm including the fixups below. > > Just pushed v5 of this series. I rebased the series on top of the current > master, > and added the already mentioned fixes plus a new one (see belo

Re: [Qemu-devel] [PATCH 00/42] TPM: code cleanup & CRB device

2017-10-09 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. Type: series Message-id: 20171009225623.29232-1-marcandre.lur...@redhat.com Subject: [Qemu-devel] [PATCH 00/42] TPM: code clea

[Qemu-devel] [PULL 23/23] tcg/mips: delete commented out extern keyword.

2017-10-09 Thread Richard Henderson
From: Jiang Biao Delete commented out extern keyword on link_error(). Signed-off-by: Jiang Biao Message-Id: <1506762042-32145-1-git-send-email-jiang.bi...@zte.com.cn> Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[Qemu-devel] [PULL 20/23] osdep: introduce qemu_mprotect_rwx/none

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- include/qemu/osdep.h | 2 ++ util/osdep.c | 41 + 2 files changed, 43 insertions(+) diff --git a/include/qemu/osdep.h b/in

[Qemu-devel] [PULL 22/23] tcg: define TCG_HIGHWATER

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Will come in handy very soon. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/tcg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index ee6079

[Qemu-devel] [PULL 16/23] tci: move tci_regs to tcg_qemu_tb_exec's stack

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Groundwork for supporting multiple TCG contexts. Compile-tested for all targets on an x86_64 host. Suggested-by: Richard Henderson Acked-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/tci.c | 552 +

[Qemu-devel] [PULL 15/23] exec-all: extract tb->tc_* into a separate struct tc_tb

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" In preparation for adding tc.size to be able to keep track of TB's using the binary search tree implementation from glib. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 12 ++-- acce

[Qemu-devel] [PULL 19/23] util: move qemu_real_host_page_size/mask to osdep.h

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" These only depend on the host and therefore belong in the common osdep, not in a target-dependent object. While at it, query the host during an init constructor, which guarantees the page size will be well-defined throughout the execution of the program. Suggested-by: Ric

[Qemu-devel] [PULL 14/23] translate-all: define and use DEBUG_TB_CHECK_GATE

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" This prevents bit rot by ensuring the debug code is compiled when building a user-mode target. Unfortunately the helpers are user-mode-only so we cannot fully get rid of the ifdef checks. Add a comment to explain this. Suggested-by: Alex Bennée Reviewed-by: Richard Hende

[Qemu-devel] [PULL 13/23] translate-all: define and use DEBUG_TB_INVALIDATE_GATE

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" This gets rid of an ifdef check while ensuring that the debug code is compiled, which prevents bit rot. Suggested-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 12 +

[Qemu-devel] [PULL 12/23] exec-all: introduce TB_PAGE_ADDR_FMT

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" And fix the following warning when DEBUG_TB_INVALIDATE is enabled in translate-all.c: CC mipsn32-linux-user/accel/tcg/translate-all.o /data/src/qemu/accel/tcg/translate-all.c: In function ‘tb_alloc_page’: /data/src/qemu/accel/tcg/translate-all.c:1201:16: error: form

[Qemu-devel] [PULL 18/23] tcg: allocate optimizer temps with tcg_malloc

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Groundwork for supporting multiple TCG contexts. While at it, also allocate temps_used directly as a bitmap of the required size, instead of using a bitmap of TCG_MAX_TEMPS via TCGTempSet. Performance-wise we lose about 1.12% in a translation-heavy workload such as bootin

[Qemu-devel] [PULL 08/23] tcg: remove addr argument from lookup_tb_ptr

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" It is unlikely that we will ever want to call this helper passing an argument other than the current PC. So just remove the argument, and use the pc we already get from cpu_get_tb_cpu_state. This change paves the way to having a common "tb_lookup" function. Reviewed-by: R

[Qemu-devel] [PULL 10/23] exec-all: bring tb->invalid into tb->cflags

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" This gets rid of a hole in struct TranslationBlock. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 3 +-- include/exec/tb-lookup.h | 2 +- accel/tcg/cpu-exec.c | 4 ++-- accel/tcg/tran

[Qemu-devel] [PULL 07/23] tcg/mips: constify tcg_target_callee_save_regs

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/mips/tcg-ta

[Qemu-devel] [PULL 09/23] tcg: consolidate TB lookups in tb_lookup__cpu_state

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" This avoids duplicating code. cpu_exec_step will also use the new common function once we integrate parallel_cpus into tb->cflags. Note that in this commit we also fix a race, described by Richard Henderson during review. Think of this scenario with threads A and B: (A

[Qemu-devel] [PULL 21/23] translate-all: use qemu_protect_rwx/none helpers

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" The helpers require the address and size to be page-aligned, so do that before calling them. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 61 ++-

[Qemu-devel] [PULL 06/23] tcg/i386: constify tcg_target_callee_save_regs

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/i386/tcg-ta

[Qemu-devel] [PULL 02/23] tcg: fix corruption of code_time profiling counter upon tb_flush

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Whenever there is an overflow in code_gen_buffer (e.g. we run out of space in it and have to flush it), the code_time profiling counter ends up with an invalid value (that is, code_time -= profile_getclock(), without later on getting += profile_getclock() due to the goto).

[Qemu-devel] [PULL 17/23] tcg: take .helpers out of TCGContext

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Groundwork for supporting multiple TCG contexts. The hash table becomes read-only after it is filled in, so we can save space by keeping just a global pointer to it. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Ri

[Qemu-devel] [PULL 05/23] cpu-exec: rename have_tb_lock to acquired_tb_lock in tb_find

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Reusing the have_tb_lock name, which is also defined in translate-all.c, makes code reviewing unnecessarily harder. Avoid potential confusion by renaming the local have_tb_lock variable to something else. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Sign

[Qemu-devel] [PULL 04/23] translate-all: make have_tb_lock static

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" It is only used by this object, and it's not exported to any other. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

[Qemu-devel] [PULL 03/23] exec-all: fix typos in TranslationBlock's documentation

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 673fc066d0..a9a8bb6f

[Qemu-devel] [PULL 01/23] cputlb: bring back tlb_flush_count under !TLB_DEBUG

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" Commit f0aff0f124 ("cputlb: add assert_cpu_is_self checks") buried the increment of tlb_flush_count under TLB_DEBUG. This results in "info jit" always (mis)reporting 0 TLB flushes when !TLB_DEBUG. Besides, under MTTCG tlb_flush_count is updated by several threads, so in or

[Qemu-devel] [PULL 11/23] translate-all: define and use DEBUG_TB_FLUSH_GATE

2017-10-09 Thread Richard Henderson
From: "Emilio G. Cota" This gets rid of some ifdef checks while ensuring that the debug code is compiled, which prevents bit rot. Suggested-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 20 ++

[Qemu-devel] [PULL 00/23] Queued TCG patches

2017-10-09 Thread Richard Henderson
:02 +0100) are available in the git repository at: git://github.com/rth7680/qemu.git tags/pull-tcg-20171009 for you to fetch changes up to 5de8a6a471ba6b86c6b4fb681e5a3c594ed5a684: tcg/mips: delete commented out extern keyword. (2017-10-09

Re: [Qemu-devel] [PATCH v3 0/8] Add the ZynqMP PMU and IPI

2017-10-09 Thread Alistair Francis
On Sun, Oct 8, 2017 at 3:20 PM, Edgar E. Iglesias wrote: > On Wed, Sep 20, 2017 at 03:01:31PM -0700, Alistair Francis wrote: >> >> This series adds the ZynqMP Power Management Unit (PMU) machine with basic >> functionality. >> >> The machine only has the >> - CPU >> - Memory >> - Interrupt cont

Re: [Qemu-devel] [PATCH 44/88] hw/core/loader: use g_new() family of functions

2017-10-09 Thread Alistair Francis
On Fri, Oct 6, 2017 at 4:49 PM, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Thanks, Alistair > --- > hw/core/loader.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/core/loader.c b/hw/core/loader.c > i

Re: [Qemu-devel] [PATCH 5/5] backup: use copy_bitmap in incremental backup

2017-10-09 Thread John Snow
On 10/02/2017 10:39 AM, Vladimir Sementsov-Ogievskiy wrote: > We can use copy_bitmap instead of sync_bitmap. copy_bitmap is > initialized from sync_bitmap and it is more informative: we will not try > to process data, that is already in progress (by write notifier). > > Signed-off-by: Vladimir S

Re: [Qemu-devel] [PATCH 4/5] backup: simplify non-dirty bits progress processing

2017-10-09 Thread John Snow
On 10/02/2017 10:39 AM, Vladimir Sementsov-Ogievskiy wrote: > Set fake progress for non-dirty clusters in copy_bitmap initialization, > to. It simplifies code and allows further refactoring. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > > Motivation (some of these paragraphs may be n

Re: [Qemu-devel] [Qemu-block] [PATCH 3/3] iotests: Add cluster_size=64k to 125

2017-10-09 Thread Jeff Cody
On Mon, Oct 09, 2017 at 11:55:33PM +0200, Max Reitz wrote: > Apparently it would be a good idea to test that, too. > > Signed-off-by: Max Reitz Reviewed-by: Jeff Cody > --- > tests/qemu-iotests/125 | 7 +- > tests/qemu-iotests/125.out | 480 > ---

Re: [Qemu-devel] [Qemu-block] [PATCH 2/3] qcow2: Always execute preallocate() in a coroutine

2017-10-09 Thread Jeff Cody
On Mon, Oct 09, 2017 at 11:55:32PM +0200, Max Reitz wrote: > Some qcow2 functions (at least perform_cow()) expect s->lock to be > taken. Therefore, if we want to make use of them, we should execute > preallocate() (as "preallocate_co") in a coroutine so that we can use > the qemu_co_mutex_* functi

Re: [Qemu-devel] [Qemu-block] [PATCH 1/3] qcow2: Fix unaligned preallocated truncation

2017-10-09 Thread Jeff Cody
On Mon, Oct 09, 2017 at 11:55:31PM +0200, Max Reitz wrote: > A qcow2 image file's length is not required to have a length that is a > multiple of the cluster size. However, qcow2_refcount_area() expects an > aligned value for its @start_offset parameter, so we need to round > @old_file_size up to

[Qemu-devel] [PATCH 42/42] WIP: add TPM CRB device

2017-10-09 Thread Marc-André Lureau
tpm_crb is a device for TPM 2.0 Command Response Buffer (CRB) Interface as defined in TCG PC Client Platform TPM Profile (PTP) Specification Family “2.0” Level 00 Revision 01.03 v22. The PTP allows device implementation to switch between TIS and CRB model at run time, but given that CRB is a simpl

[Qemu-devel] [PATCH 39/42] tpm: add tpm_cmd_get_size() to tpm_util

2017-10-09 Thread Marc-André Lureau
The function is generally useful and used in the following patches. Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_util.h | 8 +++- hw/tpm/tpm_tis.c | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/tpm/tpm_util.h b/hw/tpm/tpm_util.h index 2f7c96146d..aca10c97bf 10

[Qemu-devel] [PATCH 40/42] acpi: change TPM TIS data conditions

2017-10-09 Thread Marc-André Lureau
The device should be exposed if present. It shouldn't have an undefined version (or else backend init failed, and device should fail too). Finally, make the fields specific to TIS device model. Signed-off-by: Marc-André Lureau --- include/sysemu/tpm.h | 3 +++ hw/i386/acpi-build.c | 12

[Qemu-devel] [PATCH 32/42] tpm-passthrough: make it safer to destroy after creation

2017-10-09 Thread Marc-André Lureau
Check fds values before closing, to avoid close(-1). Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_passthrough.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index 7371d50739..aa9167e3c6 100644 --- a/hw/tpm/tpm_

[Qemu-devel] [PATCH 36/42] tpm: rename qemu_find_tpm() -> qemu_find_tpm_be()

2017-10-09 Thread Marc-André Lureau
find_tpm() will be introduced to lookup the TPM device. Signed-off-by: Marc-André Lureau --- include/sysemu/tpm_backend.h | 2 +- hw/tpm/tpm_tis.c | 2 +- tpm.c| 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sysemu/tpm_backend.h

[Qemu-devel] [PATCH 38/42] tpm: add TPM interface to lookup TPM version

2017-10-09 Thread Marc-André Lureau
Do not hardcode TPM device model to lookup version, use an interface instead. Signed-off-by: Marc-André Lureau --- include/sysemu/tpm.h | 5 ++--- hw/tpm/tpm_tis.c | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index dbd2

[Qemu-devel] [PATCH 31/42] tpm-backend: move set 'id' to common code

2017-10-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- include/sysemu/tpm_backend.h | 2 +- hw/tpm/tpm_emulator.c| 12 +++- hw/tpm/tpm_passthrough.c | 9 +++-- tpm.c| 3 ++- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/include/sysemu/tpm_backend

[Qemu-devel] [PATCH 30/42] tpm-passthrough: pass TPMPassthruState to handle_device_opts

2017-10-09 Thread Marc-André Lureau
It doesn't need TPMBackend. Also reorder arguments for consistency. Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_passthrough.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index 048edb1a1a..9326cbfdc9 100644 ---

[Qemu-devel] [PATCH 37/42] tpm: lookup the the TPM interface instead of TIS device

2017-10-09 Thread Marc-André Lureau
This will allow to introduce new devices implementing TPM. Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_int.h | 19 --- include/sysemu/tpm.h | 52 ++-- hw/i386/acpi-build.c | 2 +- 3 files changed, 39 insertions(+), 34 delet

[Qemu-devel] [PATCH 41/42] tpm-emulator: add a FIXME comment about blocking cancel

2017-10-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_emulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c index 315819329b..091d7ea147 100644 --- a/hw/tpm/tpm_emulator.c +++ b/hw/tpm/tpm_emulator.c @@ -328,6 +328,7 @@ static void tpm_emulator_can

[Qemu-devel] [PATCH 25/42] tpm-be: report error instead of front-end

2017-10-09 Thread Marc-André Lureau
Backend can give more accurate error description, and lift out the job from the frontend. Signed-off-by: Marc-André Lureau --- include/sysemu/tpm_backend.h | 3 ++- backends/tpm.c | 3 ++- hw/tpm/tpm_tis.c | 4 +--- 3 files changed, 5 insertions(+), 5 deletions(-) diff

[Qemu-devel] [PATCH 29/42] tpm-be: update optional function pointers

2017-10-09 Thread Marc-André Lureau
QEMU code doesn't generally have assert() for mandatory callbacks/function pointers, probably because the crash is pretty obvious. Document the methods instead of going into the code. Make get_tpm_options() mandatory to implement (since all backend implementation have it). Signed-off-by: Marc-And

[Qemu-devel] [PATCH 34/42] tpm-passthrough: workaround a possible race

2017-10-09 Thread Marc-André Lureau
The TPM backend processing thread has common shared variable race issues. (they should not be so easy to reach since guest interaction with the device is slow compared to host emulation) An obvious one is setting op_cancelled from device thread after calling write(cancel_fd). The backend thread ma

[Qemu-devel] [PATCH 33/42] tpm-passthrough: remove error cleanup from handle_device_opts

2017-10-09 Thread Marc-André Lureau
Clean-up is handled by the create() function. Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_passthrough.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index aa9167e3c6..0806cf86af 100644 --- a/hw/tpm/tp

[Qemu-devel] [PATCH 28/42] tpm-passthrough: don't save guessed cancel_path in options

2017-10-09 Thread Marc-André Lureau
The value is later unneeded, and may leak if the free visitor doesn't consider it since has_cancel_path is false. And for consistency with "path" it shouldn't be returned in get_tpm_options(). Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_passthrough.c | 4 +--- 1 file changed, 1 insertion(+),

[Qemu-devel] [PATCH 24/42] tpm-be: call request_completed() out of thread

2017-10-09 Thread Marc-André Lureau
Lift from the backend implementation the responsability to call the request_completed() callback outside of thread context. This also simplify frontend/interface work, as they no longer need to care whether the callback is called from a different thread. Signed-off-by: Marc-André Lureau --- hw/t

[Qemu-devel] [PATCH 35/42] tpm-tis: simplify header inclusion

2017-10-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_tis.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 3c8d246ac8..e7e8b112e8 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -24,17 +24,12 @@ #include "qemu/osdep

[Qemu-devel] [PATCH 21/42] tpm: move recv_data_callback to TPM interface

2017-10-09 Thread Marc-André Lureau
Simplify the TPM backend setup, move callback to TPM interface. Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_int.h | 3 +++ include/sysemu/tpm_backend.h | 6 +- backends/tpm.c | 4 +--- hw/tpm/tpm_emulator.c| 3 ++- hw/tpm/tpm_passthrough.c | 3 +

[Qemu-devel] [PATCH 27/42] tpm: remove unused opened code

2017-10-09 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- include/sysemu/tpm_backend.h | 12 backends/tpm.c | 42 -- tpm.c| 6 -- 3 files changed, 60 deletions(-) diff --git a/include/sysemu/tpm_backend.h b/include/sysemu

[Qemu-devel] [PATCH 26/42] tpm-be: ask model to the TPM interface

2017-10-09 Thread Marc-André Lureau
No need to store the mode in the backend, or to let the frontend set it itself. Signed-off-by: Marc-André Lureau --- hw/tpm/tpm_int.h | 1 + include/sysemu/tpm_backend.h | 1 - backends/tpm.c | 4 ++-- hw/tpm/tpm_tis.c | 3 +-- tpm.c|

  1   2   3   4   >