From e69f7d2510ab93ed4828ed69452f9c7c84f3f33a Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Mon, 19 Sep 2016 11:56:26 +0100 Subject: [PATCH 01/26] qemu-options.hx: fix -chardev ringbuf typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clean up the documentation for -chardev ringbuf. There is a stray closing parenthesis and the comma is unnecessary. Signed-off-by: Stefan Hajnoczi Reviewed-by: Marc-André Lureau Signed-off-by: Michael Tokarev --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 01f01dfadc..b1fbdb08cd 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2374,7 +2374,7 @@ console with the given dimensions. @item -chardev ringbuf ,id=@var{id} [,size=@var{size}] Create a ring buffer with fixed size @option{size}. -@var{size} must be a power of two, and defaults to @code{64K}). +@var{size} must be a power of two and defaults to @code{64K}. @item -chardev file ,id=@var{id} ,path=@var{path} From a1c2bbc87b227dbf8e00b9684544eff9c861fcf7 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 14 Sep 2016 11:57:53 +0200 Subject: [PATCH 02/26] bt-hci-csr: drop unused argument Signed-off-by: Paolo Bonzini Signed-off-by: Michael Tokarev --- hw/arm/nseries.c | 3 +-- hw/bt/hci-csr.c | 2 +- include/hw/bt.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index fea911e3e3..c86cf80514 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -786,8 +786,7 @@ static void n8x0_cbus_setup(struct n800_s *s) static void n8x0_uart_setup(struct n800_s *s) { - CharDriverState *radio = uart_hci_init( - qdev_get_gpio_in(s->mpu->gpio, N8X0_BT_HOST_WKUP_GPIO)); + CharDriverState *radio = uart_hci_init(); qdev_connect_gpio_out(s->mpu->gpio, N8X0_BT_RESET_GPIO, csrhci_pins_get(radio)[csrhci_pin_reset]); diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c index d688372ca3..b77c0366e4 100644 --- a/hw/bt/hci-csr.c +++ b/hw/bt/hci-csr.c @@ -458,7 +458,7 @@ qemu_irq *csrhci_pins_get(CharDriverState *chr) return s->pins; } -CharDriverState *uart_hci_init(qemu_irq wakeup) +CharDriverState *uart_hci_init(void) { struct csrhci_s *s = (struct csrhci_s *) g_malloc0(sizeof(struct csrhci_s)); diff --git a/include/hw/bt.h b/include/hw/bt.h index 963f330138..2fa22bdab6 100644 --- a/include/hw/bt.h +++ b/include/hw/bt.h @@ -128,7 +128,7 @@ enum { __csrhci_pins, }; qemu_irq *csrhci_pins_get(CharDriverState *chr); -CharDriverState *uart_hci_init(qemu_irq wakeup); +CharDriverState *uart_hci_init(void); /* bt-l2cap.c */ struct bt_l2cap_device_s; From 496e079813ac793523213eebc099940b91855fd9 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 20 Sep 2016 09:43:01 -0500 Subject: [PATCH 03/26] tests: Ignore test executables Commits 9ef8112a and efad6682 introduced new tests, but forgot to ignore the built executables from an in-tree build. Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Signed-off-by: Michael Tokarev --- tests/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/.gitignore b/tests/.gitignore index 0f0c79b1a9..9f3d2ee038 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -12,7 +12,9 @@ rcutorture test-aio test-base64 test-bitops +test-blockjob test-blockjob-txn +test-bufferiszero test-clone-visitor test-coroutine test-crypto-afsplit From a3ccdfb5bb37dc8a20702b7ea3b87f73e46b4b62 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 22 Sep 2016 21:16:33 +0200 Subject: [PATCH 04/26] MAINTAINERS: Add files to the Moxie section. The hw/moxie/ folder and default-configs/moxie-softmmu.mak obviously belong to the Moxie CPU. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9bca506365..adc5e4e1d8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -157,6 +157,8 @@ M: Anthony Green S: Maintained F: target-moxie/ F: disas/moxie.c +F: hw/moxie/ +F: default-configs/moxie-softmmu.mak OpenRISC M: Jia Liu From c13e9912d9aa2ac485825bc7ca6879b0797cd715 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 22 Sep 2016 21:32:38 +0200 Subject: [PATCH 05/26] MAINTAINERS: Add some more files to the HMP section The hmp-commands-info.hx, hmp.h and include/monitor/hmp-target.h files were classified as unmaintained. Let's add them to the HMP section. Signed-off-by: Thomas Huth Reviewed-by: Luiz Capitulino Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- MAINTAINERS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index adc5e4e1d8..ba50167088 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1183,8 +1183,9 @@ Human Monitor (HMP) M: Luiz Capitulino S: Maintained F: monitor.c -F: hmp.c -F: hmp-commands.hx +F: hmp.[ch] +F: hmp-commands*.hx +F: include/monitor/hmp-target.h T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp Network device backends From a2b245ae2f67ef08b861e17c643ef9f2e77a0a51 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 23 Sep 2016 15:19:10 +0200 Subject: [PATCH 06/26] MAINTAINERS: Add include/hw/audio/ to audio section audio.h and pcspk.h are recognized as maintained files now. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index ba50167088..94f14ea1b2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1046,6 +1046,7 @@ M: Gerd Hoffmann S: Maintained F: audio/ F: hw/audio/ +F: include/hw/audio/ F: tests/ac97-test.c F: tests/es1370-test.c F: tests/intel-hda-test.c From c10a1c787b4894048b688d8111b1f5e135015e04 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Mon, 19 Sep 2016 21:58:34 +0200 Subject: [PATCH 07/26] MAINTAINERS: Add some SPARC machine related files And while we're at it, remove Blue Swirl from the list of maintainers. Blue has apparently been inactive for quite a while now, so I assume he's unfortunately not available as maintainer anymore. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 94f14ea1b2..3ac5fbc1d0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -673,22 +673,27 @@ F: hw/sh4/shix.c SPARC Machines -------------- Sun4m -M: Blue Swirl M: Mark Cave-Ayland S: Maintained F: hw/sparc/sun4m.c +F: hw/dma/sparc32_dma.c +F: hw/dma/sun4m_iommu.c +F: include/hw/sparc/sparc32_dma.h +F: include/hw/sparc/sun4m.h +F: pc-bios/openbios-sparc32 Sun4u -M: Blue Swirl M: Mark Cave-Ayland S: Maintained F: hw/sparc64/sun4u.c +F: pc-bios/openbios-sparc64 Leon3 M: Fabien Chouteau S: Maintained F: hw/sparc/leon3.c F: hw/*/grlib* +F: include/hw/sparc/grlib.h S390 Machines ------------- From 72fa605decb371d8ebe3c9b3ca33a004b5da3671 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 23 Sep 2016 18:11:21 +0200 Subject: [PATCH 08/26] MAINTAINERS: Add some more files to the virtio section Makefile.objs and trace-events in hw/virtio/ were not covered by MAINTAINERS yet. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3ac5fbc1d0..9e4ca021b2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -933,6 +933,8 @@ virtio M: Michael S. Tsirkin S: Supported F: hw/*/virtio* +F: hw/virtio/Makefile.objs +F: hw/virtio/trace-events F: net/vhost-user.c F: include/hw/virtio/ F: tests/virtio-balloon-test.c From c9b900903b10467f06ca1df10548bc43272d8529 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 23 Sep 2016 18:08:46 +0200 Subject: [PATCH 09/26] MAINTAINERS: Add header files to CRIS section etraxfs_dma.h and etraxfs.h in include/hw/cris/ obviously belong to the CRIS section in MAINTAINERS. Signed-off-by: Thomas Huth Reviewed-by: Edgar E. Iglesias Signed-off-by: Michael Tokarev --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9e4ca021b2..a5751a67bd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -116,6 +116,7 @@ M: Edgar E. Iglesias S: Maintained F: target-cris/ F: hw/cris/ +F: include/hw/cris/ F: tests/tcg/cris/ F: disas/cris.c From de85094825834df939d1f6f09bdc573d2b72f7ae Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 27 Sep 2016 16:33:46 +0200 Subject: [PATCH 10/26] MAINTAINERS: Add some more rocker related files The files in tests/rocker/ and docs/specs/rocker.txt should be listed in the Rocker section of MAINTAINERS. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a5751a67bd..4b17a050c1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1023,6 +1023,8 @@ Rocker M: Jiri Pirko S: Maintained F: hw/net/rocker/ +F: tests/rocker/ +F: docs/specs/rocker.txt NVDIMM M: Xiao Guangrong From 03972660f74aee433274ec8ab5018a83bf6af67e Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 29 Sep 2016 09:43:31 +0200 Subject: [PATCH 11/26] MAINTAINERS: Add some more pattern to recognize all win32 related files The get_maintainer.pl script currently thinks that the win32 related files in the util and include folders are currently unmaintained. Thus let's add some additional wildcards to match these files. Signed-off-by: Thomas Huth Reviewed-by: Stefan Weil Signed-off-by: Michael Tokarev --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4b17a050c1..f0ab48ffcb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -322,6 +322,9 @@ L: qemu-devel@nongnu.org M: Stefan Weil S: Maintained F: *win32* +F: */*win32* +F: include/*/*win32* +X: qga/*win32* F: qemu.nsi ARM Machines From ccf0a57b45c1ff49d21d5b8c0322ea40b5f4f2c7 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 30 Sep 2016 09:07:15 +0200 Subject: [PATCH 12/26] MAINTAINERS: Add usermode related config files The default-configs/*-linux-user.mak belong to Linux usermode emulation, and default-configs/*-bsd-user.mak belong to BSD usermode emulation. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index f0ab48ffcb..4a72b77f36 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1425,11 +1425,13 @@ F: user-exec.c BSD user S: Orphan F: bsd-user/ +F: default-configs/*-bsd-user.mak Linux user M: Riku Voipio S: Maintained F: linux-user/ +F: default-configs/*-linux-user.mak Tiny Code Generator (TCG) ------------------------- From 5995db887161ec74a7b43f4969de8a0c06e70cc0 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 30 Sep 2016 09:26:51 +0200 Subject: [PATCH 13/26] MAINTAINERS: Add some more MIPS related files The MIPS section is missing some related header files, and files in the hw/misc/, hw/intc/ and hw/timer/ folders. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4a72b77f36..2d77759e6d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -150,6 +150,13 @@ M: Yongbok Kim S: Maintained F: target-mips/ F: hw/mips/ +F: hw/misc/mips_* +F: hw/intc/mips_gic.c +F: hw/timer/mips_gictimer.c +F: include/hw/mips/ +F: include/hw/misc/mips_* +F: include/hw/intc/mips_gic.h +F: include/hw/timer/mips_gictimer.h F: tests/tcg/mips/ F: disas/mips.c From 81527b94ad14d9f2b33b88ba31b68e2775a5e4fc Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 30 Sep 2016 11:32:02 +0200 Subject: [PATCH 14/26] MAINTAINERS: Some updates related to the SH4 machines hw/intc/sh_intc.c and hw/timer/sh_timer.c seem to belong to the R2D machine, as far as I can see. And concerning the Shix machine, it does not make much sense to have a "M:" entry here and the "S:" set to "Orphan". So I'd like to suggest to use "Odd Fixes" here instead. Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- MAINTAINERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 2d77759e6d..64f57c6451 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -675,10 +675,12 @@ R2D M: Magnus Damm S: Maintained F: hw/sh4/r2d.c +F: hw/intc/sh_intc.c +F: hw/timer/sh_timer.c Shix M: Magnus Damm -S: Orphan +S: Odd Fixes F: hw/sh4/shix.c SPARC Machines From 7a488b5b2426cfb1d0d0ab01960e29cf9127792b Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Fri, 23 Sep 2016 17:16:06 +0800 Subject: [PATCH 15/26] maint: Add module_block.h to .gitignore Commit 0c0c1fd9 generated module_block.h automatically, Add it to .gitignore to avoid checking in it by 'git add .'. Signed-off-by: Lin Ma Reviewed-by: Fam Zheng Signed-off-by: Michael Tokarev --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c91d018c78..97aca6c6b2 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ /qemu-monitor-info.texi /qemu-version.h /qemu-version.h.tmp +/module_block.h /vscclient /fsdev/virtfs-proxy-helper *.[1-9] From a43edcf20a14aab81373fe64a6ed8cf84eb2a7f3 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 21 Sep 2016 21:00:19 -0700 Subject: [PATCH 16/26] qapi: make the json schema files more regular. This makes it easier to parse the schema file for tool generation: each paragraph is either a non-docstring comment, or a docstring immediately followed by a Python dict describing an API item. Signed-off-by: David Anderson Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- qapi-schema.json | 3 +-- qapi/block-core.json | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index c3dcf11a4a..9e47b47cc7 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -752,6 +752,7 @@ 'cpu-throttle-increment': 'int', 'tls-creds': 'str', 'tls-hostname': 'str'} } + ## # @query-migrate-parameters # @@ -4118,7 +4119,6 @@ # # Since 1.6 ## - { 'struct': 'RxFilterInfo', 'data': { 'name': 'str', @@ -4338,7 +4338,6 @@ # # Since: 2.1 ## - { 'struct': 'Memdev', 'data': { 'size': 'size', diff --git a/qapi/block-core.json b/qapi/block-core.json index 9d797b8fe0..4badb97373 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -25,7 +25,6 @@ # Since: 1.3 # ## - { 'struct': 'SnapshotInfo', 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int', 'date-sec': 'int', 'date-nsec': 'int', @@ -81,7 +80,6 @@ # # Since: 1.7 ## - { 'union': 'ImageInfoSpecific', 'data': { 'qcow2': 'ImageInfoSpecificQCow2', @@ -129,7 +127,6 @@ # Since: 1.3 # ## - { 'struct': 'ImageInfo', 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool', '*actual-size': 'int', 'virtual-size': 'int', @@ -181,7 +178,6 @@ # Since: 1.4 # ## - { 'struct': 'ImageCheck', 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int', '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int', @@ -518,7 +514,6 @@ # # Since: 2.5 ## - { 'struct': 'BlockDeviceTimedStats', 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int', 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int', From b16c129daf0fed91febbb88de23dae8271c8898a Mon Sep 17 00:00:00 2001 From: Li Qiang Date: Sun, 18 Sep 2016 19:48:35 -0700 Subject: [PATCH 17/26] usb: ehci: fix memory leak in ehci_process_itd While processing isochronous transfer descriptors(iTD), if the page select(PG) field value is out of bands it will return. In this situation the ehci's sg list is not freed thus leading to a memory leak issue. This patch avoid this. Signed-off-by: Li Qiang Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/usb/hcd-ehci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index b093db729c..f4ece9abed 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1426,6 +1426,7 @@ static int ehci_process_itd(EHCIState *ehci, if (off + len > 4096) { /* transfer crosses page border */ if (pg == 6) { + qemu_sglist_destroy(&ehci->isgl); return -1; /* avoid page pg + 1 */ } ptr2 = (itd->bufptr[pg + 1] & ITD_BUFPTR_MASK); From efee678d6df6ea2f531425e38825883008b3c1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 28 Sep 2016 16:37:20 +0400 Subject: [PATCH 18/26] exec: remove unused compacted argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit b35ba30f8f when it was introduced, phys_page_compact() takes an unused compacted argument. ubsan complains about it when launching qemu-x86_64 without arguments: qemu/exec.c:310:5: runtime error: variable length array bound evaluates to non-positive value 0 Signed-off-by: Marc-André Lureau Signed-off-by: Michael Tokarev --- exec.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exec.c b/exec.c index c8389f93c3..374c364dff 100644 --- a/exec.c +++ b/exec.c @@ -255,7 +255,7 @@ static void phys_page_set(AddressSpaceDispatch *d, /* Compact a non leaf page entry. Simply detect that the entry has a single child, * and update our entry so we can skip it and go directly to the destination. */ -static void phys_page_compact(PhysPageEntry *lp, Node *nodes, unsigned long *compacted) +static void phys_page_compact(PhysPageEntry *lp, Node *nodes) { unsigned valid_ptr = P_L2_SIZE; int valid = 0; @@ -275,7 +275,7 @@ static void phys_page_compact(PhysPageEntry *lp, Node *nodes, unsigned long *com valid_ptr = i; valid++; if (p[i].skip) { - phys_page_compact(&p[i], nodes, compacted); + phys_page_compact(&p[i], nodes); } } @@ -307,10 +307,8 @@ static void phys_page_compact(PhysPageEntry *lp, Node *nodes, unsigned long *com static void phys_page_compact_all(AddressSpaceDispatch *d, int nodes_nb) { - DECLARE_BITMAP(compacted, nodes_nb); - if (d->phys_map.skip) { - phys_page_compact(&d->phys_map, d->map.nodes, compacted); + phys_page_compact(&d->phys_map, d->map.nodes); } } From cbf061bd1fdb5017bfadde2164bdd6183d53a43d Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Wed, 28 Sep 2016 10:06:39 +1000 Subject: [PATCH 19/26] m68k: change default system clock for m5208evb The shipping default setting for the Freescale M5208EVB board is to run the CPU at 166.67MHz. The current qemu emulation code for this board is defaulting to 66MHz. This results in time appearing to run way to slowly. So a "sleep 5" in a standard ColdFire Linux build takes almost 15 seconds in real time to actually complete. Change the hard coded default to match the default hardware setting. Signed-off-by: Greg Ungerer Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/m68k/mcf5208.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index 9240ebf9af..3438314c35 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -21,7 +21,7 @@ #include "elf.h" #include "exec/address-spaces.h" -#define SYS_FREQ 66000000 +#define SYS_FREQ 166666666 #define PCSR_EN 0x0001 #define PCSR_RLD 0x0002 From 88071589e8c6665c40c39bdefc59ad615693b325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 23 Sep 2016 16:35:08 +0400 Subject: [PATCH 20/26] build-sys: fix find-in-path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix spelling, the GNU make text functions is not called "find-string" but "findstring". Broken in commit 2b2e59e. Fairly harmless: its only use is in tests/tcg/Makefile, where the bug can cause the I386_TESTS not to run when they should. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- rules.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.mak b/rules.mak index 3fdb261e32..0333ae3c95 100644 --- a/rules.mak +++ b/rules.mak @@ -138,7 +138,7 @@ endef # Looks in the PATH if the argument contains no slash, else only considers one # specific directory. Returns an # empty string if the program doesn't exist # there. -find-in-path = $(if $(find-string /, $1), \ +find-in-path = $(if $(findstring /, $1), \ $(wildcard $1), \ $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH))))) From cb57fb37051b11d04f1ddce736b0ec3f936e978e Mon Sep 17 00:00:00 2001 From: Wei Yang Date: Sat, 5 Mar 2016 13:47:08 +0000 Subject: [PATCH 21/26] bitmap: refine and move BITMAP_{FIRST/LAST}_WORD_MASK According to linux kernel commit <89c1e79eb30> ("linux/bitmap.h: improve BITMAP_{LAST,FIRST}_WORD_MASK"), these two macro could be improved. This patch takes this change and also move them all in header file. Signed-off-by: Wei Yang Signed-off-by: Michael Tokarev --- include/qemu/bitmap.h | 7 ++----- util/bitmap.c | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h index 7247f14788..63ea2d0b1e 100644 --- a/include/qemu/bitmap.h +++ b/include/qemu/bitmap.h @@ -57,11 +57,8 @@ * find_next_bit(addr, nbits, bit) Position next set bit in *addr >= bit */ -#define BITMAP_LAST_WORD_MASK(nbits) \ - ( \ - ((nbits) % BITS_PER_LONG) ? \ - (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \ - ) +#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1))) +#define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1))) #define DECLARE_BITMAP(name,bits) \ unsigned long name[BITS_TO_LONGS(bits)] diff --git a/util/bitmap.c b/util/bitmap.c index 40aadfb4f3..43ed011720 100644 --- a/util/bitmap.c +++ b/util/bitmap.c @@ -157,8 +157,6 @@ int slow_bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, return result != 0; } -#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG)) - void bitmap_set(unsigned long *map, long start, long nr) { unsigned long *p = map + BIT_WORD(start); From 56bef8511a576deef32d3e763b993b5001015c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Fri, 30 Sep 2016 02:04:28 +0200 Subject: [PATCH 22/26] CODING_STYLE: Fix a typo ("have" vs. "has") MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathan Neuschäfer Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- CODING_STYLE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODING_STYLE b/CODING_STYLE index e7fde15003..f53180bf3f 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -9,7 +9,7 @@ patches before submitting. Of course, the most important aspect in any coding style is whitespace. Crusty old coders who have trouble spotting the glasses on their noses can tell the difference between a tab and eight spaces from a distance -of approximately fifteen parsecs. Many a flamewar have been fought and +of approximately fifteen parsecs. Many a flamewar has been fought and lost on this issue. QEMU indents are four spaces. Tabs are never used, except in Makefiles From 660a2d83e026496db6b3eaec2256a2cdd6c74de8 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 30 Sep 2016 16:02:01 +0100 Subject: [PATCH 23/26] char: fix missing return in error path for chardev TLS init If the qio_channel_tls_new_(server|client) methods fail, we disconnect the client. Unfortunately a missing return means we then go on to try and run the TLS handshake on a NULL I/O channel. This gives predictably segfaulty results. The main way to trigger this is to request a bogus TLS priority string for the TLS credentials. e.g. -object tls-creds-x509,id=tls0,priority=wibble,... Most other ways appear impossible to trigger except perhaps if OOM conditions cause gnutls initialization to fail. Signed-off-by: Daniel P. Berrange Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- qemu-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-char.c b/qemu-char.c index fb456cec34..48a45ef583 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3132,6 +3132,7 @@ static void tcp_chr_tls_init(CharDriverState *chr) if (tioc == NULL) { error_free(err); tcp_chr_disconnect(chr); + return; } object_unref(OBJECT(s->ioc)); s->ioc = QIO_CHANNEL(tioc); From 0839f11cda08039d15b3e7621390de3e512b24e7 Mon Sep 17 00:00:00 2001 From: Felix Janda Date: Fri, 30 Sep 2016 19:40:21 -0400 Subject: [PATCH 24/26] linux-user: include instead of This removes the last usage of in the code base. Signed-off-by: Felix Janda Signed-off-by: Michael Tokarev --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 0815f30965..52012d4aa5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -42,7 +42,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base, #include #include #include -#include +#include #include #include #include From 7a25126d8a4155536a8a3d350e0ab185607bc819 Mon Sep 17 00:00:00 2001 From: Chen Fan Date: Thu, 29 Sep 2016 12:04:40 +0800 Subject: [PATCH 25/26] virtio: rename the bar index field name in VirtIOPCIProxy the bar index names are much similar to the bar memory regions, distinguish them to improve the code readability. Signed-off-by: Chen Fan Signed-off-by: Michael Tokarev --- hw/display/virtio-vga.c | 4 ++-- hw/virtio/virtio-pci.c | 20 ++++++++++---------- hw/virtio/virtio-pci.h | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index f77b401264..f9b017d86b 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -120,8 +120,8 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp) * virtio regions are moved to the end of bar #2, to make room for * the stdvga mmio registers at the start of bar #2. */ - vpci_dev->modern_mem_bar = 2; - vpci_dev->msix_bar = 4; + vpci_dev->modern_mem_bar_idx = 2; + vpci_dev->msix_bar_idx = 4; if (!(vpci_dev->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)) { /* diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 2d60a005b6..06831de5ff 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1551,7 +1551,7 @@ static void virtio_pci_modern_mem_region_map(VirtIOPCIProxy *proxy, struct virtio_pci_cap *cap) { virtio_pci_modern_region_map(proxy, region, cap, - &proxy->modern_bar, proxy->modern_mem_bar); + &proxy->modern_bar, proxy->modern_mem_bar_idx); } static void virtio_pci_modern_io_region_map(VirtIOPCIProxy *proxy, @@ -1559,7 +1559,7 @@ static void virtio_pci_modern_io_region_map(VirtIOPCIProxy *proxy, struct virtio_pci_cap *cap) { virtio_pci_modern_region_map(proxy, region, cap, - &proxy->io_bar, proxy->modern_io_bar); + &proxy->io_bar, proxy->modern_io_bar_idx); } static void virtio_pci_modern_mem_region_unmap(VirtIOPCIProxy *proxy, @@ -1670,14 +1670,14 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) memory_region_init(&proxy->io_bar, OBJECT(proxy), "virtio-pci-io", 0x4); - pci_register_bar(&proxy->pci_dev, proxy->modern_io_bar, + pci_register_bar(&proxy->pci_dev, proxy->modern_io_bar_idx, PCI_BASE_ADDRESS_SPACE_IO, &proxy->io_bar); virtio_pci_modern_io_region_map(proxy, &proxy->notify_pio, ¬ify_pio.cap); } - pci_register_bar(&proxy->pci_dev, proxy->modern_mem_bar, + pci_register_bar(&proxy->pci_dev, proxy->modern_mem_bar_idx, PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_PREFETCH | PCI_BASE_ADDRESS_MEM_TYPE_64, @@ -1693,7 +1693,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) if (proxy->nvectors) { int err = msix_init_exclusive_bar(&proxy->pci_dev, proxy->nvectors, - proxy->msix_bar); + proxy->msix_bar_idx); if (err) { /* Notice when a system that supports MSIx can't initialize it. */ if (err != -ENOTSUP) { @@ -1716,7 +1716,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) &virtio_pci_config_ops, proxy, "virtio-pci", size); - pci_register_bar(&proxy->pci_dev, proxy->legacy_io_bar, + pci_register_bar(&proxy->pci_dev, proxy->legacy_io_bar_idx, PCI_BASE_ADDRESS_SPACE_IO, &proxy->bar); } @@ -1760,10 +1760,10 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp) * region 4+5 -- virtio modern memory (64bit) bar * */ - proxy->legacy_io_bar = 0; - proxy->msix_bar = 1; - proxy->modern_io_bar = 2; - proxy->modern_mem_bar = 4; + proxy->legacy_io_bar_idx = 0; + proxy->msix_bar_idx = 1; + proxy->modern_io_bar_idx = 2; + proxy->modern_mem_bar_idx = 4; proxy->common.offset = 0x0; proxy->common.size = 0x1000; diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index 541cbdbc2b..b4edea6987 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -143,10 +143,10 @@ struct VirtIOPCIProxy { MemoryRegion io_bar; MemoryRegion modern_cfg; AddressSpace modern_as; - uint32_t legacy_io_bar; - uint32_t msix_bar; - uint32_t modern_io_bar; - uint32_t modern_mem_bar; + uint32_t legacy_io_bar_idx; + uint32_t msix_bar_idx; + uint32_t modern_io_bar_idx; + uint32_t modern_mem_bar_idx; int config_cap; uint32_t flags; bool disable_modern; From 52cfcb464255b4da5115408e2a6ce3327bbcb9df Mon Sep 17 00:00:00 2001 From: Zhang Chen Date: Fri, 30 Sep 2016 10:27:58 +0800 Subject: [PATCH 26/26] net/filter-mirror: Fix mirror initial check typo Signed-off-by: Zhang Chen Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- net/filter-mirror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 35df37451d..0ee58d905e 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -198,7 +198,7 @@ static void filter_mirror_setup(NetFilterState *nf, Error **errp) MirrorState *s = FILTER_MIRROR(nf); if (!s->outdev) { - error_setg(errp, "filter filter mirror needs 'outdev' " + error_setg(errp, "filter mirror needs 'outdev' " "property set"); return; } @@ -315,7 +315,7 @@ filter_mirror_set_outdev(Object *obj, const char *value, Error **errp) g_free(s->outdev); s->outdev = g_strdup(value); if (!s->outdev) { - error_setg(errp, "filter filter mirror needs 'outdev' " + error_setg(errp, "filter mirror needs 'outdev' " "property set"); return; }