[PATCH v19 3/5] ACPI: Add APEI GHES table generation support

2019-10-15 Thread Xiang Zheng
From: Dongjiu Geng This patch implements APEI GHES Table generation via fw_cfg blobs. Now it only supports ARMv8 SEA, a type of GHESv2 error source. Afterwards, we can extend the supported types if needed. For the CPER section, currently it is memory section because kernel mainly wants userspace

[PATCH v19 4/5] KVM: Move hwpoison page related functions into kvm-all.c

2019-10-15 Thread Xiang Zheng
From: Dongjiu Geng kvm_hwpoison_page_add() and kvm_unpoison_all() will both be used by X86 and ARM platforms, so moving them into "accel/kvm/kvm-all.c" to avoid duplicate code. For architectures that don't use the poison-list functionality the reset handler will harmlessly do nothing, so let's r

[PATCH v19 5/5] target-arm: kvm64: handle SIGBUS signal from kernel or KVM

2019-10-15 Thread Xiang Zheng
From: Dongjiu Geng Add a SIGBUS signal handler. In this handler, it checks the SIGBUS type, translates the host VA delivered by host to guest PA, then fills this PA to guest APEI GHES memory, then notifies guest according to the SIGBUS type. When guest accesses the poisoned memory, it will gener

[PATCH v19 1/5] hw/arm/virt: Introduce a RAS machine option

2019-10-15 Thread Xiang Zheng
From: Dongjiu Geng RAS Virtualization feature is not supported now, so add a RAS machine option and disable it by default. Signed-off-by: Dongjiu Geng Signed-off-by: Xiang Zheng --- hw/arm/virt.c | 23 +++ include/hw/arm/virt.h | 1 + 2 files changed, 24 insertion

Re: [PATCH] doc: Describe missing generic -blockdev options

2019-10-15 Thread Kevin Wolf
Am 15.10.2019 um 15:55 hat Peter Maydell geschrieben: > On Tue, 15 Oct 2019 at 13:40, Kevin Wolf wrote: > > > > We added more generic options after introducing -blockdev and forgot to > > update the documentation (man page and --help output) accordingly. Do > > that now. > > > > Signed-off-by: Kev

[PATCH v19 2/5] docs: APEI GHES generation and CPER record description

2019-10-15 Thread Xiang Zheng
From: Dongjiu Geng Add APEI/GHES detailed design document Signed-off-by: Dongjiu Geng Signed-off-by: Xiang Zheng --- docs/specs/acpi_hest_ghes.rst | 94 +++ docs/specs/index.rst | 1 + 2 files changed, 95 insertions(+) create mode 100644 docs

[PATCH v19 0/5] Add ARMv8 RAS virtualization support in QEMU

2019-10-15 Thread Xiang Zheng
In the ARMv8 platform, the CPU error types are synchronous external abort(SEA) and SError Interrupt (SEI). If exception happens in guest, sometimes it's better for guest to perform the recovery, because host does not know the detailed information of guest. For example, if an exception happens in a

Re: [PATCH] doc: Describe missing generic -blockdev options

2019-10-15 Thread Eric Blake
On 10/15/19 9:05 AM, Kevin Wolf wrote: +@item force-share +Override the image locking system of QEMU and force the node to allowing +sharing all permissions with other uses. Grammar nit: "to allow sharing"; but maybe the phrasing could be clarified anyway -- I'm not entirely sure what 'sharing

[PATCH v2 06/21] iotests: Drop compat=1.1 in 050

2019-10-15 Thread Max Reitz
IMGOPTS can never be empty for qcow2, because the check scripts adds compat=1.1 unless the user specified any compat option themselves. Thus, this block does not do anything and can be dropped. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky --- tests/qemu-iotests/050 | 4 1 file chan

[PATCH v2 01/21] iotests/qcow2.py: Add dump-header-exts

2019-10-15 Thread Max Reitz
This is useful for tests that want to whitelist fields from dump-header (with grep) but still print all header extensions. Signed-off-by: Max Reitz --- tests/qemu-iotests/qcow2.py | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py i

[PATCH v2 02/21] iotests/qcow2.py: Split feature fields into bits

