Re: [PATCH] qom: fix objects with improper parent type

2020-10-05 Thread Michael S. Tsirkin
On Tue, Sep 29, 2020 at 04:47:14PM -0700, Sergey Nizovtsev wrote: > Some objects accidentally inherit ObjectClass instead of Object. > They compile silently but may crash after downcasting. > > In this patch, we introduce a coccinelle script to find broken > declarations and fix them manually

Re: [RFC PATCH 2/2] contrib/gitdm: Add more academic domains

2020-10-05 Thread precinct--- via
Acked-by: Xinyu Li 在2020-10-05 04:40:10,Philippe Mathieu-Daudé写道: > There is a number of contributions from these academic domains. > Add the entries to the gitdm 'academic' domain map. > > Cc: Akkarit Sangpetch > Cc: Alexander Bulekov > Cc: Alexander Oleinik > Cc: Alex Barcelo > Cc: Brian

Re: Re: [RFC PATCH 2/2] contrib/gitdm: Add more academic domains

2020-10-05 Thread precinct--- via
Acked-by: Xinyu Li 在2020-10-06 11:35:01,Alexander Bulekov写道: > On 201004 2240, Philippe Mathieu-Daudé wrote: > > There is a number of contributions from these academic domains. > > Add the entries to the gitdm 'academic' domain map. > > > > Cc: Akkarit Sangpetch > > Cc: Alexander Bulekov > >

Re: Re: [RFC PATCH 2/2] contrib/gitdm: Add more academic domains

2020-10-05 Thread precinct--- via
Acked-by: Xinyu Li 在2020-10-06 11:23:45,Fan Yang写道: > Acked-by: Fan Yang > > On Mon, Oct 05, 2020 at 4:40AM +0800,Philippe Mathieu-Daudé > wrote: > > > There is a number of contributions from these academic domains. > > Add the entries to the gitdm 'academic' domain map. > > > > Cc:

Re: [RFC PATCH 08/21] contrib/gitdm: Add Mentor Graphics to the domain map

2020-10-05 Thread Jan Kiszka
On 05.10.20 22:52, Joseph Myers wrote: > On Mon, 5 Oct 2020, Alex Bennée wrote: > >> Joseph Myers writes: >> >>> On Sun, 4 Oct 2020, Philippe Mathieu-Daudé wrote: >>> There is a number of contributors from this domain, add its own entry to the gitdm domain map. >>> >>> At some point

Re: [RFC PATCH 2/2] contrib/gitdm: Add more academic domains

2020-10-05 Thread Fan Yang
Acked-by: Fan Yang On Mon, Oct 05, 2020 at 4:40AM +0800,Philippe Mathieu-Daudé wrote: > > There is a number of contributions from these academic domains. > Add the entries to the gitdm 'academic' domain map. > > Cc: Akkarit Sangpetch > Cc: Alexander Bulekov > Cc: Alexander Oleinik > Cc:

Re: [RFC PATCH 2/2] contrib/gitdm: Add more academic domains

2020-10-05 Thread Alexander Bulekov
On 201004 2240, Philippe Mathieu-Daudé wrote: > There is a number of contributions from these academic domains. > Add the entries to the gitdm 'academic' domain map. > > Cc: Akkarit Sangpetch > Cc: Alexander Bulekov > Cc: Alexander Oleinik > Cc: Alex Barcelo > Cc: Brian Wheeler > Cc: Chen

Re: [RFC PATCH 2/2] contrib/gitdm: Add more academic domains

2020-10-05 Thread Fan Yang
Acked-by: Fan Yang On Mon, Oct 05, 2020 at 4:40AM +0800,Philippe Mathieu-Daudé wrote: > There is a number of contributions from these academic domains. > Add the entries to the gitdm 'academic' domain map. > > Cc: Akkarit Sangpetch > Cc: Alexander Bulekov > Cc: Alexander Oleinik > Cc:

RE: [PATCH 3/9] hw/block/nvme: support per-namespace smart log

2020-10-05 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Wednesday, September 30, 2020 6:04 PM > To: qemu-bl...@nongnu.org; qemu-devel@nongnu.org; Klaus Jensen > > Cc: Niklas Cassel ; Dmitry Fomichev > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Keith Busch > Subject: [PATCH 3/9] hw/block/nvme:

