Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier

2020-06-28 Thread Jason Wang
On 2020/6/27 上午5:29, Peter Xu wrote: Hi, Eugenio, (CCing Eric, Yan and Michael too) On Fri, Jun 26, 2020 at 08:41:22AM +0200, Eugenio Pérez wrote: diff --git a/memory.c b/memory.c index 2f15a4b250..7f789710d2 100644 --- a/memory.c +++ b/memory.c @@ -1915,8 +1915,6 @@ void memory_region_notif

Re: [PATCH v1 00/10] vDPA support in qemu

2020-06-28 Thread Jason Wang
On 2020/6/22 下午11:37, Cindy Lu wrote: vDPA device is a device that uses a datapath which complies with the virtio specifications with vendor specific control path. vDPA devices can be both physically located on the hardware or emulated by software. This RFC introduce the vDPA support in qemu TO

Re: [PATCH v1 00/10] vDPA support in qemu

2020-06-28 Thread Cindy Lu
On Sun, Jun 28, 2020 at 3:07 PM Jason Wang wrote: > > > On 2020/6/22 下午11:37, Cindy Lu wrote: > > vDPA device is a device that uses a datapath which complies with the > > virtio specifications with vendor specific control path. vDPA devices > > can be both physically located on the hardware or emu

Crash when running Qemu.

2020-06-28 Thread Jean-Christophe DUBOIS
Hi, Since the last pull I did this week end on the qemu git tree (master branch) I am unable to "start" qemu anymore (It was working OK from git master previously). Traces are provided bellow. Am I the only one to get this behavior? JC jcd@jcd-UX305CA:~/Projects/µCOS/work$ ../../qemu/qemu

[PATCH v9 06/34] qcow2: Add get_l2_entry() and set_l2_entry()

2020-06-28 Thread Alberto Garcia
The size of an L2 entry is 64 bits, but if we want to have subclusters we need extended L2 entries. This means that we have to access L2 tables and slices differently depending on whether an image has extended L2 entries or not. This patch replaces all l2_slice[] accesses with calls to get_l2_entr

[PATCH v9 03/34] qcow2: Add calculate_l2_meta()

2020-06-28 Thread Alberto Garcia
handle_alloc() creates a QCowL2Meta structure in order to update the image metadata and perform the necessary copy-on-write operations. This patch moves that code to a separate function so it can be used from other places. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cl

[PATCH v9 10/34] qcow2: Add offset_to_sc_index()

2020-06-28 Thread Alberto Garcia
For a given offset, return the subcluster number within its cluster (i.e. with 32 subclusters per cluster it returns a number between 0 and 31). Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h | 5 + 1 file changed, 5 inserti

[PATCH v9 05/34] qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied()

2020-06-28 Thread Alberto Garcia
When writing to a qcow2 file there are two functions that take a virtual offset and return a host offset, possibly allocating new clusters if necessary: - handle_copied() looks for normal data clusters that are already allocated and have a reference count of 1. In those clusters we ca

[PATCH v9 07/34] qcow2: Document the Extended L2 Entries feature

2020-06-28 Thread Alberto Garcia
Subcluster allocation in qcow2 is implemented by extending the existing L2 table entries and adding additional information to indicate the allocation status of each subcluster. This patch documents the changes to the qcow2 format and how they affect the calculation of the L2 cache size. Signed-of

[PATCH v9 26/34] qcow2: Clear the L2 bitmap when allocating a compressed cluster

2020-06-28 Thread Alberto Garcia
Compressed clusters always have the bitmap part of the extended L2 entry set to 0. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 2276cee6d6..deff838fe8 100

[PATCH v9 13/34] qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap()

2020-06-28 Thread Alberto Garcia
Extended L2 entries are 128-bit wide: 64 bits for the entry itself and 64 bits for the subcluster allocation bitmap. In order to support them correctly get/set_l2_entry() need to be updated so they take the entry width into account in order to calculate the correct offset. This patch also adds th

[PATCH v9 11/34] qcow2: Add offset_into_subcluster() and size_to_subclusters()

2020-06-28 Thread Alberto Garcia
Like offset_into_cluster() and size_to_clusters(), but for subclusters. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- block/qcow2.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/qcow2.h b/block/qcow2.h index 2503374677..4fe31adfd3 100644 --- a/block/qcow2.h +

[PATCH v9 02/34] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-06-28 Thread Alberto Garcia
qcow2_get_cluster_offset() takes an (unaligned) guest offset and returns the (aligned) offset of the corresponding cluster in the qcow2 image. In practice none of the callers need to know where the cluster starts so this patch makes the function calculate and return the final host offset directly.

[PATCH v9 08/34] qcow2: Add dummy has_subclusters() function

