Re: [Qemu-devel] [PATCH v3 27/32] s390x/tcg: Provide probe_write_access helper

2019-03-07 Thread David Hildenbrand
On 07.03.19 15:10, Richard Henderson wrote:
> On 3/7/19 4:15 AM, David Hildenbrand wrote:
>> +void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,
>> +uintptr_t ra)
>> +{
>> +#ifdef CONFIG_USER_ONLY
>> +if (!h2g_valid(addr) || !h2g_valid(addr + len - 1)) {
>> +s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra);
>> +}
> 
> You need
> 
>   || page_check_range(addr, len, PAGE_WRITE) < 0
> 
> as well.

Indeed, thanks.

So it should be


+void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,
+uintptr_t ra)
+{
+#ifdef CONFIG_USER_ONLY
+if (!h2g_valid(addr) || !h2g_valid(addr + len - 1) ||
+page_check_range(addr, len, PAGE_WRITE) < 0) {
+s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra);
+}
+#else
+/* test the actual access, not just any access to the page due to LAP */
+while (len) {
+const uint64_t pagelen = -(addr | -TARGET_PAGE_MASK);
+const uint64_t curlen = MIN(pagelen, len);
+
+probe_write(env, addr, curlen, cpu_mmu_index(env, false), ra);
+addr = wrap_address(env, addr + curlen);
+len -= curlen;
+}
+#endif
+}

Conny, I can resend if you don't feel like fixing up (or there is more to do).

-- 

Thanks,

David / dhildenb



[Qemu-devel] [PATCH v4 3/4] qemu-iotests: Improve portability by searching bash in the $PATH

2019-03-07 Thread Philippe Mathieu-Daudé
Bash is not always installed as /bin/bash. In particular on OpenBSD,
the package installs it in /usr/local/bin.
Use the 'env' shebang to search bash in the $PATH.

Patch created mechanically by running:

  $ git grep -lE '#! ?/bin/bash' -- tests/qemu-iotests \
| while read f; do \
  sed -i 's|^#!.\?/bin/bash$|#!/usr/bin/env bash|' $f; \
done

Reviewed-by: Eric Blake 
Signed-off-by: Philippe Mathieu-Daudé 
---
 tests/qemu-iotests/001| 2 +-
 tests/qemu-iotests/002| 2 +-
 tests/qemu-iotests/003| 2 +-
 tests/qemu-iotests/004| 2 +-
 tests/qemu-iotests/005| 2 +-
 tests/qemu-iotests/007| 2 +-
 tests/qemu-iotests/008| 2 +-
 tests/qemu-iotests/009| 2 +-
 tests/qemu-iotests/010| 2 +-
 tests/qemu-iotests/011| 2 +-
 tests/qemu-iotests/012| 2 +-
 tests/qemu-iotests/013| 2 +-
 tests/qemu-iotests/014| 2 +-
 tests/qemu-iotests/015| 2 +-
 tests/qemu-iotests/017| 2 +-
 tests/qemu-iotests/018| 2 +-
 tests/qemu-iotests/019| 2 +-
 tests/qemu-iotests/020| 2 +-
 tests/qemu-iotests/021| 2 +-
 tests/qemu-iotests/022| 2 +-
 tests/qemu-iotests/023| 2 +-
 tests/qemu-iotests/024| 2 +-
 tests/qemu-iotests/025| 2 +-
 tests/qemu-iotests/026| 2 +-
 tests/qemu-iotests/027| 2 +-
 tests/qemu-iotests/028| 2 +-
 tests/qemu-iotests/029| 2 +-
 tests/qemu-iotests/031| 2 +-
 tests/qemu-iotests/032| 2 +-
 tests/qemu-iotests/033| 2 +-
 tests/qemu-iotests/034| 2 +-
 tests/qemu-iotests/035| 2 +-
 tests/qemu-iotests/036| 2 +-
 tests/qemu-iotests/037| 2 +-
 tests/qemu-iotests/038| 2 +-
 tests/qemu-iotests/039| 2 +-
 tests/qemu-iotests/042| 2 +-
 tests/qemu-iotests/043| 2 +-
 tests/qemu-iotests/046| 2 +-
 tests/qemu-iotests/047| 2 +-
 tests/qemu-iotests/048| 2 +-
 tests/qemu-iotests/049| 2 +-
 tests/qemu-iotests/050| 2 +-
 tests/qemu-iotests/051| 2 +-
 tests/qemu-iotests/052| 2 +-
 tests/qemu-iotests/053| 2 +-
 tests/qemu-iotests/054| 2 +-
 tests/qemu-iotests/058| 2 +-
 tests/qemu-iotests/059| 2 +-
 tests/qemu-iotests/060| 2 +-
 tests/qemu-iotests/061| 2 +-
 tests/qemu-iotests/062| 2 +-
 tests/qemu-iotests/063| 2 +-
 tests/qemu-iotests/064| 2 +-
 tests/qemu-iotests/066| 2 +-
 tests/qemu-iotests/067| 2 +-
 tests/qemu-iotests/068| 2 +-
 tests/qemu-iotests/069| 2 +-
 tests/qemu-iotests/070| 2 +-
 tests/qemu-iotests/071| 2 +-
 tests/qemu-iotests/072| 2 +-
 tests/qemu-iotests/073| 2 +-
 tests/qemu-iotests/074| 2 +-
 tests/qemu-iotests/075| 2 +-
 tests/qemu-iotests/076| 2 +-
 tests/qemu-iotests/077| 2 +-
 tests/qemu-iotests/078| 2 +-
 tests/qemu-iotests/079| 2 +-
 tests/qemu-iotests/080| 2 +-
 tests/qemu-iotests/081| 2 +-
 tests/qemu-iotests/082| 2 +-
 tests/qemu-iotests/083| 2 +-
 tests/qemu-iotests/084| 2 +-
 tests/qemu-iotests/085| 2 +-
 tests/qemu-iotests/086| 2 +-
 tests/qemu-iotests/087| 2 +-
 tests/qemu-iotests/088| 2 +-
 tests/qemu-iotests/089| 2 +-
 tests/qemu-iotests/090| 2 +-
 tests/qemu-iotests/091| 2 +-
 tests/qemu-iotests/092| 2 +-
 tests/qemu-iotests/094| 2 +-
 tests/qemu-iotests/095| 2 +-
 tests/qemu-iotests/097| 2 +-
 tests/qemu-iotests/098| 2 +-
 tests/qemu-iotests/099| 2 +-
 tests/qemu-iotests/101| 2 +-
 tests/qemu-iotests/102| 2 +-
 tests/qemu-iotests/103| 2 +-
 tests/qemu-iotests/104| 2 +-
 tests/qemu-iotests/105| 2 +-
 tests/qemu-iotests/106| 2 +-
 tests/qemu-iotests/107| 2 +-
 tests/qemu-iotests/108| 2 +-
 tests/qemu-iotests/109| 2 +-
 tests/qemu-iotests/110| 2 +-
 tests/qemu-iotests/111| 2 +-
 tests/qemu-iotests/112| 2 +-
 tests/qemu-iotests/113| 2 +-
 tests/qemu-iotests/114| 2 +-
 tests/qemu-iotests/115| 2 +-
 tests/qemu-iotests/116| 2 +-
 tests/qemu-iotests/117| 2 +-
 tests/qemu-iotests/119| 2 +-
 tests/qemu-iotests/120| 2 +-
 tests/qemu-iotests/121| 2 +-
 tests/qemu-iotests/122| 2 +-
 tests/qemu-iotests/123| 2 +-
 tests/qemu-iotests/125| 

Re: [Qemu-devel] [PATCH v5 2/2] Add Nios II semihosting support.

2019-03-07 Thread Peter Maydell
On Wed, 13 Feb 2019 at 04:02, Sandra Loosemore  wrote:
>
> This patch adds support for libgloss semihosting to Nios II bare-metal
> emulation.
>
> Signed-off-by: Sandra Loosemore 
> Signed-off-by: Julian Brown 

Do you have a link to the spec that defines this semihosting
ABI, please ?

thanks
-- PMM



[Qemu-devel] [PATCH v4 2/4] tests/bios-tables: Improve portability by searching bash in the $PATH

2019-03-07 Thread Philippe Mathieu-Daudé
Bash is not always installed as /bin/bash. In particular on OpenBSD,
the package installs it in /usr/local/bin.
Use the 'env' shebang to search bash in the $PATH.

Reviewed-by: Kamil Rytarowski 
Reviewed-by: Igor Mammedov 
Reviewed-by: Michael S. Tsirkin 
Signed-off-by: Philippe Mathieu-Daudé 
---
 tests/data/acpi/rebuild-expected-aml.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/data/acpi/rebuild-expected-aml.sh 
b/tests/data/acpi/rebuild-expected-aml.sh
index bf9ba242ad..abdff70a0d 100755
--- a/tests/data/acpi/rebuild-expected-aml.sh
+++ b/tests/data/acpi/rebuild-expected-aml.sh
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/usr/bin/env bash
 
 #
 # Rebuild expected AML files for acpi unit-test
-- 
2.20.1




Re: [Qemu-devel] [PATCH v3 0/2] OpenBSD: Let QEMU 4.0 be usable from OpenBSD 6.0 and onwards

2019-03-07 Thread Daniel P . Berrangé
On Thu, Mar 07, 2019 at 03:28:20PM +0100, Philippe Mathieu-Daudé wrote:
> Since OpenBSD 6.0, the W^X protection is enforced by default.
> TCG is incompatible with this protection, to be able to use the
> QEMU binary, this protection has to be disabled.
> The OpenBSD ports seens to have downstream patches to be able to
> use QEMU, but these patches were never upstreamed.
> This series allow to run QEMU when built from the mainstream sources.
> 
> I salvaged the minimum patches required to be able to run OpenBSD
> from a previous series, which aimed at running the QEMU QTest suite
> on OpenBSD. Sadly it seems there is not much interest in having this
> OS covered by tests (except by Peter Maydell).

What were the blocking issues with getting the test fixes accepted in
previous postings ?  Was it simply no one interested in reviewing it
or actual review problems ?

With our increased interest in CI & push to drop build targets which
are not actively maintained, I'd question whether OpenBSD (or any
build target in the same situation) should continue to be supported
if the test suite hasn't worked for several releases in a row & not
enough people are willing to contribute to fix it.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|



[Qemu-devel] [PATCH 8/9] target/arm: Use extract2 for EXTR

2019-03-07 Thread Richard Henderson
This is, after all, how we implement extract2 in tcg/aarc64.

Cc: qemu-...@nongnu.org
Cc: Peter Maydell 
Signed-off-by: Richard Henderson 
---
 target/arm/translate-a64.c | 38 --
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 1959046343..54fe94c436 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -4114,25 +4114,27 @@ static void disas_extract(DisasContext *s, uint32_t 
insn)
 } else {
 tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm));
 }
-} else if (rm == rn) { /* ROR */
-tcg_rm = cpu_reg(s, rm);
-if (sf) {
-tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm);
-} else {
-TCGv_i32 tmp = tcg_temp_new_i32();
-tcg_gen_extrl_i64_i32(tmp, tcg_rm);
-tcg_gen_rotri_i32(tmp, tmp, imm);
-tcg_gen_extu_i32_i64(tcg_rd, tmp);
-tcg_temp_free_i32(tmp);
-}
 } else {
-tcg_rm = read_cpu_reg(s, rm, sf);
-tcg_rn = read_cpu_reg(s, rn, sf);
-tcg_gen_shri_i64(tcg_rm, tcg_rm, imm);
-tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm);
-tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn);
-if (!sf) {
-tcg_gen_ext32u_i64(tcg_rd, tcg_rd);
+tcg_rm = cpu_reg(s, rm);
+tcg_rn = cpu_reg(s, rn);
+
+if (sf) {
+/* Specialization to ROR happens in EXTRACT2.  */
+tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm);
+} else {
+TCGv_i32 t0 = tcg_temp_new_i32();
+
+tcg_gen_extrl_i64_i32(t0, tcg_rm);
+if (rm == rn) {
+tcg_gen_rotri_i32(t0, t0, imm);
+} else {
+TCGv_i32 t1 = tcg_temp_new_i32();
+tcg_gen_extrl_i64_i32(t1, tcg_rn);
+tcg_gen_extract2_i32(t0, t0, t1, imm);
+tcg_temp_free_i32(t1);
+}
+tcg_gen_extu_i32_i64(tcg_rd, t0);
+tcg_temp_free_i32(t0);
 }
 }
 }
-- 
2.17.2




[Qemu-devel] [PATCH v4 0/4] tests: Allow use of Ports bash and GNU sed extensions

2019-03-07 Thread Philippe Mathieu-Daudé
Hi Thomas,

This series contains few script cleanups which help to
run tests on OpenBSD.
Note, this is a split of the previous series, here restricted
to tests/.

Since v3:
- Do not use space in shebang (21st century update from Thomas)
- Added R-b

Since v2:
- Addressed Eric's comments (in code and commit descriptions)
- Added R-b

v3: https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg00943.html
v2: https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg07513.html

Philippe Mathieu-Daudé (4):
  tests/multiboot: Improve portability by searching bash in the $PATH
  tests/bios-tables: Improve portability by searching bash in the $PATH
  qemu-iotests: Improve portability by searching bash in the $PATH
  qemu-iotests: Ensure GNU sed is used

 tests/data/acpi/rebuild-expected-aml.sh |  2 +-
 tests/multiboot/run_test.sh |  2 +-
 tests/qemu-iotests/001  |  2 +-
 tests/qemu-iotests/002  |  2 +-
 tests/qemu-iotests/003  |  2 +-
 tests/qemu-iotests/004  |  2 +-
 tests/qemu-iotests/005  |  2 +-
 tests/qemu-iotests/007  |  2 +-
 tests/qemu-iotests/008  |  2 +-
 tests/qemu-iotests/009  |  2 +-
 tests/qemu-iotests/010  |  2 +-
 tests/qemu-iotests/011  |  2 +-
 tests/qemu-iotests/012  |  2 +-
 tests/qemu-iotests/013  |  2 +-
 tests/qemu-iotests/014  |  2 +-
 tests/qemu-iotests/015  |  2 +-
 tests/qemu-iotests/017  |  2 +-
 tests/qemu-iotests/018  |  2 +-
 tests/qemu-iotests/019  |  2 +-
 tests/qemu-iotests/020  |  2 +-
 tests/qemu-iotests/021  |  2 +-
 tests/qemu-iotests/022  |  2 +-
 tests/qemu-iotests/023  |  2 +-
 tests/qemu-iotests/024  |  2 +-
 tests/qemu-iotests/025  |  2 +-
 tests/qemu-iotests/026  |  2 +-
 tests/qemu-iotests/027  |  2 +-
 tests/qemu-iotests/028  |  2 +-
 tests/qemu-iotests/029  |  2 +-
 tests/qemu-iotests/031  |  2 +-
 tests/qemu-iotests/032  |  2 +-
 tests/qemu-iotests/033  |  2 +-
 tests/qemu-iotests/034  |  2 +-
 tests/qemu-iotests/035  |  2 +-
 tests/qemu-iotests/036  |  2 +-
 tests/qemu-iotests/037  |  2 +-
 tests/qemu-iotests/038  |  2 +-
 tests/qemu-iotests/039  |  2 +-
 tests/qemu-iotests/042  |  2 +-
 tests/qemu-iotests/043  |  2 +-
 tests/qemu-iotests/046  |  2 +-
 tests/qemu-iotests/047  |  2 +-
 tests/qemu-iotests/048  |  2 +-
 tests/qemu-iotests/049  |  2 +-
 tests/qemu-iotests/050  |  2 +-
 tests/qemu-iotests/051  |  2 +-
 tests/qemu-iotests/052  |  2 +-
 tests/qemu-iotests/053  |  2 +-
 tests/qemu-iotests/054  |  2 +-
 tests/qemu-iotests/058  |  2 +-
 tests/qemu-iotests/059  |  2 +-
 tests/qemu-iotests/060  |  2 +-
 tests/qemu-iotests/061  |  2 +-
 tests/qemu-iotests/062  |  2 +-
 tests/qemu-iotests/063  |  2 +-
 tests/qemu-iotests/064  |  2 +-
 tests/qemu-iotests/066  |  2 +-
 tests/qemu-iotests/067  |  2 +-
 tests/qemu-iotests/068  |  2 +-
 tests/qemu-iotests/069  |  2 +-
 tests/qemu-iotests/070  |  2 +-
 tests/qemu-iotests/071  |  2 +-
 tests/qemu-iotests/072  |  2 +-
 tests/qemu-iotests/073  |  2 +-
 tests/qemu-iotests/074  |  2 +-
 tests/qemu-iotests/075  |  2 +-
 tests/qemu-iotests/076  |  2 +-
 tests/qemu-iotests/077  |  2 +-
 tests/qemu-iotests/078  |  2 +-
 tests/qemu-iotests/079  |  2 +-
 tests/qemu-iotests/080  |  2 +-
 tests/qemu-iotests/081  |  2 +-
 tests/qemu-iotests/082  |  2 +-
 tests/qemu-iotests/083  |  2 +-
 tests/qemu-iotests/084  |  2 +-
 tests/qemu-iotests/085  |  2 +-
 tests/qemu-iotests/086  |  2 +-
 tests/qemu-iotests/087  |  2 +-
 tests/qemu-iotests/088  |  2 +-
 tests/qemu-iotests/089  |  2 +-
 tests/qemu-iotests/090  |  2 +-
 tests/qemu-iotests/091  |  2 +-
 tests/qemu-iotests/092  |  2 +-
 tests/qemu-iotests/094  |  2 +-
 tests/qemu-iotests/095  |  2 +-
 tests/qemu-iotests/097  |  2 +-
 tests/qemu-iotests/098 

[Qemu-devel] [PATCH v3 1/2] oslib-posix: Ignore fcntl("/dev/null", F_SETFL, O_NONBLOCK) failure

2019-03-07 Thread Philippe Mathieu-Daudé
Previous to OpenBSD 6.3 [1], fcntl(F_SETFL) is not permitted on
memory devices.
Trying this call sets errno to ENODEV ("not a memory device"):

  19 ENODEV Operation not supported by device.
An attempt was made to apply an inappropriate function to a device,
for example, trying to read a write-only device such as a printer.

Do not assert fcntl failures in this specific case (errno set to ENODEV)
on OpenBSD. This fixes:

  $ lm32-softmmu/qemu-system-lm32
  assertion "f != -1" failed: file "util/oslib-posix.c", line 247, function 
"qemu_set_nonblock"
  Abort trap (core dumped)

[1] The fix seems https://github.com/openbsd/src/commit/c2a35b387f9d3c
  "fcntl(F_SETFL) invokes the FIONBIO and FIOASYNC ioctls internally, so
  the memory devices (/dev/null, /dev/zero, etc) need to permit them."

Reviewed-by: Peter Maydell 
Reviewed-by: Michael S. Tsirkin 
Signed-off-by: Philippe Mathieu-Daudé 
---
 util/oslib-posix.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 37c5854b9c..326d92dcd2 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -244,7 +244,19 @@ void qemu_set_nonblock(int fd)
 f = fcntl(fd, F_GETFL);
 assert(f != -1);
 f = fcntl(fd, F_SETFL, f | O_NONBLOCK);
+#ifdef __OpenBSD__
+if (f == -1) {
+/*
+ * Previous to OpenBSD 6.3, fcntl(F_SETFL) is not permitted on
+ * memory devices and sets errno to ENODEV.
+ * It's OK if we fail to set O_NONBLOCK on devices like /dev/null,
+ * because they will never block anyway.
+ */
+assert(errno == ENODEV);
+}
+#else
 assert(f != -1);
+#endif
 }
 
 int socket_set_fast_reuse(int fd)
-- 
2.20.1




Re: [Qemu-devel] [multiprocess RFC PATCH 36/37] multi-process: add the concept description to docs/devel/qemu-multiprocess

2019-03-07 Thread Thomas Huth
On 07/03/2019 15.40, Konrad Rzeszutek Wilk wrote:
> On Thu, Mar 07, 2019 at 03:21:47PM +0100, Thomas Huth wrote:
>> On 07/03/2019 15.16, Kevin Wolf wrote:
>>> Am 07.03.2019 um 09:14 hat Thomas Huth geschrieben:
 On 07/03/2019 08.22, elena.ufimts...@oracle.com wrote:
> From: Elena Ufimtseva 
>
> TODO: Make relevant changes to the doc.
>
> Signed-off-by: John G Johnson 
> Signed-off-by: Elena Ufimtseva 
> Signed-off-by: Jagannathan Raman 
> ---
>  docs/devel/qemu-multiprocess.txt | 1109 
> ++
>  1 file changed, 1109 insertions(+)
>  create mode 100644 docs/devel/qemu-multiprocess.txt
>
> diff --git a/docs/devel/qemu-multiprocess.txt 
> b/docs/devel/qemu-multiprocess.txt
> new file mode 100644
> index 000..e29c6c8
> --- /dev/null
> +++ b/docs/devel/qemu-multiprocess.txt
> @@ -0,0 +1,1109 @@
> +/*
> + * Copyright 2019, Oracle and/or its affiliates. All rights reserved.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining 
> a copy
> + * of this software and associated documentation files (the "Software"), 
> to deal
> + * in the Software without restriction, including without limitation the 
> rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or 
> sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be 
> included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
> ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS IN
> + * THE SOFTWARE.
> + */

 Somehow weird to see such a big license statement talking about
 "software", but which applies to a text file only... Not sure if it is
 an option for you, but maybe one of the Creative Common licenses
 (dual-licensed with the GPLv2+) would be a better fit? E.g. for the QEMU
 website, the content is dual-licensed: https://www.qemu.org/license.html
>>>
>>> While we're talking about licenses, the "All rights reserved." notice is
>>> out of place in a license header that declares that a lot of permissions
>>> are granted. Better to remove it to avoid any ambiguities that could
>>> result from the contradiction. (Applies to the whole series.)
>>
>> Apart from that, it is also not required for other work anymore. See:
>>
>> https://en.wikipedia.org/wiki/All_rights_reserved
> 
> Interesting. Do folks know why the Linux Foundation does it?
> 
> See for example cf0d37aecc06801d4847fb36740da4a5690d9d45 (in the Linux kernel)
> where every change they stamp it with their 'All Rights Reserved'?

No clue why they use it. Seems unnecessary to me. But as always: IANAL

 Thomas



[Qemu-devel] [PATCH 9/9] target/arm: Simplify BFXIL expansion

2019-03-07 Thread Richard Henderson
The mask implied by the extract is redundant with the one
implied by the deposit.  Also, fix spelling of BFXIL.

Cc: qemu-...@nongnu.org 
Cc: Peter Maydell  
Signed-off-by: Richard Henderson 
---
 target/arm/translate-a64.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 54fe94c436..39e0512d21 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -4043,8 +4043,8 @@ static void disas_bitfield(DisasContext *s, uint32_t insn)
 tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len);
 return;
 }
-/* opc == 1, BXFIL fall through to deposit */
-tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len);
+/* opc == 1, BFXIL fall through to deposit */
+tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri);
 pos = 0;
 } else {
 /* Handle the ri > si case with a deposit
@@ -4062,7 +4062,7 @@ static void disas_bitfield(DisasContext *s, uint32_t insn)
 len = ri;
 }
 
-if (opc == 1) { /* BFM, BXFIL */
+if (opc == 1) { /* BFM, BFXIL */
 tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len);
 } else {
 /* SBFM or UBFM: We start with zero, and we haven't modified
-- 
2.17.2




[Qemu-devel] [PATCH v4 29/29] hw/arm: Remove hard-enablement of the remaining PCI devices

2019-03-07 Thread Thomas Huth
The PCI devices should be pulled in by default if PCI_DEVICES
is set, so there is no need anymore to enforce them in the configs
file.

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 8 
 1 file changed, 8 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index ee95cc0..6b1f6a8 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -33,14 +33,6 @@ CONFIG_DIGIC=y
 CONFIG_SABRELITE=y
 CONFIG_EMCRAFT_SF2=y
 CONFIG_MICROBIT=y
-
-CONFIG_VGA=y
-
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
-
-CONFIG_PCIE_PORT=y
-CONFIG_XIO3130=y
-CONFIG_IOH3420=y
-CONFIG_I82801B11=y
-- 
1.8.3.1




[Qemu-devel] [PATCH 6/9] tcg/arm: Support INDEX_op_extract2_i32

2019-03-07 Thread Richard Henderson
Signed-off-by: Richard Henderson 
---
 tcg/arm/tcg-target.h |  2 +-
 tcg/arm/tcg-target.inc.c | 25 +
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
index 4ee6c98958..17e771374d 100644
--- a/tcg/arm/tcg-target.h
+++ b/tcg/arm/tcg-target.h
@@ -116,7 +116,7 @@ extern bool use_idiv_instructions;
 #define TCG_TARGET_HAS_deposit_i32  use_armv7_instructions
 #define TCG_TARGET_HAS_extract_i32  use_armv7_instructions
 #define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions
-#define TCG_TARGET_HAS_extract2_i32 0
+#define TCG_TARGET_HAS_extract2_i32 1
 #define TCG_TARGET_HAS_movcond_i32  1
 #define TCG_TARGET_HAS_mulu2_i321
 #define TCG_TARGET_HAS_muls2_i321
diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c
index 2245a8aeb9..6873b0cf95 100644
--- a/tcg/arm/tcg-target.inc.c
+++ b/tcg/arm/tcg-target.inc.c
@@ -2064,6 +2064,27 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode 
opc,
 case INDEX_op_sextract_i32:
 tcg_out_sextract(s, COND_AL, args[0], args[1], args[2], args[3]);
 break;
+case INDEX_op_extract2_i32:
+/* ??? These optimization vs zero should be generic.  */
+/* ??? But we can't substitute 2 for 1 in the opcode stream yet.  */
+if (const_args[1]) {
+if (const_args[2]) {
+tcg_out_movi(s, TCG_TYPE_REG, args[0], 0);
+} else {
+tcg_out_dat_reg(s, COND_AL, ARITH_MOV, args[0], 0,
+args[2], SHIFT_IMM_LSL(32 - args[3]));
+}
+} else if (const_args[2]) {
+tcg_out_dat_reg(s, COND_AL, ARITH_MOV, args[0], 0,
+args[1], SHIFT_IMM_LSR(args[3]));
+} else {
+/* We can do extract2 in 2 insns, vs the 3 required otherwise.  */
+tcg_out_dat_reg(s, COND_AL, ARITH_MOV, TCG_REG_TMP, 0,
+args[2], SHIFT_IMM_LSL(32 - args[3]));
+tcg_out_dat_reg(s, COND_AL, ARITH_ORR, args[0], TCG_REG_TMP,
+args[1], SHIFT_IMM_LSR(args[3]));
+}
+break;
 
 case INDEX_op_div_i32:
 tcg_out_sdiv(s, COND_AL, args[0], args[1], args[2]);
@@ -2108,6 +2129,8 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode 
op)
 = { .args_ct_str = { "s", "s", "s", "s" } };
 static const TCGTargetOpDef br
 = { .args_ct_str = { "r", "rIN" } };
+static const TCGTargetOpDef ext2
+= { .args_ct_str = { "r", "rZ", "rZ" } };
 static const TCGTargetOpDef dep
 = { .args_ct_str = { "r", "0", "rZ" } };
 static const TCGTargetOpDef movc
@@ -2174,6 +2197,8 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode 
op)
 return 
 case INDEX_op_deposit_i32:
 return 
+case INDEX_op_extract2_i32:
+return 
 case INDEX_op_movcond_i32:
 return 
 case INDEX_op_add2_i32:
-- 
2.17.2




Re: [Qemu-devel] [multiprocess RFC PATCH 36/37] multi-process: add the concept description to docs/devel/qemu-multiprocess

2019-03-07 Thread Daniel P . Berrangé
On Thu, Mar 07, 2019 at 02:26:09PM +, Stefan Hajnoczi wrote:
> On Wed, Mar 06, 2019 at 11:22:53PM -0800, elena.ufimts...@oracle.com wrote:
> > diff --git a/docs/devel/qemu-multiprocess.txt 
> > b/docs/devel/qemu-multiprocess.txt
> > new file mode 100644
> > index 000..e29c6c8
> > --- /dev/null
> > +++ b/docs/devel/qemu-multiprocess.txt
> 
> Thanks for this document and the interesting work that you are doing.
> I'd like to discuss the security advantages gained by disaggregating
> QEMU in more detail.
> 
> The security model for VMs managed by libvirt (most production x86, ppc,
> s390 guests) is that the QEMU process is untrusted and only has access
> to resources belonging to the guest.  SELinux is used to restrict the
> process from accessing other files, processes, etc on the host.

NB it doesn't have to be SELinux. Libvirt also supports AppArmor and
can even do isolation with traditional DAC by putting each QEMU under
a distinct UID/GID and having libvirtd set ownership on resources each
VM is permitted to use.

> QEMU does not hold privileged resources that must be kept away from the
> guest.  An escaped guest can access its image file, tap file descriptor,
> etc but they are the same resources it could already access via device
> emulation.
> 
> Can you give specific examples of how disaggregation improves security?

I guess one obvious answer is that the existing security mechanisms like
SELinux/ApArmor/DAC can be made to work in a more fine grained manner if
there are distinct processes. This would allow for a more useful seccomp
filter to better protect against secondary kernel exploits should QEMU
itself be exploited, if we can protect individual components.

Not everything is protected by MAC/DAC. For example network based disks
typically have a username + password for accessing the remote storage
server. Best practice would be a distinct username for every QEMU process
such that each can only access its own storage, but I don't know of any
app which does that. So ability to split off backends into separate
processes could limit exposure of information that is not otherwise
protected by current protection models.

Whether any of this is useful in practice depends on the degree to
which the individual disaggregated pieces of QEMU trust each other.
Effectively they would have to consider each other as untrusted,
so one compromised piece can't simply trigger its desired exploit
via the communication channel with another disaggregated piece.

The broadening of vhost-user support is useful with that in much the
same way I imagine.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|



[Qemu-devel] [PATCH 5/9] tcg/i386: Support INDEX_op_extract2_{i32, i64}

2019-03-07 Thread Richard Henderson
Signed-off-by: Richard Henderson 
---
 tcg/i386/tcg-target.h |  4 ++--
 tcg/i386/tcg-target.inc.c | 11 +++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index 2c58eaa9ed..241bf19413 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -124,7 +124,7 @@ extern bool have_avx2;
 #define TCG_TARGET_HAS_deposit_i32  1
 #define TCG_TARGET_HAS_extract_i32  1
 #define TCG_TARGET_HAS_sextract_i32 1