2019-10-15 Thread Max Reitz
Print the feature fields as a set of bits so that filtering is easier. Signed-off-by: Max Reitz --- tests/qemu-iotests/031.out | 36 +-- tests/qemu-iotests/036.out | 18 +- tests/qemu-iotests/039.out | 22 ++-- tests/qemu-iotests/060.out | 20 +-- test

[PATCH v2 00/21] iotests: Allow ./check -o data_file

2019-10-15 Thread Max Reitz
Hi, The cover letter from v1 (explaining the motivation behind this series and the general structure) is here: https://lists.nongnu.org/archive/html/qemu-block/2019-09/msg01323.html For v2, I’ve tried to address Maxim’s comments: - Patch 1 through 3: New - Patch 4: Only print feature bits inste

[PATCH v2 03/21] iotests: Add _filter_json_filename

2019-10-15 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/common.filter | 24 1 file changed, 24 insertions(+) diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter index 9f418b4881..63bc6f6f26 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qe

[PATCH v2 14/21] iotests: Use _rm_test_img for deleting test images

2019-10-15 Thread Max Reitz
Just rm will not delete external data files. Use _rm_test_img every time we delete a test image. (In the process, clean up the indentation of every _cleanup() this patch touches.) ((Also, use quotes consistently. I am happy to see unquoted instances like "rm -rf $TEST_DIR/..." go.)) Signed-off

[PATCH v2 12/21] iotests: Drop IMGOPTS use in 267

2019-10-15 Thread Max Reitz
Overwriting IMGOPTS means ignoring all user-supplied options, which is not what we want. Replace the current IMGOPTS use by a new BACKING_FILE variable. Signed-off-by: Max Reitz --- tests/qemu-iotests/267 | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/qem

[PATCH v2 04/21] iotests: Filter refcount_order in 036

2019-10-15 Thread Max Reitz
This test can run just fine with other values for refcount_bits, so we should filter the value from qcow2.py's dump-header. In fact, we can filter everything but the feature bits and header extensions, because that is what the test is about. (036 currently ignores user-specified image options, bu

[PATCH v2 13/21] iotests: Avoid qemu-img create

2019-10-15 Thread Max Reitz
Use _make_test_img whenever possible. This way, we will not ignore user-specified image options. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky --- tests/qemu-iotests/094 | 2 +- tests/qemu-iotests/111 | 3 +-- tests/qemu-iotests/123 | 2 +- tests/qemu-iotests/153 | 2 +- tests/qemu-iote

[PATCH v2 05/21] iotests: Replace IMGOPTS by _unsupported_imgopts

2019-10-15 Thread Max Reitz
Some tests require compat=1.1 and thus set IMGOPTS='compat=1.1' globally. That is not how it should be done; instead, they should simply set _unsupported_imgopts to compat=0.10 (compat=1.1 is the default anyway). This makes the tests heed user-specified $IMGOPTS. Some do not work with all image

[PATCH v2 17/21] iotests: Make 110 work with data_file

2019-10-15 Thread Max Reitz
The only difference is that the json:{} filename of the image looks different. We actually do not care about that filename in this test, we are only interested in (1) that there is a json:{} filename, and (2) whether the backing filename can be constructed. So just filter out the json:{} data, th

[PATCH v2 07/21] iotests: Let _make_test_img parse its parameters

2019-10-15 Thread Max Reitz
This will allow us to add more options than just -b. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky --- tests/qemu-iotests/common.rc | 28 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.r

[PATCH v2 10/21] iotests: Replace IMGOPTS= by -o

2019-10-15 Thread Max Reitz
Tests should not overwrite all user-supplied image options, but only add to it (which will effectively overwrite conflicting values). Accomplish this by passing options to _make_test_img via -o instead of $IMGOPTS. For some tests, there is no functional change because they already only appended o

[PATCH v2 19/21] iotests: Make 198 work with data_file

2019-10-15 Thread Max Reitz
We do not care about the json:{} filenames here, so we can just filter them out and thus make the test work both with and without external data files. Signed-off-by: Max Reitz --- tests/qemu-iotests/198 | 6 -- tests/qemu-iotests/198.out | 4 ++-- 2 files changed, 6 insertions(+), 4 dele