2020-06-28 Thread Alberto Garcia
This function will be used by the qcow2 code to check if an image has subclusters or not. At the moment this simply returns false. Once all patches needed for subcluster support are ready then QEMU will be able to create and read images with subclusters and this function will return the actual val

[PATCH v9 19/34] qcow2: Handle QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC

2020-06-28 Thread Alberto Garcia
When dealing with subcluster types there is a new value called QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC that has no equivalent in QCow2ClusterType. This patch handles that value in all places where subcluster types are processed. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Vladi

[PATCH v9 27/34] qcow2: Add subcluster support to handle_alloc_space()

2020-06-28 Thread Alberto Garcia
The bdrv_co_pwrite_zeroes() call here fills complete clusters with zeroes, but it can happen that some subclusters are not part of the write request or the copy-on-write. This patch makes sure that only the affected subclusters are overwritten. A potential improvement would be to also fill with ze

[PATCH v9 16/34] qcow2: Add qcow2_cluster_is_allocated()

2020-06-28 Thread Alberto Garcia
This helper function tells us if a cluster is allocated (that is, there is an associated host offset for it). Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- block/qcow2.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/qcow2.h b/block/qcow2.h index 3aec6f452a..ea647c8

[PATCH v9 24/34] qcow2: Add subcluster support to check_refcounts_l2()

2020-06-28 Thread Alberto Garcia
The offset field of an uncompressed cluster's L2 entry must be aligned to the cluster size, otherwise it is invalid. If the cluster has no data then it means that the offset points to a preallocation, so we can clear the offset field without affecting the guest-visible data. This is what 'qemu-img

[PATCH v9 04/34] qcow2: Split cluster_needs_cow() out of count_cow_clusters()

2020-06-28 Thread Alberto Garcia
We are going to need it in other places. Signed-off-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/block/qcow2-cluster.c b/blo

[PATCH v9 17/34] qcow2: Add cluster type parameter to qcow2_get_host_offset()

2020-06-28 Thread Alberto Garcia
This function returns an integer that can be either an error code or a cluster type (a value from the QCow2ClusterType enum). We are going to start using subcluster types instead of cluster types in some functions so it's better to use the exact data types instead of integers for clarity and in or

[PATCH v9 29/34] qcow2: Add subcluster support to qcow2_measure()

2020-06-28 Thread Alberto Garcia
Extended L2 entries are bigger than normal L2 entries so this has an impact on the amount of metadata needed for a qcow2 file. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/block/q

[PATCH v9 01/34] qcow2: Make Qcow2AioTask store the full host offset

2020-06-28 Thread Alberto Garcia
The file_cluster_offset field of Qcow2AioTask stores a cluster-aligned host offset. In practice this is not very useful because all users(*) of this structure need the final host offset into the cluster, which they calculate using host_offset = file_cluster_offset + offset_into_cluster(s, offse

[PATCH v9 00/34] Add subcluster allocation to qcow2

2020-06-28 Thread Alberto Garcia
Hi, here's the new version of the patches to add subcluster allocation support to qcow2. Please refer to the cover letter of the first version for a full description of the patches: https://lists.gnu.org/archive/html/qemu-block/2019-10/msg00983.html The important change from v8 is patch 24.

[PATCH v9 20/34] qcow2: Add subcluster support to calculate_l2_meta()

2020-06-28 Thread Alberto Garcia
If an image has subclusters then there are more copy-on-write scenarios that we need to consider. Let's say we have a write request from the middle of subcluster #3 until the end of the cluster: 1) If we are writing to a newly allocated cluster then we need copy-on-write. The previous contents

[PATCH v9 22/34] qcow2: Add subcluster support to zero_in_l2_slice()

2020-06-28 Thread Alberto Garcia
The QCOW_OFLAG_ZERO bit that indicates that a cluster reads as zeroes is only used in standard L2 entries. Extended L2 entries use individual 'all zeroes' bits for each subcluster. This must be taken into account when updating the L2 entry and also when deciding that an existing entry does not nee

[PATCH v9 25/34] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2()

2020-06-28 Thread Alberto Garcia
The L2 bitmap needs to be updated after each write to indicate what new subclusters are now allocated. This needs to happen even if the cluster was already allocated and the L2 entry was otherwise valid. In some cases however a write operation doesn't need change the L2 bitmap (because all affecte

[PATCH v9 32/34] qcow2: Allow preallocation and backing files if extended_l2 is set

2020-06-28 Thread Alberto Garcia
Traditional qcow2 images don't allow preallocation if a backing file is set. This is because once a cluster is allocated there is no way to tell that its data should be read from the backing file. Extended L2 entries have individual allocation bits for each subcluster, and therefore it is perfectl

[PATCH v9 34/34] iotests: Add tests for qcow2 images with extended L2 entries

2020-06-28 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/qemu-iotests/271 | 901 + tests/qemu-iotests/271.out | 724 + tests/qemu-iotests/group | 1 + 3 files changed, 1626 insertions(+) create mode 100755 tests/qemu-iotests/271 create mode

[PATCH v9 09/34] qcow2: Add subcluster-related fields to BDRVQcow2State

2020-06-28 Thread Alberto Garcia
This patch adds the following new fields to BDRVQcow2State: - subclusters_per_cluster: Number of subclusters in a cluster - subcluster_size: The size of each subcluster, in bytes - subcluster_bits: No. of bits so 1 << subcluster_bits = subcluster_size Images without subclusters are treated as if

[PATCH v9 12/34] qcow2: Add l2_entry_size()

2020-06-28 Thread Alberto Garcia
qcow2 images with subclusters have 128-bit L2 entries. The first 64 bits contain the same information as traditional images and the last 64 bits form a bitmap with the status of each individual subcluster. Because of that we cannot assume that L2 entries are sizeof(uint64_t) anymore. This function

[PATCH v9 23/34] qcow2: Add subcluster support to discard_in_l2_slice()

2020-06-28 Thread Alberto Garcia
Two things need to be taken into account here: 1) With full_discard == true the L2 entry must be cleared completely. This also includes the L2 bitmap if the image has extended L2 entries. 2) With full_discard == false we have to make the discarded cluster read back as zeroes. With normal