-#define TCG_TARGET_HAS_extract2_i32 0
+#define TCG_TARGET_HAS_extract2_i32 1
 #define TCG_TARGET_HAS_movcond_i32  1
 #define TCG_TARGET_HAS_add2_i32 1
 #define TCG_TARGET_HAS_sub2_i32 1
@@ -163,7 +163,7 @@ extern bool have_avx2;
 #define TCG_TARGET_HAS_deposit_i64  1
 #define TCG_TARGET_HAS_extract_i64  1
 #define TCG_TARGET_HAS_sextract_i64 0
-#define TCG_TARGET_HAS_extract2_i64 0
+#define TCG_TARGET_HAS_extract2_i64 1
 #define TCG_TARGET_HAS_movcond_i64  1
 #define TCG_TARGET_HAS_add2_i64 1
 #define TCG_TARGET_HAS_sub2_i64 1
diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c
index e0670e5098..1fa833840e 100644
--- a/tcg/i386/tcg-target.inc.c
+++ b/tcg/i386/tcg-target.inc.c
@@ -452,6 +452,7 @@ static inline int tcg_target_const_match(tcg_target_long 
val, TCGType type,
 #define OPC_SHUFPS  (0xc6 | P_EXT)
 #define OPC_SHLX(0xf7 | P_EXT38 | P_DATA16)
 #define OPC_SHRX(0xf7 | P_EXT38 | P_SIMDF2)
+#define OPC_SHRD_Ib (0xac | P_EXT)
 #define OPC_TESTL  (0x85)
 #define OPC_TZCNT   (0xbc | P_EXT | P_SIMDF3)
 #define OPC_UD2 (0x0b | P_EXT)
@@ -2587,6 +2588,12 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode 
opc,
 }
 break;
 
+OP_32_64(extract2):
+/* Note that SHRD outputs to the r/m operand.  */
+tcg_out_modrm(s, OPC_SHRD_Ib + rexw, a2, a0);
+tcg_out8(s, args[3]);
+break;
+
 case INDEX_op_mb:
 tcg_out_mb(s, a0);
 break;
@@ -2845,6 +2852,7 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode 
op)
 static const TCGTargetOpDef r_0 = { .args_ct_str = { "r", "0" } };
 static const TCGTargetOpDef r_r_ri = { .args_ct_str = { "r", "r", "ri" } };
 static const TCGTargetOpDef r_r_re = { .args_ct_str = { "r", "r", "re" } };
+static const TCGTargetOpDef r_0_r = { .args_ct_str = { "r", "0", "r" } };
 static const TCGTargetOpDef r_0_re = { .args_ct_str = { "r", "0", "re" } };
 static const TCGTargetOpDef r_0_ci = { .args_ct_str = { "r", "0", "ci" } };
 static const TCGTargetOpDef r_L = { .args_ct_str = { "r", "L" } };
@@ -2970,6 +2978,9 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode 
op)
 case INDEX_op_ctpop_i32:
 case INDEX_op_ctpop_i64:
 return _r;
+case INDEX_op_extract2_i32:
+case INDEX_op_extract2_i64:
+return _0_r;
 
 case INDEX_op_deposit_i32:
 case INDEX_op_deposit_i64:
-- 
2.17.2




[Qemu-devel] [PATCH v4 26/29] hw/arm: Express dependencies of the ZynqMP zcu102 machine with Kconfig

2019-03-07 Thread Thomas Huth
This cleans up most settings in default-configs/aarch64-softmmu.mak.

Signed-off-by: Thomas Huth 
---
 default-configs/aarch64-softmmu.mak |  4 
 hw/arm/Kconfig  | 11 +++
 hw/display/Kconfig  |  1 +
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/default-configs/aarch64-softmmu.mak 
b/default-configs/aarch64-softmmu.mak
index 4ea9add..3a4b15e 100644
--- a/default-configs/aarch64-softmmu.mak
+++ b/default-configs/aarch64-softmmu.mak
@@ -3,10 +3,6 @@
 # We support all the 32 bit boards so need all their config
 include arm-softmmu.mak
 
-CONFIG_AUX=y
-CONFIG_DDC=y
-CONFIG_DPCD=y
-CONFIG_XLNX_ZYNQMP=y
 CONFIG_XLNX_ZYNQMP_ARM=y
 CONFIG_XLNX_VERSAL=y
 CONFIG_ARM_SMMUV3=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index da4d5c1..adc38d4 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -283,6 +283,17 @@ config STM32F205_SOC
 
 config XLNX_ZYNQMP_ARM
 bool
+select AHCI
+select ARM_GIC
+select CADENCE
+select DDC
+select DPCD
+select SDHCI
+select SSI
+select SSI_M25P80
+select XILINX_AXI
+select XILINX_SPIPS
+select XLNX_ZYNQMP
 
 config XLNX_VERSAL
 bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index 25116e6..5ea402c 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -108,3 +108,4 @@ config VIRTIO_VGA
 
 config DPCD
 bool
+select AUX
-- 
1.8.3.1




[Qemu-devel] [PATCH 1/9] tcg: Implement tcg_gen_extract2_{i32, i64}

2019-03-07 Thread Richard Henderson
From: David Hildenbrand 

Will be helpful for s390x. Input 128 bit and output 64 bit only,
which is sufficient for now.

Reviewed-by: Richard Henderson 
Signed-off-by: David Hildenbrand 
Message-Id: <20190225154204.26751-1-da...@redhat.com>
[rth: Add matching tcg_gen_extract2_i32.]
Signed-off-by: Richard Henderson 
---
 tcg/tcg-op.h |  6 ++
 tcg/tcg-op.c | 44 
 2 files changed, 50 insertions(+)

diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index d3e51b15af..1f1824c30a 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -308,6 +308,8 @@ void tcg_gen_extract_i32(TCGv_i32 ret, TCGv_i32 arg,
  unsigned int ofs, unsigned int len);
 void tcg_gen_sextract_i32(TCGv_i32 ret, TCGv_i32 arg,
   unsigned int ofs, unsigned int len);
+void tcg_gen_extract2_i32(TCGv_i32 ret, TCGv_i32 al, TCGv_i32 ah,
+  unsigned int ofs);
 void tcg_gen_brcond_i32(TCGCond cond, TCGv_i32 arg1, TCGv_i32 arg2, TCGLabel 
*);
 void tcg_gen_brcondi_i32(TCGCond cond, TCGv_i32 arg1, int32_t arg2, TCGLabel 
*);
 void tcg_gen_setcond_i32(TCGCond cond, TCGv_i32 ret,
@@ -501,6 +503,8 @@ void tcg_gen_extract_i64(TCGv_i64 ret, TCGv_i64 arg,
  unsigned int ofs, unsigned int len);
 void tcg_gen_sextract_i64(TCGv_i64 ret, TCGv_i64 arg,
   unsigned int ofs, unsigned int len);
+void tcg_gen_extract2_i64(TCGv_i64 ret, TCGv_i64 al, TCGv_i64 ah,
+  unsigned int ofs);
 void tcg_gen_brcond_i64(TCGCond cond, TCGv_i64 arg1, TCGv_i64 arg2, TCGLabel 
*);
 void tcg_gen_brcondi_i64(TCGCond cond, TCGv_i64 arg1, int64_t arg2, TCGLabel 
*);
 void tcg_gen_setcond_i64(TCGCond cond, TCGv_i64 ret,
@@ -1068,6 +1072,7 @@ void tcg_gen_stl_vec(TCGv_vec r, TCGv_ptr base, TCGArg 
offset, TCGType t);
 #define tcg_gen_deposit_z_tl tcg_gen_deposit_z_i64
 #define tcg_gen_extract_tl tcg_gen_extract_i64
 #define tcg_gen_sextract_tl tcg_gen_sextract_i64
+#define tcg_gen_extract2_tl tcg_gen_extract2_i64
 #define tcg_const_tl tcg_const_i64
 #define tcg_const_local_tl tcg_const_local_i64
 #define tcg_gen_movcond_tl tcg_gen_movcond_i64
@@ -1178,6 +1183,7 @@ void tcg_gen_stl_vec(TCGv_vec r, TCGv_ptr base, TCGArg 
offset, TCGType t);
 #define tcg_gen_deposit_z_tl tcg_gen_deposit_z_i32
 #define tcg_gen_extract_tl tcg_gen_extract_i32
 #define tcg_gen_sextract_tl tcg_gen_sextract_i32
+#define tcg_gen_extract2_tl tcg_gen_extract2_i32
 #define tcg_const_tl tcg_const_i32
 #define tcg_const_local_tl tcg_const_local_i32
 #define tcg_gen_movcond_tl tcg_gen_movcond_i32
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 1bd7ef24af..7c56c92c8e 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -809,6 +809,28 @@ void tcg_gen_sextract_i32(TCGv_i32 ret, TCGv_i32 arg,
 tcg_gen_sari_i32(ret, ret, 32 - len);
 }
 
+/*
+ * Extract 32-bits from a 64-bit input, ah:al, starting from ofs.
+ * Unlike tcg_gen_extract_i32 above, len is fixed at 32.
+ */
+void tcg_gen_extract2_i32(TCGv_i32 ret, TCGv_i32 al, TCGv_i32 ah,
+  unsigned int ofs)
+{
+tcg_debug_assert(ofs <= 32);
+if (ofs == 0) {
+tcg_gen_mov_i32(ret, al);
+} else if (ofs == 32) {
+tcg_gen_mov_i32(ret, ah);
+} else if (al == ah) {
+tcg_gen_rotri_i32(ret, al, ofs);
+} else {
+TCGv_i32 t0 = tcg_temp_new_i32();
+tcg_gen_shri_i32(t0, al, ofs);
+tcg_gen_deposit_i32(ret, t0, ah, 32 - ofs, ofs);
+tcg_temp_free_i32(t0);
+}
+}
+
 void tcg_gen_movcond_i32(TCGCond cond, TCGv_i32 ret, TCGv_i32 c1,
  TCGv_i32 c2, TCGv_i32 v1, TCGv_i32 v2)
 {
@@ -2297,6 +2319,28 @@ void tcg_gen_sextract_i64(TCGv_i64 ret, TCGv_i64 arg,
 tcg_gen_sari_i64(ret, ret, 64 - len);
 }
 
+/*
+ * Extract 64 bits from a 128-bit input, ah:al, starting from ofs.
+ * Unlike tcg_gen_extract_i64 above, len is fixed at 64.
+ */
+void tcg_gen_extract2_i64(TCGv_i64 ret, TCGv_i64 al, TCGv_i64 ah,
+  unsigned int ofs)
+{
+tcg_debug_assert(ofs <= 64);
+if (ofs == 0) {
+tcg_gen_mov_i64(ret, al);
+} else if (ofs == 64) {
+tcg_gen_mov_i64(ret, ah);
+} else if (al == ah) {
+tcg_gen_rotri_i64(ret, al, ofs);
+} else {
+TCGv_i64 t0 = tcg_temp_new_i64();
+tcg_gen_shri_i64(t0, al, ofs);
+tcg_gen_deposit_i64(ret, t0, ah, 64 - ofs, ofs);
+tcg_temp_free_i64(t0);
+}
+}
+
 void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret, TCGv_i64 c1,
  TCGv_i64 c2, TCGv_i64 v1, TCGv_i64 v2)
 {
-- 
2.17.2




[Qemu-devel] [PATCH 4/9] tcg: Use extract2 in tcg_gen_deposit_{i32, i64}

2019-03-07 Thread Richard Henderson
Signed-off-by: Richard Henderson 
---
 tcg/tcg-op.c | 28 ++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 34e0dbc6e0..caee80235e 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -614,6 +614,18 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, 
TCGv_i32 arg2,
 mask = (1u << len) - 1;
 t1 = tcg_temp_new_i32();
 
+if (TCG_TARGET_HAS_extract2_i32) {
+if (ofs + len == 32) {
+tcg_gen_shli_i32(t1, arg1, len);
+tcg_gen_extract2_i32(ret, t1, arg2, len);
+goto done;
+}
+if (ofs == 0) {
+tcg_gen_extract2_i32(ret, arg1, arg2, len);
+tcg_gen_rotli_i32(ret, ret, len);
+goto done;
+}
+}
 if (ofs + len < 32) {
 tcg_gen_andi_i32(t1, arg2, mask);
 tcg_gen_shli_i32(t1, t1, ofs);
@@ -622,7 +634,7 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, 
TCGv_i32 arg2,
 }
 tcg_gen_andi_i32(ret, arg1, ~(mask << ofs));
 tcg_gen_or_i32(ret, ret, t1);
-
+ done:
 tcg_temp_free_i32(t1);
 }
 
@@ -2027,6 +2039,18 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, 
TCGv_i64 arg2,
 mask = (1ull << len) - 1;
 t1 = tcg_temp_new_i64();
 
+if (TCG_TARGET_HAS_extract2_i64) {
+if (ofs + len == 64) {
+tcg_gen_shli_i64(t1, arg1, len);
+tcg_gen_extract2_i64(ret, t1, arg2, len);
+goto done;
+}
+if (ofs == 0) {
+tcg_gen_extract2_i64(ret, arg1, arg2, len);
+tcg_gen_rotli_i64(ret, ret, len);
+goto done;
+}
+}
 if (ofs + len < 64) {
 tcg_gen_andi_i64(t1, arg2, mask);
 tcg_gen_shli_i64(t1, t1, ofs);
@@ -2035,7 +2059,7 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, 
TCGv_i64 arg2,
 }
 tcg_gen_andi_i64(ret, arg1, ~(mask << ofs));
 tcg_gen_or_i64(ret, ret, t1);
-
+ done:
 tcg_temp_free_i64(t1);
 }
 
-- 
2.17.2




[Qemu-devel] [PATCH v4 24/29] hw/arm: Express dependencies for remaining IMX boards with Kconfig

2019-03-07 Thread Thomas Huth
IMX25, IMX7 and IMX6UL were still missing the Kconfig dependencies.

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak |  2 --
 hw/arm/Kconfig  | 18 ++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index a01e407..88e4e8e 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -34,7 +34,6 @@ CONFIG_SABRELITE=y
 CONFIG_EMCRAFT_SF2=y
 
 CONFIG_VGA=y
-CONFIG_IMX_FEC=y
 
 CONFIG_NRF51_SOC=y
 
@@ -46,4 +45,3 @@ CONFIG_PCIE_PORT=y
 CONFIG_XIO3130=y
 CONFIG_IOH3420=y
 CONFIG_I82801B11=y
-CONFIG_PCI_EXPRESS_DESIGNWARE=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 7df0bb6..6a8b801 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -289,6 +289,10 @@ config XLNX_VERSAL
 
 config FSL_IMX25
 bool
+select IMX
+select IMX_FEC
+select IMX_I2C
+select DS1338
 
 config FSL_IMX31
 bool
@@ -303,6 +307,7 @@ config FSL_IMX6
 select A9MPCORE
 select IMX
 select IMX_I2C
+select SDHCI
 
 config ASPEED_SOC
 bool
@@ -328,12 +333,25 @@ config MPS2
 
 config FSL_IMX7
 bool
+imply PCI_DEVICES
+select A15MPCORE
+select PCI
+select IMX
+select IMX_FEC
+select IMX_I2C
+select PCI_EXPRESS_DESIGNWARE
+select SDHCI
 
 config ARM_SMMUV3
 bool
 
 config FSL_IMX6UL
 bool
+select A15MPCORE
+select IMX
+select IMX_FEC
+select IMX_I2C
+select SDHCI
 
 config NRF51_SOC
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH 7/9] tcg/aarch64: Support INDEX_op_extract2_{i32, i64}

2019-03-07 Thread Richard Henderson
Signed-off-by: Richard Henderson 
---
 tcg/aarch64/tcg-target.h |  4 ++--
 tcg/aarch64/tcg-target.inc.c | 11 +++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h
index 6600a54a02..ce2bb1f90b 100644
--- a/tcg/aarch64/tcg-target.h
+++ b/tcg/aarch64/tcg-target.h
@@ -77,7 +77,7 @@ typedef enum {
 #define TCG_TARGET_HAS_deposit_i32  1
 #define TCG_TARGET_HAS_extract_i32  1
 #define TCG_TARGET_HAS_sextract_i32 1
-#define TCG_TARGET_HAS_extract2_i32 0
+#define TCG_TARGET_HAS_extract2_i32 1
 #define TCG_TARGET_HAS_movcond_i32  1
 #define TCG_TARGET_HAS_add2_i32 1
 #define TCG_TARGET_HAS_sub2_i32 1
@@ -114,7 +114,7 @@ typedef enum {
 #define TCG_TARGET_HAS_deposit_i64  1
 #define TCG_TARGET_HAS_extract_i64  1
 #define TCG_TARGET_HAS_sextract_i64 1
-#define TCG_TARGET_HAS_extract2_i64 0
+#define TCG_TARGET_HAS_extract2_i64 1
 #define TCG_TARGET_HAS_movcond_i64  1
 #define TCG_TARGET_HAS_add2_i64 1
 #define TCG_TARGET_HAS_sub2_i64 1
diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c
index d57f9e500f..8b93598bce 100644
--- a/tcg/aarch64/tcg-target.inc.c
+++ b/tcg/aarch64/tcg-target.inc.c
@@ -2058,6 +2058,11 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
 tcg_out_sbfm(s, ext, a0, a1, a2, a2 + args[3] - 1);
 break;
 
+case INDEX_op_extract2_i64:
+case INDEX_op_extract2_i32:
+tcg_out_extr(s, ext, a0, a1, a2, args[3]);
+break;
+
 case INDEX_op_add2_i32:
 tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, REG0(2), REG0(3),
 (int32_t)args[4], args[5], const_args[4],
@@ -2300,6 +2305,8 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode 
op)
 = { .args_ct_str = { "r", "r", "rAL" } };
 static const TCGTargetOpDef dep
 = { .args_ct_str = { "r", "0", "rZ" } };
+static const TCGTargetOpDef ext2
+= { .args_ct_str = { "r", "rZ", "rZ" } };
 static const TCGTargetOpDef movc
 = { .args_ct_str = { "r", "r", "rA", "rZ", "rZ" } };
 static const TCGTargetOpDef add2
@@ -2430,6 +2437,10 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode 
op)
 case INDEX_op_deposit_i64:
 return 
 
+case INDEX_op_extract2_i32:
+case INDEX_op_extract2_i64:
+return 
+
 case INDEX_op_add2_i32:
 case INDEX_op_add2_i64:
 case INDEX_op_sub2_i32:
-- 
2.17.2




[Qemu-devel] [PATCH v4 23/29] hw/arm: Express dependencies of the MSF2 / EMCRAFT_SF2 machine with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the emcraft-sf2 machine - we also
distinguish between the machine (CONFIG_EMCRAFT_SF2) and the SoC
(CONFIG_MSF2) now.

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak |  3 +--
 hw/arm/Kconfig  | 10 +-
 hw/arm/Makefile.objs|  3 ++-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 9150858..a01e407 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -31,9 +31,9 @@ CONFIG_MPS2=y
 CONFIG_RASPI=y
 CONFIG_DIGIC=y
 CONFIG_SABRELITE=y
+CONFIG_EMCRAFT_SF2=y
 
 CONFIG_VGA=y
-CONFIG_SSI_M25P80=y
 CONFIG_IMX_FEC=y
 
 CONFIG_NRF51_SOC=y
@@ -46,5 +46,4 @@ CONFIG_PCIE_PORT=y
 CONFIG_XIO3130=y
 CONFIG_IOH3420=y
 CONFIG_I82801B11=y
-CONFIG_MSF2=y
 CONFIG_PCI_EXPRESS_DESIGNWARE=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index cff2925..7df0bb6 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -325,7 +325,6 @@ config MPS2
 select MPS2_SCC
 select PL022# Serial port
 select PL080# DMA controller
-select TZ_MPC
 
 config FSL_IMX7
 bool
@@ -339,9 +338,17 @@ config FSL_IMX6UL
 config NRF51_SOC
 bool
 
+config EMCRAFT_SF2
+bool
+select MSF2
+select SSI_M25P80
+
 config MSF2
 bool
+select ARM_V7M
 select PTIMER
+select SERIAL
+select SSI
 
 config ZAURUS
 bool
@@ -374,6 +381,7 @@ config ARMSSE
 select IOTKIT_SECCTL
 select IOTKIT_SYSCTL
 select IOTKIT_SYSINFO
+select TZ_MPC
 select TZ_MSC
 select TZ_PPC
 
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index fadd698..eae9f6c 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -4,6 +4,7 @@ obj-$(CONFIG_ARM_VIRT) += virt.o
 obj-$(CONFIG_ACPI) += virt-acpi-build.o
 obj-$(CONFIG_DIGIC) += digic_boards.o
 obj-$(CONFIG_EXYNOS4) += exynos4_boards.o
+obj-$(CONFIG_EMCRAFT_SF2) += msf2-som.o
 obj-$(CONFIG_HIGHBANK) += highbank.o
 obj-$(CONFIG_INTEGRATOR) += integratorcp.o
 obj-$(CONFIG_MAINSTONE) += mainstone.o
@@ -41,7 +42,7 @@ obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o
 obj-$(CONFIG_ASPEED_SOC) += aspeed_soc.o aspeed.o
 obj-$(CONFIG_MPS2) += mps2.o
 obj-$(CONFIG_MPS2) += mps2-tz.o
-obj-$(CONFIG_MSF2) += msf2-soc.o msf2-som.o
+obj-$(CONFIG_MSF2) += msf2-soc.o
 obj-$(CONFIG_MUSCA) += musca.o
 obj-$(CONFIG_ARMSSE) += armsse.o
 obj-$(CONFIG_FSL_IMX7) += fsl-imx7.o mcimx7d-sabre.o
-- 
1.8.3.1




[Qemu-devel] [PATCH v3 2/2] configure: Disable W^X on OpenBSD

2019-03-07 Thread Philippe Mathieu-Daudé
Since OpenBSD 6.0 [1], W^X is enforced by default [2].
TCG requires WX access. Disable W^X if it is available.
This fixes:

  # lm32-softmmu/qemu-system-lm32
  Could not allocate dynamic translator buffer

  # sysctl kern.wxabort=1
  kern.wxabort: 0 -> 1
  # lm32-softmmu/qemu-system-lm32
  mmap: Not supported
  Abort trap (core dumped)
  # gdb -q lm32-softmmu/qemu-system-lm32 qemu-system-lm32.core
  (gdb) bt
  #0  0x17e3c156c50a in _thread_sys___syscall () at {standard input}:5
  #1  0x17e3c15e5d7a in *_libc_mmap (addr=Variable "addr" is not 
available.) at /usr/src/lib/libc/sys/mmap.c:47
  #2  0x17e17d9abc8b in alloc_code_gen_buffer () at 
/usr/src/qemu/accel/tcg/translate-all.c:1064
  #3  0x17e17d9abd04 in code_gen_alloc (tb_size=0) at 
/usr/src/qemu/accel/tcg/translate-all.c:1112
  #4  0x17e17d9abe81 in tcg_exec_init (tb_size=0) at 
/usr/src/qemu/accel/tcg/translate-all.c:1149
  #5  0x17e17d9897e9 in tcg_init (ms=0x17e45e456800) at 
/usr/src/qemu/accel/tcg/tcg-all.c:66
  #6  0x17e17d9891b8 in accel_init_machine (acc=0x17e3c3f50800, 
ms=0x17e45e456800) at /usr/src/qemu/accel/accel.c:63
  #7  0x17e17d989312 in configure_accelerator (ms=0x17e45e456800, 
progname=0x7f7f07b0 "lm32-softmmu/qemu-system-lm32") at 
/usr/src/qemu/accel/accel.c:111
  #8  0x17e17d9d8616 in main (argc=1, argv=0x7f7f06b8, 
envp=0x7f7f06c8) at vl.c:4325

[1] https://www.openbsd.org/faq/upgrade60.html
[2] https://undeadly.org/cgi?action=article=20160527203200

Signed-off-by: Philippe Mathieu-Daudé 
---
 configure | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/configure b/configure
index cefeb8fcce..abfd60923a 100755
--- a/configure
+++ b/configure
@@ -5835,6 +5835,17 @@ if test "$mingw32" = "yes" ; then
 done
 fi
 
+# Disable OpenBSD W^X if available
+if test "$tcg" = "yes" && test "$targetos" = "OpenBSD"; then
+cat > $TMPC <

[Qemu-devel] [PATCH 0/9] tcg: Add tcg_gen_extract2_{i32,i64}

2019-03-07 Thread Richard Henderson
The primary motivator here is usage within s390x,
but (as with any good primitive) the opcode has
applications outside that.


r~


David Hildenbrand (1):
  tcg: Implement tcg_gen_extract2_{i32,i64}

Richard Henderson (8):
  tcg: Add INDEX_op_extract2_{i32,i64}
  tcg: Use extract2 in tcg_gen_shifti_i64
  tcg: Use extract2 in tcg_gen_deposit_{i32,i64}
  tcg/i386: Support INDEX_op_extract2_{i32,i64}
  tcg/arm: Support INDEX_op_extract2_i32
  tcg/aarch64: Support INDEX_op_extract2_{i32,i64}
  target/arm: Use extract2 for EXTR
  target/arm: Simplify BFXIL expansion

 tcg/aarch64/tcg-target.h |   2 +
 tcg/arm/tcg-target.h |   1 +
 tcg/i386/tcg-target.h|   2 +
 tcg/mips/tcg-target.h|   2 +
 tcg/ppc/tcg-target.h |   2 +
 tcg/riscv/tcg-target.h   |   2 +
 tcg/s390/tcg-target.h|   2 +
 tcg/sparc/tcg-target.h   |   2 +
 tcg/tcg-op.h |   6 ++
 tcg/tcg-opc.h|   2 +
 tcg/tcg.h|   1 +
 tcg/tci/tcg-target.h |   2 +
 target/arm/translate-a64.c   |  44 +++--
 tcg/aarch64/tcg-target.inc.c |  11 
 tcg/arm/tcg-target.inc.c |  25 +++
 tcg/i386/tcg-target.inc.c|  11 
 tcg/optimize.c   |  10 +++
 tcg/tcg-op.c | 123 ---
 tcg/tcg.c|   4 ++
 tcg/README   |   5 ++
 20 files changed, 213 insertions(+), 46 deletions(-)

-- 
2.17.2




[Qemu-devel] [PATCH 2/9] tcg: Add INDEX_op_extract2_{i32,i64}

2019-03-07 Thread Richard Henderson
This will let backends implement the double-word shift operation.

Signed-off-by: Richard Henderson 
---
 tcg/aarch64/tcg-target.h |  2 ++
 tcg/arm/tcg-target.h |  1 +
 tcg/i386/tcg-target.h|  2 ++
 tcg/mips/tcg-target.h|  2 ++
 tcg/ppc/tcg-target.h |  2 ++
 tcg/riscv/tcg-target.h   |  2 ++
 tcg/s390/tcg-target.h|  2 ++
 tcg/sparc/tcg-target.h   |  2 ++
 tcg/tcg-opc.h|  2 ++
 tcg/tcg.h|  1 +
 tcg/tci/tcg-target.h |  2 ++
 tcg/optimize.c   | 10 ++
 tcg/tcg-op.c |  4 
 tcg/tcg.c|  4 
 tcg/README   |  5 +
 15 files changed, 43 insertions(+)

diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h
index 2d93cf404e..6600a54a02 100644
--- a/tcg/aarch64/tcg-target.h
+++ b/tcg/aarch64/tcg-target.h
@@ -77,6 +77,7 @@ typedef enum {
 #define TCG_TARGET_HAS_deposit_i32  1
 #define TCG_TARGET_HAS_extract_i32  1
 #define TCG_TARGET_HAS_sextract_i32 1
+#define TCG_TARGET_HAS_extract2_i32 0
 #define TCG_TARGET_HAS_movcond_i32  1
 #define TCG_TARGET_HAS_add2_i32 1
 #define TCG_TARGET_HAS_sub2_i32 1
@@ -113,6 +114,7 @@ typedef enum {
 #define TCG_TARGET_HAS_deposit_i64  1
 #define TCG_TARGET_HAS_extract_i64  1
 #define TCG_TARGET_HAS_sextract_i64 1
+#define TCG_TARGET_HAS_extract2_i64 0
 #define TCG_TARGET_HAS_movcond_i64  1
 #define TCG_TARGET_HAS_add2_i64 1
 #define TCG_TARGET_HAS_sub2_i64 1
diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
index 16172f73a3..4ee6c98958 100644
--- a/tcg/arm/tcg-target.h
+++ b/tcg/arm/tcg-target.h
@@ -116,6 +116,7 @@ extern bool use_idiv_instructions;
 #define TCG_TARGET_HAS_deposit_i32  use_armv7_instructions
 #define TCG_TARGET_HAS_extract_i32  use_armv7_instructions
 #define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions
+#define TCG_TARGET_HAS_extract2_i32 0
 #define TCG_TARGET_HAS_movcond_i32  1
 #define TCG_TARGET_HAS_mulu2_i321
 #define TCG_TARGET_HAS_muls2_i321
diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index 7995fe3eab..2c58eaa9ed 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -124,6 +124,7 @@ extern bool have_avx2;
 #define TCG_TARGET_HAS_deposit_i32  1
 #define TCG_TARGET_HAS_extract_i32  1
 #define TCG_TARGET_HAS_sextract_i32 1
+#define TCG_TARGET_HAS_extract2_i32 0
 #define TCG_TARGET_HAS_movcond_i32  1
 #define TCG_TARGET_HAS_add2_i32 1
 #define TCG_TARGET_HAS_sub2_i32 1
@@ -162,6 +163,7 @@ extern bool have_avx2;
 #define TCG_TARGET_HAS_deposit_i64  1
 #define TCG_TARGET_HAS_extract_i64  1
 #define TCG_TARGET_HAS_sextract_i64 0
+#define TCG_TARGET_HAS_extract2_i64 0
 #define TCG_TARGET_HAS_movcond_i64  1
 #define TCG_TARGET_HAS_add2_i64 1
 #define TCG_TARGET_HAS_sub2_i64 1
diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h
index 5cb8672470..c6b091d849 100644
--- a/tcg/mips/tcg-target.h
+++ b/tcg/mips/tcg-target.h
@@ -162,6 +162,7 @@ extern bool use_mips32r2_instructions;
 #define TCG_TARGET_HAS_deposit_i32  use_mips32r2_instructions
 #define TCG_TARGET_HAS_extract_i32  use_mips32r2_instructions
 #define TCG_TARGET_HAS_sextract_i32 0
+#define TCG_TARGET_HAS_extract2_i32 0
 #define TCG_TARGET_HAS_ext8s_i32use_mips32r2_instructions
 #define TCG_TARGET_HAS_ext16s_i32   use_mips32r2_instructions
 #define TCG_TARGET_HAS_rot_i32  use_mips32r2_instructions
@@ -177,6 +178,7 @@ extern bool use_mips32r2_instructions;
 #define TCG_TARGET_HAS_deposit_i64  use_mips32r2_instructions
 #define TCG_TARGET_HAS_extract_i64  use_mips32r2_instructions
 #define TCG_TARGET_HAS_sextract_i64 0
+#define TCG_TARGET_HAS_extract2_i64 0
 #define TCG_TARGET_HAS_ext8s_i64use_mips32r2_instructions
 #define TCG_TARGET_HAS_ext16s_i64   use_mips32r2_instructions
 #define TCG_TARGET_HAS_rot_i64  use_mips32r2_instructions
diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
index 52c1bb04b1..7627fb62d3 100644
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -77,6 +77,7 @@ extern bool have_isa_3_00;
 #define TCG_TARGET_HAS_deposit_i32  1
 #define TCG_TARGET_HAS_extract_i32  1
 #define TCG_TARGET_HAS_sextract_i32 0
+#define TCG_TARGET_HAS_extract2_i32 0
 #define TCG_TARGET_HAS_movcond_i32  1
 #define TCG_TARGET_HAS_mulu2_i320
 #define TCG_TARGET_HAS_muls2_i320
@@ -115,6 +116,7 @@ extern bool have_isa_3_00;
 #define TCG_TARGET_HAS_deposit_i64  1
 #define TCG_TARGET_HAS_extract_i64  1
 #define TCG_TARGET_HAS_sextract_i64 0
+#define TCG_TARGET_HAS_extract2_i64 0
 #define TCG_TARGET_HAS_movcond_i64  1
 #define TCG_TARGET_HAS_add2_i64 1
 #define TCG_TARGET_HAS_sub2_i64 1
diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h
index 60918cacb4..032439d806 100644
--- a/tcg/riscv/tcg-target.h
+++ 

[Qemu-devel] [PATCH v3 0/2] OpenBSD: Let QEMU 4.0 be usable from OpenBSD 6.0 and onwards

2019-03-07 Thread Philippe Mathieu-Daudé
Since OpenBSD 6.0, the W^X protection is enforced by default.
TCG is incompatible with this protection, to be able to use the
QEMU binary, this protection has to be disabled.
The OpenBSD ports seens to have downstream patches to be able to
use QEMU, but these patches were never upstreamed.
This series allow to run QEMU when built from the mainstream sources.

I salvaged the minimum patches required to be able to run OpenBSD
from a previous series, which aimed at running the QEMU QTest suite
on OpenBSD. Sadly it seems there is not much interest in having this
OS covered by tests (except by Peter Maydell).

v2: https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg07513.html
v1: https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg06676.html

Philippe Mathieu-Daudé (2):
  oslib-posix: Ignore fcntl("/dev/null", F_SETFL, O_NONBLOCK) failure
  configure: Disable W^X on OpenBSD

 configure  | 11 +++
 util/oslib-posix.c | 12 
 2 files changed, 23 insertions(+)

-- 
2.20.1




Re: [Qemu-devel] [PATCHv2 0/2] curses: Add support for wide output

2019-03-07 Thread Samuel Thibault
Gerd Hoffmann, le jeu. 07 mars 2019 14:21:12 +0100, a ecrit:
> On Mon, Mar 04, 2019 at 10:02:15PM +0100, Samuel Thibault wrote:
> > This adds support for wide output in the curses frontend
> > 
> > Difference with previous version:
> > - Add more rationale in commit message
> > - Move charset option to curses-only section.
> 
> Added to UI patch queue (the other curses patches too).

Thanks!

Samuel



[Qemu-devel] [PATCH v4 22/29] hw/arm: Express dependencies of sabrelite with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the Sabrelite / iMX6 machine.

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 4 +---
 hw/arm/Kconfig  | 7 +++
 hw/arm/Makefile.objs| 3 ++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 53609ea..9150858 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -30,6 +30,7 @@ CONFIG_NETDUINO2=y
 CONFIG_MPS2=y
 CONFIG_RASPI=y
 CONFIG_DIGIC=y
+CONFIG_SABRELITE=y
 
 CONFIG_VGA=y
 CONFIG_SSI_M25P80=y
@@ -37,13 +38,10 @@ CONFIG_IMX_FEC=y
 
 CONFIG_NRF51_SOC=y
 
-CONFIG_FSL_IMX6=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
 
-CONFIG_IMX_I2C=y
-
 CONFIG_PCIE_PORT=y
 CONFIG_XIO3130=y
 CONFIG_IOH3420=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index ed42e60..cff2925 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -181,6 +181,10 @@ config REALVIEW
 select DS1338 # I2C RTC+NVRAM
 select USB_OHCI
 
+config SABRELITE
+bool
+select FSL_IMX6
+
 config STELLARIS
 bool
 select ARM_V7M
@@ -296,6 +300,9 @@ config FSL_IMX31
 
 config FSL_IMX6
 bool
+select A9MPCORE
+select IMX
+select IMX_I2C
 
 config ASPEED_SOC
 bool
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 4f591ca..fadd698 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -22,6 +22,7 @@ obj-$(CONFIG_COLLIE) += collie.o
 obj-$(CONFIG_VERSATILE) += versatilepb.o
 obj-$(CONFIG_VEXPRESS) += vexpress.o
 obj-$(CONFIG_ZYNQ) += xilinx_zynq.o
+obj-$(CONFIG_SABRELITE) += sabrelite.o
 
 obj-$(CONFIG_ARM_V7M) += armv7m.o
 obj-$(CONFIG_EXYNOS4) += exynos4210.o
@@ -36,7 +37,7 @@ obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zynqmp.o xlnx-zcu102.o
 obj-$(CONFIG_XLNX_VERSAL) += xlnx-versal.o xlnx-versal-virt.o
 obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
 obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o
-obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o
+obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o
 obj-$(CONFIG_ASPEED_SOC) += aspeed_soc.o aspeed.o
 obj-$(CONFIG_MPS2) += mps2.o
 obj-$(CONFIG_MPS2) += mps2-tz.o
-- 
1.8.3.1




Re: [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the thread_fn

2019-03-07 Thread Stefan Hajnoczi
On Wed, Mar 06, 2019 at 07:55:31PM +0800, Peter Xu wrote:
> +/*
> + * We should do this as soon as we enter the thread, because the
> + * function will silently fail if it fails to acquire the
> + * gcontext.
> + */
> +g_main_context_push_thread_default(iothread->worker_context);

I have a hard time understanding this comment.  The mention of how it
fails makes me think "we'll never find out about failures anyway, so how
does it help to call this early?".

I suggest sticking to the point that this function must always be called
first:

  /*
   * g_main_context_push_thread_default() must be called before anything
   * in this new thread uses glib.
   */

Now people will think before moving this function call.

Stefan


signature.asc
Description: PGP signature


[Qemu-devel] [PATCH v4 27/29] hw/arm: Express dependencies of the xlnx-versal-virt machine with Kconfig

2019-03-07 Thread Thomas Huth
Dependencies have been determined with trial-and-error and by
looking at the xlnx-versal.c source file.

Signed-off-by: Thomas Huth 
---
 hw/arm/Kconfig | 4 
 1 file changed, 4 insertions(+)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index adc38d4..3a04def 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -297,6 +297,10 @@ config XLNX_ZYNQMP_ARM
 
 config XLNX_VERSAL
 bool
+select ARM_GIC
+select PL011
+select CADENCE
+select VIRTIO_MMIO
 
 config FSL_IMX25
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 21/29] hw/arm: Express dependencies of canon-a1100 with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the DIGIC / canon-a1100 machine.

Reviewed-by: Philippe Mathieu-Daudé 
Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 2 +-
 hw/arm/Kconfig  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 290023c..53609ea 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -29,12 +29,12 @@ CONFIG_ASPEED_SOC=y
 CONFIG_NETDUINO2=y
 CONFIG_MPS2=y
 CONFIG_RASPI=y
+CONFIG_DIGIC=y
 
 CONFIG_VGA=y
 CONFIG_SSI_M25P80=y
 CONFIG_IMX_FEC=y
 
-CONFIG_DIGIC=y
 CONFIG_NRF51_SOC=y
 
 CONFIG_FSL_IMX6=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 87440db..ed42e60 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -31,6 +31,7 @@ config CUBIEBOARD
 config DIGIC
 bool
 select PTIMER
+select PFLASH_CFI02
 
 config EXYNOS4
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 28/29] hw/arm: Express dependencies of the musca machines with Kconfig

2019-03-07 Thread Thomas Huth
Dependencies have been determined with trial-and-error and by
looking at the musca.c source file.

Signed-off-by: Thomas Huth 
---
 hw/arm/Kconfig | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 3a04def..7a0e0ba 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -77,6 +77,12 @@ config MAINSTONE
 select PFLASH_CFI01
 select SMC91C111
 
+config MUSCA
+bool
+select ARMSSE
+select PL011
+select PL031
+
 config MUSICPAL
 bool
 select BITBANG_I2C
@@ -429,6 +435,3 @@ config ARMSSE_CPUID
 
 config ARMSSE_MHU
 bool
-
-config MUSCA
-bool
-- 
1.8.3.1




Re: [Qemu-devel] [multiprocess RFC PATCH 36/37] multi-process: add the concept description to docs/devel/qemu-multiprocess

2019-03-07 Thread Stefan Hajnoczi
On Wed, Mar 06, 2019 at 11:22:53PM -0800, elena.ufimts...@oracle.com wrote:
> diff --git a/docs/devel/qemu-multiprocess.txt 
> b/docs/devel/qemu-multiprocess.txt
> new file mode 100644
> index 000..e29c6c8
> --- /dev/null
> +++ b/docs/devel/qemu-multiprocess.txt

Thanks for this document and the interesting work that you are doing.
I'd like to discuss the security advantages gained by disaggregating
QEMU in more detail.

The security model for VMs managed by libvirt (most production x86, ppc,
s390 guests) is that the QEMU process is untrusted and only has access
to resources belonging to the guest.  SELinux is used to restrict the
process from accessing other files, processes, etc on the host.

QEMU does not hold privileged resources that must be kept away from the
guest.  An escaped guest can access its image file, tap file descriptor,
etc but they are the same resources it could already access via device
emulation.

Can you give specific examples of how disaggregation improves security?

Stefan


signature.asc
Description: PGP signature


[Qemu-devel] [PATCH v4 20/29] hw/arm: Express dependencies of the raspi machines with Kconfig

2019-03-07 Thread Thomas Huth
Most of the code is directly controlled by the CONFIG_RASPI switch,
so not much to add here additionally.

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 4 +---
 hw/arm/Kconfig  | 3 +++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index b8509fd..290023c 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -28,15 +28,13 @@ CONFIG_COLLIE=y
 CONFIG_ASPEED_SOC=y
 CONFIG_NETDUINO2=y
 CONFIG_MPS2=y
+CONFIG_RASPI=y
 
 CONFIG_VGA=y
 CONFIG_SSI_M25P80=y
 CONFIG_IMX_FEC=y
 
-CONFIG_FRAMEBUFFER=y
-
 CONFIG_DIGIC=y
-CONFIG_RASPI=y
 CONFIG_NRF51_SOC=y
 
 CONFIG_FSL_IMX6=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 32c8663..87440db 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -263,6 +263,9 @@ config ALLWINNER_A10
 
 config RASPI
 bool
+select FRAMEBUFFER
+select PL011 # UART
+select SDHCI
 
 config STM32F205_SOC
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 19/29] hw/arm: Express dependencies of the MPS2 boards with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the mps2-an* machines.

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 20 +---
 hw/arm/Kconfig  | 18 ++
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index b6f3d60..b8509fd 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -27,6 +27,7 @@ CONFIG_Z2=y
 CONFIG_COLLIE=y
 CONFIG_ASPEED_SOC=y
 CONFIG_NETDUINO2=y
+CONFIG_MPS2=y
 
 CONFIG_VGA=y
 CONFIG_SSI_M25P80=y
@@ -35,28 +36,9 @@ CONFIG_IMX_FEC=y
 CONFIG_FRAMEBUFFER=y
 
 CONFIG_DIGIC=y
-CONFIG_MPS2=y
 CONFIG_RASPI=y
 CONFIG_NRF51_SOC=y
 
-CONFIG_CMSDK_APB_TIMER=y
-CONFIG_CMSDK_APB_DUALTIMER=y
-CONFIG_CMSDK_APB_UART=y
-CONFIG_CMSDK_APB_WATCHDOG=y
-
-CONFIG_MPS2_FPGAIO=y
-CONFIG_MPS2_SCC=y
-
-CONFIG_TZ_MPC=y
-CONFIG_TZ_MSC=y
-CONFIG_TZ_PPC=y
-CONFIG_ARMSSE=y
-CONFIG_IOTKIT_SECCTL=y
-CONFIG_IOTKIT_SYSCTL=y
-CONFIG_IOTKIT_SYSINFO=y
-CONFIG_ARMSSE_CPUID=y
-CONFIG_ARMSSE_MHU=y
-
 CONFIG_FSL_IMX6=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 743c78b..32c8663 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -308,6 +308,13 @@ config ASPEED_SOC
 
 config MPS2
 bool
+select ARMSSE
+select LAN9118
+select MPS2_FPGAIO
+select MPS2_SCC
+select PL022# Serial port
+select PL080# DMA controller
+select TZ_MPC
 
 config FSL_IMX7
 bool
@@ -347,6 +354,17 @@ config ARM11MPCORE
 
 config ARMSSE
 bool
+select ARMSSE_CPUID
+select ARMSSE_MHU
+select CMSDK_APB_TIMER
+select CMSDK_APB_DUALTIMER
+select CMSDK_APB_UART
+select CMSDK_APB_WATCHDOG
+select IOTKIT_SECCTL
+select IOTKIT_SYSCTL
+select IOTKIT_SYSINFO
+select TZ_MSC
+select TZ_PPC
 
 config ARMSSE_CPUID
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 25/29] hw/arm: Express dependencies of the microbit / nrf51 machine with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the NRF51 / microbit machine.

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 3 +--
 hw/arm/Kconfig  | 6 ++
 hw/arm/Makefile.objs| 3 ++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 88e4e8e..ee95cc0 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -32,11 +32,10 @@ CONFIG_RASPI=y
 CONFIG_DIGIC=y
 CONFIG_SABRELITE=y
 CONFIG_EMCRAFT_SF2=y
+CONFIG_MICROBIT=y
 
 CONFIG_VGA=y
 
-CONFIG_NRF51_SOC=y
-
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 6a8b801..da4d5c1 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -353,8 +353,14 @@ config FSL_IMX6UL
 select IMX_I2C
 select SDHCI
 
+config MICROBIT
+bool
+select NRF51_SOC
+
 config NRF51_SOC
 bool
+select I2C
+select ARM_V7M
 
 config EMCRAFT_SF2
 bool
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index eae9f6c..994e67d 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -8,6 +8,7 @@ obj-$(CONFIG_EMCRAFT_SF2) += msf2-som.o
 obj-$(CONFIG_HIGHBANK) += highbank.o
 obj-$(CONFIG_INTEGRATOR) += integratorcp.o
 obj-$(CONFIG_MAINSTONE) += mainstone.o
+obj-$(CONFIG_MICROBIT) += microbit.o
 obj-$(CONFIG_MUSICPAL) += musicpal.o
 obj-$(CONFIG_NETDUINO2) += netduino2.o
 obj-$(CONFIG_NSERIES) += nseries.o
@@ -48,4 +49,4 @@ obj-$(CONFIG_ARMSSE) += armsse.o
 obj-$(CONFIG_FSL_IMX7) += fsl-imx7.o mcimx7d-sabre.o
 obj-$(CONFIG_ARM_SMMUV3) += smmu-common.o smmuv3.o
 obj-$(CONFIG_FSL_IMX6UL) += fsl-imx6ul.o mcimx6ul-evk.o
-obj-$(CONFIG_NRF51_SOC) += nrf51_soc.o microbit.o
+obj-$(CONFIG_NRF51_SOC) += nrf51_soc.o
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 17/29] hw/arm: Express dependencies of netduino / stm32f2xx with Kconfig

2019-03-07 Thread Thomas Huth
Netduino only depends on the stm32f205 SoC which in turn depends on
its components.

Reviewed-by: Alistair Francis 
Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 9 +
 hw/arm/Kconfig  | 7 +++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 79996a3..beb94d9 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -25,25 +25,18 @@ CONFIG_TOSA=y
 CONFIG_Z2=y
 CONFIG_COLLIE=y
 CONFIG_ASPEED_SOC=y
+CONFIG_NETDUINO2=y
 
 CONFIG_VGA=y
 CONFIG_SSI_M25P80=y
 CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
 
-CONFIG_NETDUINO2=y
-
 CONFIG_FRAMEBUFFER=y
 
 CONFIG_DIGIC=y
 CONFIG_MPS2=y
 CONFIG_RASPI=y
-CONFIG_STM32F2XX_TIMER=y
-CONFIG_STM32F2XX_USART=y
-CONFIG_STM32F2XX_SYSCFG=y
-CONFIG_STM32F2XX_ADC=y
-CONFIG_STM32F2XX_SPI=y
-CONFIG_STM32F205_SOC=y
 CONFIG_NRF51_SOC=y
 
 CONFIG_CMSDK_APB_TIMER=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 76cf754..68eccbf 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -84,6 +84,7 @@ config MUSICPAL
 
 config NETDUINO2
 bool
+select STM32F205_SOC
 
 config NSERIES
 bool
@@ -256,6 +257,12 @@ config RASPI
 
 config STM32F205_SOC
 bool
+select ARM_V7M
+select STM32F2XX_TIMER
+select STM32F2XX_USART
+select STM32F2XX_SYSCFG
+select STM32F2XX_ADC
+select STM32F2XX_SPI
 
 config XLNX_ZYNQMP_ARM
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 18/29] hw/arm: Express dependencies of allwinner / cubieboard with Kconfig

2019-03-07 Thread Thomas Huth
Add dependencies for the Cubitech Cubieboard.

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 6 +-
 hw/arm/Kconfig  | 9 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index beb94d9..b6f3d60 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -4,6 +4,7 @@
 CONFIG_ARM_V7M=y
 
 CONFIG_ARM_VIRT=y
+CONFIG_CUBIEBOARD=y
 CONFIG_EXYNOS4=y
 CONFIG_HIGHBANK=y
 CONFIG_INTEGRATOR=y
@@ -29,7 +30,6 @@ CONFIG_NETDUINO2=y
 
 CONFIG_VGA=y
 CONFIG_SSI_M25P80=y
-CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
 
 CONFIG_FRAMEBUFFER=y
@@ -57,10 +57,6 @@ CONFIG_IOTKIT_SYSINFO=y
 CONFIG_ARMSSE_CPUID=y
 CONFIG_ARMSSE_MHU=y
 
-CONFIG_ALLWINNER_A10_PIT=y
-CONFIG_ALLWINNER_A10_PIC=y
-CONFIG_ALLWINNER_A10=y
-
 CONFIG_FSL_IMX6=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 68eccbf..743c78b 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -24,6 +24,10 @@ config CHEETAH
 select OMAP
 select TSC210X
 
+config CUBIEBOARD
+bool
+select ALLWINNER_A10
+
 config DIGIC
 bool
 select PTIMER
@@ -251,6 +255,11 @@ config ARM_V7M
 
 config ALLWINNER_A10
 bool
+select AHCI
+select ALLWINNER_A10_PIT
+select ALLWINNER_A10_PIC
+select ALLWINNER_EMAC
+select SERIAL
 
 config RASPI
 bool
-- 
1.8.3.1




Re: [Qemu-devel] [multiprocess RFC PATCH 36/37] multi-process: add the concept description to docs/devel/qemu-multiprocess

2019-03-07 Thread Thomas Huth
On 07/03/2019 15.16, Kevin Wolf wrote:
> Am 07.03.2019 um 09:14 hat Thomas Huth geschrieben:
>> On 07/03/2019 08.22, elena.ufimts...@oracle.com wrote:
>>> From: Elena Ufimtseva 
>>>
>>> TODO: Make relevant changes to the doc.
>>>
>>> Signed-off-by: John G Johnson 
>>> Signed-off-by: Elena Ufimtseva 
>>> Signed-off-by: Jagannathan Raman 
>>> ---
>>>  docs/devel/qemu-multiprocess.txt | 1109 
>>> ++
>>>  1 file changed, 1109 insertions(+)
>>>  create mode 100644 docs/devel/qemu-multiprocess.txt
>>>
>>> diff --git a/docs/devel/qemu-multiprocess.txt 
>>> b/docs/devel/qemu-multiprocess.txt
>>> new file mode 100644
>>> index 000..e29c6c8
>>> --- /dev/null
>>> +++ b/docs/devel/qemu-multiprocess.txt
>>> @@ -0,0 +1,1109 @@
>>> +/*
>>> + * Copyright 2019, Oracle and/or its affiliates. All rights reserved.
>>> + *
>>> + * Permission is hereby granted, free of charge, to any person obtaining a 
>>> copy
>>> + * of this software and associated documentation files (the "Software"), 
>>> to deal
>>> + * in the Software without restriction, including without limitation the 
>>> rights
>>> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or 
>>> sell
>>> + * copies of the Software, and to permit persons to whom the Software is
>>> + * furnished to do so, subject to the following conditions:
>>> + *
>>> + * The above copyright notice and this permission notice shall be included 
>>> in
>>> + * all copies or substantial portions of the Software.
>>> + *
>>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
>>> OR
>>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
>>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
>>> OTHER
>>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
>>> FROM,
>>> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
>>> IN
>>> + * THE SOFTWARE.
>>> + */
>>
>> Somehow weird to see such a big license statement talking about
>> "software", but which applies to a text file only... Not sure if it is
>> an option for you, but maybe one of the Creative Common licenses
>> (dual-licensed with the GPLv2+) would be a better fit? E.g. for the QEMU
>> website, the content is dual-licensed: https://www.qemu.org/license.html
> 
> While we're talking about licenses, the "All rights reserved." notice is
> out of place in a license header that declares that a lot of permissions
> are granted. Better to remove it to avoid any ambiguities that could
> result from the contradiction. (Applies to the whole series.)

Apart from that, it is also not required for other work anymore. See:

https://en.wikipedia.org/wiki/All_rights_reserved

 Thomas



[Qemu-devel] [PATCH v4 11/29] hw/arm: Express dependencies of realview, versatile and vexpress with Kconfig

2019-03-07 Thread Thomas Huth
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 21 +++---
 hw/arm/Kconfig  | 47 +
 hw/arm/Makefile.objs|  3 ++-
 hw/display/Kconfig  |  1 +
 hw/i2c/Kconfig  |  2 +-
 5 files changed, 54 insertions(+), 20 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 46ec4eb..41df0af 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -3,8 +3,6 @@
 # TODO: ARM_V7M is currently always required - make this more flexible!
 CONFIG_ARM_V7M=y
 
-CONFIG_PCI_DEVICES=y
-
 CONFIG_EXYNOS4=y
 CONFIG_HIGHBANK=y
 CONFIG_INTEGRATOR=y
@@ -15,6 +13,9 @@ CONFIG_CHEETAH=y
 CONFIG_SX1=y
 CONFIG_NSERIES=y
 CONFIG_STELLARIS=y
+CONFIG_REALVIEW=y
+CONFIG_VERSATILE=y
+CONFIG_VEXPRESS=y
 
 CONFIG_VGA=y
 CONFIG_NAND=y
@@ -23,8 +24,6 @@ CONFIG_SERIAL=y
 CONFIG_MAX7310=y
 CONFIG_TMP421=y
 CONFIG_PCA9552=y
-CONFIG_DDC=y
-CONFIG_SII9022=y
 CONFIG_ADS7846=y
 CONFIG_MAX111X=y
 CONFIG_SSI_M25P80=y
@@ -36,13 +35,8 @@ CONFIG_MICRODRIVE=y
 CONFIG_PLATFORM_BUS=y
 CONFIG_VIRTIO_MMIO=y
 
-CONFIG_ARM11MPCORE=y
-
 CONFIG_NETDUINO2=y
 
-CONFIG_PL041=y
-CONFIG_PL080=y
-CONFIG_PL190=y
 CONFIG_PL330=y
 CONFIG_CADENCE=y
 CONFIG_PXA2XX=y
@@ -50,12 +44,10 @@ CONFIG_FRAMEBUFFER=y
 CONFIG_XILINX_SPIPS=y
 CONFIG_ZYNQ_DEVCFG=y
 
-CONFIG_ARM11SCU=y
 CONFIG_DIGIC=y
 CONFIG_MAINSTONE=y
 CONFIG_MPS2=y
 CONFIG_RASPI=y
-CONFIG_REALVIEW=y
 CONFIG_ZAURUS=y
 CONFIG_ZYNQ=y
 CONFIG_STM32F2XX_TIMER=y
@@ -84,10 +76,6 @@ CONFIG_IOTKIT_SYSINFO=y
 CONFIG_ARMSSE_CPUID=y
 CONFIG_ARMSSE_MHU=y
 
-CONFIG_VERSATILE=y
-CONFIG_VERSATILE_PCI=y
-CONFIG_VERSATILE_I2C=y
-
 CONFIG_PCI_EXPRESS=y
 CONFIG_PCI_EXPRESS_GENERIC_BRIDGE=y
 
@@ -118,6 +106,3 @@ CONFIG_XILINX_AXI=y
 CONFIG_PCI_EXPRESS_DESIGNWARE=y
 
 CONFIG_STRONGARM=y
-
-# for realview and versatilepb
-CONFIG_LSI_SCSI_PCI=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index cb19fd3..2a82a4f 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -93,6 +93,29 @@ config PXA2XX
 
 config REALVIEW
 bool
+imply PCI_DEVICES
+select SMC91C111
+select LAN9118
+select A9MPCORE
+select A15MPCORE
+select ARM11MPCORE
+select ARM_TIMER
+select VERSATILE_PCI
+select WM8750 # audio codec
+select LSI_SCSI_PCI
+select PCI
+select PL011  # UART
+select PL031  # RTC
+select PL041  # audio codec
+select PL050  # keyboard/mouse
+select PL061  # GPIO
+select PL080  # DMA controller
+select PL110
+select PL181  # display
+select PL310  # cache controller
+select VERSATILE_I2C
+select DS1338 # I2C RTC+NVRAM
+select USB_OHCI
 
 config STELLARIS
 bool
@@ -116,6 +139,29 @@ config SX1
 
 config VERSATILE
 bool
+select ARM_TIMER # sp804
+select PFLASH_CFI01
+select LSI_SCSI_PCI
+select PL050  # keyboard/mouse
+select PL080  # DMA controller
+select PL190  # Vector PIC
+select REALVIEW
+select USB_OHCI
+
+config VEXPRESS
+bool
+select A9MPCORE
+select A15MPCORE
+select ARM_MPTIMER
+select ARM_TIMER # sp804
+select LAN9118
+select PFLASH_CFI01
+select PL011 # UART
+select PL041 # audio codec
+select PL181  # display
+select REALVIEW
+select SII9022
+select VIRTIO_MMIO
 
 config ZYNQ
 bool
@@ -189,6 +235,7 @@ config A15MPCORE
 
 config ARM11MPCORE
 bool
+select ARM11SCU
 
 config ARMSSE
 bool
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 8302b8d..bd0b45a 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -15,7 +15,8 @@ obj-$(CONFIG_PXA2XX) += gumstix.o spitz.o tosa.o z2.o
 obj-$(CONFIG_REALVIEW) += realview.o
 obj-$(CONFIG_STELLARIS) += stellaris.o
 obj-$(CONFIG_STRONGARM) += collie.o
-obj-$(CONFIG_VERSATILE) += vexpress.o versatilepb.o
+obj-$(CONFIG_VERSATILE) += versatilepb.o
+obj-$(CONFIG_VEXPRESS) += vexpress.o
 obj-$(CONFIG_ZYNQ) += xilinx_zynq.o
 
 obj-$(CONFIG_ARM_V7M) += armv7m.o
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index 364d628..25116e6 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -26,6 +26,7 @@ config PL110
 config SII9022
 bool
 depends on I2C
+select DDC
 
 config SSD0303
 bool
diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
index ef1caa6..0004893 100644
--- a/hw/i2c/Kconfig
+++ b/hw/i2c/Kconfig
@@ -12,7 +12,7 @@ config DDC
 
 config VERSATILE_I2C
 bool
-select I2C
+select BITBANG_I2C
 
 config ACPI_SMBUS
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 14/29] hw/arm: Express dependencies of collie with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the Strongarm collie machine.
This patch is based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 3 +--
 hw/arm/Kconfig  | 7 +++
 hw/arm/Makefile.objs| 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 54b1c61..44988f7 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -22,6 +22,7 @@ CONFIG_GUMSTIX=y
 CONFIG_SPITZ=y
 CONFIG_TOSA=y
 CONFIG_Z2=y
+CONFIG_COLLIE=y
 
 CONFIG_VGA=y
 CONFIG_TMP421=y
@@ -94,5 +95,3 @@ CONFIG_GPIO_KEY=y
 CONFIG_MSF2=y
 CONFIG_FW_CFG_DMA=y
 CONFIG_PCI_EXPRESS_DESIGNWARE=y
-
-CONFIG_STRONGARM=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index ef9cc97..43ef149 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -173,6 +173,13 @@ config STELLARIS
 
 config STRONGARM
 bool
+select PXA2XX
+
+config COLLIE
+bool
+select PFLASH_CFI01
+select ZAURUS  # scoop
+select STRONGARM
 
 config SX1
 bool
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 00328d1..729e711 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -17,7 +17,7 @@ obj-$(CONFIG_TOSA) += tosa.o
 obj-$(CONFIG_Z2) += z2.o
 obj-$(CONFIG_REALVIEW) += realview.o
 obj-$(CONFIG_STELLARIS) += stellaris.o