RE: [PATCH 1/9] hw/block/nvme: remove pointless rw indirection

2020-10-05 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Wednesday, September 30, 2020 6:04 PM > To: qemu-bl...@nongnu.org; qemu-devel@nongnu.org; Klaus Jensen > > Cc: Niklas Cassel ; Dmitry Fomichev > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Keith Busch > Subject: [PATCH 1/9] hw/block/nvme:

Re: [PATCH v5 00/36] qapi: static typing conversion, pt1

2020-10-05 Thread John Snow
On 10/5/20 7:05 PM, Cleber Rosa wrote: Here on patches 08 an later, I've run: flake8 ./scripts/qapi And starting on patch 24 ("qapi/source.py: add type hint annotations") it complained about: /scripts/qapi/source.py:44:31: F821 undefined name 'T' I think that must be flake8 < 3.8.0.

RE: [PATCH v5 09/14] hw/block/nvme: Support Zoned Namespace Command Set

2020-10-05 Thread Dmitry Fomichev
> -Original Message- > From: Niklas Cassel > Sent: Monday, October 5, 2020 7:41 AM > To: Dmitry Fomichev > Cc: Alistair Francis ; qemu-devel@nongnu.org; > Damien Le Moal ; f...@euphon.net; Matias > Bjorling ; qemu-bl...@nongnu.org; > kw...@redhat.com; mlevi...@redhat.com;

Re: [PATCH v5 00/36] qapi: static typing conversion, pt1

2020-10-05 Thread Cleber Rosa
On Mon, Oct 05, 2020 at 03:51:22PM -0400, John Snow wrote: > Hi, this series adds static type hints to the QAPI module. > This is part one! > > Part 1: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt1 > Everything: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6 > > -

Re: [PATCH 2/2] aspeed: Add support for the g220a-bmc board

2020-10-05 Thread Joel Stanley
On Tue, 29 Sep 2020 at 05:53, John Wang wrote: > > G220A is a 2 socket x86 motherboard supported by OpenBMC. > Strapping configuration was obtained from hardware. > > Signed-off-by: John Wang Reviewed-by: Joel Stanley > --- > hw/arm/aspeed.c | 60

Re: [PATCH 2/5] target/riscv: Add PMP state description

2020-10-05 Thread Alistair Francis
On Mon, Sep 28, 2020 at 7:05 PM Yifei Jiang wrote: > > In the case of supporting PMP feature, add PMP state description > to vmstate_riscv_cpu. > > Signed-off-by: Yifei Jiang > Signed-off-by: Yipeng Yin > --- > target/riscv/machine.c | 49 ++ > 1 file

[Bug 1772165] Re: arm raspi2/raspi3 emulation has no USB support

2020-10-05 Thread Paul Zimmerman
I misspoke in my last comment, that first bullet should have said - If you are running a Raspbian image, you must add "dwc_otg.fiq_fsm_enable=0" to the '-append' command-line parameters. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to

Re: [PATCH 3/5] target/riscv: Add H extention state description