[PATCH v2 08/21] iotests: Add -o and --no-opts to _make_test_img

2019-10-15 Thread Max Reitz
Blindly overriding IMGOPTS is suboptimal as this discards user-specified options. Whatever options the test needs should simply be appended. Some tests do this (with IMGOPTS=$(_optstr_add "$IMGOPTS" "...")), but that is cumbersome. It’s simpler to just give _make_test_img an -o parameter with wh

[PATCH v2 11/21] iotests: Replace IMGOPTS='' by --no-opts

2019-10-15 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky --- tests/qemu-iotests/071 | 4 ++-- tests/qemu-iotests/174 | 2 +- tests/qemu-iotests/178 | 4 ++-- tests/qemu-iotests/197 | 4 ++-- tests/qemu-iotests/215 | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/qemu-io

[PATCH v2 16/21] iotests: Make 091 work with data_file

2019-10-15 Thread Max Reitz
The image end offset as reported by qemu-img check is different when using an external data file; we do not care about its value here, so we can just filter it. Incidentally, common.rc already has _check_test_img for us which does exactly that. Signed-off-by: Max Reitz --- tests/qemu-iotests/09

[PATCH v2 09/21] iotests: Inject space into -ocompat=0.10 in 051

2019-10-15 Thread Max Reitz
It did not matter before, but now that _make_test_img understands -o, we should use it properly here. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky --- tests/qemu-iotests/051 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/0

[PATCH v2 20/21] iotests: Disable data_file where it cannot be used

2019-10-15 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/007 | 5 +++-- tests/qemu-iotests/014 | 2 ++ tests/qemu-iotests/015 | 5 +++-- tests/qemu-iotests/026 | 5 - tests/qemu-iotests/029 | 5 +++-- tests/qemu-iotests/031 | 6 +++--- tests/qemu-iotests/036 | 5 +++-- tests/qemu-iotests/039 | 3 +++

[PATCH v2 15/21] iotests: Avoid cp/mv of test images

2019-10-15 Thread Max Reitz
This will not work with external data files, so try to get tests working without it as far as possible. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky --- tests/qemu-iotests/063 | 12 tests/qemu-iotests/063.out | 3 ++- tests/qemu-iotests/085 | 9 +++-- tests/qe

[PATCH v2 18/21] iotests: Make 137 work with data_file

2019-10-15 Thread Max Reitz
When using an external data file, there are no refcounts for data clusters. We thus have to adjust the corruption test in this patch to not be based around a data cluster allocation, but the L2 table allocation (L2 tables are still refcounted with external data files). Furthermore, we should not

[PATCH V2 2/2] target/i386/kvm: Add Hyper-V direct tlb flush support

2019-10-15 Thread lantianyu1986
From: Tianyu Lan Hyper-V direct tlb flush targets KVM on Hyper-V guest. Enable direct TLB flush for its guests meaning that TLB flush hypercalls are handled by Level 0 hypervisor (Hyper-V) bypassing KVM in Level 1. Due to the different ABI for hypercall parameters between Hyper-V and KVM, KVM cap

[PATCH V2 0/2] target/i386/kvm: Add Hyper-V direct tlb flush support

2019-10-15 Thread lantianyu1986
From: Tianyu Lan This patchset is to enable Hyper-V direct tlbflush feature. The feature is to let L0 hypervisor to handle tlb flush hypercall for L1 hypervisor. Tianyu Lan (2): linux headers: update against Linux 5.4-rc2 target/i386/kvm: Add Hyper-V direct tlb flush support docs/hyperv.tx

[PATCH v2 21/21] iotests: Allow check -o data_file

2019-10-15 Thread Max Reitz
The problem with allowing the data_file option is that you want to use a different data file per image used in the test. Therefore, we need to allow patterns like -o data_file='$TEST_IMG.data_file'. Then, we need to filter it out from qemu-img map, qemu-img create, and remove the data file in _rm

[PATCH V2 1/2] linux headers: update against Linux 5.4-rc2