-obj-$(CONFIG_STRONGARM) += collie.o
+obj-$(CONFIG_COLLIE) += collie.o
 obj-$(CONFIG_VERSATILE) += versatilepb.o
 obj-$(CONFIG_VEXPRESS) += vexpress.o
 obj-$(CONFIG_ZYNQ) += xilinx_zynq.o
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 12/29] hw/arm: Express dependencies of the PXA2xx machines with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the PXA2xx machines (akita, borzoi,
connex and verdex gumstix, tosa, mainstone, spitz, terrier and z2).
This patch is based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 15 +-
 hw/arm/Kconfig  | 43 +
 hw/arm/Makefile.objs|  5 -
 3 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 41df0af..f3ac12c 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -16,22 +16,20 @@ CONFIG_STELLARIS=y
 CONFIG_REALVIEW=y
 CONFIG_VERSATILE=y
 CONFIG_VEXPRESS=y
+CONFIG_MAINSTONE=y
+CONFIG_GUMSTIX=y
+CONFIG_SPITZ=y
+CONFIG_TOSA=y
+CONFIG_Z2=y
 
 CONFIG_VGA=y
-CONFIG_NAND=y
-CONFIG_ECC=y
-CONFIG_SERIAL=y
-CONFIG_MAX7310=y
 CONFIG_TMP421=y
 CONFIG_PCA9552=y
-CONFIG_ADS7846=y
-CONFIG_MAX111X=y
 CONFIG_SSI_M25P80=y
 CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
 CONFIG_FTGMAC100=y
 CONFIG_DS1338=y
-CONFIG_MICRODRIVE=y
 CONFIG_PLATFORM_BUS=y
 CONFIG_VIRTIO_MMIO=y
 
@@ -39,16 +37,13 @@ CONFIG_NETDUINO2=y
 
 CONFIG_PL330=y
 CONFIG_CADENCE=y
-CONFIG_PXA2XX=y
 CONFIG_FRAMEBUFFER=y
 CONFIG_XILINX_SPIPS=y
 CONFIG_ZYNQ_DEVCFG=y
 
 CONFIG_DIGIC=y
-CONFIG_MAINSTONE=y
 CONFIG_MPS2=y
 CONFIG_RASPI=y
-CONFIG_ZAURUS=y
 CONFIG_ZYNQ=y
 CONFIG_STM32F2XX_TIMER=y
 CONFIG_STM32F2XX_USART=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 2a82a4f..1a3ad0f 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -51,6 +51,9 @@ config INTEGRATOR
 
 config MAINSTONE
 bool
+select PXA2XX
+select PFLASH_CFI01
+select SMC91C111
 
 config MUSICPAL
 bool
@@ -90,6 +93,44 @@ config OMAP
 
 config PXA2XX
 bool
+select FRAMEBUFFER
+select I2C
+select PCI
+select SERIAL
+select SD
+select SSI
+select USB_OHCI
+
+config GUMSTIX
+bool
+select PFLASH_CFI01
+select SMC91C111
+select PXA2XX
+
+config TOSA
+bool
+select ZAURUS  # scoop
+select MICRODRIVE
+select PXA2XX
+
+config SPITZ
+bool
+select ADS7846 # display
+select MAX111X # A/D converter
+select WM8750  # audio codec
+select MAX7310 # GPIO expander
+select ZAURUS  # scoop
+select NAND# memory
+select ECC # Error-correcting for NAND
+select MICRODRIVE
+select PXA2XX
+
+config Z2
+bool
+select PFLASH_CFI01
+select WM8750
+select PL011 # UART
+select PXA2XX
 
 config REALVIEW
 bool
@@ -222,6 +263,8 @@ config MSF2
 
 config ZAURUS
 bool
+select NAND
+select ECC
 
 config A9MPCORE
 bool
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index bd0b45a..00328d1 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -11,7 +11,10 @@ obj-$(CONFIG_NETDUINO2) += netduino2.o
 obj-$(CONFIG_NSERIES) += nseries.o
 obj-$(CONFIG_SX1) += omap_sx1.o
 obj-$(CONFIG_CHEETAH) += palm.o
-obj-$(CONFIG_PXA2XX) += gumstix.o spitz.o tosa.o z2.o
+obj-$(CONFIG_GUMSTIX) += gumstix.o
+obj-$(CONFIG_SPITZ) += spitz.o
+obj-$(CONFIG_TOSA) += tosa.o
+obj-$(CONFIG_Z2) += z2.o
 obj-$(CONFIG_REALVIEW) += realview.o
 obj-$(CONFIG_STELLARIS) += stellaris.o
 obj-$(CONFIG_STRONGARM) += collie.o
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 16/29] hw/arm: Express dependencies of the virt machine with Kconfig

2019-03-07 Thread Thomas Huth
Dependencies have been determined by looking at hw/arm/virt.c

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 11 +--
 hw/arm/Kconfig  | 18 ++
 hw/arm/Makefile.objs|  3 ++-
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 81c8156..79996a3 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -3,6 +3,7 @@
 # TODO: ARM_V7M is currently always required - make this more flexible!
 CONFIG_ARM_V7M=y
 
+CONFIG_ARM_VIRT=y
 CONFIG_EXYNOS4=y
 CONFIG_HIGHBANK=y
 CONFIG_INTEGRATOR=y
@@ -29,8 +30,6 @@ CONFIG_VGA=y
 CONFIG_SSI_M25P80=y
 CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
-CONFIG_PLATFORM_BUS=y
-CONFIG_VIRTIO_MMIO=y
 
 CONFIG_NETDUINO2=y
 
@@ -65,9 +64,6 @@ CONFIG_IOTKIT_SYSINFO=y
 CONFIG_ARMSSE_CPUID=y
 CONFIG_ARMSSE_MHU=y
 
-CONFIG_PCI_EXPRESS=y
-CONFIG_PCI_EXPRESS_GENERIC_BRIDGE=y
-
 CONFIG_ALLWINNER_A10_PIT=y
 CONFIG_ALLWINNER_A10_PIC=y
 CONFIG_ALLWINNER_A10=y
@@ -83,10 +79,5 @@ CONFIG_PCIE_PORT=y
 CONFIG_XIO3130=y
 CONFIG_IOH3420=y
 CONFIG_I82801B11=y
-CONFIG_ACPI=y
-CONFIG_ARM_VIRT=y
-CONFIG_SMBIOS=y
-CONFIG_GPIO_KEY=y
 CONFIG_MSF2=y
-CONFIG_FW_CFG_DMA=y
 CONFIG_PCI_EXPRESS_DESIGNWARE=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index e162049..76cf754 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -1,6 +1,23 @@
 config ARM_VIRT
 bool
+imply PCI_DEVICES
+imply VFIO_AMD_XGBE
 imply VFIO_PLATFORM
+imply VFIO_XGMAC
+select A15MPCORE
+select ACPI
+select ARM_SMMUV3
+select GPIO_KEY
+select FW_CFG_DMA
+select PCI_EXPRESS
+select PCI_EXPRESS_GENERIC_BRIDGE
+select PFLASH_CFI01
+select PL011 # UART
+select PL031 # RTC
+select PL061 # GPIO
+select PLATFORM_BUS
+select SMBIOS
+select VIRTIO_MMIO
 
 config CHEETAH
 bool
@@ -306,6 +323,7 @@ config A9MPCORE
 
 config A15MPCORE
 bool
+select ARM_GIC
 
 config ARM11MPCORE
 bool
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 729e711..4f591ca 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -1,4 +1,5 @@
-obj-y += boot.o sysbus-fdt.o
+obj-y += boot.o
+obj-$(CONFIG_PLATFORM_BUS) += sysbus-fdt.o
 obj-$(CONFIG_ARM_VIRT) += virt.o
 obj-$(CONFIG_ACPI) += virt-acpi-build.o
 obj-$(CONFIG_DIGIC) += digic_boards.o
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 06/29] hw/arm: Express dependencies of integratorcp with Kconfig

2019-03-07 Thread Thomas Huth
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 8 +---
 hw/arm/Kconfig  | 9 +
 hw/display/Kconfig  | 1 +
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 13cfffa..51032c5 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -7,6 +7,7 @@ CONFIG_PCI_DEVICES=y
 
 CONFIG_EXYNOS4=y
 CONFIG_HIGHBANK=y
+CONFIG_INTEGRATOR=y
 
 CONFIG_VGA=y
 CONFIG_NAND=y
@@ -31,7 +32,6 @@ CONFIG_ADS7846=y
 CONFIG_MAX111X=y
 CONFIG_SSI_SD=y
 CONFIG_SSI_M25P80=y
-CONFIG_SMC91C111=y
 CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
 CONFIG_FTGMAC100=y
@@ -48,10 +48,7 @@ CONFIG_ARM11MPCORE=y
 CONFIG_NETDUINO2=y
 
 CONFIG_PL041=y
-CONFIG_PL050=y
 CONFIG_PL080=y
-CONFIG_PL110=y
-CONFIG_PL181=y
 CONFIG_PL190=y
 CONFIG_PL330=y
 CONFIG_CADENCE=y
@@ -111,9 +108,6 @@ CONFIG_VERSATILE_I2C=y
 CONFIG_PCI_EXPRESS=y
 CONFIG_PCI_EXPRESS_GENERIC_BRIDGE=y
 
-CONFIG_INTEGRATOR=y
-CONFIG_INTEGRATOR_DEBUG=y
-
 CONFIG_ALLWINNER_A10_PIT=y
 CONFIG_ALLWINNER_A10_PIC=y
 CONFIG_ALLWINNER_A10=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 2747e2b..a08a863 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -34,6 +34,15 @@ config HIGHBANK
 
 config INTEGRATOR
 bool
+select ARM_TIMER
+select INTEGRATOR_DEBUG
+select PL011 # UART
+select PL031 # RTC
+select PL050 # keyboard/mouse
+select PL110 # pl111 LCD controller
+select PL181 # display
+select PCI
+select SMC91C111
 
 config MAINSTONE
 bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index a96ea76..364d628 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -21,6 +21,7 @@ config JAZZ_LED
 
 config PL110
 bool
+select FRAMEBUFFER
 
 config SII9022
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 15/29] hw/arm: Express dependencies of the aspeed boards with Kconfig

2019-03-07 Thread Thomas Huth
Dependencies have been determined by looking at hw/arm/aspeed.c

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak |  7 +--
 hw/arm/Kconfig  | 10 ++
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 44988f7..81c8156 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -23,15 +23,12 @@ CONFIG_SPITZ=y
 CONFIG_TOSA=y
 CONFIG_Z2=y
 CONFIG_COLLIE=y
+CONFIG_ASPEED_SOC=y
 
 CONFIG_VGA=y
-CONFIG_TMP421=y
-CONFIG_PCA9552=y
 CONFIG_SSI_M25P80=y
 CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
-CONFIG_FTGMAC100=y
-CONFIG_DS1338=y
 CONFIG_PLATFORM_BUS=y
 CONFIG_VIRTIO_MMIO=y
 
@@ -89,8 +86,6 @@ CONFIG_I82801B11=y
 CONFIG_ACPI=y
 CONFIG_ARM_VIRT=y
 CONFIG_SMBIOS=y
-CONFIG_ASPEED_SOC=y
-CONFIG_SMBUS_EEPROM=y
 CONFIG_GPIO_KEY=y
 CONFIG_MSF2=y
 CONFIG_FW_CFG_DMA=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 43ef149..e162049 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -262,6 +262,16 @@ config FSL_IMX6
 
 config ASPEED_SOC
 bool
+select DS1338
+select FTGMAC100
+select I2C
+select PCA9552
+select SERIAL
+select SMBUS_EEPROM
+select SSI
+select SSI_M25P80
+select TMP105
+select TMP421
 
 config MPS2
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 10/29] hw/arm: Express dependencies of stellaris with Kconfig

2019-03-07 Thread Thomas Huth
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak |  7 +--
 hw/arm/Kconfig  | 10 ++
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 2c07f5c..46ec4eb 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -14,6 +14,7 @@ CONFIG_MUSCA=y
 CONFIG_CHEETAH=y
 CONFIG_SX1=y
 CONFIG_NSERIES=y
+CONFIG_STELLARIS=y
 
 CONFIG_VGA=y
 CONFIG_NAND=y
@@ -22,16 +23,10 @@ CONFIG_SERIAL=y
 CONFIG_MAX7310=y
 CONFIG_TMP421=y
 CONFIG_PCA9552=y
-CONFIG_STELLARIS=y
-CONFIG_STELLARIS_INPUT=y
-CONFIG_STELLARIS_ENET=y
-CONFIG_SSD0303=y
-CONFIG_SSD0323=y
 CONFIG_DDC=y
 CONFIG_SII9022=y
 CONFIG_ADS7846=y
 CONFIG_MAX111X=y
-CONFIG_SSI_SD=y
 CONFIG_SSI_M25P80=y
 CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index cfb3ab1..cb19fd3 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -96,6 +96,16 @@ config REALVIEW
 
 config STELLARIS
 bool
+select ARM_V7M
+select I2C
+select PL011 # UART
+select PL022 # Serial port
+select PL061 # GPIO
+select SSD0303 # OLED display
+select SSD0323 # OLED display
+select SSI_SD
+select STELLARIS_INPUT
+select STELLARIS_ENET # ethernet
 
 config STRONGARM
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 03/29] hw/sd/sdhci: Move PCI-related code into a separate file

2019-03-07 Thread Thomas Huth
Some machines have an SDHCI device, but no PCI. To be able to
compile hw/sd/sdhci.c without CONFIG_PCI, we must not call functions
like pci_get_address_space() and pci_allocate_irq() there. Thus
move the PCI-related code into a separate file.

This is required for the new Kconfig-like build system, e.g. it is
needed if a user wants to compile a QEMU binary with just one machine
that has SDHCI, but no PCI, like the ARM "raspi" machines for example.

Signed-off-by: Thomas Huth 
---
 hw/sd/Kconfig  |  6 +++-
 hw/sd/Makefile.objs|  1 +
 hw/sd/sdhci-internal.h | 34 ++
 hw/sd/sdhci-pci.c  | 87 
 hw/sd/sdhci.c  | 98 +++---
 5 files changed, 132 insertions(+), 94 deletions(-)
 create mode 100644 hw/sd/sdhci-pci.c

diff --git a/hw/sd/Kconfig b/hw/sd/Kconfig
index 864f535..c5e1e55 100644
--- a/hw/sd/Kconfig
+++ b/hw/sd/Kconfig
@@ -12,6 +12,10 @@ config SD
 
 config SDHCI
 bool
+select SD
+
+config SDHCI_PCI
+bool
 default y if PCI_DEVICES
 depends on PCI
-select SD
+select SDHCI
diff --git a/hw/sd/Makefile.objs b/hw/sd/Makefile.objs
index a99d9fb..0665727 100644
--- a/hw/sd/Makefile.objs
+++ b/hw/sd/Makefile.objs
@@ -2,6 +2,7 @@ common-obj-$(CONFIG_PL181) += pl181.o
 common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
 common-obj-$(CONFIG_SD) += sd.o core.o sdmmc-internal.o
 common-obj-$(CONFIG_SDHCI) += sdhci.o
+common-obj-$(CONFIG_SDHCI_PCI) += sdhci-pci.o
 
 obj-$(CONFIG_MILKYMIST) += milkymist-memcard.o
 obj-$(CONFIG_OMAP) += omap_mmc.o
diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h
index 19665fd..3414140 100644
--- a/hw/sd/sdhci-internal.h
+++ b/hw/sd/sdhci-internal.h
@@ -304,4 +304,38 @@ extern const VMStateDescription sdhci_vmstate;
 
 #define ESDHC_PRNSTS_SDSTB  (1 << 3)
 
+/*
+ * Default SD/MMC host controller features information, which will be
+ * presented in CAPABILITIES register of generic SD host controller at reset.
+ *
+ * support:
+ * - 3.3v and 1.8v voltages
+ * - SDMA/ADMA1/ADMA2
+ * - high-speed
+ * max host controller R/W buffers size: 512B
+ * max clock frequency for SDclock: 52 MHz
+ * timeout clock frequency: 52 MHz
+ *
+ * does not support:
+ * - 3.0v voltage
+ * - 64-bit system bus
+ * - suspend/resume
+ */
+#define SDHC_CAPAB_REG_DEFAULT 0x057834b4
+
+#define DEFINE_SDHCI_COMMON_PROPERTIES(_state) \
+DEFINE_PROP_UINT8("sd-spec-version", _state, sd_spec_version, 2), \
+DEFINE_PROP_UINT8("uhs", _state, uhs_mode, UHS_NOT_SUPPORTED), \
+\
+/* Capabilities registers provide information on supported
+ * features of this specific host controller implementation */ \
+DEFINE_PROP_UINT64("capareg", _state, capareg, SDHC_CAPAB_REG_DEFAULT), \
+DEFINE_PROP_UINT64("maxcurr", _state, maxcurr, 0)
+
+void sdhci_initfn(SDHCIState *s);
+void sdhci_uninitfn(SDHCIState *s);
+void sdhci_common_realize(SDHCIState *s, Error **errp);
+void sdhci_common_unrealize(SDHCIState *s, Error **errp);
+void sdhci_common_class_init(ObjectClass *klass, void *data);
+
 #endif
diff --git a/hw/sd/sdhci-pci.c b/hw/sd/sdhci-pci.c
new file mode 100644
index 000..f884661
--- /dev/null
+++ b/hw/sd/sdhci-pci.c
@@ -0,0 +1,87 @@
+/*
+ * SDHCI device on PCI
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see .
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "hw/hw.h"
+#include "hw/sd/sdhci.h"
+#include "sdhci-internal.h"
+
+static Property sdhci_pci_properties[] = {
+DEFINE_SDHCI_COMMON_PROPERTIES(SDHCIState),
+DEFINE_PROP_END_OF_LIST(),
+};
+
+static void sdhci_pci_realize(PCIDevice *dev, Error **errp)
+{
+SDHCIState *s = PCI_SDHCI(dev);
+Error *local_err = NULL;
+
+sdhci_initfn(s);
+sdhci_common_realize(s, _err);
+if (local_err) {
+error_propagate(errp, local_err);
+return;
+}
+
+dev->config[PCI_CLASS_PROG] = 0x01; /* Standard Host supported DMA */
+dev->config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin A */
+s->irq = pci_allocate_irq(dev);
+s->dma_as = pci_get_address_space(dev);
+pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, >iomem);
+}
+
+static void sdhci_pci_exit(PCIDevice *dev)
+{
+SDHCIState *s = PCI_SDHCI(dev);
+
+sdhci_common_unrealize(s, _abort);
+sdhci_uninitfn(s);
+}
+
+static void sdhci_pci_class_init(ObjectClass 

[Qemu-devel] [PATCH v4 13/29] hw/arm: Express dependencies of xilinx-zynq with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the xilinx-zynq-a9 board.
This patch is based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak |  7 +--
 hw/arm/Kconfig  | 14 ++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index f3ac12c..54b1c61 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -16,6 +16,7 @@ CONFIG_STELLARIS=y
 CONFIG_REALVIEW=y
 CONFIG_VERSATILE=y
 CONFIG_VEXPRESS=y
+CONFIG_ZYNQ=y
 CONFIG_MAINSTONE=y
 CONFIG_GUMSTIX=y
 CONFIG_SPITZ=y
@@ -35,16 +36,11 @@ CONFIG_VIRTIO_MMIO=y
 
 CONFIG_NETDUINO2=y
 
-CONFIG_PL330=y
-CONFIG_CADENCE=y
 CONFIG_FRAMEBUFFER=y
-CONFIG_XILINX_SPIPS=y
-CONFIG_ZYNQ_DEVCFG=y
 
 CONFIG_DIGIC=y
 CONFIG_MPS2=y
 CONFIG_RASPI=y
-CONFIG_ZYNQ=y
 CONFIG_STM32F2XX_TIMER=y
 CONFIG_STM32F2XX_USART=y
 CONFIG_STM32F2XX_SYSCFG=y
@@ -97,7 +93,6 @@ CONFIG_SMBUS_EEPROM=y
 CONFIG_GPIO_KEY=y
 CONFIG_MSF2=y
 CONFIG_FW_CFG_DMA=y
-CONFIG_XILINX_AXI=y
 CONFIG_PCI_EXPRESS_DESIGNWARE=y
 
 CONFIG_STRONGARM=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 1a3ad0f..ef9cc97 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -206,6 +206,20 @@ config VEXPRESS
 
 config ZYNQ
 bool
+select A9MPCORE
+select CADENCE # UART
+select PCI
+select PFLASH_CFI02
+select PL330
+select SDHCI
+select SSI_M25P80
+select USB_EHCI
+select USB_EHCI_SYSBUS
+select XILINX # UART
+select XILINX_AXI
+select XILINX_SPI
+select XILINX_SPIPS
+select ZYNQ_DEVCFG
 
 config ARM_V7M
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 05/29] hw/arm: Express dependencies of the highbank machines with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the highbank machine (and the midway
machine).
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak |  9 +
 hw/arm/Kconfig  | 12 
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 3475d50..13cfffa 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -6,6 +6,7 @@ CONFIG_ARM_V7M=y
 CONFIG_PCI_DEVICES=y
 
 CONFIG_EXYNOS4=y
+CONFIG_HIGHBANK=y
 
 CONFIG_VGA=y
 CONFIG_NAND=y
@@ -43,24 +44,17 @@ CONFIG_PLATFORM_BUS=y
 CONFIG_VIRTIO_MMIO=y
 
 CONFIG_ARM11MPCORE=y
-CONFIG_A15MPCORE=y
 
 CONFIG_NETDUINO2=y
 
-CONFIG_ARM_TIMER=y
-CONFIG_PL011=y
-CONFIG_PL022=y
-CONFIG_PL031=y
 CONFIG_PL041=y
 CONFIG_PL050=y
-CONFIG_PL061=y
 CONFIG_PL080=y
 CONFIG_PL110=y
 CONFIG_PL181=y
 CONFIG_PL190=y
 CONFIG_PL330=y
 CONFIG_CADENCE=y
-CONFIG_XGMAC=y
 CONFIG_PXA2XX=y
 CONFIG_BITBANG_I2C=y
 CONFIG_FRAMEBUFFER=y
@@ -148,7 +142,6 @@ CONFIG_XILINX_AXI=y
 CONFIG_PCI_EXPRESS_DESIGNWARE=y
 
 CONFIG_STRONGARM=y
-CONFIG_HIGHBANK=y
 CONFIG_MUSICPAL=y
 
 # for realview and versatilepb
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 74436cc..2747e2b 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -19,6 +19,18 @@ config EXYNOS4
 
 config HIGHBANK
 bool
+select A9MPCORE
+select A15MPCORE
+select AHCI
+select ARM_TIMER # sp804
+select ARM_V7M
+select PCI
+select PL011 # UART
+select PL022 # Serial port
+select PL031 # RTC
+select PL061 # GPIO
+select PL310 # cache controller
+select XGMAC # ethernet
 
 config INTEGRATOR
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 04/29] hw/arm: Express dependencies of the exynos machines with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the Exynos-related boards (nuri and
smdkc210).
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 18 ++
 hw/arm/Kconfig  | 11 +++
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 2a7efc1..3475d50 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -1,7 +1,12 @@
 # Default configuration for arm-softmmu
 
-CONFIG_PCI=y
+# TODO: ARM_V7M is currently always required - make this more flexible!
+CONFIG_ARM_V7M=y
+
 CONFIG_PCI_DEVICES=y
+
+CONFIG_EXYNOS4=y
+
 CONFIG_VGA=y
 CONFIG_NAND=y
 CONFIG_ECC=y
@@ -25,7 +30,6 @@ CONFIG_ADS7846=y
 CONFIG_MAX111X=y
 CONFIG_SSI_SD=y
 CONFIG_SSI_M25P80=y
-CONFIG_LAN9118=y
 CONFIG_SMC91C111=y
 CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
@@ -35,21 +39,15 @@ CONFIG_PFLASH_CFI01=y
 CONFIG_PFLASH_CFI02=y
 CONFIG_MICRODRIVE=y
 CONFIG_USB_MUSB=y
-CONFIG_USB_EHCI_SYSBUS=y
 CONFIG_PLATFORM_BUS=y
 CONFIG_VIRTIO_MMIO=y
 
 CONFIG_ARM11MPCORE=y
-CONFIG_A9MPCORE=y
 CONFIG_A15MPCORE=y
 
-CONFIG_ARM_V7M=y
 CONFIG_NETDUINO2=y
 
-CONFIG_ARM_GIC=y
 CONFIG_ARM_TIMER=y
-CONFIG_ARM_MPTIMER=y
-CONFIG_A9_GTIMER=y
 CONFIG_PL011=y
 CONFIG_PL022=y
 CONFIG_PL031=y
@@ -60,11 +58,9 @@ CONFIG_PL080=y
 CONFIG_PL110=y
 CONFIG_PL181=y
 CONFIG_PL190=y
-CONFIG_PL310=y
 CONFIG_PL330=y
 CONFIG_CADENCE=y
 CONFIG_XGMAC=y
-CONFIG_EXYNOS4=y
 CONFIG_PXA2XX=y
 CONFIG_BITBANG_I2C=y
 CONFIG_FRAMEBUFFER=y
@@ -72,7 +68,6 @@ CONFIG_XILINX_SPIPS=y
 CONFIG_ZYNQ_DEVCFG=y
 
 CONFIG_ARM11SCU=y
-CONFIG_A9SCU=y
 CONFIG_DIGIC=y
 CONFIG_MARVELL_88W8618=y
 CONFIG_OMAP=y
@@ -122,7 +117,6 @@ CONFIG_VERSATILE_I2C=y
 CONFIG_PCI_EXPRESS=y
 CONFIG_PCI_EXPRESS_GENERIC_BRIDGE=y
 
-CONFIG_SDHCI=y
 CONFIG_INTEGRATOR=y
 CONFIG_INTEGRATOR_DEBUG=y
 
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index d298fbd..74436cc 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -8,7 +8,14 @@ config DIGIC
 
 config EXYNOS4
 bool
+select A9MPCORE
+select I2C
+select LAN9118
+select PCI
+select PL310 # cache controller
 select PTIMER
+select SDHCI
+select USB_EHCI_SYSBUS
 
 config HIGHBANK
 bool
@@ -104,6 +111,10 @@ config ZAURUS
 
 config A9MPCORE
 bool
+select A9_GTIMER
+select A9SCU   # snoop control unit
+select ARM_GIC
+select ARM_MPTIMER
 
 config A15MPCORE
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 09/29] hw/arm: Express dependencies of the OMAP machines with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the OMAP machines (cheetah, n800, n810,
sx1 and sx1-v1).
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 17 -
 hw/arm/Kconfig  | 26 ++
 hw/arm/Makefile.objs|  3 ++-
 3 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index a058bcb..2c07f5c 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -10,16 +10,16 @@ CONFIG_HIGHBANK=y
 CONFIG_INTEGRATOR=y
 CONFIG_FSL_IMX31=y
 CONFIG_MUSICPAL=y
+CONFIG_MUSCA=y
+CONFIG_CHEETAH=y
+CONFIG_SX1=y
+CONFIG_NSERIES=y
 
 CONFIG_VGA=y
 CONFIG_NAND=y
 CONFIG_ECC=y
 CONFIG_SERIAL=y
 CONFIG_MAX7310=y
-CONFIG_TWL92230=y
-CONFIG_TSC2005=y
-CONFIG_LM832X=y
-CONFIG_TMP105=y
 CONFIG_TMP421=y
 CONFIG_PCA9552=y
 CONFIG_STELLARIS=y
@@ -37,9 +37,7 @@ CONFIG_ALLWINNER_EMAC=y
 CONFIG_IMX_FEC=y
 CONFIG_FTGMAC100=y
 CONFIG_DS1338=y
-CONFIG_PFLASH_CFI01=y
 CONFIG_MICRODRIVE=y
-CONFIG_USB_MUSB=y
 CONFIG_PLATFORM_BUS=y
 CONFIG_VIRTIO_MMIO=y
 
@@ -59,15 +57,8 @@ CONFIG_ZYNQ_DEVCFG=y
 
 CONFIG_ARM11SCU=y
 CONFIG_DIGIC=y
-CONFIG_OMAP=y
-CONFIG_TSC210X=y
-CONFIG_BLIZZARD=y
-CONFIG_ONENAND=y
-CONFIG_TUSB6010=y
 CONFIG_MAINSTONE=y
 CONFIG_MPS2=y
-CONFIG_MUSCA=y
-CONFIG_NSERIES=y
 CONFIG_RASPI=y
 CONFIG_REALVIEW=y
 CONFIG_ZAURUS=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 08c213d..cfb3ab1 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -2,6 +2,11 @@ config ARM_VIRT
 bool
 imply VFIO_PLATFORM
 
+config CHEETAH
+bool
+select OMAP
+select TSC210X
+
 config DIGIC
 bool
 select PTIMER
@@ -62,9 +67,26 @@ config NETDUINO2
 
 config NSERIES
 bool
+select OMAP
+select TMP105   # tempature sensor
+select BLIZZARD # LCD/TV controller
+select ONENAND
+select TSC210X  # touchscreen/sensors/audio
+select TSC2005  # touchscreen/sensors/keypad
+select LM832X   # GPIO keyboard chip
+select TWL92230 # energy-management
+select TUSB6010
 
 config OMAP
 bool
+select FRAMEBUFFER
+select I2C
+select ECC
+select NAND
+select PFLASH_CFI01
+select PCI
+select SD
+select SERIAL
 
 config PXA2XX
 bool
@@ -78,6 +100,10 @@ config STELLARIS
 config STRONGARM
 bool
 
+config SX1
+bool
+select OMAP
+
 config VERSATILE
 bool
 
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index fa57c7c..8302b8d 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -9,7 +9,8 @@ obj-$(CONFIG_MAINSTONE) += mainstone.o
 obj-$(CONFIG_MUSICPAL) += musicpal.o
 obj-$(CONFIG_NETDUINO2) += netduino2.o
 obj-$(CONFIG_NSERIES) += nseries.o
-obj-$(CONFIG_OMAP) += omap_sx1.o palm.o
+obj-$(CONFIG_SX1) += omap_sx1.o
+obj-$(CONFIG_CHEETAH) += palm.o
 obj-$(CONFIG_PXA2XX) += gumstix.o spitz.o tosa.o z2.o
 obj-$(CONFIG_REALVIEW) += realview.o
 obj-$(CONFIG_STELLARIS) += stellaris.o
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 07/29] hw/arm: Express dependencies of the fsl-imx31 machine with Kconfig