2020-10-05 Thread Alistair Francis
On Thu, Oct 1, 2020 at 10:56 AM Richard Henderson wrote: > > On 9/28/20 9:03 PM, Yifei Jiang wrote: > > +VMSTATE_UINTTL(env.vsstatus, RISCVCPU), > > +VMSTATE_UINTTL(env.vstvec, RISCVCPU), > > +VMSTATE_UINTTL(env.vsscratch, RISCVCPU), > > +VMSTATE_UINTTL(env.vsepc,

Re: Emulate Rpi with QEMU fails

2020-10-05 Thread Paul Zimmerman
If you can upgrade to Qemu 5.1 or newer, you should be able to use the builtin raspi2 or raspi3 emulation directly. Version 5.1 adds support for the USB controller on the Pi. There is no limitation on the amount of memory you can use with this method, and the networking should work. Here is the

[Bug 1772165] Re: arm raspi2/raspi3 emulation has no USB support

2020-10-05 Thread Paul Zimmerman
As of version 5.1, Qemu now supports USB on Raspberry PI 2 and 3. There are a few caveats: - If you are running a Raspbian image, you must add "dwc_otg.fiq_fsm_enable=0" to the '-kernel' command-line parameters. - Raspbian images 2016-05-27-raspbian-jessie and earlier don't work, see Bug

[PULL 21/21] kernel-doc: Remove $decl_type='type name' hack

2020-10-05 Thread Eduardo Habkost
The $decl_type='type name' hack makes it impossible to document macros with uppercase names (e.g. most of the macros in object.h). Now that we have explicitly tagged the struct and typedef doc comments in memory.h and object.h, we don't need that hack anymore. This will make the documentation

[PULL 15/21] docs/devel/qom: Remove usage of

2020-10-05 Thread Eduardo Habkost
is not valid reST syntax. Function @argument references don't need additional markup, so just remove . Constants were changed to use reST ``code`` syntax Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-6-ehabk...@redhat.com> Signed-off-by: Eduardo

[PULL 16/21] docs/devel/qom: Avoid long lines

2020-10-05 Thread Eduardo Habkost
Long code lines don't look good in the rendered documents, make them shorter. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-7-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/qom.rst | 9

[PULL 11/21] qom: Fix DECLARE_*CHECKER documentation

2020-10-05 Thread Eduardo Habkost
Correct copy/paste mistake in the DECLARE_INSTANCE_CHECKER and DECLARE_CLASS_CHECKERS documentation. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-2-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost ---

[PULL 14/21] docs/devel/qom: Use *emphasis* for emphasis

2020-10-05 Thread Eduardo Habkost
is not valid reST syntax. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-5-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/qom.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PULL 19/21] qom: Explicitly tag doc comments for typedefs and structs

2020-10-05 Thread Eduardo Habkost
If we explicitly indicate we are documenting a typedef or a struct, we'll be able to remove the $decl_type='type name' hack from kernel-doc. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003024123.193840-4-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost ---

[PULL 13/21] docs/devel/qom: Fix indentation of code blocks

2020-10-05 Thread Eduardo Habkost
Some code blocks had one extra space, fix that. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-4-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/qom.rst | 76 +++--- 1 file changed, 38

[PULL 20/21] memory: Explicitly tag doc comments for structs

2020-10-05 Thread Eduardo Habkost
This will allow us to remove the QEMU-specific $decl_type='type name' hack from the kernel-doc script. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003024123.193840-5-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost --- include/exec/memory.h | 6 +++--- 1

[PULL 07/21] hw/core/qdev-properties: Export some integer-related functions

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé We are going to split this file and reuse these static functions. Declare them in the local "qdev-prop-internal.h" header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-8-phi...@redhat.com> Signed-off-by:

[PULL 17/21] kernel-doc: Handle function typedefs that return pointers

2020-10-05 Thread Eduardo Habkost
One example that was not being parsed correctly by kernel-doc is: typedef Object *(ObjectPropertyResolve)(Object *obj, void *opaque, const char *part); Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini

[PULL 18/21] kernel-doc: Handle function typedefs without asterisks

2020-10-05 Thread Eduardo Habkost
Example of typedef that was not parsed by kernel-doc: typedef void (ObjectUnparent)(Object *obj); Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003024123.193840-3-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/kernel-doc | 2 +- 1 file

[PULL 10/21] qom: Improve error message displayed with missing object properties

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé Instead of only displaying the property missing, also display the object name. This help developer to quickly figure out the mistake without opening a debugger. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Eduardo Habkost Reviewed-by: Li Qiang Acked-by:

[PULL 06/21] hw/core/qdev-properties: Export qdev_prop_enum

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-7-phi...@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c| 7 +++ 2 files changed, 8

[PULL 12/21] docs/devel/qom: Fix indentation of bulleted list

2020-10-05 Thread Eduardo Habkost
The list was incorrectly parsed as a literal block due to indentation. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-3-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/qom.rst | 6 +++--- 1 file changed, 3 insertions(+), 3

[PULL 05/21] hw/core/qdev-properties: Export enum-related functions

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé We are going to split this file and reuse these static functions. Add the local "qdev-prop-internal.h" header declaring them. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-6-phi...@redhat.com>

[PULL 04/21] hw/core/qdev-properties: Fix code style

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé We will soon move this code, fix its style to avoid checkpatch.pl to complain. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-5-phi...@redhat.com> Signed-off-by: Eduardo Habkost ---