2019-10-15 Thread lantianyu1986
From: Tianyu Lan commit da0c9ea146cbe92b832f1b0f694840ea8eb33cce Signed-off-by: Tianyu Lan --- include/standard-headers/asm-x86/bootparam.h | 2 + include/standard-headers/asm-x86/kvm_para.h | 1 + include/standard-headers/linux/ethtool.h | 24 ++ include/standard-headers/linux/

Re: [PATCH v19 3/5] ACPI: Add APEI GHES table generation support

2019-10-15 Thread Peter Maydell
On Tue, 15 Oct 2019 at 15:02, Xiang Zheng wrote: > > From: Dongjiu Geng > > This patch implements APEI GHES Table generation via fw_cfg blobs. Now > it only supports ARMv8 SEA, a type of GHESv2 error source. Afterwards, > we can extend the supported types if needed. For the CPER section, > curren

Re: [PATCH v2 1/2] nbd: Don't send oversize strings

2019-10-15 Thread Eric Blake
On 10/11/19 2:32 AM, Vladimir Sementsov-Ogievskiy wrote: 11.10.2019 0:00, Eric Blake wrote: Qemu as server currently won't accept export names larger than 256 bytes, nor create dirty bitmap names longer than 1023 bytes, so most uses of qemu as client or server have no reason to get anywhere near

Re: [PATCH v19 2/5] docs: APEI GHES generation and CPER record description

2019-10-15 Thread Peter Maydell
On Tue, 15 Oct 2019 at 15:02, Xiang Zheng wrote: > > From: Dongjiu Geng > > Add APEI/GHES detailed design document > > Signed-off-by: Dongjiu Geng > Signed-off-by: Xiang Zheng > --- > docs/specs/acpi_hest_ghes.rst | 94 > +++ > docs/specs/index.rst

Re: [PATCH v19 5/5] target-arm: kvm64: handle SIGBUS signal from kernel or KVM

2019-10-15 Thread Peter Maydell
On Tue, 15 Oct 2019 at 15:02, Xiang Zheng wrote: > > From: Dongjiu Geng > > Add a SIGBUS signal handler. In this handler, it checks the SIGBUS type, > translates the host VA delivered by host to guest PA, then fills this PA > to guest APEI GHES memory, then notifies guest according to the SIGBUS

LEON3 networking

2019-10-15 Thread Joshua Shaffer
Hello, I've been using the LEON3 port of qemu, and am wondering if anyone has touched the networking setup for such since the thread here: https://lists.rtems.org/pipermail/users/2014-September/028224.html Joshua Shaffer -- Notice: This message is intended solely for use of the individual or en

[RFC PATCH 10/23] qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap()

2019-10-15 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

[RFC PATCH 12/23] qcow2: Handle QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER

2019-10-15 Thread Alberto Garcia
In the previous patch we added a new QCow2ClusterType named QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER. There is a couple of places where this new value needs to be handled, and that is what this patch does. Signed-off-by: Alberto Garcia --- block/qcow2.c | 10 +++--- 1 file changed, 7 insertions(

[RFC PATCH 16/23] qcow2: Add subcluster support to discard_in_l2_slice()

2019-10-15 Thread Alberto Garcia
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an image has subclusters. Instead, the individual 'all zeroes' bits must be used. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/qcow2-cluster.c

[RFC PATCH 01/23] qcow2: Add calculate_l2_meta()

2019-10-15 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 --- block/qcow2-cluster.c | 76 +++

[RFC PATCH 04/23] qcow2: Add get_l2_entry() and set_l2_entry()

2019-10-15 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

[RFC PATCH 09/23] qcow2: Add l2_entry_size()

2019-10-15 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

[RFC PATCH 05/23] qcow2: Document the Extended L2 Entries feature

2019-10-15 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

[RFC PATCH 06/23] qcow2: Add dummy has_subclusters() function

2019-10-15 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

[RFC PATCH 11/23] qcow2: Add qcow2_get_subcluster_type()

2019-10-15 Thread Alberto Garcia
This function returns the type of an individual subcluster. If an image does not have subclusters then this returns the exact same value as qcow2_get_cluster_type(). The information in standard and extended L2 entries is encoded in a slightly different way, but all existing QCow2ClusterType values

[RFC PATCH 00/23] Add subcluster allocation to qcow2

2019-10-15 Thread Alberto Garcia
Hi, this series adds a new feature to the qcow2 on-disk format called "Extended L2 Entries", which allows us to do subcluster allocation. This cover letter explains the reasons behind this proposal, the changes to the on-disk format, test results and pending work. If you are curious you can also

[RFC PATCH 03/23] qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied()

2019-10-15 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

[RFC PATCH 23/23] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2019-10-15 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 --- block/qcow2.c| 47 ++ block/qcow2.h

[RFC PATCH 18/23] qcow2: Add subcluster support to expand_zero_clusters_in_l1()

2019-10-15 Thread Alberto Garcia
Two changes are needed in order to add subcluster support to this function: deallocated clusters must have their bitmaps cleared, and expanded clusters must have all the "subcluster allocated" bits set. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 2 ++ 1 file changed, 2 insertions(

[RFC PATCH 08/23] qcow2: Add offset_to_sc_index()

2019-10-15 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 --- block/qcow2.h | 5 + 1 file changed, 5 insertions(+) diff --git a/block/qcow2.h b/block/qcow2.h index e6486a2cf8

[RFC PATCH 20/23] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2()

2019-10-15 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. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 16 1 file chang

[RFC PATCH 19/23] qcow2: Fix offset calculation in handle_dependencies()

2019-10-15 Thread Alberto Garcia
l2meta_cow_start() and l2meta_cow_end() are not necessarily cluster-aligned if the image has subclusters, so update the calculation of old_start and old_end to guarantee that no two requests try to write on the same cluster. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 4 ++-- 1 fil

[RFC PATCH 02/23] qcow2: Split cluster_needs_cow() out of count_cow_clusters()

2019-10-15 Thread Alberto Garcia
We are going to need it in other places. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index fe2523ed66..f462e169c0 100644 --- a/block/

[RFC PATCH 07/23] qcow2: Add subcluster-related fields to BDRVQcow2State

2019-10-15 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

[RFC PATCH 15/23] qcow2: Add subcluster support to zero_in_l2_slice()

2019-10-15 Thread Alberto Garcia
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an image has subclusters. Instead, the individual 'all zeroes' bits must be used. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/block/qcow

[RFC PATCH 22/23] qcow2: Restrict qcow2_co_pwrite_zeroes() to full clusters only

2019-10-15 Thread Alberto Garcia
Ideally it should be possible to zero individual subclusters using this function, but this is currently not implemented. Signed-off-by: Alberto Garcia --- block/qcow2.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index c54278ab0b..2eb032aed7 100644 ---

[RFC PATCH 17/23] qcow2: Add subcluster support to check_refcounts_l2()

2019-10-15 Thread Alberto Garcia
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an image has subclusters. Instead, the individual 'all zeroes' bits must be used. Signed-off-by: Alberto Garcia --- block/qcow2-refcount.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/block/qcow2-refc

[RFC PATCH 14/23] qcow2: Add subcluster support to qcow2_get_cluster_offset()

2019-10-15 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. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.

[RFC PATCH 21/23] qcow2: Add subcluster support to handle_alloc_space()

2019-10-15 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

[RFC PATCH 13/23] qcow2: Add subcluster support to calculate_l2_meta()

2019-10-15 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: - If the cluster is new, then subclusters #0 to #3 from the old cluster must be copied into the

Re: [PULL 0/2] Tracing patches

2019-10-15 Thread Philippe Mathieu-Daudé
On 10/15/19 2:24 PM, Peter Maydell wrote: On Mon, 14 Oct 2019 at 09:57, Stefan Hajnoczi wrote: The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d: Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2019-10-08 16:08:35 +0100) are

Re: [RFC PATCH 23/23] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2019-10-15 Thread Eric Blake
On 10/15/19 10:23 AM, Alberto Garcia wrote: 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 --- +++ b/qapi/block-core.json @@ -85,6

Re: [PATCH] blockdev: Use error_report() in hmp_commit()

2019-10-15 Thread Philippe Mathieu-Daudé
On 10/15/19 2:39 PM, Kevin Wolf wrote: Instead of using monitor_printf() to report errors, hmp_commit() should use error_report() like other places do. Signed-off-by: Kevin Wolf --- blockdev.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/blockdev.c b/blockdev.c

Re: [PULL 0/2] Tracing patches

2019-10-15 Thread Peter Maydell
On Tue, 15 Oct 2019 at 16:38, Philippe Mathieu-Daudé wrote: > > On 10/15/19 2:24 PM, Peter Maydell wrote: > > On Mon, 14 Oct 2019 at 09:57, Stefan Hajnoczi wrote: > >> > >> The following changes since commit > >> 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d: > >> > >>Merge remote-tracking branch

Re: [RFC PATCH 00/23] Add subcluster allocation to qcow2

2019-10-15 Thread Eric Blake
On 10/15/19 10:23 AM, Alberto Garcia wrote: Hi, this series adds a new feature to the qcow2 on-disk format called "Extended L2 Entries", which allows us to do subcluster allocation. This cover letter explains the reasons behind this proposal, the changes to the on-disk format, test results and

[PATCH] qemu-options.hx: Update for reboot-timeout parameter

2019-10-15 Thread Han Han
Since ee5d0f89d, -1 is not valid for the value of reboot-timeout. Update that in qemu-options doc. Signed-off-by: Han Han --- qemu-options.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 793d70ff..6b92a916 100644 --- a/qemu-optio

Re: [PULL 00/15] Block layer patches

2019-10-15 Thread Peter Maydell
On Mon, 14 Oct 2019 at 17:03, Kevin Wolf wrote: > > The following changes since commit 22dbfdecc3c52228d3489da3fe81da92b21197bf: > > Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20191010.0' > into staging (2019-10-14 15:09:08 +0100) > > are available in the Git repository at:

Re: [PATCH v2 1/2] nbd: Don't send oversize strings

2019-10-15 Thread Vladimir Sementsov-Ogievskiy
15.10.2019 18:07, Eric Blake wrote: > On 10/11/19 2:32 AM, Vladimir Sementsov-Ogievskiy wrote: >> 11.10.2019 0:00, Eric Blake wrote: >>> Qemu as server currently won't accept export names larger than 256 >>> bytes, nor create dirty bitmap names longer than 1023 bytes, so most >>> uses of qemu as cl

[PATCH 01/32] hw/i386: Remove obsolete LoadStateHandler::load_state_old handlers

2019-10-15 Thread Philippe Mathieu-Daudé
These devices implemented their load_state_old() handler 10 years ago, previous to QEMU v0.12. Since commit cc425b5ddf removed the pc-0.10 and pc-0.11 machines, we can drop this code. Note: the mips_r4k machine started to use the i8254 device just after QEMU v0.5.0, but the MIPS machine types are

[PATCH 02/32] hw/i386/pc: Move kvm_i8259_init() declaration to sysemu/kvm.h

2019-10-15 Thread Philippe Mathieu-Daudé
Move the KVM-related call to "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 1 - include/sysemu/kvm.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 6df4f4b6fb..09e74e7764 100644 --- a/includ

[PATCH 00/32] hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge

2019-10-15 Thread Philippe Mathieu-Daudé
Hi, This series is a rework of "piix4: cleanup and improvements" [1] from Hervé, and my "remove i386/pc dependency: PIIX cleanup" [2]. Still trying to remove the strong X86/PC dependency 2 years later, one step at a time. Here we split the PIIX3 southbridge from i440FX northbridge. The i440FX nor

[PATCH 04/32] mc146818rtc: Move RTC_ISA_IRQ definition

2019-10-15 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé The ISA default number for the RTC devices is not related to its registers neither. Move this definition to "hw/timer/mc146818rtc.h". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/timer/mc146818rtc.h | 2 ++ include/hw/timer/mc146818rtc_regs.h | 2 -- t

[PATCH 05/32] mc146818rtc: Include "mc146818rtc_regs.h" directly in mc146818rtc.c

2019-10-15 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Devices/boards wanting to use the MC146818 RTC don't need the knowledge its internal registers. Move the "mc146818rtc_regs.h" inclusion to mc146818rtc.c where it is required. We can not move this file from include/hw/timer/ to hw/timer/ for local inclusion because th

[PATCH 07/32] MAINTAINERS: Keep PIIX4 South Bridge separate from PC Chipsets

2019-10-15 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé The PIIX4 Southbridge is not used by the PC machine, but by the Malta board (MIPS). Add a new section to keep it covered. Suggested-by: Michael S. Tsirkin Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 7 ++- 1 file changed, 6 insertions(+), 1 deletio

[PATCH 03/32] mc146818rtc: move structure to header file

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau We are now able to embed a timer in another object. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20171216090228.28505-4-hpous...@reactos.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/timer/mc146818rtc.c

Re: [PATCH 01/32] hw/i386: Remove obsolete LoadStateHandler::load_state_old handlers

2019-10-15 Thread Philippe Mathieu-Daudé
I forgot to Cc David and Daniel for this one. On 10/15/19 6:26 PM, Philippe Mathieu-Daudé wrote: These devices implemented their load_state_old() handler 10 years ago, previous to QEMU v0.12. Since commit cc425b5ddf removed the pc-0.10 and pc-0.11 machines, we can drop this code. Note: the mips

[PATCH 06/32] mc146818rtc: always register rtc to rtc list

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau We are not required anymore to use rtc_init() function. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20171216090228.28505-5-hpous...@reactos.org> [PMD: rebased, fix OBJECT() value] Signed-off-by: Philippe Mathieu-Daud

[PATCH 08/32] piix4: rename some variables in realize function

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau PIIX4 structure is now 's' PCI device is now 'pci_dev' DeviceState is now 'dev' Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20171216090228.28505-6-hpous...@reactos.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/

[PATCH 12/32] piix4: rename PIIX4 object to piix4-isa

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau Other piix4 parts are already named piix4-ide and piix4-usb-uhci. Reviewed-by: Philippe Mathieu-Daudé Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20171216090228.28505-15-hpous...@reactos.org> [PMD: rebased] Signed-o

[PATCH 14/32] piix4: add a i8257 dma controller as specified in datasheet

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau Remove i8257 instanciated in malta board, to not have it twice. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20171216090228.28505-9-hpous...@reactos.org> [PMD: rebased] Signed-off-by: Philippe Mathieu-Daudé --- hw/i

[PATCH 10/32] piix4: add a i8259 interrupt controller as specified in datasheet

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau Add ISA irqs as piix4 gpio in, and CPU interrupt request as piix4 gpio out. Remove i8259 instanciated in malta board, to not have it twice. We can also remove the now unused piix4_init() function. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé

[PATCH 09/32] piix4: add Reset Control Register

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau The RCR I/O port (0xcf9) is used to generate a hard reset or a soft reset. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20171216090228.28505-7-hpous...@reactos.org> [PMD: rebased, updated includes] Signed-off-by: Phil

[PATCH 13/32] piix4: convert reset function to QOM

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20180106153730.30313-15-hpous...@reactos.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH 16/32] piix4: add a mc146818rtc controller as specified in datasheet