2019-03-07 Thread Thomas Huth
Add Kconfig dependencies for the fsl-imx31 / kzm machine.
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 3 +--
 hw/arm/Kconfig  | 5 +
 hw/misc/Kconfig | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 51032c5..a2e74cd 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -8,6 +8,7 @@ CONFIG_PCI_DEVICES=y
 CONFIG_EXYNOS4=y
 CONFIG_HIGHBANK=y
 CONFIG_INTEGRATOR=y
+CONFIG_FSL_IMX31=y
 
 CONFIG_VGA=y
 CONFIG_NAND=y
@@ -66,7 +67,6 @@ CONFIG_TSC210X=y
 CONFIG_BLIZZARD=y
 CONFIG_ONENAND=y
 CONFIG_TUSB6010=y
-CONFIG_IMX=y
 CONFIG_MAINSTONE=y
 CONFIG_MPS2=y
 CONFIG_MUSCA=y
@@ -113,7 +113,6 @@ CONFIG_ALLWINNER_A10_PIC=y
 CONFIG_ALLWINNER_A10=y
 
 CONFIG_FSL_IMX6=y
-CONFIG_FSL_IMX31=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index a08a863..40c79d2 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -101,6 +101,11 @@ config FSL_IMX25
 
 config FSL_IMX31
 bool
+select SERIAL
+select IMX
+select IMX_I2C
+select LAN9118
+select PCI
 
 config FSL_IMX6
 bool
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
index 2c60be9..4db73ec 100644
--- a/hw/misc/Kconfig
+++ b/hw/misc/Kconfig
@@ -76,6 +76,8 @@ config ECCMEMCTL
 config IMX
 bool
 select PTIMER
+select SSI
+select USB_EHCI_SYSBUS
 
 config STM32F2XX_SYSCFG
 bool
-- 
1.8.3.1




Re: [Qemu-devel] Question about hardware cursor in VGA

2019-03-07 Thread BALATON Zoltan

On Thu, 7 Mar 2019, Gerd Hoffmann wrote:

On Wed, Mar 06, 2019 at 02:50:36PM +0100, BALATON Zoltan wrote:

On Wed, 6 Mar 2019, Gerd Hoffmann wrote:

On Wed, Mar 06, 2019 at 12:48:59AM +0100, BALATON Zoltan wrote:

On Tue, 5 Mar 2019, Gerd Hoffmann wrote:

Use dpy_cursor_define().