[PULL 03/21] hw/core/qdev-properties: Use qemu_strtoul() in set_pci_host_devaddr()

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé Replace strtoul() by qemu_strtoul() so checkpatch.pl won't complain if we move this code later. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-4-phi...@redhat.com> Signed-off-by: Eduardo Habkost ---

[PULL 08/21] hw/core/qdev-properties: Extract system-mode specific properties

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé Move properties specific to machines into a separate file. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-9-phi...@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-properties-system.c | 687

[PULL 02/21] hw/core/qdev-properties: Use qemu_strtol() in set_mac() handler

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé The MACAddr structure contains an array of uint8_t. Previously if a value was out of the [0..255] range, it was silently casted and no input validation was done. Replace strtol() by qemu_strtol() -- so checkpatch.pl won't complain if we move this code later -- and

[PULL 09/21] hw/core/cpu: Add missing 'exec/cpu-common.h' include

2020-10-05 Thread Eduardo Habkost
From: Philippe Mathieu-Daudé cpu_common_reset() uses tcg_flush_softmmu_tlb() which is declared in "exec/cpu-common.h". Add the missing header to avoid when refactoring other headers: hw/core/cpu.c: In function ‘cpu_common_reset’: hw/core/cpu.c:273:9: error: implicit declaration of function

[PULL 00/21] machine + QOM queue, 2020-10-05

2020-10-05 Thread Eduardo Habkost
The following changes since commit 36d9c2883e55c863b622b99f0ebb5143f0001401: readthedocs: build with Python 3.6 (2020-10-05 16:30:45 +0100) are available in the Git repository at: git://github.com/ehabkost/qemu.git tags/machine-next-pull-request for you to fetch changes up to

[PULL 01/21] numa: hmat: require parent cache description before the next level one

2020-10-05 Thread Eduardo Habkost
From: Igor Mammedov Spec[1] defines 0 - 3 level memory side cache, however QEMU CLI allows to specify an intermediate cache level without specifying previous level. Such option(s) silently ignored when building HMAT table, which leads to incomplete cache information. Make sure that previous

[PATCH 3/3] docs/devel/qtest: Include libqtest API reference

2020-10-05 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- docs/devel/qtest.rst | 6 ++ tests/qtest/libqos/libqtest.h | 20 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/devel/qtest.rst b/docs/devel/qtest.rst index 3bf9ebee7f0..075fe5f7d53 100644 ---

Re: [RFC PATCH 08/21] contrib/gitdm: Add Mentor Graphics to the domain map

2020-10-05 Thread Joseph Myers
On Mon, 5 Oct 2020, Alex Bennée wrote: > Joseph Myers writes: > > > On Sun, 4 Oct 2020, Philippe Mathieu-Daudé wrote: > > > >> There is a number of contributors from this domain, > >> add its own entry to the gitdm domain map. > > > > At some point the main branding will be Siemens; not sure

[PATCH 0/3] docs: Include QTest protocol and libqtest API on documentation

2020-10-05 Thread Eduardo Habkost
This moves the QTest section of testing.rst to a separate document, and include the QTest Protocol specification and libqtest API reference in the document. Eduardo Habkost (3): docs: Move QTest documentation to its own document docs/devel/qtest: Include protocol spec in document

[PATCH 1/3] docs: Move QTest documentation to its own document

2020-10-05 Thread Eduardo Habkost
The qtest and libqtest doc comments will be parsed to generate API documentation, so move QTest documentation to its own document where the API and format documentation and will be included. Signed-off-by: Eduardo Habkost --- docs/devel/index.rst | 1 + docs/devel/qtest.rst | 58

[PATCH 2/3] docs/devel/qtest: Include protocol spec in document

2020-10-05 Thread Eduardo Habkost
Include the QTest Protocol doc string in docs/devel/qtest.rst, after converting it to use Sphinx syntax. Signed-off-by: Eduardo Habkost --- docs/devel/qtest.rst | 12 ++-- softmmu/qtest.c | 73 +++- 2 files changed, 75 insertions(+), 10

Re: [Bug 1772165] Re: arm raspi2/raspi3 emulation has no USB support

2020-10-05 Thread mcandre
Which Beagle boards, Jetson Nano, other devices have rich support from qemu? ARM is critical going forward. On Mon, Oct 5, 2020, 10:20 AM Dims <1772...@bugs.launchpad.net> wrote: > So, is it still true, that QEMU doesn't support USB on Raspberry Pi? > > In other words I can't emulate Raspberry