2019-10-15 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Remove mc146818rtc instanciated in malta board, to not have it twice. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20171216090228.28505-13-hpous...@reactos.org> [PMD: rebased, set RTC base_year to 2000] Signed-o

[PATCH 11/32] Revert "irq: introduce qemu_irq_proxy()"

2019-10-15 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé This function isn't used anymore. This reverts commit 22ec3283efba9ba0792790da786d6776d83f2a92. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/irq.c| 14 -- include/hw/irq.h | 5 - 2 files changed, 19 deletions(-) diff --git a/hw/core/irq.

[PATCH 15/32] piix4: add a i8254 pit controller as specified in datasheet

2019-10-15 Thread Philippe Mathieu-Daudé
From: Hervé Poussineau Remove i8254 instanciated in malta board, to not have it twice. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20171216090228.28505-10-hpous...@reactos.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c

[PATCH 18/32] hw/mips/mips_malta: Extract the PIIX4 creation code as piix4_create()

2019-10-15 Thread Philippe Mathieu-Daudé
The Malta board instantiate a PIIX4 chipset doing various calls. Refactor all those related calls into a single function: piix4_create(). Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/mips_malta.c | 47 +++- 1 file changed, 29 insertions(+), 18 deletio

[PATCH 19/32] hw/isa/piix4: Move piix4_create() to hw/isa/piix4.c