I've done that but it's not working very well. The mouse pointer is quite
jumpy with this and there are some problems updating the pointer image when
the guest changes image data in video ram without changing registers. (Like


When using a relative pointing device (i.e. mouse instead of tablet) you
also need dpy_mouse_set(), to update the host mouse position when the
guest moves the cursor sprite around.


Sure, I figured that out otherwise the mouse pointer would not move.


Is it possible to figure where the cursor hotspot is?


Not sure what you mean. I call dpy_mouse_set() on writing the reg that
contains mouse position. Hot spot is always top left of sprite (or I don't
know where it's set). I'll submit a v5 after adding some more checks to make
it a bit safer then you can have a look.


Well, paravirtual graphics devices propagate the hot-spot information
from the guest to the host.  But on real hardware you typically don't
have registers for that information as the GPU doesn't need to know the
hotspot for cursor display.  The guest driver can simply take the
hotspot location into account when programming the cursor position into
the hardware registers.

So, the suggestion to use dpy_cursor_define() wasn't a good one after
all.  I totally forgot about the hotspot issue as I work with
paravirtual graphics devices most of the time.  Sorry for that.


Hmm, OK but this still does not explain why mouse is jumping when it's 
just moved around without changing the image.



least doing hw cursor like this works somewhat but I note that the other
version with cursor_invalidate and cursor_draw_line callbacks worked much
smoother, alas I've found that cannot work with shared_surface.


There is a VGAComminState->force_shadow ...


Yes, but that would also make things slower so I like to keep advantage of
shared_surface and try to fix the jumpy mouse we get with define_cursor
instead if possible.


Its not so much a performance issue.  But you need a round-trip to the
guest to update the cursor position, which adds noticeable latency to
mouse moves ...


It's not a big performance issue when rendering the mouse but may be when 
rendering the screen having to copy contents to the display surface at 
each refresh (at least the part that changed) instead of using it directly 
from guest VRAM with shared_surface where this copy is avoided if I got 
that right.


I still have the unfinished version using the callbacks which might work 
with force_shadow like for cirrus but I'd need to finish and clean that 
up. Now that we have both implemented probably will allow switching 
between them but may not be able to do it before the freeze so don't wait 
for that. (The define_cursor way is enough for testing at the moment and 
rewriting it to use different callback could be considered bugfix or 
added in next devel cycle as well.)


Regards,
BALATON Zoltan



[Qemu-devel] [PATCH v4 02/29] hw/ide/ahci: Add a Kconfig switch for the AHDI-ICH9 device

2019-03-07 Thread Thomas Huth
Some of our machines (like the ARM cubieboard) use CONFIG_AHCI for an AHCI
sysbus device, but do not use CONFIG_PCI since they do not feature a PCI
bus. With CONFIG_AHCI but without CONFIG_PCI, currently linking fails:

../hw/ide/ich.o: In function `pci_ich9_ahci_realize':
hw/ide/ich.c:124: undefined reference to `pci_allocate_irq'
hw/ide/ich.c:126: undefined reference to `pci_register_bar'
hw/ide/ich.c:128: undefined reference to `pci_register_bar'
hw/ide/ich.c:131: undefined reference to `pci_add_capability'
hw/ide/ich.c:147: undefined reference to `msi_init'
../hw/ide/ich.o: In function `pci_ich9_uninit':
hw/ide/ich.c:158: undefined reference to `msi_uninit'
../hw/ide/ich.o:(.data.rel+0x50): undefined reference to 
`vmstate_pci_device'

We must only compile ich.c if CONFIG_PCI is available, too, so introduce a
new config switch for this device.

Signed-off-by: Thomas Huth 
---
 hw/ide/Kconfig   | 6 +-
 hw/ide/Makefile.objs | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig
index ab47b6a..5d9106b 100644
--- a/hw/ide/Kconfig
+++ b/hw/ide/Kconfig
@@ -44,9 +44,13 @@ config MICRODRIVE
 
 config AHCI
 bool
+select IDE_QDEV
+
+config AHCI_ICH9
+bool
 default y if PCI_DEVICES
 depends on PCI
-select IDE_QDEV
+select AHCI
 
 config IDE_SII3112
 bool
diff --git a/hw/ide/Makefile.objs b/hw/ide/Makefile.objs
index a142add..faf04e0 100644
--- a/hw/ide/Makefile.objs
+++ b/hw/ide/Makefile.objs
@@ -9,6 +9,6 @@ common-obj-$(CONFIG_IDE_MMIO) += mmio.o
 common-obj-$(CONFIG_IDE_VIA) += via.o
 common-obj-$(CONFIG_MICRODRIVE) += microdrive.o
 common-obj-$(CONFIG_AHCI) += ahci.o
-common-obj-$(CONFIG_AHCI) += ich.o
+common-obj-$(CONFIG_AHCI_ICH9) += ich.o
 common-obj-$(CONFIG_ALLWINNER_A10) += ahci-allwinner.o
 common-obj-$(CONFIG_IDE_SII3112) += sii3112.o
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 08/29] hw/arm: Express dependencies of musicpal with Kconfig

2019-03-07 Thread Thomas Huth
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Signed-off-by: Thomas Huth 
---
 default-configs/arm-softmmu.mak | 6 +-
 hw/arm/Kconfig  | 6 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index a2e74cd..a058bcb 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -9,13 +9,13 @@ CONFIG_EXYNOS4=y
 CONFIG_HIGHBANK=y
 CONFIG_INTEGRATOR=y
 CONFIG_FSL_IMX31=y
+CONFIG_MUSICPAL=y
 
 CONFIG_VGA=y
 CONFIG_NAND=y
 CONFIG_ECC=y
 CONFIG_SERIAL=y
 CONFIG_MAX7310=y
-CONFIG_WM8750=y
 CONFIG_TWL92230=y
 CONFIG_TSC2005=y
 CONFIG_LM832X=y
@@ -38,7 +38,6 @@ CONFIG_IMX_FEC=y
 CONFIG_FTGMAC100=y
 CONFIG_DS1338=y
 CONFIG_PFLASH_CFI01=y
-CONFIG_PFLASH_CFI02=y
 CONFIG_MICRODRIVE=y
 CONFIG_USB_MUSB=y
 CONFIG_PLATFORM_BUS=y
@@ -54,14 +53,12 @@ CONFIG_PL190=y
 CONFIG_PL330=y
 CONFIG_CADENCE=y
 CONFIG_PXA2XX=y
-CONFIG_BITBANG_I2C=y
 CONFIG_FRAMEBUFFER=y
 CONFIG_XILINX_SPIPS=y
 CONFIG_ZYNQ_DEVCFG=y
 
 CONFIG_ARM11SCU=y
 CONFIG_DIGIC=y
-CONFIG_MARVELL_88W8618=y
 CONFIG_OMAP=y
 CONFIG_TSC210X=y
 CONFIG_BLIZZARD=y
@@ -135,7 +132,6 @@ CONFIG_XILINX_AXI=y
 CONFIG_PCI_EXPRESS_DESIGNWARE=y
 
 CONFIG_STRONGARM=y
-CONFIG_MUSICPAL=y
 
 # for realview and versatilepb
 CONFIG_LSI_SCSI_PCI=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 40c79d2..08c213d 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -49,7 +49,13 @@ config MAINSTONE
 
 config MUSICPAL
 bool
+select BITBANG_I2C
+select MARVELL_88W8618
 select PTIMER
+select PFLASH_CFI02
+select PCI
+select SERIAL
+select WM8750
 
 config NETDUINO2
 bool
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 01/29] hw/pci/pci-stub: Add msi_enabled() and msi_notify() to the pci stubs

2019-03-07 Thread Thomas Huth
Some machines have an AHCI adapter, but no PCI. To be able to
compile hw/ide/ahci.c without CONFIG_PCI, we still need the two
functions msi_enabled() and msi_notify() for linking.
This is required for the new Kconfig-like build system, if a user
wants to compile a QEMU binary with just one machine that has AHCI,
but no PCI, like the ARM "cubieboard" for example.

Reviewed-by: Michael S. Tsirkin 
Signed-off-by: Thomas Huth 
---
 hw/pci/pci-stub.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c
index b941a0e..c04a5df 100644
--- a/hw/pci/pci-stub.c
+++ b/hw/pci/pci-stub.c
@@ -53,3 +53,14 @@ uint16_t pci_requester_id(PCIDevice *dev)
 g_assert(false);
 return 0;
 }
+
+/* Required by ahci.c */
+bool msi_enabled(const PCIDevice *dev)
+{
+return false;
+}
+
+void msi_notify(PCIDevice *dev, unsigned int vector)
+{
+g_assert_not_reached();
+}
-- 
1.8.3.1




[Qemu-devel] [PATCH v4 00/29] Kconfig dependencies for ARM machines

2019-03-07 Thread Thomas Huth
This series reworks the default-configs/arm-softmmu.mak and
default-configs/aarch64-softmmu.mak files to use the new Kconfig-style
dependencies instead.

Based-on: 1551723614-1823-1-git-send-email-pbonz...@redhat.com
  ("Support Kconfig in QEMU")

Some of the patches are slightly based on the work by Ákos Kovács:

https://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg03730.html

The other patches have been created by looking at the sources and finding
out the dependencies the hard way via trial-and-error (i.e. by enabling
only one machine at a time and checking whether it can be compiled and
started).

v4:
 - Rebased the series to Paolo's latest kconfig tree

v3:
 - Addressed review feedback from v2
 - Included patches to clean up the PCI dependencies of AHCI and SDHCI
   (so CONFIG_AHCI and CONFIG_SDHCI do not depend on CONFIG_PCI anymore)
 - Added an additional patch for the new "musca" machines

v2: Adressed review-feedback from v1
 - CONFIG_SDHCI and CONFIG_AHCI now select CONFIG_PCI
 - Added switches for MICROBIT and EMCRAFT_SF2

Thomas Huth (29):
  hw/pci/pci-stub: Add msi_enabled() and msi_notify() to the pci stubs
  hw/ide/ahci: Add a Kconfig switch for the AHDI-ICH9 device
  hw/sd/sdhci: Move PCI-related code into a separate file
  hw/arm: Express dependencies of the exynos machines with Kconfig
  hw/arm: Express dependencies of the highbank machines with Kconfig
  hw/arm: Express dependencies of integratorcp with Kconfig
  hw/arm: Express dependencies of the fsl-imx31 machine with Kconfig
  hw/arm: Express dependencies of musicpal with Kconfig
  hw/arm: Express dependencies of the OMAP machines with Kconfig
  hw/arm: Express dependencies of stellaris with Kconfig
  hw/arm: Express dependencies of realview, versatile and vexpress with
Kconfig
  hw/arm: Express dependencies of the PXA2xx machines with Kconfig
  hw/arm: Express dependencies of xilinx-zynq with Kconfig
  hw/arm: Express dependencies of collie with Kconfig
  hw/arm: Express dependencies of the aspeed boards with Kconfig
  hw/arm: Express dependencies of the virt machine with Kconfig
  hw/arm: Express dependencies of netduino / stm32f2xx with Kconfig
  hw/arm: Express dependencies of allwinner / cubieboard with Kconfig
  hw/arm: Express dependencies of the MPS2 boards with Kconfig
  hw/arm: Express dependencies of the raspi machines with Kconfig
  hw/arm: Express dependencies of canon-a1100 with Kconfig
  hw/arm: Express dependencies of sabrelite with Kconfig
  hw/arm: Express dependencies of the MSF2 / EMCRAFT_SF2 machine with
Kconfig
  hw/arm: Express dependencies for remaining IMX boards with Kconfig
  hw/arm: Express dependencies of the microbit / nrf51 machine with
Kconfig
  hw/arm: Express dependencies of the ZynqMP zcu102 machine with Kconfig
  hw/arm: Express dependencies of the xlnx-versal-virt machine with
Kconfig
  hw/arm: Express dependencies of the musca machines with Kconfig
  hw/arm: Remove hard-enablement of the remaining PCI devices

 default-configs/aarch64-softmmu.mak |   4 -
 default-configs/arm-softmmu.mak | 175 +++-
 hw/arm/Kconfig  | 319 +++-
 hw/arm/Makefile.objs|  25 ++-
 hw/display/Kconfig  |   3 +
 hw/i2c/Kconfig  |   2 +-
 hw/ide/Kconfig  |   6 +-
 hw/ide/Makefile.objs|   2 +-
 hw/misc/Kconfig |   2 +
 hw/pci/pci-stub.c   |  11 ++
 hw/sd/Kconfig   |   6 +-
 hw/sd/Makefile.objs |   1 +
 hw/sd/sdhci-internal.h  |  34 
 hw/sd/sdhci-pci.c   |  87 ++
 hw/sd/sdhci.c   |  98 +--
 15 files changed, 514 insertions(+), 261 deletions(-)
 create mode 100644 hw/sd/sdhci-pci.c

-- 
1.8.3.1




Re: [Qemu-devel] [multiprocess RFC PATCH 36/37] multi-process: add the concept description to docs/devel/qemu-multiprocess

2019-03-07 Thread Kevin Wolf
Am 07.03.2019 um 09:14 hat Thomas Huth geschrieben:
> On 07/03/2019 08.22, elena.ufimts...@oracle.com wrote:
> > From: Elena Ufimtseva 
> > 
> > TODO: Make relevant changes to the doc.
> > 
> > Signed-off-by: John G Johnson 
> > Signed-off-by: Elena Ufimtseva 
> > Signed-off-by: Jagannathan Raman 
> > ---
> >  docs/devel/qemu-multiprocess.txt | 1109 
> > ++
> >  1 file changed, 1109 insertions(+)
> >  create mode 100644 docs/devel/qemu-multiprocess.txt
> > 
> > diff --git a/docs/devel/qemu-multiprocess.txt 
> > b/docs/devel/qemu-multiprocess.txt
> > new file mode 100644
> > index 000..e29c6c8
> > --- /dev/null
> > +++ b/docs/devel/qemu-multiprocess.txt
> > @@ -0,0 +1,1109 @@
> > +/*
> > + * Copyright 2019, Oracle and/or its affiliates. All rights reserved.
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a 
> > copy
> > + * of this software and associated documentation files (the "Software"), 
> > to deal
> > + * in the Software without restriction, including without limitation the 
> > rights
> > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or 
> > sell
> > + * copies of the Software, and to permit persons to whom the Software is
> > + * furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice shall be included 
> > in
> > + * all copies or substantial portions of the Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
> > OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
> > OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> > FROM,
> > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
> > IN
> > + * THE SOFTWARE.
> > + */
> 
> Somehow weird to see such a big license statement talking about
> "software", but which applies to a text file only... Not sure if it is
> an option for you, but maybe one of the Creative Common licenses
> (dual-licensed with the GPLv2+) would be a better fit? E.g. for the QEMU
> website, the content is dual-licensed: https://www.qemu.org/license.html

While we're talking about licenses, the "All rights reserved." notice is
out of place in a license header that declares that a lot of permissions
are granted. Better to remove it to avoid any ambiguities that could
result from the contradiction. (Applies to the whole series.)

Kevin



[Qemu-devel] [PULL v2 26/54] tpm: express dependencies with Kconfig

2019-03-07 Thread Paolo Bonzini
This automatically removes the TPM backends from the
binary altogether if no front-ends are selected.

Signed-off-by: Paolo Bonzini 
---
 configure  | 24 
 hw/tpm/Kconfig | 10 +-
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/configure b/configure
index 0fdbab4..0fb4dce 100755
--- a/configure
+++ b/configure
@@ -466,7 +466,7 @@ gcrypt_hmac="no"
 auth_pam=""
 vte=""
 virglrenderer=""
-tpm="yes"
+tpm=""
 libssh2=""
 live_block_migration="yes"
 numa=""
@@ -3877,20 +3877,20 @@ EOF
 fi
 
 ##
-# TPM passthrough is only on x86 Linux
+# TPM emulation is only on POSIX
 
-if test "$targetos" = Linux && { test "$cpu" = i386 || test "$cpu" = x86_64; 
}; then
-  tpm_passthrough=$tpm
-else
-  tpm_passthrough=no
+if test "$tpm" = ""; then
+  if test "$mingw32" = "yes"; then
+tpm=no
+  else
+tpm=yes
+  fi
+elif test "$tpm" = "yes"; then
+  if test "$mingw32" = "yes" ; then
+error_exit "TPM emulation only available on POSIX systems"
+  fi
 fi
 
-# TPM emulator is for all posix systems
-if test "$mingw32" != "yes"; then
-  tpm_emulator=$tpm
-else
-  tpm_emulator=no
-fi
 ##
 # attr probe
 
diff --git a/hw/tpm/Kconfig b/hw/tpm/Kconfig
index f654f0f..4c8ee87 100644
--- a/hw/tpm/Kconfig
+++ b/hw/tpm/Kconfig
@@ -1,16 +1,24 @@
-config TPM
+config TPMDEV
 bool
+depends on TPM
 
 config TPM_TIS
 bool
 depends on TPM && ISA_BUS
+select TPMDEV
 
 config TPM_CRB
 bool
 depends on TPM && PC
+select TPMDEV
 
 config TPM_PASSTHROUGH
 bool
+default y
+# FIXME: should check for x86 host as well
+depends on TPMDEV && LINUX
 
 config TPM_EMULATOR
 bool
+default y
+depends on TPMDEV
-- 
1.8.3.1



[Qemu-devel] [PULL v2 00/54] Kconfig conversion, excluding ARM and MIPS

2019-03-07 Thread Paolo Bonzini
The following changes since commit 1ba530a4ecba6015d52d8f392fd327cfa07bc37a:

  Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190304' into 
staging (2019-03-04 13:38:54 +)

are available in the git repository at:


  git://github.com/bonzini/qemu.git tags/for-upstream-kconfig

for you to fetch changes up to 1f749c0626f6f79cfc27fc3e6b910a6df03d3488:

  kconfig: add documentation (2019-03-07 15:06:29 +0100)


Initial Kconfig work, excluding ARM and MIPS


Paolo Bonzini (42):
  9pfs: remove unnecessary conditionals
  xtensa: rename CONFIG_XTENSA_FPGA to CONFIG_XTENSA_XTFPGA
  minikconfig: add parser skeleton
  minikconfig: add AST
  minikconfig: add semantic analysis
  kconfig: introduce kconfig files
  build: switch to Kconfig
  minikconfig: implement allnoconfig and defconfig modes
  kconfig: introduce CONFIG_TEST_DEVICES
  ide: express dependencies with Kconfig
  build: convert pci.mak to Kconfig
  build: convert sound.mak to Kconfig
  build: convert usb.mak to Kconfig
  block: fix recursion in hw/block/dataplane
  scsi: express dependencies with Kconfig
  isa: express dependencies with kconfig
  i386: express dependencies with Kconfig
  i2c: express dependencies with Kconfig
  ptimer: express dependencies with Kconfig
  vfio: express vfio dependencies with Kconfig
  tpm: express dependencies with Kconfig
  isa: express SuperIO dependencies with Kconfig
  ssi: express dependencies with kconfig
  sd: express dependencies with kconfig
  ipmi: express dependencies with kconfig
  alpha-softmmu.mak: express dependencies with Kconfig
  cris-softmmu.mak: express dependencies with Kconfig
  hppa-softmmu.mak: express dependencies with Kconfig
  lm32-softmmu.mak: express dependencies with Kconfig
  m68k-softmmu.mak: express dependencies with Kconfig
  microblaze-softmmu.mak: express dependencies with Kconfig
  moxie-softmmu.mak: express dependencies with Kconfig
  nios2-softmmu.mak: express dependencies with Kconfig
  or1k-softmmu.mak: express dependencies with Kconfig
  riscv-softmmu.mak: replace CONFIG_* with Kconfig "select" directives
  sh4-softmmu.mak: express dependencies with Kconfig
  sparc-softmmu.mak: express dependencies with Kconfig
  sparc64-softmmu.mak: express dependencies with Kconfig
  unicore32-softmmu.mak: express dependencies with Kconfig
  xtensa-softmmu.mak: express dependencies with Kconfig
  .travis.yml: test that no-default-device builds do not regress
  kconfig: add documentation

Thomas Huth (6):
  ppc64: Express dependencies of 'pseries' and 'powernv' machines with 
kconfig
  ppc: Express dependencies of the 'prep' and '40p' machines with kconfig
  ppc: Express dependencies of the Mac machines with kconfig
  ppc: Express dependencies of the Sam460EX machines with kconfig
  ppc: Express dependencies of the embedded machines with kconfig
  s390x: express dependencies with Kconfig

Yang Zhong (6):
  hw/display: make edid configurable
  hw/pci/Makefile.objs: make pcie configurable
  display: express dependencies with kconfig
  hyperv: express dependencies with kconfig
  virtio: express virtio dependencies with Kconfig
  i386-softmmu.mak: remove all CONFIG_* except boards definitions

 .travis.yml |   6 +
 Kconfig.host|  33 ++
 Makefile|  27 +-
 Makefile.target |   7 +-
 configure   |  42 +-
 default-configs/alpha-softmmu.mak   |  26 +-
 default-configs/arm-softmmu.mak |  18 +-
 default-configs/cris-softmmu.mak|   6 +-
 default-configs/hppa-softmmu.mak|  20 +-
 default-configs/hyperv.mak  |   2 -
 default-configs/i386-softmmu.mak|  93 ++---
 default-configs/lm32-softmmu.mak|  12 +-
 default-configs/m68k-softmmu.mak|   4 +-
 default-configs/microblaze-softmmu.mak  |  12 +-
 default-configs/mips-softmmu-common.mak |  10 +-
 default-configs/mips64el-softmmu.mak|   2 +
 default-configs/moxie-softmmu.mak   |   7 +-
 default-configs/nios2-softmmu.mak   |   6 +-
 default-configs/or1k-softmmu.mak|   5 +-
 default-configs/pci.mak |  51 ---
 default-configs/ppc-softmmu.mak |  60 ---
 default-configs/ppc64-softmmu.mak   |  13 -
 default-configs/riscv32-softmmu.mak |  21 +-
 default-configs/riscv64-softmmu.mak |  22 +-
 default-configs/s390x-softmmu.mak   |  23 +-
 default-configs/sh4-softmmu.mak |  28 +-
 default-configs/sh4eb-softmmu.mak   |  22 +-
 default-configs/sound.mak   |   4 -
 default-configs/sparc-softmmu.mak   |  24 +-
 

Re: [Qemu-devel] [qemu-s390x] [PATCH v3 09/16] s390-bios: ptr2u32 and u32toptr

2019-03-07 Thread Jason J. Herne

On 3/5/19 2:22 AM, Thomas Huth wrote:

On 01/03/2019 19.59, Jason J. Herne wrote:

Introduce inline functions to convert between pointers and unsigned 32-bit
ints. These are used to hide the ugliness required to  avoid compiler
warnings.

Signed-off-by: Jason J. Herne 
Acked-by: Cornelia Huck 
---
  pc-bios/s390-ccw/helper.h | 16 
  1 file changed, 16 insertions(+)
  create mode 100644 pc-bios/s390-ccw/helper.h

diff --git a/pc-bios/s390-ccw/helper.h b/pc-bios/s390-ccw/helper.h
new file mode 100644
index 000..b8bc61b
--- /dev/null
+++ b/pc-bios/s390-ccw/helper.h
@@ -0,0 +1,16 @@
+#ifndef S390_CCW_HELPER_H
+#define S390_CCW_HELPER_H
+
+/* Avoids compiler warnings when casting a pointer to a u32 */
+static inline uint32_t ptr2u32(void *ptr)
+{


Would it make sense to add an IPL_assert(ptr <= 0x) here?



I'm not sure... I remember something about the bios always having to be below the 2^32 
memory line. But I suppose it doesn't hurt to add the assert anyway. Then, someday, if my 
assumption proves not to be true or someone changes that assumption we are still covered.


--
-- Jason J. Herne (jjhe...@linux.ibm.com)




Re: [Qemu-devel] [multiprocess RFC PATCH 35/37] multi-process: QMP/HMP commands to resize block device on remote process

2019-03-07 Thread Kevin Wolf
Am 07.03.2019 um 08:22 hat elena.ufimts...@oracle.com geschrieben:
> From: Jagannathan Raman 
> 
> Adds rblock_resize QMP/HMP commands to resize block devices on the remote
> process.
> 
> Signed-off-by: John G Johnson 
> Signed-off-by: Jagannathan Raman 
> Signed-off-by: Elena Ufimtseva 

Up to this patch, I thought that maybe the block layer related things
would only need a few changes, like:

* Have -rblockdev instead of -rdrive
* Add QMP version for HMP-only only commands

But this one got me thinking. If I understand this correctly, the
current design means that we have to duplicate every single QMP command
to have a remote variant. This just doesn't scale.

I'm not entirely sure what the final design should look like, but I
think we need to have a separate QMP connection to the process that owns
the block device so that the normal existing QMP commands can be used to
managed it.

In the long run, I think you'll want to separate the block backends from
the device emulation anyway. The thing I have in mind is the storage
daemon idea that was occasionally mentioned here and there; and the
process that owns the device would connect to the backend process, maybe
using the vhost-user protocol (or an extension of it with more
management stuff). For the start, that separate process could in fact be
the main process.

For a limited prototype, maybe we could even use NBD, which is already
existing (both server and client parts), but will obviously impact
performance. Then we'd need a way to configure the remote device process
to connect to either an external NBD server (e.g. qemu-nbd) or to the
main process, which would manage the real storage and export it to the
remote processes over NBD.

In a second step, we could switch it over to a different protocol that
is more feature complete and can provide better performance.

This probably needs some more thought, but what do you think in general?

Kevin



Re: [Qemu-devel] [PATCH v3 27/32] s390x/tcg: Provide probe_write_access helper

2019-03-07 Thread Richard Henderson
On 3/7/19 4:15 AM, David Hildenbrand wrote:
> +void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,
> +uintptr_t ra)
> +{
> +#ifdef CONFIG_USER_ONLY
> +if (!h2g_valid(addr) || !h2g_valid(addr + len - 1)) {
> +s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra);
> +}

You need

  || page_check_range(addr, len, PAGE_WRITE) < 0

as well.


r~



Re: [Qemu-devel] [PULL 00/54] Kconfig conversion, excluding ARM and MIPS

2019-03-07 Thread Paolo Bonzini
On 07/03/19 14:47, Philippe Mathieu-Daudé wrote:
> Paolo, we might need:
> 
> -- >8 --
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -336,6 +336,7 @@ MINIKCONF_ARGS = \
>  CONFIG_SPICE=$(CONFIG_SPICE) \
>  CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
>  CONFIG_TPM=$(CONFIG_TPM) \
> +CONFIG_TPM_EMULATOR=$(CONFIG_TPM_EMULATOR) \
>  CONFIG_XEN=$(CONFIG_XEN) \
>  CONFIG_OPENGL=$(CONFIG_OPENGL) \
>  CONFIG_X11=$(CONFIG_X11) \
> ---
> 
> I'm not sure about CONFIG_TPM_PASSTHROUGH.

Instead of that I'm disabling tpm completely in configure for mingw:

tpm=""
...
if test "$tpm" = ""; then
  if test "$mingw32" = "yes"; then
tpm=no
  else
tpm=yes
  fi
elif test "$tpm" = "yes"; then
  if test "$mingw32" = "yes" ; then
error_exit "TPM emulation only available on POSIX systems"
  fi
fi

Paolo



Re: [Qemu-devel] [PATCH v3 00/30] Kconfig dependencies for ARM machines

2019-03-07 Thread no-reply
Patchew URL: 
https://patchew.org/QEMU/1550908162-22644-1-git-send-email-th...@redhat.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 BEGIN ===
#!/bin/bash
time make docker-test-mingw@fedora SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===




The full log is available at
http://patchew.org/logs/1550908162-22644-1-git-send-email-th...@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-de...@redhat.com

Re: [Qemu-devel] PMON2000 compilation and kernel question

2019-03-07 Thread BALATON Zoltan

On Thu, 7 Mar 2019, Andrew Randrianasulu wrote:

distorted screen was when I tried 800x600 or 32 bpp 


The screen resolution this binary tried to set was 640x480x16 but it used 
two screens, one at offset 0 which was not set up correctly due to flat 
panel registers not emulated and another for CRT at 0x500 which is 
outside VRAM. The window was switched to 640x480 but showed picture of the 
screen at 0 with wrong depth/stride so it showed at 4x size with dots 
instead of correct image. Maybe it could be fixed by emulating flat panel 
part of the chip but that's not used on the fulong2e so the pmon.bin 
should not set that up and should not put CRT outside of VRAM so I think 
config of this pmon was not correct for fulong2e.



sha256sum /dev/shm/pmon-my/pmon/zloader.2edev/pmon.bin
ecc82c621c33d140ac1ba01a70876f467e47a7cc9eb154a0647c227355d39e60  
/dev/shm/pmon-my/pmon/zloader.2edev/pmon.bin


The one you've sent to me was:
$ sha256sum pmon.bin
4f2fdb964cb386a8ba5340b5be7744c974b76b521ce940105c0c76c6387b  pmon.bin


mac99 machine with your ati-vga device look like this (after upgrading X and 
r128 driver)
https://ibin.co/4ZKLzg90dFZA.png
note again, this is with NoAccel (while strangely overlay still around via 
xvinfo)


NoAccel just disables 2D but not overlay I think. Chip supports overlay 
but it's not emulated yet (plan to look at that after 2D) so any guest 
driver using it will probably not get picture for overlay (if it's not 
crashing due to unexpected data from device).


Regards,
BALATON Zoltan



Re: [Qemu-devel] [PATCH v3 00/32] s390x/tcg: Vector Instruction Support Part 1

2019-03-07 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190307121539.12842-1-da...@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20190307121539.12842-1-da...@redhat.com
Subject: [Qemu-devel] [PATCH v3 00/32] s390x/tcg: Vector Instruction Support 
Part 1

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 t [tag update]patchew/20190307121539.12842-1-da...@redhat.com -> 
patchew/20190307121539.12842-1-da...@redhat.com
Switched to a new branch 'test'
26fb2d7a48 s390x/tcg: Implement VECTOR UNPACK *
df2340ec06 s390x/tcg: Implement VECTOR STORE WITH LENGTH
809ea72f2a s390x/tcg: Implement VECTOR STORE MULTIPLE
bc20fcf1e4 s390x/tcg: Implement VECTOR STORE ELEMENT
79dc189d2c s390x/tcg: Implement VECTOR STORE
82ae500ad9 s390x/tcg: Provide probe_write_access helper
70ad09ba01 s390x/tcg: Implement VECTOR SIGN EXTEND TO DOUBLEWORD
387ce0c789 s390x/tcg: Implement VECTOR SELECT
428c54de2d s390x/tcg: Implement VECTOR SCATTER ELEMENT
14165826a8 s390x/tcg: Implement VECTOR REPLICATE IMMEDIATE
62b8dd3043 s390x/tcg: Implement VECTOR REPLICATE
a0bbd82903 s390x/tcg: Implement VECTOR PERMUTE DOUBLEWORD IMMEDIATE
fc9d89b81a s390x/tcg: Implement VECTOR PERMUTE
e118ce0140 s390x/tcg: Implement VECTOR PACK *
9eae02d1e8 s390x/tcg: Implement VECTOR MERGE (HIGH|LOW)
f43ab11966 s390x/tcg: Implement VECTOR LOAD WITH LENGTH
90b085e683 s390x/tcg: Implement VECTOR LOAD VR FROM GRS DISJOINT
c0d9c4a22b s390x/tcg: Implement VECTOR LOAD VR ELEMENT FROM GR
cf328654bc s390x/tcg: Implement VECTOR LOAD TO BLOCK BOUNDARY
e87662b255 s390x/tcg: Implement VECTOR LOAD MULTIPLE
a871ece7dd s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO
dd9cc4ad61 s390x/tcg: Implement VECTOR LOAD GR FROM VR ELEMENT
b7af5ff813 s390x/tcg: Implement VECTOR LOAD ELEMENT IMMEDIATE
dd197feff8 s390x/tcg: Implement VECTOR LOAD ELEMENT
e6244fc7f9 s390x/tcg: Implement VECTOR LOAD AND REPLICATE
484d13e05f s390x/tcg: Implement VECTOR LOAD
712ac0b13a s390x/tcg: Implement VECTOR GENERATE MASK
6c8dbd8eae s390x/tcg: Implement VECTOR GENERATE BYTE MASK
013df3f91c s390x/tcg: Implement VECTOR GATHER ELEMENT
d3cdda2073 s390x/tcg: Utilities for vector instruction helpers
57c9e3d42b s390x/tcg: Check vector register instructions at central point
379a1fb237 s390x/tcg: Define vector instruction formats

=== OUTPUT BEGIN ===
1/32 Checking commit 379a1fb237fa (s390x/tcg: Define vector instruction formats)
2/32 Checking commit 57c9e3d42b26 (s390x/tcg: Check vector register 
instructions at central point)
3/32 Checking commit d3cdda20732a (s390x/tcg: Utilities for vector instruction 
helpers)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#17: 
new file mode 100644

total: 0 errors, 1 warnings, 101 lines checked

Patch 3/32 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/32 Checking commit 013df3f91c15 (s390x/tcg: Implement VECTOR GATHER ELEMENT)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#56: 
new file mode 100644

total: 0 errors, 1 warnings, 155 lines checked

Patch 4/32 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/32 Checking commit 6c8dbd8eaeeb (s390x/tcg: Implement VECTOR GENERATE BYTE 
MASK)
6/32 Checking commit 712ac0b13a69 (s390x/tcg: Implement VECTOR GENERATE MASK)
7/32 Checking commit 484d13e05f3d (s390x/tcg: Implement VECTOR LOAD)
8/32 Checking commit e6244fc7f980 (s390x/tcg: Implement VECTOR LOAD AND 
REPLICATE)
9/32 Checking commit dd197feff85a (s390x/tcg: Implement VECTOR LOAD ELEMENT)
10/32 Checking commit b7af5ff813f6 (s390x/tcg: Implement VECTOR LOAD ELEMENT 
IMMEDIATE)
11/32 Checking commit dd9cc4ad61e4 (s390x/tcg: Implement VECTOR LOAD GR FROM VR 
ELEMENT)
12/32 Checking commit a871ece7ddd2 (s390x/tcg: Implement VECTOR LOAD LOGICAL 
ELEMENT AND ZERO)
13/32 Checking commit e87662b2559f (s390x/tcg: Implement VECTOR LOAD MULTIPLE)
14/32 Checking commit cf328654bc45 (s390x/tcg: Implement VECTOR LOAD TO BLOCK 
BOUNDARY)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#97: 
new file mode 100644

total: 0 errors, 1 warnings, 96 lines checked

Patch 14/32 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
15/32 Checking commit c0d9c4a22ba1 (s390x/tcg: Implement VECTOR LOAD VR ELEMENT 
FROM GR)
16/32 Checking commit 90b085e683ed (s390x/tcg: Implement VECTOR LOAD VR FROM 
GRS DISJOINT)
17/32 Checking commit f43ab119664b 

[Qemu-devel] [PATCH] mirror: Confirm we're quiesced only if the job is paused or cancelled

2019-03-07 Thread Sergio Lopez
While child_job_drained_begin() calls to job_pause(), the job doesn't
actually transition between states until it runs again and reaches a
pause point. This means bdrv_drained_begin() may return with some jobs
using the node still having 'busy == true'.

As a consequence, block_job_detach_aio_context() may get into a
deadlock, waiting for the job to be actually paused, while the coroutine
servicing the job is yielding and doesn't get the opportunity to get
scheduled again. This situation can be reproduced by issuing a
'block-commit' immediately followed by a 'device_del'.

To ensure bdrv_drained_begin() only returns when the jobs have been
paused, we change mirror_drained_poll() to only confirm it's quiesced
when job->paused == true and there aren't any in-flight requests, except
if we reached that point by a drained section initiated by the
mirror/commit job itself.

The other block jobs shouldn't need any changes, as the default
drained_poll() behavior is to only confirm it's quiesced if the job is
not busy or completed.

Signed-off-by: Sergio Lopez 
---
 block/mirror.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/block/mirror.c b/block/mirror.c
index 726d3c27fb..b7f076f97c 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -80,6 +80,7 @@ typedef struct MirrorBlockJob {
 bool initial_zeroing_ongoing;
 int in_active_write_counter;
 bool prepared;
+bool in_drain;
 } MirrorBlockJob;
 
 typedef struct MirrorBDSOpaque {
@@ -679,9 +680,11 @@ static int mirror_exit_common(Job *job)
 
 /* The mirror job has no requests in flight any more, but we need to
  * drain potential other users of the BDS before changing the graph. */
+s->in_drain = true;
 bdrv_drained_begin(target_bs);
 bdrv_replace_node(to_replace, target_bs, _err);
 bdrv_drained_end(target_bs);
+s->in_drain = false;
 if (local_err) {
 error_report_err(local_err);
 ret = -EPERM;
@@ -717,6 +720,7 @@ static int mirror_exit_common(Job *job)
 bs_opaque->job = NULL;
 
 bdrv_drained_end(src);
+s->in_drain = false;
 bdrv_unref(mirror_top_bs);
 bdrv_unref(src);
 
@@ -1000,10 +1004,12 @@ static int coroutine_fn mirror_run(Job *job, Error 
**errp)
  */
 trace_mirror_before_drain(s, cnt);
 
+s->in_drain = true;
 bdrv_drained_begin(bs);
 cnt = bdrv_get_dirty_count(s->dirty_bitmap);
 if (cnt > 0 || mirror_flush(s) < 0) {
 bdrv_drained_end(bs);
+s->in_drain = false;
 continue;
 }
 
@@ -1051,6 +1057,7 @@ immediate_exit:
 bdrv_dirty_iter_free(s->dbi);
 
 if (need_drain) {
+s->in_drain = true;
 bdrv_drained_begin(bs);
 }
 
@@ -1119,6 +1126,16 @@ static void coroutine_fn mirror_pause(Job *job)
 static bool mirror_drained_poll(BlockJob *job)
 {
 MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);
+
+/* If the job isn't paused nor cancelled, we can't be sure that it won't
+ * issue more requets. We make an exception if we've reached this point
+ * from one of our own drain sections, to avoid a deadlock waiting for
+ * ourselves.
+ */
+if (!s->common.job.paused && !s->common.job.cancelled && !s->in_drain) {
+return true;
+}
+
 return !!s->in_flight;
 }
 
-- 
2.20.1




[Qemu-devel] [Bug 1818880] Re: Deadlock when detaching network interface

2019-03-07 Thread Heitor R. Alves de Siqueira
** Patch added: "Debdiff for xenial"
   
https://bugs.launchpad.net/cloud-archive/+bug/1818880/+attachment/5244384/+files/xenial.debdiff

** Description changed:

  [Impact]
  Qemu guests hang indefinitely
  
  [Description]
  When running a Qemu guest with VirtIO network interfaces, detaching an 
interface that's currently being used can result in a deadlock. The guest 
instance will hang and become unresponsive to commands, and the only option is 
to kill -9 the instance.
  The reason for this is a dealock between a monitor and an RCU thread, which 
will fight over the BQL (qemu_global_mutex) and the critical RCU section locks. 
The monitor thread will acquire the BQL for detaching the network interface, 
and fire up a helper thread to deal with detaching the network adapter. That 
new thread needs to wait on the RCU thread to complete the deletion, but the 
RCU thread wants the BQL to commit its transactions.
  This bug is already fixed upstream (73c6e4013b4c rcu: completely disable 
pthread_atfork callbacks as soon as possible) and included for other series 
(see below), so we don't need to backport it to Bionic onwards.
  
  Upstream commit:
  https://git.qemu.org/?p=qemu.git;a=commit;h=73c6e4013b4c
  
  $ git describe --contains 73c6e4013b4c
  v2.10.0-rc2~1^2~8
  
  $ rmadison qemu
  ===> qemu | 1:2.5+dfsg-5ubuntu10.34 | xenial-updates/universe   | amd64, ...
-  qemu | 1:2.11+dfsg-1ubuntu7| bionic/universe   | amd64, ...
-  qemu | 1:2.12+dfsg-3ubuntu8| cosmic/universe   | amd64, ...
-  qemu | 1:3.1+dfsg-2ubuntu2 | disco/universe| amd64, ...
+  qemu | 1:2.11+dfsg-1ubuntu7| bionic/universe   | amd64, ...
+  qemu | 1:2.12+dfsg-3ubuntu8| cosmic/universe   | amd64, ...
+  qemu | 1:3.1+dfsg-2ubuntu2 | disco/universe| amd64, ...
  
  [Test Case]
  Being a racing condition, this is a tricky bug to reproduce consistently. 
We've had reports of users running into this with OpenStack deployments and 
Windows Server guests, and the scenario is usually like this:
  1) Deploy a 16vCPU Windows Server 2012 R2 guest with a virtio network 
interface
  2) Stress the network interface with e.g. Windows HLK test suite or similar
  3) Repeatedly attach/detach the network adapter that's in use
  It usually takes more than ~4000 attach/detach cycles to trigger the bug.
  
  [Regression Potential]
- Regressions for this might arise from the fact that the fix changes RCU lock 
code. Since this patch has been upstream and in other series for a while, it's 
unlikely that it would regressions in RCU code specifically. Other code that 
makes use of the RCU locks (MMIO and some monitor events) will be thoroughly 
tested for any regressions with autokpkgtest and scripted Qemu runs.
+ Regressions for this might arise from the fact that the fix changes RCU lock 
code. Since this patch has been upstream and in other series for a while, it's 
unlikely that it would regressions in RCU code specifically. Other code that 
makes use of the RCU locks (MMIO and some monitor events) will be thoroughly 
tested for any regressions with use-case scenarios and scripted runs.

** Tags added: sts-sponsor

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1818880

Title:
  Deadlock when detaching network interface

Status in Ubuntu Cloud Archive:
  Confirmed
Status in QEMU:
  Fix Released
Status in qemu package in Ubuntu:
  Fix Released
Status in qemu source package in Xenial:
  Confirmed
Status in qemu source package in Bionic:
  Fix Released
Status in qemu source package in Cosmic:
  Fix Released
Status in qemu source package in Disco:
  Fix Released

Bug description:
  [Impact]
  Qemu guests hang indefinitely

  [Description]
  When running a Qemu guest with VirtIO network interfaces, detaching an 
interface that's currently being used can result in a deadlock. The guest 
instance will hang and become unresponsive to commands, and the only option is 
to kill -9 the instance.
  The reason for this is a dealock between a monitor and an RCU thread, which 
will fight over the BQL (qemu_global_mutex) and the critical RCU section locks. 
The monitor thread will acquire the BQL for detaching the network interface, 
and fire up a helper thread to deal with detaching the network adapter. That 
new thread needs to wait on the RCU thread to complete the deletion, but the 
RCU thread wants the BQL to commit its transactions.
  This bug is already fixed upstream (73c6e4013b4c rcu: completely disable 
pthread_atfork callbacks as soon as possible) and included for other series 
(see below), so we don't need to backport it to Bionic onwards.

  Upstream commit:
  https://git.qemu.org/?p=qemu.git;a=commit;h=73c6e4013b4c

  $ git describe --contains 73c6e4013b4c
  v2.10.0-rc2~1^2~8

  $ rmadison qemu
  ===> qemu | 1:2.5+dfsg-5ubuntu10.34 | xenial-updates/universe   | 

Re: [Qemu-devel] [PATCH v3 03/32] s390x/tcg: Utilities for vector instruction helpers

2019-03-07 Thread Richard Henderson
On 3/7/19 4:15 AM, David Hildenbrand wrote:
> We'll have to read/write vector elements quite frequently from helpers.
> The tricky bit is properly taking care of endianess. Handle it similar
> to aarch64.
> 
> Signed-off-by: David Hildenbrand 
> ---
>  target/s390x/vec.h | 101 +
>  1 file changed, 101 insertions(+)
>  create mode 100644 target/s390x/vec.h

Reviewed-by: Richard Henderson 


r~



[Qemu-devel] egl: EGL_MESA_image_dma_buf_export not supported / Failed to initialize EGL render node for SPICE GL

2019-03-07 Thread manish jaggi
Hi List,
I am trying to run qemu with spice gl=on with the below command line
and getting errors.

qemu-system-x86_64 -cdrom ubuntu-18.04.2-desktop-amd64.iso -hda
u1.qcow2 -enable-kvm -m 1G -cpu host -smp 8 -machine vmport=off -boot
order=dc -device virtio-vga,virgl=on -spice
gl=on,unix,addr=/home/mjaggi/spice.sock,password=1,disable-ticketing
-soundhw hda -device virtio-serial -chardev
spicevmc,id=vdagent,debug=0,name=vdagent -device
virtserialport,chardev=vdagent,name=com.redhat.spice.0

qemu-system-x86_64: egl: EGL_MESA_image_dma_buf_export not supported
qemu-system-x86_64: Failed to initialize EGL render node for SPICE GL

Qemu configuration
./configure --enable-sdl --with-sdlabi=2.0 --enable-opengl
--enable-virglrenderer --enable-system --enable-modules
--target-list=x86_64-softmmu --enable-kvm  --disable-werror

...
OpenGL supportyes
OpenGL dmabufsyes

As per configure script

#include 
#ifndef EGL_MESA_image_dma_buf_export
# error mesa/epoxy lacks support for dmabufs (mesa 10.6+)
#endif
int main(void) { return 0; }
EOF
  if compile_prog "" "" ; then
opengl_dmabuf=yes
  fi
fi

So if OpenGL dmabufs   is yes, should I be getting
EGL_MESA_image_dma_buf_export not supported error ?
What I could be missing here
Need help/guidance.

-Thanks
Manish



Re: [Qemu-devel] [PATCH v5-resend 0/2] Basic ATI VGA emulation

2019-03-07 Thread BALATON Zoltan

Hello,

On Thu, 7 Mar 2019, Andrew Randrianasulu wrote:

Tried this with mac99 machine and lubuntu 16.04 ppc.


Thanks for testing it. Do you want to add a Tested-by: tag? You can reply 
to the patch (or series cover letter for all patches) with your Tested-by: 
to declare that.



After upgrading r128 driver to -hwe part to get past this bug
https://bugs.freedesktop.org/show_bug.cgi?id=91622

and disabling accel I can see some image and cursor!


Good. Accel is still not quite right, I now about that but couldn't fix it 
yet. I'd need more time for that which I don't have now. So for now only 
console and unaccelerated X is expected to work.



qemu command:

ppc64-softmmu/qemu-system-ppc64 -M mac99 -device ati-vga \
-cdrom /mnt/sdb1/ISO/lubuntu-16.04-desktop-powerpc.iso -m 1G -boot d -cpu g4 
-device usb-mouse -smp 1


The -cpu g4 is not needed as that's the default (it's also single core so 
-smp 1 is not needed either). You're probably also better off using -M 
mac99,via=pmu which is closer to real hardware and adds USB keyboard and 
mouse as well instead of ADB ones so you can omit the -device usb-mouse 
option with that as well.



model rv100 doesn't recognized by openfirmware, so no output from it.


rv100 is only supported for fulong2e console at the moment because drivers 
for it probably need more features of the GPU implemented (such as command 
FIFO) that aren't emulated yet. At first I only target rage128p as found 
in PowerMac3,1 without 3D for Linux, X, MorphOS and maybe MacOS.



Menus in wondows still at wrong place (not shown, even), but generally speaking 
some image is on screen.


I wonder if it's a bug in guest or due to Linux FB using some 2D ops that 
are not correct? Maybe this could be cross-checked with an Intel version 
of the same lubuntu version to make sure it's not a PPC specific xorg 
problem.


Regards,
BALATON Zoltan



Re: [Qemu-devel] [PULL 00/54] Kconfig conversion, excluding ARM and MIPS

2019-03-07 Thread Paolo Bonzini
On 07/03/19 14:25, Peter Maydell wrote:
> In file included from 
> /home/petmay01/qemu-for-merges/hw/tpm/tpm_emulator.c:37:0:
> /home/petmay01/qemu-for-merges/hw/tpm/tpm_ioctl.h:11:21: fatal error:
> sys/uio.h: No such file or directory
> 
> I'm not sure what's happened here. It looks like the Kconfig machinery
> is putting CONFIG_TPM_EMULATOR in build/x86-64-softmmu/config-devices.mak,
> but configure is trying to put it into config-host.mak. The configure
> code is where the "don't do TPM on windows" check is, but the Kconfig
> entry in config-devices.mak overrides that and tries to build this
> code on Windows anyway.
> 
> All the other builds seemed to run ok (I'm just rerunning one lot
> which failed due to an issue on my end; will follow up if there's
> any failure there).

I did the final push to github from the wrong machine. :(  Resending.

Paolo




Re: [Qemu-devel] [PATCH 1/5] hw/mips/malta: Fix the DEBUG_BOARD_INIT code

2019-03-07 Thread Aleksandar Markovic
> > From: Markus Armbruster 
> > Subject: Re: [Qemu-devel] [PATCH 1/5] hw/mips/malta: Fix the 
> > DEBUG_BOARD_INIT code
> > 
> > Philippe Mathieu-Daudé  writes:
> > 
> > > Commit fa1d36df746 missed to convert this ifdef'ed out code.
> > > Introduce the pflash_blk variable.
> > > 
> > > This fixes:
> > > 
> > >hw/mips/mips_malta.c:1273:16: error: implicit declaration of function 
> > > ‘blk_name’; > did you mean ‘basename’? 
> > > [-Werror=implicit-function-declaration]
> > > blk_name(dinfo->bdrv), fl_sectors);
> > > ^~~~
> > >   hw/mips/mips_malta.c:1273:16: error: nested extern declaration of 
> > > ‘blk_name’
> [-Werror=nested-externs]
> > >   hw/mips/mips_malta.c:1273:30: error: ‘DriveInfo’ {aka ‘struct 
> > > DriveInfo’} has no
> member named ‘bdrv’
> > > blk_name(dinfo->bdrv), fl_sectors);
> > > ^~
> > > 
> > > Fixes: fa1d36df746
> > > Signed-off-by: Philippe Mathieu-Daudé 
> > 
> > Question for the maintainers: Aurelien, Aleksandar, fix the
> > DEBUG_BOARD_INIT code or drop it?  It looks rather stale...
> 
> Markus,
> 
> My vote is: drop it.
> 
> And, Markus, yes, if you agree with any patch from this series,
> please let them all go > though your pull request.
> 
> Regards,
> Aleksandar

Markus, if you decide to drop the code segment, you have my

Reviewed-by: Aleksandar Markovic 

in advance.

I believe the whole patch series was also reviewed by Richard.

Sincerely,
Aleksandar



Re: [Qemu-devel] [PATCH v3 08/14] r2d: Fix flash memory size, sector size, width, device ID

2019-03-07 Thread Philippe Mathieu-Daudé
On 3/7/19 2:03 PM, Markus Armbruster wrote:
> pflash_cfi02_register() takes a size in bytes, a block size in bytes
> and a number of blocks.  r2d_init() passes FLASH_SIZE, 16 * KiB,
> FLASH_SIZE >> 16.  Does not compute: size doesn't match block size *
> number of blocks.  The latter happens to win: FLASH_SIZE / 4,
> i.e. 8MiB.
> 
> The best information we have on the physical hardware lists a Cypress
> S29PL127J60TFI130 128MiBit NOR flash addressable in words of 16 bits,
> in sectors of 4 and 32 Kibiwords.  We don't model multiple sector
> sizes.
> 
> Fix the flash size from 8 to 16MiB, and adjust the sector size from 16
> to 64KiB.  Fix the width from 4 to 2.  While there, supply the real
> device IDs 0x0001, 0x227e, 0x2220, 0x2200 instead of zeros.
> 
> Cc: Magnus Damm 
> Signed-off-by: Markus Armbruster 

Reviewed-by: Philippe Mathieu-Daudé 

> ---
>  hw/sh4/r2d.c | 16 
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
> index dcdb3728cb..cd23c60b86 100644
> --- a/hw/sh4/r2d.c
> +++ b/hw/sh4/r2d.c
> @@ -44,7 +44,7 @@
>  #include "exec/address-spaces.h"
>  
>  #define FLASH_BASE 0x
> -#define FLASH_SIZE 0x0200
> +#define FLASH_SIZE (16 * MiB)
>  
>  #define SDRAM_BASE 0x0c00 /* Physical location of SDRAM: Area 3 */
>  #define SDRAM_SIZE 0x0400
> @@ -288,12 +288,20 @@ static void r2d_init(MachineState *machine)
>  sysbus_mmio_map(busdev, 1, 0x1400080c);
>  mmio_ide_init_drives(dev, dinfo, NULL);
>  
> -/* onboard flash memory */
> +/*
> + * Onboard flash memory
> + * According to the old board user document in Japanese (under
> + * NDA) what is referred to as FROM (Area0) is connected via a
> + * 32-bit bus and CS0 to CN8. The docs mention a Cypress
> + * S29PL127J60TFI130 chipsset.  Per the 'S29PL-J 002-00615
> + * Rev. *E' datasheet, it is a 128Mbit NOR parallel flash
> + * addressable in words of 16bit.
> + */
>  dinfo = drive_get(IF_PFLASH, 0, 0);
>  pflash_cfi02_register(0x0, NULL, "r2d.flash", FLASH_SIZE,
>dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
> -  16 * KiB, FLASH_SIZE >> 16,
> -  1, 4, 0x, 0x, 0x, 0x,
> +  64 * KiB, FLASH_SIZE >> 16,
> +  1, 2, 0x0001, 0x227e, 0x2220, 0x2200,
>0x555, 0x2aa, 0);
>  
>  /* NIC: rtl8139 on-board, and 2 slots. */
> 



Re: [Qemu-devel] [PATCH 1/5] hw/mips/malta: Fix the DEBUG_BOARD_INIT code

2019-03-07 Thread Aleksandar Markovic
> From: Markus Armbruster 
> Subject: Re: [Qemu-devel] [PATCH 1/5] hw/mips/malta: Fix the DEBUG_BOARD_INIT 
> code
> 
> Philippe Mathieu-Daudé  writes:
> 
> > Commit fa1d36df746 missed to convert this ifdef'ed out code.
> > Introduce the pflash_blk variable.
> > 
> > This fixes:
> > 
> >hw/mips/mips_malta.c:1273:16: error: implicit declaration of function 
> > ‘blk_name’; did you mean ‘basename’? [-Werror=implicit-function-declaration]
> > blk_name(dinfo->bdrv), fl_sectors);
> > ^~~~
> >   hw/mips/mips_malta.c:1273:16: error: nested extern declaration of 
> > ‘blk_name’ [-Werror=nested-externs]
> >   hw/mips/mips_malta.c:1273:30: error: ‘DriveInfo’ {aka ‘struct DriveInfo’} 
> > has no member named ‘bdrv’
> > blk_name(dinfo->bdrv), fl_sectors);
> > ^~
> > 
> > Fixes: fa1d36df746
> > Signed-off-by: Philippe Mathieu-Daudé 
> 
> Question for the maintainers: Aurelien, Aleksandar, fix the
> DEBUG_BOARD_INIT code or drop it?  It looks rather stale...

Markus,

My vote is: drop it.

And, Markus, yes, if you agree with any patch from this series, please let them 
all go though your pull request.

Regards,
Aleksandar



Re: [Qemu-devel] [PULL 00/54] Kconfig conversion, excluding ARM and MIPS

2019-03-07 Thread Philippe Mathieu-Daudé
On 3/7/19 2:25 PM, Peter Maydell wrote:
> On Mon, 4 Mar 2019 at 19:25, Paolo Bonzini  wrote:
>>
>> The following changes since commit 1ba530a4ecba6015d52d8f392fd327cfa07bc37a:
>>
>>   Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190304' into 
>> staging (2019-03-04 13:38:54 +)
>>
>> are available in the git repository at:
>>
>>
>>   git://github.com/bonzini/qemu.git tags/for-upstream-kconfig
>>
>> for you to fetch changes up to b1d8b9a6cc37e33dde1873379174de78957830ca:
>>
>>   kconfig: add documentation (2019-03-04 19:09:35 +0100)
>>
>> 
>> Initial Kconfig work, excluding ARM and MIPS
> 
> Build failure for the Windows builds:
> 
> In file included from 
> /home/petmay01/qemu-for-merges/hw/tpm/tpm_emulator.c:37:0:
> /home/petmay01/qemu-for-merges/hw/tpm/tpm_ioctl.h:11:21: fatal error:
> sys/uio.h: No such file or directory
> 
> I'm not sure what's happened here. It looks like the Kconfig machinery
> is putting CONFIG_TPM_EMULATOR in build/x86-64-softmmu/config-devices.mak,
> but configure is trying to put it into config-host.mak. The configure
> code is where the "don't do TPM on windows" check is, but the Kconfig
> entry in config-devices.mak overrides that and tries to build this
> code on Windows anyway.

Paolo, we might need:

-- >8 --
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -336,6 +336,7 @@ MINIKCONF_ARGS = \
 CONFIG_SPICE=$(CONFIG_SPICE) \
 CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
 CONFIG_TPM=$(CONFIG_TPM) \
+CONFIG_TPM_EMULATOR=$(CONFIG_TPM_EMULATOR) \
 CONFIG_XEN=$(CONFIG_XEN) \
 CONFIG_OPENGL=$(CONFIG_OPENGL) \
 CONFIG_X11=$(CONFIG_X11) \
---

I'm not sure about CONFIG_TPM_PASSTHROUGH.

> 
> All the other builds seemed to run ok (I'm just rerunning one lot
> which failed due to an issue on my end; will follow up if there's
> any failure there).
> 
> thanks
> -- PMM
> 



Re: [Qemu-devel] [PATCH v3 08/12] docs: Provide separate conf.py for each manual we want

2019-03-07 Thread Peter Maydell
On Thu, 7 Mar 2019 at 13:41, Cleber Rosa  wrote:
>
> On Thu, Mar 07, 2019 at 01:30:39PM +, Peter Maydell wrote:
> > Well, I'm also a bit biased here, in that this is v3 of this
> > patchset that's been on the list using this approach for
> > a month, and I was planning to apply it to master today
> > so that it could be in before the softfreeze on Tuesday
> > next week. So late-breaking suggestions for significant
> > restructurings are essentially saying "we should postpone
> > this to 4.1" :-(
> >
>
> I apologize for not looking at this before... honestly speaking, my
> bandwidth and efficiency doesn't allow me look at most patches :).  It
> was only a CC on this v3 that caught my attention.
>
> Anyway, I don't want to disrupt progress, and I do believe in
> incremental betterment.  I have plans to add Python API docs once the
> "python" directory structure gets in, so I might as well suggest
> improvements in the form of patches later on.

OK, thanks. If the end result in document structure is the
same then we can make the change as an incremental improvement later.

thanks
-- PMM



Re: [Qemu-devel] [PATCH v5-resend 2/2] mips_fulong2e: Add on-board graphics chip

2019-03-07 Thread Aleksandar Markovic
> From: BALATON Zoltan 
> Subject: Re: [PATCH v5-resend 2/2] mips_fulong2e: Add on-board graphics chip
> 
> > On Thu, 7 Mar 2019, Philippe Mathieu-Daudé wrote:
> > Aleksandar, if you take this series, do you mind fixing with:
> 
> I think it should go via Gerd's tree together with the other patch.
> 
> Regards,
> BALATON Zoltan

Yes, Gerd, should you agree with the patches, let they both go through your
tree/pull request, please.

Sincerely,
Aleksandar



[Qemu-devel] [PATCH v2 3/4] iotests: ask QEMU for supported formats

2019-03-07 Thread Andrey Shinkevich
Supported formats listed by 'qemu' may differ from those listed by
'qemu-img' due to whitelists. Some test cases require specific formats
that may be used with qemu. They can be inquired directly by running
'qemu -drive format=help'. The response takes whitelists into account.
The method supported_formats() serves for that. The method decorator
skip_if_unsupported() checks if all requested formats are whitelisted.
If not, the test case will be skipped. That has been implemented in
the 'check' file in the way similar to the 'test notrun' mechanism.

Suggested-by: Roman Kagan 
Suggested-by: Vladimir Sementsov-Ogievskiy 
Suggested-by: Kevin Wolf 
Signed-off-by: Andrey Shinkevich 
---
 tests/qemu-iotests/check  | 13 -
 tests/qemu-iotests/iotests.py | 43 +++
 2 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 895e1e3..1016887 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -25,6 +25,7 @@ try=0
 n_bad=0
 bad=""
 notrun=""
+casenotrun=""
 interrupt=true
 
 # by default don't output timestamps
@@ -664,6 +665,11 @@ END{ if (NR > 0) {
 echo "Not run:$notrun"
 echo "Not run:$notrun" >>check.log
 fi
+if [ ! -z "$casenotrun" ]
+then
+echo "Some cases not run in:$casenotrun"
+echo "Some cases not run in:$casenotrun" >>check.log
+fi
 if [ ! -z "$n_bad" -a $n_bad != 0 ]
 then
 echo "Failures:$bad"
@@ -743,6 +749,7 @@ do
 printf ""# prettier output with timestamps.
 fi
 rm -f core $seq.notrun
+rm -f $seq.casenotrun
 
 start=$(_wallclock)
 $timestamp && printf %s "[$(date "+%T")]"
@@ -823,7 +830,11 @@ do
 fi
 fi
 fi
-
+if [ -f $seq.casenotrun ]
+then
+cat $seq.casenotrun
+casenotrun="$casenotrun $seq"
+fi
 fi
 
 # come here for each test, except when $showme is true
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 35b63fc..f2fee9d 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -716,6 +716,14 @@ def notrun(reason):
 print('%s not run: %s' % (seq, reason))
 sys.exit(0)
 
+def case_notrun(reason):
+'''Skip this test case'''
+# Each test in qemu-iotests has a number ("seq")
+seq = os.path.basename(sys.argv[0])
+
+open('%s/%s.casenotrun' % (output_dir, seq), 'a').write(
+'[case not run] ' + reason + '\n')
+
 def verify_image_format(supported_fmts=[], unsupported_fmts=[]):
 assert not (supported_fmts and unsupported_fmts)
 
@@ -756,6 +764,41 @@ def verify_quorum():
 if not supports_quorum():
 notrun('quorum support missing')
 
+def qemu_pipe(*args):
+'''Run qemu with an option to print something and exit (e.g. a help 
option),
+and return its output'''
+args = [qemu_prog] + qemu_opts + list(args)
+subp = subprocess.Popen(args, stdout=subprocess.PIPE,
+stderr=subprocess.STDOUT,
+universal_newlines=True)
+exitcode = subp.wait()
+if exitcode < 0:
+sys.stderr.write('qemu received signal %i: %s\n' % (-exitcode,
+ ' '.join(args)))
+return subp.communicate()[0]
+
+def supported_formats(read_only=False):
+'''Set 'read_only' to True to check ro-whitelist
+   Otherwise, rw-whitelist is checked'''
+format_message = qemu_pipe("-drive", "format=help")
+line = 1 if read_only else 0
+return format_message.splitlines()[line].split(":")[1].split()
+
+def skip_if_unsupported(required_formats=[], read_only=False):
+'''Skip Test Decorator
+   Runs the test if all the required formats are whitelisted'''
+def skip_test_decorator(func):
+def func_wrapper(*args, **kwargs):
+usf_list = list(set(required_formats) -
+set(supported_formats(read_only)))
+if usf_list:
+case_notrun('{}: formats {} are not whitelisted'.format(
+args[0], usf_list))
+else:
+return func(*args, **kwargs)
+return func_wrapper
+return skip_test_decorator
+
 def main(supported_fmts=[], supported_oses=['linux'], supported_cache_modes=[],
  unsupported_fmts=[]):
 '''Run tests'''
-- 
1.8.3.1



Re: [Qemu-devel] [PATCH v3 08/12] docs: Provide separate conf.py for each manual we want

2019-03-07 Thread Cleber Rosa
On Thu, Mar 07, 2019 at 01:30:39PM +, Peter Maydell wrote:
> On Thu, 7 Mar 2019 at 13:18, Cleber Rosa  wrote:
> >
> > On Thu, Mar 07, 2019 at 12:29:08PM +, Peter Maydell wrote:
> > > I'm still not clear how this helps. Either the top level
> > > index file has everything in it (in which case it's no good
> > > for 'make install'), or we just have separate manuals per
> >
> > IIRC, it shouldn't matter what the "top level" index file (index.rst)
> > has, because it's the resulting build (not the source index.rst) that
> > will be 'make install'ed.  Or am I missing something?
> 
> I guess what I'm trying to ask is whether this tags
> approach results in different (or differently structured)
> final documents being produced, or whether it's just a
> different mechanism that gives the same end result.
>

I was pursuing the same result, as I understand the requirements are
sound and well defined, that is, we do want multiple final documents
produced in the non-readthedocs.org environment.

> > I don't see the multiple listings you mention here
> 
> I think I was looking at the sketch you had in a previous
> email rather than the more fleshed-out code in the git repo.
>

Oh, OK.

> > Anyway, if it's not clear to you as it's to me, then I'm probably
> > biased or missing something.
> 
> Well, I'm also a bit biased here, in that this is v3 of this
> patchset that's been on the list using this approach for
> a month, and I was planning to apply it to master today
> so that it could be in before the softfreeze on Tuesday
> next week. So late-breaking suggestions for significant
> restructurings are essentially saying "we should postpone
> this to 4.1" :-(
>

I apologize for not looking at this before... honestly speaking, my
bandwidth and efficiency doesn't allow me look at most patches :).  It
was only a CC on this v3 that caught my attention.

Anyway, I don't want to disrupt progress, and I do believe in
incremental betterment.  I have plans to add Python API docs once the
"python" directory structure gets in, so I might as well suggest
improvements in the form of patches later on.

Feel free to ignore this suggestion for now.

> thanks
> -- PMM

Best regards,
- Cleber.



[Qemu-devel] [PATCH v2 0/4] iotests: check whitelisted formats

2019-03-07 Thread Andrey Shinkevich
Some test cases require specific formats to be supported by QEMU. The
list of formats supported by the block layer doesn't take whitelists
into account. This series manages this issue. The method decorator
skip_if_unsupported() checks if requested formats are whitelisted.
The sample output is shown with the test #139.

v1:
Discussed in the email thread with the message ID:
<1551694120-768127-1-git-send-email-andrey.shinkev...@virtuozzo.com>
Fixes and amendments suggested by Kevin Wolf were applied in v2.

Andrey Shinkevich (4):
  iotests: open notrun files in text mode
  block: iterate_format with account of whitelisting
  iotests: ask QEMU for supported formats
  iotests: check whitelisted formats

 block.c   | 23 ++
 blockdev.c|  4 +++-
 include/block/block.h |  2 +-
 qemu-img.c|  2 +-
 tests/qemu-iotests/139|  3 +++
 tests/qemu-iotests/check  | 13 -
 tests/qemu-iotests/iotests.py | 45 ++-
 7 files changed, 83 insertions(+), 9 deletions(-)

-- 
1.8.3.1



[Qemu-devel] [PATCH v2 1/4] iotests: open notrun files in text mode

2019-03-07 Thread Andrey Shinkevich
Replace the binary mode with the default text one when *.notrun
files are opened for skipped tests. That change is made for the
compatibility with Python 3 which returns error otherwise.

Signed-off-by: Kevin Wolf 
Signed-off-by: Andrey Shinkevich 
---
 tests/qemu-iotests/iotests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 4910fb2..35b63fc 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -712,7 +712,7 @@ def notrun(reason):
 # Each test in qemu-iotests has a number ("seq")
 seq = os.path.basename(sys.argv[0])
 
-open('%s/%s.notrun' % (output_dir, seq), 'wb').write(reason + '\n')
+open('%s/%s.notrun' % (output_dir, seq), 'w').write(reason + '\n')
 print('%s not run: %s' % (seq, reason))
 sys.exit(0)
 
-- 
1.8.3.1



[Qemu-devel] [PATCH v2 2/4] block: iterate_format with account of whitelisting

2019-03-07 Thread Andrey Shinkevich
bdrv_iterate_format (which is currently only used for printing out the
formats supported by the block layer) doesn't take format whitelisting
into account.

This creates a problem for tests: they enumerate supported formats to
decide which tests to enable, but then discover that QEMU doesn't let
them actually use some of those formats.

To avoid that, exclude formats that are not whitelisted from
enumeration, if whitelisting is in use.  Since we have separate
whitelists for r/w and r/o, take this a parameter to
bdrv_iterate_format, and print two lists of supported formats (r/w and
r/o) in main qemu.

Signed-off-by: Roman Kagan 
Signed-off-by: Andrey Shinkevich 
---
 block.c   | 23 +++
 blockdev.c|  4 +++-
 include/block/block.h |  2 +-
 qemu-img.c|  2 +-
 4 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/block.c b/block.c
index 35e78e2..ccf008c 100644
--- a/block.c
+++ b/block.c
@@ -426,7 +426,7 @@ BlockDriver *bdrv_find_format(const char *format_name)
 return bdrv_do_find_format(format_name);
 }
 
-int bdrv_is_whitelisted(BlockDriver *drv, bool read_only)
+static int bdrv_format_is_whitelisted(const char *format_name, bool read_only)
 {
 static const char *whitelist_rw[] = {
 CONFIG_BDRV_RW_WHITELIST
@@ -441,13 +441,13 @@ int bdrv_is_whitelisted(BlockDriver *drv, bool read_only)
 }
 
 for (p = whitelist_rw; *p; p++) {
-if (!strcmp(drv->format_name, *p)) {
+if (!strcmp(format_name, *p)) {
 return 1;
 }
 }
 if (read_only) {
 for (p = whitelist_ro; *p; p++) {
-if (!strcmp(drv->format_name, *p)) {
+if (!strcmp(format_name, *p)) {
 return 1;
 }
 }
@@ -455,6 +455,11 @@ int bdrv_is_whitelisted(BlockDriver *drv, bool read_only)
 return 0;
 }
 
+int bdrv_is_whitelisted(BlockDriver *drv, bool read_only)
+{
+return bdrv_format_is_whitelisted(drv->format_name, read_only);
+}
+
 bool bdrv_uses_whitelist(void)
 {
 return use_bdrv_whitelist;
@@ -4147,7 +4152,7 @@ static int qsort_strcmp(const void *a, const void *b)
 }
 
 void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
- void *opaque)
+ void *opaque, bool read_only)
 {
 BlockDriver *drv;
 int count = 0;
@@ -4158,6 +4163,11 @@ void bdrv_iterate_format(void (*it)(void *opaque, const 
char *name),
 if (drv->format_name) {
 bool found = false;
 int i = count;
+
+if (use_bdrv_whitelist && !bdrv_is_whitelisted(drv, read_only)) {
+continue;
+}
+
 while (formats && i && !found) {
 found = !strcmp(formats[--i], drv->format_name);
 }
@@ -4176,6 +4186,11 @@ void bdrv_iterate_format(void (*it)(void *opaque, const 
char *name),
 bool found = false;
 int j = count;
 
+if (use_bdrv_whitelist &&
+!bdrv_format_is_whitelisted(format_name, read_only)) {
+continue;
+}
+
 while (formats && j && !found) {
 found = !strcmp(formats[--j], format_name);
 }
diff --git a/blockdev.c b/blockdev.c
index 7e6bf99..871966c 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -531,7 +531,9 @@ static BlockBackend *blockdev_init(const char *file, QDict 
*bs_opts,
 if ((buf = qemu_opt_get(opts, "format")) != NULL) {
 if (is_help_option(buf)) {
 error_printf("Supported formats:");
-bdrv_iterate_format(bdrv_format_print, NULL);
+bdrv_iterate_format(bdrv_format_print, NULL, false);
+error_printf("\nSupported formats (read-only):");
+bdrv_iterate_format(bdrv_format_print, NULL, true);
 error_printf("\n");
 goto early_err;
 }
diff --git a/include/block/block.h b/include/block/block.h
index 5b5cf86..6a758a7 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -472,7 +472,7 @@ void bdrv_next_cleanup(BdrvNextIterator *it);
 BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs);
 bool bdrv_is_encrypted(BlockDriverState *bs);
 void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
- void *opaque);
+ void *opaque, bool read_only);
 const char *bdrv_get_node_name(const BlockDriverState *bs);
 const char *bdrv_get_device_name(const BlockDriverState *bs);
 const char *bdrv_get_device_or_node_name(const BlockDriverState *bs);
diff --git a/qemu-img.c b/qemu-img.c
index 660c018..5fac840 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -198,7 +198,7 @@ static void QEMU_NORETURN help(void)
"  'skip=N' skip N bs-sized blocks at the start of input\n";
 
 printf("%s\nSupported formats:", help_msg);
-bdrv_iterate_format(format_print, NULL);
+bdrv_iterate_format(format_print, NULL, false);
 printf("\n\n" 

Re: [Qemu-devel] [PULL 00/54] Kconfig conversion, excluding ARM and MIPS

2019-03-07 Thread Peter Maydell
On Mon, 4 Mar 2019 at 19:25, Paolo Bonzini  wrote:
>
> The following changes since commit 1ba530a4ecba6015d52d8f392fd327cfa07bc37a:
>
>   Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190304' into 
> staging (2019-03-04 13:38:54 +)
>
> are available in the git repository at:
>
>
>   git://github.com/bonzini/qemu.git tags/for-upstream-kconfig
>
> for you to fetch changes up to b1d8b9a6cc37e33dde1873379174de78957830ca:
>
>   kconfig: add documentation (2019-03-04 19:09:35 +0100)
>
> 
> Initial Kconfig work, excluding ARM and MIPS

Build failure for the Windows builds:

In file included from /home/petmay01/qemu-for-merges/hw/tpm/tpm_emulator.c:37:0:
/home/petmay01/qemu-for-merges/hw/tpm/tpm_ioctl.h:11:21: fatal error:
sys/uio.h: No such file or directory

I'm not sure what's happened here. It looks like the Kconfig machinery
is putting CONFIG_TPM_EMULATOR in build/x86-64-softmmu/config-devices.mak,
but configure is trying to put it into config-host.mak. The configure
code is where the "don't do TPM on windows" check is, but the Kconfig
entry in config-devices.mak overrides that and tries to build this
code on Windows anyway.

All the other builds seemed to run ok (I'm just rerunning one lot
which failed due to an issue on my end; will follow up if there's
any failure there).

thanks
-- PMM



[Qemu-devel] [PATCH v2 4/4] iotests: check whitelisted formats

2019-03-07 Thread Andrey Shinkevich
Some test cases require specific formats. The method decorator
skip_if_unsupported() checks if requested formats are whitelisted.
The test #139 was selected for a sample output, after running
$ ./check -qcow2 131-140

137 3s ...
138 0s ...
139 2s ...
[case not run] testBlkDebug (__main__.TestBlockdevDel): formats 
['blkdebug'] are not whitelisted
[case not run] testBlkVerify (__main__.TestBlockdevDel): formats 
['blkverify'] are not whitelisted
[case not run] testQuorum (__main__.TestBlockdevDel): formats ['quorum'] 
are not whitelisted
140 0s ...
Not run: 131 135 136
Some cases not run in: 139
Passed all 7 tests

Signed-off-by: Andrey Shinkevich 
---
 tests/qemu-iotests/139 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index 62402c1..933b451 100755
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -325,6 +325,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
 # FIXME mirror0 disappears, drive-mirror doesn't take a reference
 #self.delBlockDriverState('mirror0')
 
+@iotests.skip_if_unsupported(['blkdebug'])
 def testBlkDebug(self):
 self.addBlkDebug('debug0', 'node0')
 # 'node0' is used by the blkdebug node
@@ -333,6 +334,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
 self.delBlockDriverState('debug0')
 self.checkBlockDriverState('node0', False)
 
+@iotests.skip_if_unsupported(['blkverify'])
 def testBlkVerify(self):
 self.addBlkVerify('verify0', 'node0', 'node1')
 # We cannot remove the children of a blkverify device
@@ -343,6 +345,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
 self.checkBlockDriverState('node0', False)
 self.checkBlockDriverState('node1', False)
 
+@iotests.skip_if_unsupported(['quorum'])
 def testQuorum(self):
 if not iotests.supports_quorum():
 return
-- 
1.8.3.1



Re: [Qemu-devel] [PATCH 0/2] ui: support for authorization control on TLS connections

2019-03-07 Thread Daniel P . Berrangé
On Thu, Mar 07, 2019 at 02:27:30PM +0100, Gerd Hoffmann wrote:
> On Thu, Mar 07, 2019 at 12:23:58PM +, Daniel P. Berrangé wrote:
> > ping - soft freeze is less than a week away & i'd like this to get into
> > a ui queue pull request in time for 4.0 if there's no review objections
> 
> I'm aware, I'm busy preparing the pre-freeze pulls.  USB is on the list
> already, busy with UI right now. VGA comes next.
> 
> Series queued.

Thanks for the quick reply !

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|



Re: [Qemu-devel] [PATCH v3 08/12] docs: Provide separate conf.py for each manual we want

2019-03-07 Thread Peter Maydell
On Thu, 7 Mar 2019 at 13:18, Cleber Rosa  wrote:
>
> On Thu, Mar 07, 2019 at 12:29:08PM +, Peter Maydell wrote:
> > I'm still not clear how this helps. Either the top level
> > index file has everything in it (in which case it's no good
> > for 'make install'), or we just have separate manuals per
>
> IIRC, it shouldn't matter what the "top level" index file (index.rst)
> has, because it's the resulting build (not the source index.rst) that
> will be 'make install'ed.  Or am I missing something?

I guess what I'm trying to ask is whether this tags
approach results in different (or differently structured)
final documents being produced, or whether it's just a
different mechanism that gives the same end result.

> I don't see the multiple listings you mention here

I think I was looking at the sketch you had in a previous
email rather than the more fleshed-out code in the git repo.

> Anyway, if it's not clear to you as it's to me, then I'm probably
> biased or missing something.

Well, I'm also a bit biased here, in that this is v3 of this
patchset that's been on the list using this approach for
a month, and I was planning to apply it to master today
so that it could be in before the softfreeze on Tuesday
next week. So late-breaking suggestions for significant
restructurings are essentially saying "we should postpone
this to 4.1" :-(

thanks
-- PMM



[Qemu-devel] [PATCH 1/5] target/mips: Add tests for a variety of MSA integer average instructions

2019-03-07 Thread Mateja Marjanovic
From: Mateja Marjanovic 

Add tests for a variety of MSA integer average instructions.

Signed-off-by: Mateja Marjanovic 
---
 .../user/ase/msa/int-average/test_msa_ave_s_b.c| 151 +
 .../user/ase/msa/int-average/test_msa_ave_s_d.c| 151 +
 .../user/ase/msa/int-average/test_msa_ave_s_h.c| 151 +
 .../user/ase/msa/int-average/test_msa_ave_s_w.c| 151 +
 .../user/ase/msa/int-average/test_msa_ave_u_b.c| 151 +
 .../user/ase/msa/int-average/test_msa_ave_u_d.c| 151 +
 .../user/ase/msa/int-average/test_msa_ave_u_h.c| 151 +
 .../user/ase/msa/int-average/test_msa_ave_u_w.c| 151 +
 .../user/ase/msa/int-average/test_msa_aver_s_b.c   | 151 +
 .../user/ase/msa/int-average/test_msa_aver_s_d.c   | 151 +
 .../user/ase/msa/int-average/test_msa_aver_s_h.c   | 151 +
 .../user/ase/msa/int-average/test_msa_aver_s_w.c   | 151 +
 .../user/ase/msa/int-average/test_msa_aver_u_b.c   | 151 +
 .../user/ase/msa/int-average/test_msa_aver_u_d.c   | 151 +
 .../user/ase/msa/int-average/test_msa_aver_u_h.c   | 151 +
 .../user/ase/msa/int-average/test_msa_aver_u_w.c   | 151 +
 16 files changed, 2416 insertions(+)
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c

diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c 
b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c
new file mode 100644
index 000..675fb90
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c
@@ -0,0 +1,151 @@
+/*
+ *  Test program for MSA instruction AVE_S.B
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Mateja Marjanovic 
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see .
+ *
+ */
+
+#include 
+#include 
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs.h"
+#include "../../../../include/test_utils.h"
+
+#define TEST_COUNT_TOTAL (\
+(PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+(RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+char *instruction_name = "AVE_S.B";
+int32_t ret;
+uint32_t i, j;
+struct timeval start, end;
+double elapsed_time;
+
+uint64_t b128_result[TEST_COUNT_TOTAL][2];
+uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+{ 0xULL, 0xULL, },/*   0  */
+{ 0xULL, 0xULL, },
+{ 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, },
+{ 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, },
+{ 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, },
+{ 0x1919191919191919ULL, 0x1919191919191919ULL, },
+{ 0xf1c61bf1c61bf1c6ULL, 0x1bf1c61bf1c61bf1ULL, },
+{ 0x0d38e30d38e30d38ULL, 0xe30d38e30d38e30dULL, },
+{ 

Re: [Qemu-devel] [multiprocess RFC PATCH 00/37] Initial support of multi-process qemu

2019-03-07 Thread Marc-André Lureau
Hi

On Thu, Mar 7, 2019 at 11:46 AM Stefan Hajnoczi  wrote:
>
> On Wed, Mar 06, 2019 at 11:20:25PM -0800, elena.ufimts...@oracle.com wrote:
> > From: Elena Ufimtseva 
> >
> > Initial support of multi-process qemu
>
> Hi Elena,
> Please use the following setting when sending future patch series:
>
>   $ git config sendemail.thread shallow
>
> This way all patches are part of a single email thread (starting with
> your PATCH 00 cover letter).  Reviewers find this more convenient so
> that individual emails don't get separated and lost.
>

Please also check that there is no regression after each commit. In
particular, the build shouldn't fail, so we can easily study, apply
and bisect patches one by one.

thanks


-- 
Marc-André Lureau



[Qemu-devel] [PATCH 2/5] target/mips: Add tests for a variety of MSA integer divide instructions

2019-03-07 Thread Mateja Marjanovic
From: Mateja Marjanovic 

Add tests for a variety of MSA integer divide instructions.

Signed-off-by: Mateja Marjanovic 
---
 .../user/ase/msa/int-divide/test_msa_div_s_b.c | 151 +
 .../user/ase/msa/int-divide/test_msa_div_s_d.c | 151 +
 .../user/ase/msa/int-divide/test_msa_div_s_h.c | 151 +
 .../user/ase/msa/int-divide/test_msa_div_s_w.c | 151 +
 .../user/ase/msa/int-divide/test_msa_div_u_b.c | 151 +
 .../user/ase/msa/int-divide/test_msa_div_u_d.c | 151 +
 .../user/ase/msa/int-divide/test_msa_div_u_h.c | 151 +
 .../user/ase/msa/int-divide/test_msa_div_u_w.c | 151 +
 8 files changed, 1208 insertions(+)
 create mode 100644 tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c

diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c 
b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c
new file mode 100644
index 000..38e3670
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c
@@ -0,0 +1,151 @@
+/*
+ *  Test program for MSA instruction DIV_S.B
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Mateja Marjanovic 
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see .
+ *
+ */
+
+#include 
+#include 
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs.h"
+#include "../../../../include/test_utils.h"
+
+#define TEST_COUNT_TOTAL (\
+(PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+(RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+char *instruction_name = "DIV_S.B";
+int32_t ret;
+uint32_t i, j;
+struct timeval start, end;
+double elapsed_time;
+
+uint64_t b128_result[TEST_COUNT_TOTAL][2];
+uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+{ 0x0101010101010101ULL, 0x0101010101010101ULL, },/*   0  */
+{ 0x0101010101010101ULL, 0x0101010101010101ULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },/*   8  */
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0x5656565656565656ULL, 0x5656565656565656ULL, },/*  16  */
+{ 0x0101010101010101ULL, 0x0101010101010101ULL, },
+{ 0x0101010101010101ULL, 0x0101010101010101ULL, },
+{ 0xULL, 0xULL, },
+{ 0x0101010101010101ULL, 0x0101010101010101ULL, },
+{ 0xULL, 0xULL, },
+{ 0x0200ff0200ff0200ULL, 0xff0200ff0200ff02ULL, },
+{ 0xfd0001fd0001fd00ULL, 0x01fd0001fd0001fdULL, },
+{ 0xababababababababULL, 0xababababababababULL, },/*  24  */
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0x0101010101010101ULL, 0x0101010101010101ULL, },
+{ 0xULL, 0xULL, },
+{ 

Re: [Qemu-devel] [PATCH 0/2] ui: support for authorization control on TLS connections

2019-03-07 Thread Gerd Hoffmann
On Thu, Mar 07, 2019 at 12:23:58PM +, Daniel P. Berrangé wrote:
> ping - soft freeze is less than a week away & i'd like this to get into
> a ui queue pull request in time for 4.0 if there's no review objections

I'm aware, I'm busy preparing the pre-freeze pulls.  USB is on the list
already, busy with UI right now. VGA comes next.

Series queued.

cheers,
  Gerd




[Qemu-devel] [PATCH 4/5] target/mips: Add tests for a variety of MSA integer multiply instructions

2019-03-07 Thread Mateja Marjanovic
From: Mateja Marjanovic 

Add tests for a variety of MSA integer multiply instructions.

Signed-off-by: Mateja Marjanovic 
---
 .../user/ase/msa/int-multiply/test_msa_mul_q_h.c   | 151 +
 .../user/ase/msa/int-multiply/test_msa_mul_q_w.c   | 151 +
 .../user/ase/msa/int-multiply/test_msa_mulr_q_h.c  | 151 +
 .../user/ase/msa/int-multiply/test_msa_mulr_q_w.c  | 151 +
 .../user/ase/msa/int-multiply/test_msa_mulv_b.c| 151 +
 .../user/ase/msa/int-multiply/test_msa_mulv_d.c| 151 +
 .../user/ase/msa/int-multiply/test_msa_mulv_h.c| 151 +
 .../user/ase/msa/int-multiply/test_msa_mulv_w.c| 151 +
 8 files changed, 1208 insertions(+)
 create mode 100644 tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulr_q_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulr_q_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_w.c

diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_h.c 
b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_h.c
new file mode 100644
index 000..f152608
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_h.c
@@ -0,0 +1,151 @@
+/*
+ *  Test program for MSA instruction MUL_Q.H
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Mateja Marjanovic 
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see .
+ *
+ */
+
+#include 
+#include 
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs.h"
+#include "../../../../include/test_utils.h"
+
+#define TEST_COUNT_TOTAL (\
+(PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+(RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+char *instruction_name = "MUL_Q.H";
+int32_t ret;
+uint32_t i, j;
+struct timeval start, end;
+double elapsed_time;
+
+uint64_t b128_result[TEST_COUNT_TOTAL][2];
+uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+{ 0xULL, 0xULL, },/*   0  */
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },/*   8  */
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },/*  16  */
+{ 0xULL, 0xULL, },
+{ 0x38e438e438e438e4ULL, 0x38e438e438e438e4ULL, },
+{ 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0x12f6da134bdb12f6ULL, 0xda134bdb12f6da13ULL, },
+{ 0xed0925edb425ed09ULL, 0x25edb425ed0925edULL, },
+{ 0xULL, 0xULL, },/*  24  */
+{ 0xULL, 0xULL, },
+{ 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
+{ 0x38e338e338e338e3ULL, 0x38e338e338e338e3ULL, },
+{ 0xULL, 0xULL, 

[Qemu-devel] [PATCH 3/5] target/mips: Add tests for a variety of MSA integer dot product instructions

2019-03-07 Thread Mateja Marjanovic
From: Mateja Marjanovic 

Add tests for a variety of MSA integer dot product instructions.

Signed-off-by: Mateja Marjanovic 
---
 .../ase/msa/int-dot-product/test_msa_dotp_s_d.c| 151 +
 .../ase/msa/int-dot-product/test_msa_dotp_s_h.c| 151 +
 .../ase/msa/int-dot-product/test_msa_dotp_s_w.c| 151 +
 .../ase/msa/int-dot-product/test_msa_dotp_u_d.c| 151 +
 .../ase/msa/int-dot-product/test_msa_dotp_u_h.c| 151 +
 .../ase/msa/int-dot-product/test_msa_dotp_u_w.c| 151 +
 6 files changed, 906 insertions(+)
 create mode 100644 
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c
 create mode 100644 
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c
 create mode 100644 
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c
 create mode 100644 
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c
 create mode 100644 
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c
 create mode 100644 
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c

diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c 
b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c
new file mode 100644
index 000..af8d609
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c
@@ -0,0 +1,151 @@
+/*
+ *  Test program for MSA instruction DOTP_S.D
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Mateja Marjanovic 
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see .
+ *
+ */
+
+#include 
+#include 
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs.h"
+#include "../../../../include/test_utils.h"
+
+#define TEST_COUNT_TOTAL (\
+(PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+(RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+char *instruction_name = "DOTP_S.D";
+int32_t ret;
+uint32_t i, j;
+struct timeval start, end;
+double elapsed_time;
+
+uint64_t b128_result[TEST_COUNT_TOTAL][2];
+uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+{ 0x0002ULL, 0x0002ULL, },/*   0  */
+{ 0xULL, 0xULL, },
+{ 0xaaacULL, 0xaaacULL, },
+{ 0x5556ULL, 0x5556ULL, },
+{ 0x6668ULL, 0x6668ULL, },
+{ 0x999aULL, 0x999aULL, },
+{ 0x8e38e38fULL, 0xe38e38e5ULL, },
+{ 0x71c71c73ULL, 0x1c71c71dULL, },
+{ 0xULL, 0xULL, },/*   8  */
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xULL, 0xULL, },
+{ 0xaaacULL, 0xaaacULL, },/*  16  */
+{ 0xULL, 0xULL, },
+{ 0x38e38e39c71c71c8ULL, 0x38e38e39c71c71c8ULL, },
+{ 0xc71c71c6e38e38e4ULL, 0xc71c71c6e38e38e4ULL, },
+{ 0xeef0ULL, 0xeef0ULL, },
+{ 0xbbbcULL, 0xbbbcULL, },
+{ 0x2f684bdab425ed0aULL, 0xf684bda197b425eeULL, },
+{ 0xd097b425f684bda2ULL, 0x097b425f12f684beULL, },
+{ 0x5556ULL, 0x5556ULL, },/*  24  */
+{ 0xULL, 0xULL, },
+{ 0xc71c71c6e38e38e4ULL, 0xc71c71c6e38e38e4ULL, },
+{ 0x38e38e3871c71c72ULL, 0x38e38e3871c71c72ULL, },
+{ 0x7778ULL, 0x7778ULL, },
+{ 0x2221dddeULL, 0x2221dddeULL, },
+{ 0xd097b425da12f685ULL, 0x097b425e4bda12f7ULL, },
+{ 0x2f684bd97b425ed1ULL, 0xf684bda1097b425fULL, },
+{ 0x6668ULL, 0x6668ULL, },/*  32  */
+{ 

Re: [Qemu-devel] converting build system to Meson?

2019-03-07 Thread Daniel P . Berrangé
On Thu, Mar 07, 2019 at 01:09:52PM +, Peter Maydell wrote:
> On Thu, 7 Mar 2019 at 12:56, Paolo Bonzini  wrote:
> > In any case, this wouldn't change; as you suggest below, configure could
> > remain as a front-end (well, in-srcdir builds are not supported by
> > Meson, so "../configure && ninja" perhaps).
> 
> As an aside, it might be a nice idea to drop the in-srcdir
> build altogether for QEMU anyway -- it's not really a very
> good idea and it means our build system has to cope with two
> different ways of working to no particularly useful end.

I'd be in favour of that. A huge amount of the pain I felt when
making previous changes to QEMU's makefiles has been caused by
trying to support both in-srcdir & vpath build with the same
set of rules. Fixing one often breaks the other, so you have
to cycle back & forth doing a fix in one, then testing the
other, repeat, repeat, scream, repeat.

Personally I always do in-srcdir builds, but I'd be fine to
switch to vpath builds to reduce our maint burden in the build
system as it would be a net win overall.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|



Re: [Qemu-devel] [PATCH v3 00/32] s390x/tcg: Vector Instruction Support Part 1

2019-03-07 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190307121539.12842-1-da...@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20190307121539.12842-1-da...@redhat.com
Subject: [Qemu-devel] [PATCH v3 00/32] s390x/tcg: Vector Instruction Support 
Part 1

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 t [tag update]patchew/20190307121539.12842-1-da...@redhat.com -> 
patchew/20190307121539.12842-1-da...@redhat.com
Switched to a new branch 'test'
f6954a7939 s390x/tcg: Implement VECTOR UNPACK *
79bdca318a s390x/tcg: Implement VECTOR STORE WITH LENGTH
b9021c771e s390x/tcg: Implement VECTOR STORE MULTIPLE
83e2794e3d s390x/tcg: Implement VECTOR STORE ELEMENT
829e3fb3e7 s390x/tcg: Implement VECTOR STORE
bd7415ba28 s390x/tcg: Provide probe_write_access helper
1e6e15312b s390x/tcg: Implement VECTOR SIGN EXTEND TO DOUBLEWORD
9364f826a7 s390x/tcg: Implement VECTOR SELECT
11059139e9 s390x/tcg: Implement VECTOR SCATTER ELEMENT
9f252fbd49 s390x/tcg: Implement VECTOR REPLICATE IMMEDIATE
1c6291228f s390x/tcg: Implement VECTOR REPLICATE
9da07a7588 s390x/tcg: Implement VECTOR PERMUTE DOUBLEWORD IMMEDIATE
7d3e23524d s390x/tcg: Implement VECTOR PERMUTE
e164481b3a s390x/tcg: Implement VECTOR PACK *
5bcdba5d59 s390x/tcg: Implement VECTOR MERGE (HIGH|LOW)
8131f03bcb s390x/tcg: Implement VECTOR LOAD WITH LENGTH
6b3e1a5833 s390x/tcg: Implement VECTOR LOAD VR FROM GRS DISJOINT
9b9456df6c s390x/tcg: Implement VECTOR LOAD VR ELEMENT FROM GR
3e3137fc5a s390x/tcg: Implement VECTOR LOAD TO BLOCK BOUNDARY
e13b78fa3a s390x/tcg: Implement VECTOR LOAD MULTIPLE
5dd092c443 s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO
73a7d5936f s390x/tcg: Implement VECTOR LOAD GR FROM VR ELEMENT
4c3cac7dea s390x/tcg: Implement VECTOR LOAD ELEMENT IMMEDIATE
2ee78ce167 s390x/tcg: Implement VECTOR LOAD ELEMENT
654c614c56 s390x/tcg: Implement VECTOR LOAD AND REPLICATE
d606d0b7f2 s390x/tcg: Implement VECTOR LOAD
15ae8fa740 s390x/tcg: Implement VECTOR GENERATE MASK
80cb753278 s390x/tcg: Implement VECTOR GENERATE BYTE MASK
3822dd2633 s390x/tcg: Implement VECTOR GATHER ELEMENT
3c360b8b2a s390x/tcg: Utilities for vector instruction helpers
21c62197c5 s390x/tcg: Check vector register instructions at central point
1eea0f8b7a s390x/tcg: Define vector instruction formats

=== OUTPUT BEGIN ===
1/32 Checking commit 1eea0f8b7a4c (s390x/tcg: Define vector instruction formats)
2/32 Checking commit 21c62197c5d5 (s390x/tcg: Check vector register 
instructions at central point)
3/32 Checking commit 3c360b8b2ae6 (s390x/tcg: Utilities for vector instruction 
helpers)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#16: 
new file mode 100644

total: 0 errors, 1 warnings, 101 lines checked

Patch 3/32 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/32 Checking commit 3822dd263336 (s390x/tcg: Implement VECTOR GATHER ELEMENT)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#56: 
new file mode 100644

total: 0 errors, 1 warnings, 155 lines checked

Patch 4/32 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/32 Checking commit 80cb7532789c (s390x/tcg: Implement VECTOR GENERATE BYTE 
MASK)
6/32 Checking commit 15ae8fa740db (s390x/tcg: Implement VECTOR GENERATE MASK)
7/32 Checking commit d606d0b7f275 (s390x/tcg: Implement VECTOR LOAD)
8/32 Checking commit 654c614c569e (s390x/tcg: Implement VECTOR LOAD AND 
REPLICATE)
9/32 Checking commit 2ee78ce167c7 (s390x/tcg: Implement VECTOR LOAD ELEMENT)
10/32 Checking commit 4c3cac7dea14 (s390x/tcg: Implement VECTOR LOAD ELEMENT 
IMMEDIATE)
11/32 Checking commit 73a7d5936fcb (s390x/tcg: Implement VECTOR LOAD GR FROM VR 
ELEMENT)
12/32 Checking commit 5dd092c44399 (s390x/tcg: Implement VECTOR LOAD LOGICAL 
ELEMENT AND ZERO)
13/32 Checking commit e13b78fa3a2f (s390x/tcg: Implement VECTOR LOAD MULTIPLE)
14/32 Checking commit 3e3137fc5ada (s390x/tcg: Implement VECTOR LOAD TO BLOCK 
BOUNDARY)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#97: 
new file mode 100644

total: 0 errors, 1 warnings, 96 lines checked

Patch 14/32 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
15/32 Checking commit 9b9456df6c4f (s390x/tcg: Implement VECTOR LOAD VR ELEMENT 
FROM GR)
16/32 Checking commit 6b3e1a5833f8 (s390x/tcg: Implement VECTOR LOAD VR FROM 
GRS DISJOINT)
17/32 Checking commit 8131f03bcb21 

[Qemu-devel] [PATCH 0/5] target/mips: Add tests for a variety of MSA int binary ops

2019-03-07 Thread Mateja Marjanovic
From: Mateja Marjanovic 

These are regression tests for MSA integer binary operations.

Mateja Marjanovic (5):
  target/mips: Add tests for a variety of MSA integer average
instructions
  target/mips: Add tests for a variety of MSA integer divide
instructions
  target/mips: Add tests for a variety of MSA integer dot product
instructions
  target/mips: Add tests for a variety of MSA integer multiply
instructions
  target/mips: Add tests for a variety of MSA integer subtract
instructions

 .../user/ase/msa/int-average/test_msa_ave_s_b.c| 151 
 .../user/ase/msa/int-average/test_msa_ave_s_d.c| 151 
 .../user/ase/msa/int-average/test_msa_ave_s_h.c| 151 
 .../user/ase/msa/int-average/test_msa_ave_s_w.c| 151 
 .../user/ase/msa/int-average/test_msa_ave_u_b.c| 151 
 .../user/ase/msa/int-average/test_msa_ave_u_d.c| 151 
 .../user/ase/msa/int-average/test_msa_ave_u_h.c| 151 
 .../user/ase/msa/int-average/test_msa_ave_u_w.c| 151 
 .../user/ase/msa/int-average/test_msa_aver_s_b.c   | 151 
 .../user/ase/msa/int-average/test_msa_aver_s_d.c   | 151 
 .../user/ase/msa/int-average/test_msa_aver_s_h.c   | 151 
 .../user/ase/msa/int-average/test_msa_aver_s_w.c   | 151 
 .../user/ase/msa/int-average/test_msa_aver_u_b.c   | 151 
 .../user/ase/msa/int-average/test_msa_aver_u_d.c   | 151 
 .../user/ase/msa/int-average/test_msa_aver_u_h.c   | 151 
 .../user/ase/msa/int-average/test_msa_aver_u_w.c   | 151 
 .../user/ase/msa/int-divide/test_msa_div_s_b.c | 151 
 .../user/ase/msa/int-divide/test_msa_div_s_d.c | 151 
 .../user/ase/msa/int-divide/test_msa_div_s_h.c | 151 
 .../user/ase/msa/int-divide/test_msa_div_s_w.c | 151 
 .../user/ase/msa/int-divide/test_msa_div_u_b.c | 151 
 .../user/ase/msa/int-divide/test_msa_div_u_d.c | 151 
 .../user/ase/msa/int-divide/test_msa_div_u_h.c | 151 
 .../user/ase/msa/int-divide/test_msa_div_u_w.c | 151 
 .../ase/msa/int-dot-product/test_msa_dotp_s_d.c| 151 
 .../ase/msa/int-dot-product/test_msa_dotp_s_h.c| 151 
 .../ase/msa/int-dot-product/test_msa_dotp_s_w.c| 151 
 .../ase/msa/int-dot-product/test_msa_dotp_u_d.c| 151 
 .../ase/msa/int-dot-product/test_msa_dotp_u_h.c| 151 
 .../ase/msa/int-dot-product/test_msa_dotp_u_w.c| 151 
 .../user/ase/msa/int-multiply/test_msa_mul_q_h.c   | 151 
 .../user/ase/msa/int-multiply/test_msa_mul_q_w.c   | 151 
 .../user/ase/msa/int-multiply/test_msa_mulr_q_h.c  | 151 
 .../user/ase/msa/int-multiply/test_msa_mulr_q_w.c  | 151 
 .../user/ase/msa/int-multiply/test_msa_mulv_b.c| 151 
 .../user/ase/msa/int-multiply/test_msa_mulv_d.c| 151 
 .../user/ase/msa/int-multiply/test_msa_mulv_h.c| 151 
 .../user/ase/msa/int-multiply/test_msa_mulv_w.c| 151 
 .../user/ase/msa/int-subtract/test_msa_subs_s_b.c  | 151 
 .../user/ase/msa/int-subtract/test_msa_subs_s_d.c  | 151 
 .../user/ase/msa/int-subtract/test_msa_subs_s_h.c  | 151 
 .../user/ase/msa/int-subtract/test_msa_subs_s_w.c  | 151 
 .../user/ase/msa/int-subtract/test_msa_subs_u_b.c  | 151 
 .../user/ase/msa/int-subtract/test_msa_subs_u_d.c  | 151 
 .../user/ase/msa/int-subtract/test_msa_subs_u_h.c  | 151 
 .../user/ase/msa/int-subtract/test_msa_subs_u_w.c  | 151 
 .../ase/msa/int-subtract/test_msa_subsus_u_b.c | 151 
 .../ase/msa/int-subtract/test_msa_subsus_u_d.c | 151 
 .../ase/msa/int-subtract/test_msa_subsus_u_h.c | 151 
 .../ase/msa/int-subtract/test_msa_subsus_u_w.c | 151 
 .../ase/msa/int-subtract/test_msa_subsuu_s_b.c | 151 
 .../ase/msa/int-subtract/test_msa_subsuu_s_d.c | 151 
 .../ase/msa/int-subtract/test_msa_subsuu_s_h.c | 151 
 .../ase/msa/int-subtract/test_msa_subsuu_s_w.c | 151 
 .../user/ase/msa/int-subtract/test_msa_subv_b.c| 151 
 .../user/ase/msa/int-subtract/test_msa_subv_d.c| 151 
 .../user/ase/msa/int-subtract/test_msa_subv_h.c| 151 

Re: [Qemu-devel] [PATCHv2 0/2] curses: Add support for wide output

2019-03-07 Thread Gerd Hoffmann
On Mon, Mar 04, 2019 at 10:02:15PM +0100, Samuel Thibault wrote:
> Hello,
> 
> This adds support for wide output in the curses frontend
> 
> Difference with previous version:
> - Add more rationale in commit message
> - Move charset option to curses-only section.

Added to UI patch queue (the other curses patches too).

thanks,
  Gerd




[Qemu-devel] [PATCH v3 08/14] r2d: Fix flash memory size, sector size, width, device ID

2019-03-07 Thread Markus Armbruster
pflash_cfi02_register() takes a size in bytes, a block size in bytes
and a number of blocks.  r2d_init() passes FLASH_SIZE, 16 * KiB,
FLASH_SIZE >> 16.  Does not compute: size doesn't match block size *
number of blocks.  The latter happens to win: FLASH_SIZE / 4,
i.e. 8MiB.

The best information we have on the physical hardware lists a Cypress
S29PL127J60TFI130 128MiBit NOR flash addressable in words of 16 bits,
in sectors of 4 and 32 Kibiwords.  We don't model multiple sector
sizes.

Fix the flash size from 8 to 16MiB, and adjust the sector size from 16
to 64KiB.  Fix the width from 4 to 2.  While there, supply the real
device IDs 0x0001, 0x227e, 0x2220, 0x2200 instead of zeros.

Cc: Magnus Damm 
Signed-off-by: Markus Armbruster 
---
 hw/sh4/r2d.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index dcdb3728cb..cd23c60b86 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -44,7 +44,7 @@
 #include "exec/address-spaces.h"
 
 #define FLASH_BASE 0x
-#define FLASH_SIZE 0x0200
+#define FLASH_SIZE (16 * MiB)
 
 #define SDRAM_BASE 0x0c00 /* Physical location of SDRAM: Area 3 */
 #define SDRAM_SIZE 0x0400
@@ -288,12 +288,20 @@ static void r2d_init(MachineState *machine)
 sysbus_mmio_map(busdev, 1, 0x1400080c);
 mmio_ide_init_drives(dev, dinfo, NULL);
 
-/* onboard flash memory */
+/*
+ * Onboard flash memory
+ * According to the old board user document in Japanese (under
+ * NDA) what is referred to as FROM (Area0) is connected via a
+ * 32-bit bus and CS0 to CN8. The docs mention a Cypress
+ * S29PL127J60TFI130 chipsset.  Per the 'S29PL-J 002-00615
+ * Rev. *E' datasheet, it is a 128Mbit NOR parallel flash
+ * addressable in words of 16bit.
+ */
 dinfo = drive_get(IF_PFLASH, 0, 0);
 pflash_cfi02_register(0x0, NULL, "r2d.flash", FLASH_SIZE,
   dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
-  16 * KiB, FLASH_SIZE >> 16,
-  1, 4, 0x, 0x, 0x, 0x,
+  64 * KiB, FLASH_SIZE >> 16,
+  1, 2, 0x0001, 0x227e, 0x2220, 0x2200,
   0x555, 0x2aa, 0);
 
 /* NIC: rtl8139 on-board, and 2 slots. */
-- 
2.17.2




[Qemu-devel] [PATCH v3 05/14] hw: Use PFLASH_CFI0{1, 2} and TYPE_PFLASH_CFI0{1, 2}

2019-03-07 Thread Markus Armbruster
We have two open-coded copies of macro PFLASH_CFI01().  Move the macro
to the header, so we can ditch the copies.  Move PFLASH_CFI02() to the
header for symmetry.

We define macros TYPE_PFLASH_CFI01 and TYPE_PFLASH_CFI02 for type name
strings, then mostly use the strings.  If the macros are worth
defining, they are worth using.  Replace the strings by the macros.

Signed-off-by: Markus Armbruster 
Reviewed-by: Laszlo Ersek 
Reviewed-by: Philippe Mathieu-Daudé 
Reviewed-by: Alex Bennée 
---
 hw/arm/vexpress.c| 4 ++--
 hw/arm/virt.c| 3 ++-
 hw/block/pflash_cfi01.c  | 3 ---
 hw/block/pflash_cfi02.c  | 3 ---
 hw/xtensa/xtfpga.c   | 4 ++--
 include/hw/block/flash.h | 4 
 6 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index ed46d2e730..f07134c424 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -515,7 +515,7 @@ static void vexpress_modify_dtb(const struct arm_boot_info 
*info, void *fdt)
 static PFlashCFI01 *ve_pflash_cfi01_register(hwaddr base, const char *name,
  DriveInfo *di)
 {
-DeviceState *dev = qdev_create(NULL, "cfi.pflash01");
+DeviceState *dev = qdev_create(NULL, TYPE_PFLASH_CFI01);
 
 if (di) {
 qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(di),
@@ -536,7 +536,7 @@ static PFlashCFI01 *ve_pflash_cfi01_register(hwaddr base, 
const char *name,
 qdev_init_nofail(dev);
 
 sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
-return OBJECT_CHECK(PFlashCFI01, (dev), "cfi.pflash01");
+return PFLASH_CFI01(dev);
 }
 
 static void vexpress_common_init(MachineState *machine)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c7fb5348ae..773637876f 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -35,6 +35,7 @@
 #include "hw/arm/arm.h"
 #include "hw/arm/primecell.h"
 #include "hw/arm/virt.h"
+#include "hw/block/flash.h"
 #include "hw/vfio/vfio-calxeda-xgmac.h"
 #include "hw/vfio/vfio-amd-xgbe.h"
 #include "hw/display/ramfb.h"
@@ -879,7 +880,7 @@ static void create_one_flash(const char *name, hwaddr 
flashbase,
  * parameters as the flash devices on the Versatile Express board.
  */
 DriveInfo *dinfo = drive_get_next(IF_PFLASH);
-DeviceState *dev = qdev_create(NULL, "cfi.pflash01");
+DeviceState *dev = qdev_create(NULL, TYPE_PFLASH_CFI01);
 SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
 const uint64_t sectorlength = 256 * 1024;
 
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index f75f0a6998..1c99aa6e4a 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -59,9 +59,6 @@ do {\
 #define DPRINTF(fmt, ...) do { } while (0)
 #endif
 
-#define PFLASH_CFI01(obj) \
-OBJECT_CHECK(PFlashCFI01, (obj), TYPE_PFLASH_CFI01)
-
 #define PFLASH_BE  0
 #define PFLASH_SECURE  1
 
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index c0869fc417..5ef40154b9 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -57,9 +57,6 @@ do {   \
 
 #define PFLASH_LAZY_ROMD_THRESHOLD 42
 
-#define PFLASH_CFI02(obj) \
-OBJECT_CHECK(PFlashCFI02, (obj), TYPE_PFLASH_CFI02)
-
 struct PFlashCFI02 {
 /*< private >*/
 SysBusDevice parent_obj;
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 3d59a7a356..e05ef75a75 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -167,7 +167,7 @@ static PFlashCFI01 *xtfpga_flash_init(MemoryRegion 
*address_space,
   DriveInfo *dinfo, int be)
 {
 SysBusDevice *s;
-DeviceState *dev = qdev_create(NULL, "cfi.pflash01");
+DeviceState *dev = qdev_create(NULL, TYPE_PFLASH_CFI01);
 
 qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(dinfo),
 _abort);
@@ -181,7 +181,7 @@ static PFlashCFI01 *xtfpga_flash_init(MemoryRegion 
*address_space,
 s = SYS_BUS_DEVICE(dev);
 memory_region_add_subregion(address_space, board->flash->base,
 sysbus_mmio_get_region(s, 0));
-return OBJECT_CHECK(PFlashCFI01, (dev), "cfi.pflash01");
+return PFLASH_CFI01(dev);
 }
 
 static uint64_t translate_phys_addr(void *opaque, uint64_t addr)
diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h
index 333005d9ff..aeea3ca99d 100644
--- a/include/hw/block/flash.h
+++ b/include/hw/block/flash.h
@@ -8,6 +8,8 @@
 /* pflash_cfi01.c */
 
 #define TYPE_PFLASH_CFI01 "cfi.pflash01"
+#define PFLASH_CFI01(obj) \
+OBJECT_CHECK(PFlashCFI01, (obj), TYPE_PFLASH_CFI01)
 
 typedef struct PFlashCFI01 PFlashCFI01;
 
@@ -25,6 +27,8 @@ MemoryRegion *pflash_cfi01_get_memory(PFlashCFI01 *fl);
 /* pflash_cfi02.c */
 
 #define TYPE_PFLASH_CFI02 "cfi.pflash02"
+#define PFLASH_CFI02(obj) \
+OBJECT_CHECK(PFlashCFI02, (obj), TYPE_PFLASH_CFI02)
 
 typedef struct PFlashCFI02 PFlashCFI02;
 
-- 
2.17.2




Re: [Qemu-devel] [PATCH v3 08/12] docs: Provide separate conf.py for each manual we want

2019-03-07 Thread Cleber Rosa
On Thu, Mar 07, 2019 at 12:29:08PM +, Peter Maydell wrote:
> On Thu, 7 Mar 2019 at 12:14, Cleber Rosa  wrote:
> >
> > On Thu, Mar 07, 2019 at 09:49:44AM +, Peter Maydell wrote:
> > > On Thu, 7 Mar 2019 at 01:40, Cleber Rosa  wrote:
> > > Thanks for pointing out the tags functionality. That said,
> > > this won't do what we want, will it?
> > >  * building the docs gives all the docs in the build tree
> > >  * but we only install via 'make install' the ones the user wants
> > >
> >
> > It should be doable.  I put a PoC here:
> >
> >   https://github.com/clebergnu/sphinx-conditional-project/tree/master
> >
> > I'm understanding that the `make install` step is nothing but a copy
> > of the produced build.  For this PoC, I used an HTML builder.
> 
> I'm still not clear how this helps. Either the top level
> index file has everything in it (in which case it's no good
> for 'make install'), or we just have separate manuals per

IIRC, it shouldn't matter what the "top level" index file (index.rst)
has, because it's the resulting build (not the source index.rst) that
will be 'make install'ed.  Or am I missing something?

> document (which doesn't seem to me to gain much over what
> we currently have in this patchset, and you end up listing
> everything multiple times in the index.rst).

I don't see the multiple listings you mention here, but I guess you're
referring to the "include" of the individual manual's index (devel.rst
and interop.rst in this example).  I chose to implement the logic for
choosing the content in the rst file, but an alternative would be to
do it in conf.py:

 if tags.has('devel'):
master_doc = 'devel.rst'
 elif tags.has('interop'):
master_doc = 'interop.rst'
 else:
master_doc = 'index.rst'

IMO all options add a bit of poison (pick yours).  I do feel that the
tag approach reuses sphinx functionality, and thus facilitate
maintanance and minimize duplication.

Anyway, if it's not clear to you as it's to me, then I'm probably
biased or missing something.

> 
> thanks
> -- PMM

Best regards,
- Cleber.



[Qemu-devel] [PATCH v3 07/14] ppc405_boards: Don't size flash memory to match backing image

2019-03-07 Thread Markus Armbruster
Machine "ref405ep" maps its flash memory at address 2^32 - image size.
Image size is rounded up to the next multiple of 64KiB.  Useless,
because pflash_cfi02_realize() fails with "failed to read the initial
flash content" unless the rounding is a no-op.

If the image size exceeds 0x8 Bytes, we overlap first SRAM, then
other stuff.  No idea how that would play out, but useful outcomes
seem unlikely.

Map the flash memory at fixed address 0xFFF8 with size 512KiB,
regardless of image size, to match the physical hardware.

Machine "taihu" maps its boot flash memory similarly.  The code even
has a comment /* XXX: should check that size is 2MB */, followed by
disabled code to adjust the size to 2MiB regardless of image size.

Its code to map its application flash memory looks the same, except
there the XXX comment asks for 32MiB, and the code to adjust the size
isn't disabled.  Note that pflash_cfi02_realize() fails with "failed
to read the initial flash content" for images smaller than 32MiB.

Map the boot flash memory at fixed address 0xFFE0 with size 2MiB,
to match the physical hardware.  Delete dead code from application
flash mapping, and simplify some.

Cc: David Gibson 
Signed-off-by: Markus Armbruster 
Acked-by: David Gibson 
Reviewed-by: Alex Bennée 
---
 hw/ppc/ppc405_boards.c | 51 +-
 1 file changed, 15 insertions(+), 36 deletions(-)

diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index f47b15f10e..672717ef1b 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -158,7 +158,7 @@ static void ref405ep_init(MachineState *machine)
 target_ulong kernel_base, initrd_base;
 long kernel_size, initrd_size;
 int linux_boot;
-int fl_idx, fl_sectors, len;
+int len;
 DriveInfo *dinfo;
 MemoryRegion *sysmem = get_system_memory();
 
@@ -185,26 +185,19 @@ static void ref405ep_init(MachineState *machine)
 #ifdef DEBUG_BOARD_INIT
 printf("%s: register BIOS\n", __func__);
 #endif
-fl_idx = 0;
 #ifdef USE_FLASH_BIOS
-dinfo = drive_get(IF_PFLASH, 0, fl_idx);
+dinfo = drive_get(IF_PFLASH, 0, 0);
 if (dinfo) {
-BlockBackend *blk = blk_by_legacy_dinfo(dinfo);
-
-bios_size = blk_getlength(blk);
-fl_sectors = (bios_size + 65535) >> 16;
 #ifdef DEBUG_BOARD_INIT
-printf("Register parallel flash %d size %lx"
-   " at addr %lx '%s' %d\n",
-   fl_idx, bios_size, -bios_size,
-   blk_name(blk), fl_sectors);
+printf("Register parallel flash\n");
 #endif
+bios_size = 8 * MiB;
 pflash_cfi02_register((uint32_t)(-bios_size),
   NULL, "ef405ep.bios", bios_size,
-  blk, 65536, fl_sectors, 1,
+  dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
+  64 * KiB, bios_size / (64 * KiB), 1,
   2, 0x0001, 0x22DA, 0x, 0x, 0x555, 0x2AA,
   1);
-fl_idx++;
 } else
 #endif
 {
@@ -455,7 +448,7 @@ static void taihu_405ep_init(MachineState *machine)
 target_ulong kernel_base, initrd_base;
 long kernel_size, initrd_size;
 int linux_boot;
-int fl_idx, fl_sectors;
+int fl_idx;
 DriveInfo *dinfo;
 
 /* RAM is soldered to the board so the size cannot be changed */
@@ -486,21 +479,14 @@ static void taihu_405ep_init(MachineState *machine)
 #if defined(USE_FLASH_BIOS)
 dinfo = drive_get(IF_PFLASH, 0, fl_idx);
 if (dinfo) {
-BlockBackend *blk = blk_by_legacy_dinfo(dinfo);
-
-bios_size = blk_getlength(blk);
-/* XXX: should check that size is 2MB */
-//bios_size = 2 * 1024 * 1024;
-fl_sectors = (bios_size + 65535) >> 16;
 #ifdef DEBUG_BOARD_INIT
-printf("Register parallel flash %d size %lx"
-   " at addr %lx '%s' %d\n",
-   fl_idx, bios_size, -bios_size,
-   blk_name(blk), fl_sectors);
+printf("Register boot flash\n");
 #endif
-pflash_cfi02_register((uint32_t)(-bios_size),
+bios_size = 2 * MiB;
+pflash_cfi02_register(0xFFE0,
   NULL, "taihu_405ep.bios", bios_size,
-  blk, 65536, fl_sectors, 1,
+  dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
+  64 * KiB, bios_size / (64 * KiB), 1,
   4, 0x0001, 0x22DA, 0x, 0x, 0x555, 0x2AA,
   1);
 fl_idx++;
@@ -536,20 +522,13 @@ static void taihu_405ep_init(MachineState *machine)
 /* Register Linux flash */
 dinfo = drive_get(IF_PFLASH, 0, fl_idx);
 if (dinfo) {
-BlockBackend *blk = blk_by_legacy_dinfo(dinfo);
-
-bios_size = blk_getlength(blk);
-/* XXX: should check that size is 32MB */
 bios_size = 32 * MiB;
-fl_sectors = (bios_size + 65535) >> 

<    1   2   3   4   5   6   7   >