Re: [PATCH v3] scripts: Convert qemu-version.sh to qemu-version.py

2020-10-05 Thread Marc-André Lureau
On Mon, Oct 5, 2020 at 11:52 PM Yonggang Luo wrote: > The sh script are harder to maintain for compatible different > xsh environment so convert it to python script > Also incorporate the fixes in > > https://patchew.org/QEMU/20200929143654.518157-1-marcandre.lur...@redhat.com/ > > Testing args

[PATCH v2 09/15] hw/misc/bcm2835_cprman: implement PLL channels behaviour

2020-10-05 Thread Luc Michel
A PLL channel is able to further divide the generated PLL frequency. The divider is given in the CTRL_A2W register. Some channels have an additional fixed divider which is always applied to the signal. Tested-by: Philippe Mathieu-Daudé Signed-off-by: Luc Michel --- hw/misc/bcm2835_cprman.c |

[PATCH v2 07/15] hw/misc/bcm2835_cprman: implement PLLs behaviour

2020-10-05 Thread Luc Michel
The CPRMAN PLLs generate a clock based on a prescaler, a multiplier and a divider. The prescaler doubles the parent (xosc) frequency, then the multiplier/divider are applied. The multiplier has an integer and a fractional part. This commit also implements the CPRMAN CM_LOCK register. This

[PATCH v2 15/15] hw/arm/bcm2835_peripherals: connect the UART clock

2020-10-05 Thread Luc Michel
Connect the 'uart-out' clock from the CPRMAN to the PL011 instance. Signed-off-by: Luc Michel --- hw/arm/bcm2835_peripherals.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 9d6190042d..d8f28b1ae2 100644 ---

[PATCH v2 06/15] hw/misc/bcm2835_cprman: add a PLL skeleton implementation

2020-10-05 Thread Luc Michel
There are 5 PLLs in the CPRMAN, namely PLL A, C, D, H and B. All of them take the xosc clock as input and produce a new clock. This commit adds a skeleton implementation for the PLLs as sub-devices of the CPRMAN. The PLLs are instantiated and connected internally to the main oscillator. Each PLL

Re: [PATCH] qom: fix objects with improper parent type

2020-10-05 Thread Marc-André Lureau
On Wed, Sep 30, 2020 at 3:47 AM Sergey Nizovtsev wrote: > > Some objects accidentally inherit ObjectClass instead of Object. > They compile silently but may crash after downcasting. > > In this patch, we introduce a coccinelle script to find broken > declarations and fix them manually with proper

[PATCH v2 13/15] hw/misc/bcm2835_cprman: add sane reset values to the registers

2020-10-05 Thread Luc Michel
Those reset values have been extracted from a Raspberry Pi 3 model B v1.2, using the 2020-08-20 version of raspios. The dump was done using the debugfs interface of the CPRMAN driver in Linux (under '/sys/kernel/debug/clk'). Each exposed clock tree stage (PLLs, channels and muxes) can be observed

[PATCH v2 05/15] hw/arm/raspi: add a skeleton implementation of the CPRMAN

2020-10-05 Thread Luc Michel
The BCM2835 CPRMAN is the clock manager of the SoC. It is composed of a main oscillator, and several sub-components (PLLs, multiplexers, ...) to generate the BCM2835 clock tree. This commit adds a skeleton of the CPRMAN, with a dummy register read/write implementation. It embeds the main

[PATCH v2 14/15] hw/char/pl011: add a clock input

2020-10-05 Thread Luc Michel
Add a clock input to the PL011 UART so we can compute the current baud rate and trace it. This is intended for developers who wish to use QEMU to e.g. debug their firmware or to figure out the baud rate configured by an unknown/closed source binary. Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2] scripts: Convert qemu-version.sh to qemu-version.py

2020-10-05 Thread Yonggang Luo
On Tue, Oct 6, 2020 at 3:23 AM Peter Maydell wrote: > > On Mon, 5 Oct 2020 at 18:24, Yonggang Luo wrote: > > > > The sh script are harder to maintain for compatible different > > xsh environment > > > > Signed-off-by: Yonggang Luo > > --- > > meson.build | 2 +- > >

[PATCH v2 02/15] hw/core/clock: trace clock values in Hz instead of ns