[PATCH v9 30/34] qcow2: Add prealloc field to QCowL2Meta

2020-06-28 Thread Alberto Garcia
This field allows us to indicate that the L2 metadata update does not come from a write request with actual data but from a preallocation request. For traditional images this does not make any difference, but for images with extended L2 entries this means that the clusters are allocated normally i

[PATCH v9 21/34] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-06-28 Thread Alberto Garcia
The logic of this function remains pretty much the same, except that it uses count_contiguous_subclusters(), which combines the logic of count_contiguous_clusters() / count_contiguous_clusters_unallocated() and checks individual subclusters. qcow2_cluster_to_subcluster_type() is not necessary as a

[PATCH v9 33/34] qcow2: Assert that expand_zero_clusters_in_l1() does not support subclusters

2020-06-28 Thread Alberto Garcia
This function is only used by qcow2_expand_zero_clusters() to downgrade a qcow2 image to a previous version. This would require transforming all extended L2 entries into normal L2 entries but this is not a simple task and there are no plans to implement this at the moment. Signed-off-by: Alberto G

[PATCH v9 18/34] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*

2020-06-28 Thread Alberto Garcia
In order to support extended L2 entries some functions of the qcow2 driver need to start dealing with subclusters instead of clusters. qcow2_get_host_offset() is modified to return the subcluster type instead of the cluster type, and all callers are updated to replace all values of QCow2ClusterTyp

[PATCH v9 15/34] qcow2: Add qcow2_get_subcluster_range_type()

2020-06-28 Thread Alberto Garcia
There are situations in which we want to know how many contiguous subclusters of the same type there are in a given cluster. This can be done by simply iterating over the subclusters and repeatedly calling qcow2_get_subcluster_type() for each one of them. However once we determined the type of a s

[PATCH v9 14/34] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-06-28 Thread Alberto Garcia
This patch adds QCow2SubclusterType, which is the subcluster-level version of QCow2ClusterType. All QCOW2_SUBCLUSTER_* values have the the same meaning as their QCOW2_CLUSTER_* equivalents (when they exist). See below for details and caveats. In images without extended L2 entries clusters are trea

[PATCH v9 28/34] qcow2: Add subcluster support to qcow2_co_pwrite_zeroes()

2020-06-28 Thread Alberto Garcia
This works now at the subcluster level and pwrite_zeroes_alignment is updated accordingly. qcow2_cluster_zeroize() is turned into qcow2_subcluster_zeroize() with the following changes: - The request can now be subcluster-aligned. - The cluster-aligned body of the request is still zeroized

[PATCH v9 31/34] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2020-06-28 Thread Alberto Garcia
Now that the implementation of subclusters is complete we can finally add the necessary options to create and read images with this feature, which we call "extended L2 entries". Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- qapi/block-core.json | 7 +++ block/qcow2.h

Re: [PATCH v2 1/2] Introduce (x86) CPU model deprecation API

2020-06-28 Thread Robert Hoo
Hi, Ping for comments:) On Thu, 2020-06-11 at 10:47 +0800, Robert Hoo wrote: > Complement versioned CPU model framework with the ability of marking > some > versions deprecated. When that CPU model is chosen, get some warning. > The > warning message is customized, e.g. telling in which future QEMU

[PATCH] ftgmac100: fix dblac write test