2019-10-15 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Now that we properly refactored the piix4_create() function, let's move it to hw/isa/piix4.c where it belongs, so it can be reused on other places. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c| 30 ++ hw/mips/

[PATCH 27/32] hw/pci-host/piix: Define and use the PIIX IRQ Route Control Registers

2019-10-15 Thread Philippe Mathieu-Daudé
The IRQ Route Control registers definitions belong to the PIIX chipset. We were only defining the 'A' register. Define the other B, C and D registers, and use them. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/xen/xen-hvm.c | 5 +++-- hw/mips/gt64xxx_pci.c | 4 ++-- hw/pci-h

[PATCH 17/32] hw/mips/mips_malta: Create IDE hard drive array dynamically

2019-10-15 Thread Philippe Mathieu-Daudé
In the next commit we'll refactor the PIIX4 code out of mips_malta_init(). As a preliminary step, add the 'ide_drives' variable and create the drive array dynamically. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/mips_malta.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) dif

[PATCH 23/32] hw/i386/pc: Extract pc_i8259_create()

2019-10-15 Thread Philippe Mathieu-Daudé
The i8259 creation code is common to all PC machines, extract the common code. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 19 +++ hw/i386/pc_piix.c| 13 + hw/i386/pc_q35.c | 14 +- include/hw/i386/pc.h | 1 + 4 files changed,