2020-10-05 Thread Luc Michel
The nanosecond unit greatly limits the dynamic range we can display in clock value traces, for values in the order of 1GHz and more. The internal representation can go way beyond this value and it is quite common for today's clocks to be within those ranges. For example, a frequency between

[PATCH v2 11/15] hw/misc/bcm2835_cprman: implement clock mux behaviour

2020-10-05 Thread Luc Michel
A clock mux can be configured to select one of its 10 sources through the CM_CTL register. It also embeds yet another clock divider, composed of an integer part and a fractional part. The number of bits of each part is mux dependent. Tested-by: Philippe Mathieu-Daudé Signed-off-by: Luc Michel

[PATCH v2 12/15] hw/misc/bcm2835_cprman: add the DSI0HSCK multiplexer

2020-10-05 Thread Luc Michel
This simple mux sits between the PLL channels and the DSI0E and DSI0P clock muxes. This mux selects between PLLA-DSI0 and PLLD-DSI0 channel and outputs the selected signal to source number 4 of DSI0E/P clock muxes. It is controlled by the cm_dsi0hsck register. Reviewed-by: Philippe Mathieu-Daudé

[PATCH v2 08/15] hw/misc/bcm2835_cprman: add a PLL channel skeleton implementation

2020-10-05 Thread Luc Michel
PLLs are composed of multiple channels. Each channel outputs one clock signal. They are modeled as one device taking the PLL generated clock as input, and outputting a new clock. A channel shares the CM register with its parent PLL, and has its own A2W_CTRL register. A write to the CM register

[PATCH v2 04/15] hw/arm/raspi: fix CPRMAN base address

2020-10-05 Thread Luc Michel
The CPRMAN (clock controller) was mapped at the watchdog/power manager address. It was also split into two unimplemented peripherals (CM and A2W) but this is really the same one, as shown by this extract of the Raspberry Pi 3 Linux device tree: watchdog@7e10 { compatible =

[PATCH v2 03/15] hw/core/clock: add the clock_new helper function

2020-10-05 Thread Luc Michel
This function creates a clock a parent it to another object with a given name. It calls clock_setup_canonical_path before returning the new clock. This function is useful to create clocks in devices when one doesn't want to expose it at the qdev level (as an input or an output). Suggested-by:

[PATCH v2 10/15] hw/misc/bcm2835_cprman: add a clock mux skeleton implementation

2020-10-05 Thread Luc Michel
The clock multiplexers are the last clock stage in the CPRMAN. Each mux outputs one clock signal that goes out of the CPRMAN to the SoC peripherals. Each mux has at most 10 sources. The sources 0 to 3 are common to all muxes. They are: 0. ground (no clock signal) 1. the main oscillator

[PATCH v5 36/36] qapi/visit.py: add type hint annotations

2020-10-05 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- scripts/qapi/mypy.ini | 5 --- scripts/qapi/visit.py | 73 +-- 2

[PATCH v2 00/15] raspi: add the bcm2835 cprman clock manager

2020-10-05 Thread Luc Michel
v1 -> v2: - patch 05: Added a comment about MMIO .valid constraints [Phil] - patch 05: Added MMIO .impl [Phil] - patch 05: Moved init_internal_clock to the public clock API, renamed clock_new (new patch 03) [Phil] - patch 11: use muldiv64 for clock mux frequency output computation

[PATCH v2 01/15] hw/core/clock: provide the VMSTATE_ARRAY_CLOCK macro

2020-10-05 Thread Luc Michel
Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Damien Hedde Signed-off-by: Luc Michel --- include/hw/clock.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/hw/clock.h b/include/hw/clock.h index d357594df9..c93e6113cd 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h

[PATCH v5 35/36] qapi/visit.py: remove unused parameters from gen_visit_object

2020-10-05 Thread John Snow
And this fixes the pylint report for this file, so make sure we check this in the future, too. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- scripts/qapi/pylintrc | 1 - scripts/qapi/visit.py | 4 ++-- 2 files changed, 2

[PATCH v5 33/36] qapi/types.py: remove one-letter variables

2020-10-05 Thread John Snow
"John, if pylint told you to jump off a bridge, would you?" Hey, if it looked like fun, I might. Now that this file is clean, enable pylint checks on this file. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/pylintrc | 1 -

[PATCH v5 34/36] qapi/visit.py: assert tag_member contains a QAPISchemaEnumType

2020-10-05 Thread John Snow
This is true by design, but not presently able to be expressed in the type system. An assertion helps mypy understand our constraints. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/visit.py | 12 +++- 1 file changed, 7 insertions(+), 5

[PATCH v5 29/36] qapi/gen.py: Remove unused parameter

2020-10-05 Thread John Snow
module_basename doesn't use the 'what' argument, so remove it. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index

[PATCH v5 31/36] qapi/gen.py: delint with pylint

2020-10-05 Thread John Snow
'fp' and 'fd' are self-evident in context, add them to the list of OK names. _top and _bottom also need to stay standard methods because some users override the method and need to use `self`. Tell pylint to shush. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa

[PATCH v5 30/36] qapi/gen.py: update write() to be more idiomatic

2020-10-05 Thread John Snow
Make the file handling here just a tiny bit more idiomatic. (I realize this is heavily subjective.) Use exist_ok=True for os.makedirs and remove the exception, use fdopen() to wrap the file descriptor in a File-like object, and use a context manager for managing the file pointer. Signed-off-by:

[PATCH v5 27/36] qapi/gen.py: add type hint annotations

2020-10-05 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/gen.py | 104 1 file changed, 57 insertions(+), 47 deletions(-) diff

[PATCH v5 26/36] qapi/gen.py: Fix edge-case of _is_user_module

2020-10-05 Thread John Snow
The edge case is that if the name is '', this expression returns a string instead of a bool, which violates our declared type. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Reviewed-by: Eduardo Habkost --- scripts/qapi/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v5 32/36] qapi/types.py: add type hint annotations