2020-06-28 Thread erik-smit
The test of the write of the dblac register was testing the old value instead of the new value. This would accept the write of an invalid value but subsequently refuse any following valid writes. Signed-off-by: erik-smit --- hw/net/ftgmac100.c | 12 ++-- 1 file changed, 6 insertions(+),

Re: [PATCH] ftgmac100: fix dblac write test

2020-06-28 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200628114057.-1-erik.lucas.s...@gmail.com/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGI

Re: [PATCH v5 09/11] macio: Add dummy screamer register area

2020-06-28 Thread BALATON Zoltan
On Fri, 26 Jun 2020, Mark Cave-Ayland wrote: Again I'm wary of adding empty devices here as the main issue around the screamer code (and why it has not been submitted upstream) is that it can cause random hangs for MacOS on startup. Does it regress any MacOS 9 through 10.5 boot tests? FWIW I'v

[RFC PATCH] WIP macio/cuda: Attempt to add i2c support

2020-06-28 Thread BALATON Zoltan
This is a non-working RFC patch attempt to implement i2c bus in CUDA needed for firmware to access SPD data of installed RAM. The skeleton is there but actual operation fails because I don't know how this is supposed to work and the i2c bus state becomes invalid quickly. Also sending back result

Re: Building in Solaris 11.4

2020-06-28 Thread Peter Maydell
On Sat, 27 Jun 2020 at 23:05, Michele Denber wrote: > > Well I removed the "static" from the line > > static int openpty(int *amaster, int *aslave, char *name, >struct termios *termp, struct winsize *winp) > > in util/qemu-openpty.c. I odn't know if that was the right thing to

Re: [PULL 0/6] MIPS + TCG Continuous Benchmarking queue for June 27th, 2020

2020-06-28 Thread Peter Maydell
On Sat, 27 Jun 2020 at 20:51, Aleksandar Markovic wrote: > > The following changes since commit 553cf5d7c47bee05a3dec9461c1f8430316d516b: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20200626' into staging (2020-06-26 > 18:22:36 +0100) > > are available in the git

Re: [PATCH v5 09/11] macio: Add dummy screamer register area