[PATCH 20/32] hw/i386/pc: Extract pc_gsi_create()

2019-10-15 Thread Philippe Mathieu-Daudé
The GSI creation code is common to all PC machines, extract the common code. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 15 +++ hw/i386/pc_piix.c| 9 + hw/i386/pc_q35.c | 9 + include/hw/i386/pc.h | 2 ++ 4 files changed, 19 insertions

[PATCH 21/32] hw/i386/pc: Reduce gsi_handler scope

2019-10-15 Thread Philippe Mathieu-Daudé
pc_gsi_create() is the single function that uses gsi_handler. Make it a static variable. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 2 +- include/hw/i386/pc.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index a7597c6c44.

[PATCH 25/32] hw/pci-host/piix: Extract piix3_create()

2019-10-15 Thread Philippe Mathieu-Daudé
Extract the PIIX3 creation code from the i440fx_init() function. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/piix.c | 51 -- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 2f4cbcb

[PATCH 24/32] hw/i386/pc: Remove kvm_i386.h include

2019-10-15 Thread Philippe Mathieu-Daudé
By extracting pc_gsi_create() and pc_i8259_create() we removed the access to "kvm_i386.h" from the machine code. We can now remove it. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 1 - hw/i386/pc_q35.c | 1 - 2 files changed, 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/

[PATCH 22/32] hw/i386/pc: Move gsi_state creation code

2019-10-15 Thread Philippe Mathieu-Daudé
The block code related to IRQ start few lines later. Move the comment and the pc_gsi_create() call where we start to use the IRQs. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_q35.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q3

[PATCH 26/32] hw/pci-host/piix: Move RCR_IOPORT register definition

2019-10-15 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé The RCR_IOPORT register belongs to the PIIX chipset. Move the definition to "piix.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/piix.c| 1 + include/hw/i386/pc.h | 6 -- include/hw/southbridge/piix.h | 6 ++ 3 files changed,

[PATCH 30/32] hw/pci-host/piix: Extract PIIX3 functions to hw/isa/piix3.c

2019-10-15 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Move all the PIIX3 functions to a new file: hw/isa/piix3.c. Signed-off-by: Philippe Mathieu-Daudé --- Checkpatch warning: ERROR: spaces required around that '*' (ctx:VxV) #312: FILE: hw/isa/piix3.c:248: +.subsections = (const VMStateDescription*[]) {

<    1   2   3   >