2020-10-05 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/mypy.ini | 5 --- scripts/qapi/types.py | 86 --- 2 files changed, 64

[PATCH v5 22/36] qapi/commands.py: add type hint annotations

2020-10-05 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/commands.py | 71 ++-- 1 file changed, 54 insertions(+), 17 deletions(-) diff

[PATCH v5 23/36] qapi/commands.py: enable checking with mypy

2020-10-05 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/mypy.ini | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index 5df11e53fd1..8ab9ac52cc4 100644 --- a/scripts/qapi/mypy.ini +++

[PATCH v5 28/36] qapi/gen.py: Enable checking with mypy

2020-10-05 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- scripts/qapi/mypy.ini | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index 1b8555dfa39..c6960ff2dbd 100644 ---

[PATCH v5 24/36] qapi/source.py: add type hint annotations

2020-10-05 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. A note on typing of __init__: mypy requires init functions with no parameters to document a return type of None to be considered fully typed. In the case when there are input parameters, None may be omitted. Since

[PATCH v5 19/36] qapi/events.py: add type hint annotations

2020-10-05 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/events.py | 46 -- scripts/qapi/mypy.ini | 5 - 2 files changed, 35

[PATCH v5 25/36] qapi/source.py: delint with pylint

2020-10-05 Thread John Snow
Shush an error and leave a hint for future cleanups when we're allowed to use Python 3.7+. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- scripts/qapi/pylintrc | 1 - scripts/qapi/source.py | 3 +++ 2 files changed, 3 insertions(+),

[PATCH v5 16/36] qapi/common.py: Convert comments into docstrings, and elaborate

2020-10-05 Thread John Snow
As docstrings, they'll show up in documentation and IDE help. The docstring style being targeted is the Sphinx documentation style. Sphinx uses an extension of ReST with "domains". We use the (implicit) Python domain, which supports a number of custom "info fields". Those info fields are

[PATCH v5 20/36] qapi/events.py: Move comments into docstrings

2020-10-05 Thread John Snow
Clarify them while we're here. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/events.py | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index 57e0939e963..599f3d1f564

[PATCH v5 21/36] qapi/commands.py: Don't re-bind to variable of different type

2020-10-05 Thread John Snow
Mypy isn't a fan of rebinding a variable with a new data type. It's easy enough to avoid. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/commands.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/qapi/commands.py

[PATCH v5 18/36] qapi: establish mypy type-checking baseline

2020-10-05 Thread John Snow
Fix two very minor issues, and then establish a mypy type-checking baseline. Like pylint, this should be run from the folder above: > mypy --config-file=qapi/mypy.ini qapi/ This is designed and tested for mypy 0.770 or greater. Signed-off-by: John Snow Tested-by: Eduardo Habkost