2020-06-28 Thread BALATON Zoltan
Here it is with --enable-debug and additional screamer debug: SCREAMER: screamer_read: addr -> 0 SCREAMER: screamer_write: addr val 11 SCREAMER: screamer_control_write: val 17 SCREAMER: basic rate: 44100 DBDMA[10]: writel 0x080c <= 0x0010 DBDMA[10

Re: Building in Solaris 11.4

2020-06-28 Thread Peter Tribble
On Sun, Jun 28, 2020 at 2:23 PM Peter Maydell wrote: > On Sat, 27 Jun 2020 at 23:05, Michele Denber > wrote: > > > > Well I removed the "static" from the line > > > > static int openpty(int *amaster, int *aslave, char *name, > >struct termios *termp, struct winsize *winp) > >

[PATCH 07/17] hw/misc/max111x: Don't use vmstate_register()

2020-06-28 Thread Peter Maydell
The max111x is a proper qdev device; we can use dc->vmsd rather than directly calling vmstate_register(). It's possible that this is a migration compat break, but the only boards that use this device are the spitz-family ('akita', 'borzoi', 'spitz', 'terrier'). Signed-off-by: Peter Maydell ---

[PATCH 00/17] spitz: fix hacks, fix CID 1421913, various cleanups

2020-06-28 Thread Peter Maydell
This series of patches makes various cleanups to the spitz board family code; the main driver here was fixing the minor Coverity nit CID 1421913, which is a complaint that the call to qemu_allocate_irqs() creates memory that is leaked. We fix this by replacing the free-standing irq array and callb

[PATCH 01/17] hw/arm/spitz: Detabify

2020-06-28 Thread Peter Maydell
The spitz board has been around a long time, and still has a fair number of hard-coded tab characters in it. We're about to do some work on this source file, so start out by expanding out the tabs. This commit is a pure whitespace only change. Signed-off-by: Peter Maydell --- Couple of checkpatc

[PATCH 03/17] hw/arm/spitz: Keep pointers to MPU and SSI devices in SpitzMachineState

2020-06-28 Thread Peter Maydell
Keep pointers to the MPU and the SSI devices in SpitzMachineState. We're going to want to make GPIO connections between some of the SSI devices and the SCPs, so we want to keep hold of a pointer to those; putting the MPU into the struct allows us to pass just one thing to spitz_ssp_attach() rather

[PATCH 04/17] hw/arm/spitz: Keep pointers to scp0, scp1 in SpitzMachineState

2020-06-28 Thread Peter Maydell
Keep pointers to scp0, scp1 in SpitzMachineState, and just pass that to spitz_scoop_gpio_setup(). (We'll want to use some of the other fields in SpitzMachineState in that function in the next commit.) Signed-off-by: Peter Maydell --- hw/arm/spitz.c | 34 +++--- 1 fil

[PATCH 10/17] hw/misc/max111x: Use GPIO lines rather than max111x_set_input()

2020-06-28 Thread Peter Maydell
The max111x ADC device model allows other code to set the level on the 8 ADC inputs using the max111x_set_input() function. Replace this with generic qdev GPIO inputs, which also allow inputs to be set to arbitrary values. Using GPIO lines will make it easier for board code to wire things up, so

[PATCH 02/17] hw/arm/spitz: Create SpitzMachineClass abstract base class

2020-06-28 Thread Peter Maydell
For the four Spitz-family machines (akita, borzoi, spitz, terrier) create a proper abstract class SpitzMachineClass which encapsulates the common behaviour, rather than having them all derive directly from TYPE_MACHINE: * instead of each machine class setting mc->init to a wrapper function whic

[PATCH 08/17] ssi: Add ssi_realize_and_unref()

2020-06-28 Thread Peter Maydell
Add an ssi_realize_and_unref(), for the benefit of callers who want to be able to create an SSI device, set QOM properties on it, and then do the realize-and-unref afterwards. The API works on the same principle as the recently added qdev_realize_and_undef(), sysbus_realize_and_undef(), etc. Sign

[PATCH 05/17] hw/arm/spitz: Implement inbound GPIO lines for bit5 and power signals

2020-06-28 Thread Peter Maydell
Currently the Spitz board uses a nasty hack for the GPIO lines that pass "bit5" and "power" information to the LCD controller: the lcdtg realize function sets a global variable to point to the instance it just realized, and then the functions spitz_bl_power() and spitz_bl_bit5() use that to find th

[PATCH 15/17] hw/arm/pxa2xx_pic: Use LOG_GUEST_ERROR for bad guest register accesses

2020-06-28 Thread Peter Maydell
Instead of using printf() for logging guest accesses to invalid register offsets in the pxa2xx PIC device, use the usual qemu_log_mask(LOG_GUEST_ERROR,...). This was the only user of the REG_FMT macro in pxa.h, so we can remove that. Signed-off-by: Peter Maydell --- include/hw/arm/pxa.h | 1 -

[PATCH 06/17] hw/misc/max111x: provide QOM properties for setting initial values

2020-06-28 Thread Peter Maydell
Add some QOM properties to the max111x ADC device to allow the initial values to be configured. Currently this is done by board code calling max111x_set_input() after it creates the device, which doesn't work on system reset. This requires us to implement a reset method for this device, so while w

[PATCH 09/17] hw/arm/spitz: Use max111x properties to set initial values

2020-06-28 Thread Peter Maydell
Use the new max111x qdev properties to set the initial input values rather than calling max111x_set_input(); this means that on system reset the inputs will correctly return to their initial values. Signed-off-by: Peter Maydell --- hw/arm/spitz.c | 11 +++ 1 file changed, 7 insertions(+)

[PATCH 12/17] hw/arm/spitz: Encapsulate misc GPIO handling in a device

2020-06-28 Thread Peter Maydell
Currently we have a free-floating set of IRQs and a function spitz_out_switch() which handle some miscellaneous GPIO lines for the spitz board. Encapsulate this behaviour in a simple QOM device. At this point we can finally remove the 'max' global, because the ADC battery-temperature value is

[PATCH 11/17] hw/misc/max111x: Create header file for documentation, TYPE_ macros

2020-06-28 Thread Peter Maydell
Create a header file for the hw/misc/max111x device, in the usual modern style for QOM devices: * definition of the TYPE_ constants and macros * definition of the device's state struct so that it can be embedded in other structs if desired * documentation of the interface This allows us to u

[PATCH 13/17] hw/gpio/zaurus.c: Use LOG_GUEST_ERROR for bad guest register accesses

2020-06-28 Thread Peter Maydell
Instead of logging guest accesses to invalid register offsets in this device using zaurus_printf() (which just prints to stderr), use the usual qemu_log_mask(LOG_GUEST_ERROR,...). Since this was the only use of the zaurus_printf() macro outside spitz.c, we can move the definition of that macro fro

[PATCH 14/17] hw/arm/spitz: Use LOG_GUEST_ERROR for bad guest register accesses

2020-06-28 Thread Peter Maydell
Instead of logging guest accesses to invalid register offsets in the Spitz flash device with zaurus_printf() (which just prints to stderr), use the usual qemu_log_mask(LOG_GUEST_ERROR,...). Signed-off-by: Peter Maydell --- hw/arm/spitz.c | 12 +++- 1 file changed, 7 insertions(+), 5 dele

[PATCH 16/17] hw/arm/spitz: Provide usual QOM macros for corgi-ssp and spitz-lcdtg

2020-06-28 Thread Peter Maydell
The QOM types "spitz-lcdtg" and "corgi-ssp" are missing the usual QOM TYPE and casting macros; provide and use them. In particular, we can safely use the QOM cast macros instead of FROM_SSI_SLAVE() because in both cases the 'ssidev' field of the instance state struct is the first field in it. Sig

Re: [PATCH v5 09/11] macio: Add dummy screamer register area

2020-06-28 Thread BALATON Zoltan
On Sun, 28 Jun 2020, BALATON Zoltan wrote: Here it is with --enable-debug and additional screamer debug: SCREAMER: screamer_read: addr -> 0 SCREAMER: screamer_write: addr val 11 SCREAMER: screamer_control_write: val 17 SCREAMER: basic rate: 44100 DBDMA[10]: writ

[PATCH 17/17] Replace uses of FROM_SSI_SLAVE() macro with QOM casts

2020-06-28 Thread Peter Maydell
The FROM_SSI_SLAVE() macro predates QOM and is used as a typesafe way to cast from an SSISlave* to the instance struct of a subtype of TYPE_SSI_SLAVE. Switch to using the QOM cast macros instead, which have the same effect (by writing the QOM macros if the types were previously missing them.) (Th

[PATCH v2] ftgmac100: fix dblac write test

2020-06-28 Thread erik-smit
The test of the write of the dblac register was testing the old value instead of the new value. This would accept the write of an invalid value but subsequently refuse any following valid writes. Signed-off-by: erik-smit --- Changes since v1: Changed %ld to HWADDR_PRIx to fix building on mingw

Re: Crash when running Qemu.

2020-06-28 Thread Peter Maydell
On Sun, 28 Jun 2020 at 11:56, Jean-Christophe DUBOIS wrote: > Since the last pull I did this week end on the qemu git tree (master > branch) I am unable to "start" qemu anymore (It was working OK from git > master previously). > > Traces are provided bellow. > > Am I the only one to get this behav

Re: [PULL 00/63] riscv-to-apply queue

2020-06-28 Thread Peter Maydell
On Fri, 26 Jun 2020 at 22:53, Alistair Francis wrote: > > The following changes since commit 553cf5d7c47bee05a3dec9461c1f8430316d516b: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20200626' into staging (2020-06-26 > 18:22:36 +0100) > > are available in the Git rep

Re: [PATCH 00/17] spitz: fix hacks, fix CID 1421913, various cleanups

2020-06-28 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200628142429.17111-1-peter.mayd...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PATCH 00/17] spitz: fix hacks, fix CID 1421913, various cleanups Type: series Message-id: 202006281

Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier

2020-06-28 Thread Peter Xu
On Sun, Jun 28, 2020 at 03:03:41PM +0800, Jason Wang wrote: > > On 2020/6/27 上午5:29, Peter Xu wrote: > > Hi, Eugenio, > > > > (CCing Eric, Yan and Michael too) > > > > On Fri, Jun 26, 2020 at 08:41:22AM +0200, Eugenio Pérez wrote: > > > diff --git a/memory.c b/memory.c > > > index 2f15a4b250..7f

QEMU | Pipeline #160886695 has failed for master | e7651153

2020-06-28 Thread GitLab via
Your pipeline has failed. Project: QEMU ( https://gitlab.com/qemu-project/qemu ) Branch: master ( https://gitlab.com/qemu-project/qemu/-/commits/master ) Commit: e7651153 ( https://gitlab.com/qemu-project/qemu/-/commit/e7651153a8801dad6805d450ea8bef9b46c1adf5 ) Commit Message: Merge remote-tr

Re: [PATCH v5 09/11] macio: Add dummy screamer register area

2020-06-28 Thread BALATON Zoltan
With increasing screamer buffer size (you may want to fix this and prevent buffer overflows, maybe should allocate it dynamically based on what the guest programs?): diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 75f1853a7b..05b289e086 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -108,7 +108

[PATCH v8 0/2] target/arm: kvm: Support for KVM DABT with no valid ISS

2020-06-28 Thread Beata Michalska
Some of the ARMv7 & ARMv8 load/store instructions might trigger a data abort exception with no valid ISS info to be decoded. The lack of decode info makes it at least tricky to emulate the instruction which is one of the (many) reasons why KVM will not even try to do so. So far, if a guest made an

Re: [PATCH v5 09/11] macio: Add dummy screamer register area

2020-06-28 Thread BALATON Zoltan
On Sun, 28 Jun 2020, BALATON Zoltan wrote: SCREAMER: ### AUDIO WRITE! 0 / 11104 - 11104 Unassigned mem write f3011190 = 0x900 Unassigned mem write f3011190 = 0xb00 Unassigned mem write f3011190 = 0x900 Unassigned mem write f3011190 = 0x900 U

[PATCH v8 1/2] target/arm: kvm: Handle DABT with no valid ISS

2020-06-28 Thread Beata Michalska
On ARMv7 & ARMv8 some load/store instructions might trigger a data abort exception with no valid ISS info to be decoded. The lack of decode info makes it at least tricky to emulate those instruction which is one of the (many) reasons why KVM will not even try to do so. Add support for handling tho

[PATCH v8 2/2] target/arm: kvm: Handle misconfigured dabt injection

2020-06-28 Thread Beata Michalska
Injecting external data abort through KVM might trigger an issue on kernels that do not get updated to include the KVM fix. For those and aarch32 guests, the injected abort gets misconfigured to be an implementation defined exception. This leads to the guest repeatedly re-running the faulting instr

Re: [PATCH 01/19] iotests: Make _filter_img_create more active

2020-06-28 Thread Maxim Levitsky
On Thu, 2020-06-25 at 14:55 +0200, Max Reitz wrote: > Right now, _filter_img_create just filters out everything that looks > format-dependent, and applies some filename filters. That means that we > have to add another filter line every time some format gets a new > creation option. This can be a

Re: Crash when running Qemu.

2020-06-28 Thread Jean-Christophe DUBOIS
When ran from valgrind, qemu does not crash but the following output is returned. valgrind --track-origins=yes ../../qemu/qemu/arm-softmmu/qemu-system-arm -machine mcimx6ul-evk -m 128M -display none -serial stdio -kernel ./OS.elf ==77479== Memcheck, a memory error detector ==77479== Copyright

Re: Crash when running Qemu.

2020-06-28 Thread Jean-Christophe DUBOIS
By reverting the recent (june 23) commit series on PCA9552 I can run Qemu again. Here is the git revert command I did. jcd@jcd-UX305CA:~/Projects/qemu/qemu$ git revert 8208335b9539e7b5aa4702b36e2f9a8abd704079..586f495b1e78c27e141ff432dd971eb41866fb80 Regards JC Le 28/06/2020 à 17:57, Jean-

Re: Crash when running Qemu.

2020-06-28 Thread Peter Maydell
On Sun, 28 Jun 2020 at 17:46, Jean-Christophe DUBOIS wrote: > > Le 28/06/2020 à 16:38, Peter Maydell a écrit : > > On Sun, 28 Jun 2020 at 11:56, Jean-Christophe DUBOIS > > wrote: > >> jcd@jcd-UX305CA:~/Projects/µCOS/work$ > >> ../../qemu/qemu/arm-softmmu/qemu-system-arm -machine mcimx6ul-evk -m >

Re: [REPORT] [GSoC - TCG Continuous Benchmarking] [#1] Measuring Basic Performance Metrics of QEMU

2020-06-28 Thread Aleksandar Markovic
пон, 22. јун 2020. у 12:31 Ahmed Karaman је написао/ла: > > Greetings, > > Welcome to the TCG Continuous Benchmarking GSoC project! > This is the first report in a series that will be posted here on the > mailing list as part of the project. > > During the project, multiple Linux profiling tools w

[PATCH v6 01/11] mac_oldworld: Allow loading binary ROM image

2020-06-28 Thread BALATON Zoltan
The beige G3 Power Macintosh has a 4MB firmware ROM. Fix the size of the rom region and fall back to loading a binary image with -bios if loading ELF image failed. This allows testing emulation with a ROM image from real hardware as well as using an ELF OpenBIOS image. Signed-off-by: BALATON Zolta

[PATCH v6 02/11] mac_newworld: Allow loading binary ROM image

2020-06-28 Thread BALATON Zoltan
Fall back to load binary ROM image if loading ELF fails. This also moves PROM_BASE and PROM_SIZE defines to board as these are matching the ROM size and address on this board and removes the now unused PROM_ADDR and BIOS_SIZE defines from common mac.h. Signed-off-by: BALATON Zoltan --- Unlike mac

[PATCH v6 00/11] Mac Old World ROM experiment

2020-06-28 Thread BALATON Zoltan
Latest version of this series with addressing review comments, adding review tags and tweaks to the WIP CUDA I2C support so with this on top of Mark's screaper patches (with a small fix) the ROM now plays the startup sound but then gets confused about some memory addresses. I don't want to debug th

[PATCH v6 04/11] mac_oldworld: Drop some variables

2020-06-28 Thread BALATON Zoltan
Values not used frequently enough may not worth putting in a local variable, especially with names almost as long as the original value because that does not improve readability, to the contrary it makes it harder to see what value is used. Drop a few such variables. Signed-off-by: BALATON Zoltan

[PATCH v6 03/11] mac_oldworld: Drop a variable, use get_system_memory() directly

2020-06-28 Thread BALATON Zoltan
Half of the occurances already use get_system_memory() directly instead of sysmem variable, convert the two other uses to get_system_memory() too which seems to be more common and drop the variable. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland --- hw/ppc/mac_oldworld.c | 5 ++---

[PATCH v6 07/11] mac_oldworld: Map macio to expected address at reset

2020-06-28 Thread BALATON Zoltan
Add a reset function that maps macio to the address expected by the firmware of the board at startup. Signed-off-by: BALATON Zoltan --- hw/ppc/mac.h | 12 hw/ppc/mac_oldworld.c | 15 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/hw/ppc/mac.h

[PATCH v6 05/11] grackle: Set revision in PCI config to match hardware

2020-06-28 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/pci-host/grackle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 4b3af0c704..48d11f13ab 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -130,7 +130,7 @@ static void gra

[RFC PATCH v6 10/11] WIP macio/cuda: Attempt to add i2c support

2020-06-28 Thread BALATON Zoltan
This is not a final, RFC patch attempt to implement i2c bus in CUDA needed for firmware to access SPD data of installed RAM. The skeleton is there but actual implementation of I2C commands need to be refined because I don't know how this is supposed to work. In my understanding after an I2C command

[PATCH v6 08/11] mac_oldworld: Add machine ID register

2020-06-28 Thread BALATON Zoltan
The G3 beige machine has a machine ID register that is accessed by the firmware to deternine the board config. Add basic emulation of it. Signed-off-by: BALATON Zoltan --- v6: Make MemoryRegionOps static const v4: Move MermoryRegion to MachineState, use constants hw/ppc/mac.h | 1 + h

[PATCH v6 06/11] mac_oldworld: Rename ppc_heathrow_reset to ppc_heathrow_cpu_reset

2020-06-28 Thread BALATON Zoltan
This function resets a CPU not the whole machine so reflect that in its name. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/mac_oldworld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 4

[PATCH v6 09/11] i2c: Match parameters of i2c_start_transfer and i2c_send_recv

2020-06-28 Thread BALATON Zoltan
These functions have a parameter that decides the direction of transfer but totally confusingly they don't match but inverted sense. To avoid frequent mistakes when using these functions change i2c_send_recv to match i2c_start_transfer. Also use bool in i2c_start_transfer instead of int to match i2

[PATCH v6 11/11] mac_oldworld: Add SPD data to cover RAM

2020-06-28 Thread BALATON Zoltan
OpenBIOS gets RAM size via fw_cfg but rhe original board firmware detects RAM using SPD data so generate and add SDP eeproms to cover as much RAM as possible to describe with SPD (this may be less than the actual ram_size due to SDRAM size constraints). This patch is more complex as it should be w

Re: [PATCH v5 00/11] Mac Old World ROM experiment

2020-06-28 Thread BALATON Zoltan
On Fri, 26 Jun 2020, Mark Cave-Ayland wrote: On 26/06/2020 11:21, BALATON Zoltan wrote: What about these patches? At least those that are finished (up to patch 9) could be merged. I've seen you sent a pull request but not including any of these. Will this need another rebase after your patches

Re: [PATCH 03/19] iotests/common.rc: Add _require_working_luks

2020-06-28 Thread Maxim Levitsky
On Thu, 2020-06-25 at 14:55 +0200, Max Reitz wrote: > That the luks driver is present is little indication on whether it is > actually working. Without the crypto libraries linked in, it does not > work. So add this function, which tries to create a luks image to see > whether that actually works

Re: Crash when running Qemu.

2020-06-28 Thread Jean-Christophe DUBOIS
I am not sure how it could influence the fact that I experience this bug and others not necessarily but for what it is worth, I am using gcc 10.0.1 to compile Qemu. I might try to use a previous version to check if it changes the overall behavior. JC Le 28/06/2020 à 18:32, Jean-Christophe D

[PATCH] hw/display/bcm2835_fb.c: Initialize all fields of struct

2020-06-28 Thread Peter Maydell
In bcm2835_fb_mbox_push(), Coverity complains (CID 1429989) that we pass a pointer to a local struct to another function without initializing all its fields. This is a real bug: bcm2835_fb_reconfigure() copies the whole of our new BCM2385FBConfig struct into s->config, so any fields we don't initi

Re: [REPORT] [GSoC - TCG Continuous Benchmarking] [#1] Measuring Basic Performance Metrics of QEMU

2020-06-28 Thread Ahmed Karaman
On Sun, Jun 28, 2020 at 7:20 PM Aleksandar Markovic wrote: > > Now, thinking longer about topN scripts, I think one really missing > thing is number of invocations (or calls, whatever term you prefer) > for any function in the list. This data must be possible to obtain > using callgrind_annotate (

  1   2   >