[PATCH v5 12/36] qapi/common.py: delint with pylint

2020-10-05 Thread John Snow
At this point, that just means using a consistent strategy for constant names. constants get UPPER_CASE and names not used externally get a leading underscore. As a preference, while renaming constants to be UPPERCASE, move them to the head of the file. Generally, it's nice to be able to audit

[PATCH v5 17/36] qapi/common.py: move build_params into gen.py

2020-10-05 Thread John Snow
Including it in common.py creates a circular import dependency; schema relies on common, but common.build_params requires a type annotation from schema. To type this properly, it needs to be moved outside the cycle. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa

[PATCH v5 10/36] qapi/common.py: Remove python compatibility workaround

2020-10-05 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/common.py | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index ba35abea478..cee63eb95c7 100644 --- a/scripts/qapi/common.py

[PATCH v5 06/36] qapi: Remove wildcard includes

2020-10-05 Thread John Snow
Wildcard includes become hard to manage when refactoring and dealing with circular dependencies with strictly typed mypy. flake8 also flags each one as a warning, as it is not smart enough to know which names exist in the imported file. Remove them and include things explicitly by name instead.

[PATCH v5 13/36] qapi/common.py: Replace one-letter 'c' variable

2020-10-05 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Cleber Rosa Reviewed-by: Eduardo Habkost --- scripts/qapi/common.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index a417b6029c8..338adedef4f 100644 ---

[PATCH v5 11/36] qapi/common.py: Add indent manager

2020-10-05 Thread John Snow
Code style tools really dislike the use of global keywords, because it generally involves re-binding the name at runtime which can have strange effects depending on when and how that global name is referenced in other modules. Make a little indent level manager instead. Signed-off-by: John Snow

[PATCH v5 15/36] qapi/common.py: add type hint annotations

2020-10-05 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/common.py | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git

[PATCH v5 09/36] qapi: add pylintrc

2020-10-05 Thread John Snow
Using `pylint --generate-rcfile > pylintrc`, generate a skeleton pylintrc file. Sections that are not presently relevant (by the end of this series) are removed leaving just the empty section as a search engine / documentation hint to future authors. I am targeting pylint 2.6.0. In the future

[PATCH v5 02/36] qapi: modify docstrings to be sphinx-compatible

2020-10-05 Thread John Snow
A precise style guide and a package-wide overhaul is forthcoming pending further discussion and consensus. At present, we are avoiding obvious errors that cause sphinx documentation build problems. A preliminary style guide is loosely based on PEP 257 and Sphinx Autodoc. It is chosen for

[PATCH v5 14/36] qapi/common.py: check with pylint

2020-10-05 Thread John Snow
Remove qapi/common.py from the pylintrc ignore list. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Tested-by: Eduardo Habkost --- scripts/qapi/pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/qapi/pylintrc

[PATCH v5 05/36] qapi: Prefer explicit relative imports

2020-10-05 Thread John Snow
All of the QAPI include statements are changed to be package-aware, as explicit relative imports. A quirk of Python packages is that the name of the package exists only *outside* of the package. This means that to a module inside of the qapi folder, there is inherently no such thing as the "qapi"

[PATCH v5 00/36] qapi: static typing conversion, pt1

2020-10-05 Thread John Snow
Hi, this series adds static type hints to the QAPI module. This is part one! Part 1: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt1 Everything: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6 - Requires Python 3.6+ - Requires mypy 0.770 or newer (for type analysis

[PATCH v5 01/36] docs: repair broken references

2020-10-05 Thread John Snow
In two different places, we are not making a cross-reference to some resource correctly. Signed-off-by: John Snow --- docs/devel/multi-thread-tcg.rst | 2 +- docs/devel/testing.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devel/multi-thread-tcg.rst

[PATCH v5 08/36] qapi: delint using flake8

2020-10-05 Thread John Snow
Petty style guide fixes and line length enforcement. Not a big win, not a big loss, but flake8 passes 100% on the qapi module, which gives us an easy baseline to enforce hereafter. A note on the flake8 exception: flake8 will warn on *any* bare except, but pylint's is context-aware and will

  1   2   3   4   >