[Qemu-devel] [PATCH] This patch is used to move some struct definition, like QEMUTimer, QEMUClock, from .c to .h.

2012-02-02 Thread Wei Yang
Tested on i386 platform. Signed-off-by: Wei Yangweiy...@linux.vnet.ibm.com --- qemu-timer.c | 40 qemu-timer.h | 41 + 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/qemu-timer.c b/qemu-timer.c

[Qemu-devel] how could I analysis the trace log?

2012-02-12 Thread Wei Yang
All I enable the trace function with --enable-trace-backend=simple and I create the event file like this g_realloc g_malloc Then I start the qemu with following command. ./i386-softmmu/qemu-system-i386 -enable-kvm -drive file=../../kvm/ubuntu.img -boot dc -m 512 -usb -monitor stdio -trace

Re: [Qemu-devel] How to follow a child process created in the guest OS?

2012-02-12 Thread Wei Yang
2012/2/11 malc av1...@comtv.ru: On Sat, 11 Feb 2012, Andreas F?rber wrote: Am 10.02.2012 11:26, schrieb ???: On Fri, Feb 10, 2012 at 08:14:41AM +, Stefan Hajnoczi wrote: On Thu, Feb 09, 2012 at 06:33:16PM +0800, ??? wrote: I am running a tiny OS on QEMU and debugging it with gdbstub.

Re: [Qemu-devel] how could I analysis the trace log?

2012-02-12 Thread Wei Yang
Hi, this kind of trace is not popular? 2012/2/12 Wei Yang weiyang.ker...@gmail.com: All I enable the trace function with --enable-trace-backend=simple and I create the event file like this g_realloc g_malloc Then I start the qemu with following command. ./i386-softmmu/qemu-system-i386

[Qemu-devel] Curious about this code in the ohci_service_td()

2012-02-18 Thread Wei Yang
I am reading the code in ohci_service_td(). There is a calculation of the length of the buffer. if ((td.cbp 0xf000) != (td.be 0xf000)) { len = (td.be 0xfff) + 0x1001 - (td.cbp 0xfff); } else { len = (td.be - td.cbp) + 1; } I am curious

Re: [Qemu-devel] Curious about this code in the ohci_service_td()

2012-02-18 Thread Wei Yang
2012/2/19 Peter Maydell peter.mayd...@linaro.org: On 18 February 2012 16:19, Wei Yang weiyang.ker...@gmail.com wrote: I am reading the code in ohci_service_td(). There is a calculation of the length of the buffer.        if ((td.cbp 0xf000) != (td.be 0xf000)) {            len

[Qemu-devel] In OHCI the HC will sent packet to each attached port?

2012-02-19 Thread Wei Yang
All In function ohci_service_td() , there is a loop. for (i = 0; i ohci-num_ports; i++) { dev = ohci-rhport[i].port.dev; if ((ohci-rhport[i].ctrl OHCI_PORT_PES) == 0) continue; if (ohci-async_td) { /* ??? The hardware

[Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-15 Thread Wei Yang
Then the guest will run very happily Also use the info b could show the break point is set. Which step I made a mistake? -- Wei Yang Help You, Help Me

Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Wei Yang
2012/3/17 Jan Kiszka jan.kis...@web.de: [ re-added qemu-devel to CC ] On 2012-03-17 13:10, Wei Yang wrote: Two major issues with this procedure: 1. When using kvm, a soft breakpoint (as set by 'b') will inject a trap instruction into the guest image - which is not yet loaded after the bios

Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Wei Yang
You can also try my patch : http://patchwork.ozlabs.org/patch/137543/ Unless there is a use case beyond this x86 band-aid, lets focus on getting gdb right. Reminds me that gdb folks asked me to file a bug about this - which I still need to do. :-/ Jan Jan, I didn't try your patch yet.

[Qemu-devel] one question on the makefile

2012-06-12 Thread Wei Yang
All, I saw a makefile rule which confused. This is in the tests/Makefile .PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS)) $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y) $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \

[Qemu-devel] [PATCH] kvm: shoten the parameter list for get_real_device()

2013-08-18 Thread Wei Yang
get_real_device() has 5 parameters with the last 4 is contained in the first structure. This patch removes the last 4 parameters and directly use them from the first parameter. Signed-off-by: Wei Yang weiy...@linux.vnet.ibm.com --- hw/i386/kvm/pci-assign.c |9 - 1 files changed, 4

Re: [Qemu-devel] [PULL 9/9] kvm: shorten the parameter list for get_real_device()

2013-08-23 Thread Wei Yang
Paolo, Is it necessary to add this? From: Wei Yang weiy...@linux.vnet.ibm.com On Fri, Aug 23, 2013 at 11:03:35AM +0200, Paolo Bonzini wrote: get_real_device() has 5 parameters with the last 4 is contained in the first structure. This patch removes the last 4 parameters and directly use them

Re: [Qemu-devel] [PULL 9/9] kvm: shorten the parameter list for get_real_device()

2013-08-23 Thread Wei Yang
Paolo, Sorry, maybe I am not familiar with the patch format in qemu-dev. I didn't see the From: Wei Yang in this one neither. On Fri, Aug 23, 2013 at 11:39:53AM +0200, Paolo Bonzini wrote: get_real_device() has 5 parameters with the last 4 is contained in the first structure. This patch

[Qemu-devel] [PATCH] migration: reorder code to make it symmetric

2016-02-04 Thread Wei Yang
() json_end_object() save_section_footer() After the change: json_start_object() save_section_header() vmstate_save() save_section_footer() json_end_object() This patch reorder the code to to make it symmetric. No functional change. Signed-off-by: Wei Yang <richard.w

Re: [Qemu-devel] [PATCH 2/2] qmp-spec: fix index in doc

2016-02-01 Thread Wei Yang
On Sat, Jan 30, 2016 at 12:46:58PM +0300, Michael Tokarev wrote: >24.01.2016 17:09, Wei Yang wrote: >> The index is duplicated. Just change it. > >It is indeed, with previous being 2.5 as well >and the next being 3. Applying to -trivial. > >Please the next time se

Re: [Qemu-devel] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs

2016-02-01 Thread Wei Yang
On Sat, Jan 30, 2016 at 12:45:27PM +0300, Michael Tokarev wrote: >24.01.2016 17:09, Wei Yang wrote: >> Within the if statement, time_spent is assured to be non-zero. >> >> This patch just removes the check on time_spent when calculating mbs. > >T

Re: [Qemu-devel] [PATCH 2/2] s390x/pci: use PCI_MSIX_FLAGS on retrieving the MSIX entries

2016-02-23 Thread Wei Yang
On Tue, Feb 23, 2016 at 02:17:11PM +0800, Yi Min Zhao wrote: >于 Mon, 22 Feb 2016 14:15:07 +0100 >Christian Borntraeger <borntrae...@de.ibm.com> 写道: > >> On 02/19/2016 04:18 PM, Wei Yang wrote: >> > Even PCI_CAP_FLAGS has the same value as PCI_MSIX_FLAGS, the lat

Re: [Qemu-devel] [PATCH 2/2] s390x/pci: use PCI_MSIX_FLAGS on retrieving the MSIX entries

2016-02-24 Thread Wei Yang
On Wed, Feb 24, 2016 at 10:40:15AM +0100, Cornelia Huck wrote: >On Fri, 19 Feb 2016 15:18:11 +0000 >Wei Yang <richard.weiy...@gmail.com> wrote: > >> Even PCI_CAP_FLAGS has the same value as PCI_MSIX_FLAGS, the later one is >> the more proper on retrieving MSIX entr

[Qemu-devel] [PATCH 0/2] use PCI_MSIX_FLAGS on retrieving the MSIX entries

2016-02-19 Thread Wei Yang
These two patches replace the PCI_CAP_FLAGS with PCI_MSIX_FLAGS on retrieving the MSIX entries. The change is the same, while I put them in two patches for different author to review. Wei Yang (2): vfio/pci: use PCI_MSIX_FLAGS on retrieving the MSIX entries s390x/pci: use PCI_MSIX_FLAGS

[Qemu-devel] [PATCH 1/2] vfio/pci: use PCI_MSIX_FLAGS on retrieving the MSIX entries

2016-02-19 Thread Wei Yang
Even PCI_CAP_FLAGS has the same value as PCI_MSIX_FLAGS, the later one is the more proper on retrieving MSIX entries. This patch uses PCI_MSIX_FLAGS to retrieve the MSIX entries. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- hw/vfio/pci.c |2 +- 1 file changed, 1 insertion

[Qemu-devel] [PATCH 2/2] s390x/pci: use PCI_MSIX_FLAGS on retrieving the MSIX entries

2016-02-19 Thread Wei Yang
Even PCI_CAP_FLAGS has the same value as PCI_MSIX_FLAGS, the later one is the more proper on retrieving MSIX entries. This patch uses PCI_MSIX_FLAGS to retrieve the MSIX entries. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> CC: Cornelia Huck <cornelia.h...@de.ibm.com> C

Re: [Qemu-devel] [PATCH 1/2] vfio/pci: use PCI_MSIX_FLAGS on retrieving the MSIX entries

2016-02-19 Thread Wei Yang
On Fri, Feb 19, 2016 at 09:45:32AM -0700, Alex Williamson wrote: >On Fri, 19 Feb 2016 15:18:10 +0000 >Wei Yang <richard.weiy...@gmail.com> wrote: > >> Even PCI_CAP_FLAGS has the same value as PCI_MSIX_FLAGS, the later one is >> the more proper on retrieving MSIX entr

Re: [Qemu-devel] [PATCH] migration: reorder code to make it symmetric

2016-02-19 Thread Wei Yang
Hi, Amit Do you like this one? On Thu, Feb 04, 2016 at 10:50:30PM +, Wei Yang wrote: >In qemu_savevm_state_complete_precopy(), it iterates on each device to add >a json object and transfer related status to destination, while the order >of the last two steps could be refined. &

Re: [Qemu-devel] [PATCH] migration: reorder code to make it symmetric

2016-02-10 Thread Wei Yang
Hello everyone, Is this one correct? On Thu, Feb 04, 2016 at 10:50:30PM +, Wei Yang wrote: >In qemu_savevm_state_complete_precopy(), it iterates on each device to add >a json object and transfer related status to destination, while the order >of the last two steps could b

[Qemu-devel] [PATCH] vfio/pci: replace 1 with PCI_CAP_LIST_NEXT to make code self-explain

2016-02-10 Thread Wei Yang
Use the macro PCI_CAP_LIST_NEXT instead of 1, so that the code would be more self-explain. This patch makes this change and also fixs one typo in comment. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- hw/vfio/pci.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

Re: [Qemu-devel] [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2016-03-18 Thread Wei Yang
Hi, Tianyu, I am testing your V2 patch set in our environment, while facing two issues now. Have a workaround for the first one and hope you could share some light on the second one :-) 1. Mismatch for ram_block (Have a workaround)

Re: [Qemu-devel] [PATCH] vfio/pci: replace 1 with PCI_CAP_LIST_NEXT to make code self-explain

2016-03-19 Thread Wei Yang
nt. By using the macro, audience is more easy to understand it tries to get the position of next capability. > >Each capability is a node of a linked list, and the position of the next >capability is at offset 1 inside the capability (here it is at offset 1 >from the tmp or pos base). I think the patch is an improvement. > Thanks Paolo for your reply. :-) >Paolo -- Wei Yang Help you, Help me

Re: [Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages

2016-03-23 Thread Wei Yang
oesn't do >it automatically. > Oh, first time to notice this, interesting~ >-- >Eric Blake eblake redhat com+1-919-301-3266 >Libvirt virtualization library http://libvirt.org > -- Wei Yang Help you, Help me

Re: [Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages

2016-03-23 Thread Wei Yang
On Wed, Mar 23, 2016 at 02:35:42PM +, Li, Liang Z wrote: >> >No special purpose. Maybe it's caused by the email client. I didn't >> >find the character in the original doc. >> > >> >> https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg00715.html >> >> You could take a look at this

Re: [Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages

2016-03-23 Thread Wei Yang
On Wed, Mar 23, 2016 at 06:48:22AM +, Li, Liang Z wrote: [...] >> > 8. Pseudo code >> > Dirty page logging should be enabled before getting the free page >> > information from guest, this is important because during the process >> > of getting free pages, some free pages may be used and

Re: [Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages

2016-03-23 Thread Wei Yang
On Thu, Mar 24, 2016 at 01:32:25AM +, Li, Liang Z wrote: >> >> >> > >> >> >> >6. Handling page cache in the guest The memory used for page >> >> >> >cache in the guest will change depends on the workload, if guest >> >> >> >run some block IO intensive work load, there will >> >> >> >> >> >>

Re: [Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages

2016-03-22 Thread Wei Yang
Hi, Liang This is a very clear documentation of your work, I appreciated it a lot. Below are some of my personal opinion and question. On Tue, Mar 22, 2016 at 03:43:49PM +0800, Liang Li wrote: >I have sent the RFC version patch set for live migration optimization >by skipping processing the free

Re: [Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages

2016-03-23 Thread Wei Yang
On Wed, Mar 23, 2016 at 07:18:57AM +, Li, Liang Z wrote: >> Hi, Liang >> >> This is a very clear documentation of your work, I appreciated it a lot. >> Below >> are some of my personal opinion and question. >> > >Thanks for your comments! > >> On Tue, Mar 22, 2016 at 03:43:49PM +0800, Liang

[Qemu-devel] [PATCH] kvm/irqchip: use bitmap utility for gsi tracking

2016-03-05 Thread Wei Yang
By using utilities in bitops and bitmap, this patch tries to make it more friendly to audience. No functional change. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- kvm-all.c | 34 ++ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git

Re: [Qemu-devel] [PATCH] kvm/irqchip: use bitmap utility for gsi tracking

2016-03-07 Thread Wei Yang
On Mon, Mar 07, 2016 at 10:47:53AM +0100, Paolo Bonzini wrote: >On 06/03/2016 02:57, Wei Yang wrote: >> By using utilities in bitops and bitmap, this patch tries to make it more >> friendly to audience. No functional change. >> >> Signed-off-by: Wei Yang <richard.wei

[Qemu-devel] [PATCH] bitmap: refine and move BITMAP_{FIRST/LAST}_WORD_MASK

2016-03-05 Thread Wei Yang
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 <richard.weiy...@gmail.com> --- inc

Re: [Qemu-devel] [PATCH] bitmap: refine and move BITMAP_{FIRST/LAST}_WORD_MASK

2016-09-29 Thread Wei Yang
On Thu, Sep 29, 2016 at 07:11:39PM +0300, Michael Tokarev wrote: >05.03.2016 16:47, Wei Yang wrote: >>According to linux kernel commit <89c1e79eb30> ("linux/bitmap.h: improve >>BITMAP_{LAST,FIRST}_WORD_MASK"), these two macro could be improved. >> >>This

[Qemu-devel] [PATCH] bios-tables-test: use strlen instead of sizeof

2017-08-14 Thread wei . yang
From: Wei Yang <wei.y...@ucloud.cn> sizeof(BLOCK_NAME_END) is actually 2. it can work because there's a space after ,. but It is better to replace it with strlen so it will work without a space too. Signed-off-by: Wei Yang <wei.y...@ucloud.cn> CC: Michael S. Tsirkin <m...@redha

[Qemu-devel] [PATCH] bios-tables-test: delete a assert about block name

2017-08-14 Thread wei . yang
From: Wei Yang <wei.y...@ucloud.cn> The assert would be touched when the version of acpica is greater than or equal to 20160318. its reason is that "Disasembler: Update a couple output items(commit id: 1ecbb3d)" is introduced by Robert, the patch emits the AML filename as a ze

Re: [Qemu-devel] Devdax backend for vnvdimm not working

2019-01-15 Thread Wei Yang
On Wed, Jan 16, 2019 at 10:18:05AM +0800, Yi Zhang wrote: >On 2019-01-16 at 09:12:33 +0800, Wei Yang wrote: >> On Tue, Jan 15, 2019 at 08:13:27PM +, Kamal Kakri via Qemu-devel wrote: >> >Hi, >> > >> >I have a namespace (backed by real nvdimm h/w) configured

Re: [Qemu-devel] Devdax backend for vnvdimm not working

2019-01-15 Thread Wei Yang
in the logs at >/var/log/libvirt/qemu) > > >Can anyone pls hint as to what possibly could be the issue ? Is this alignment >related or something else ? > >Here are my versions: ># virsh --version >4.5.0 >[root@fox22hv libexec]# /usr/libexec/qemu-kvm --version >QEMU emulator version 2.12.0 (qemu-kvm-rhev-2.12.0-18.el7_6.1) >Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers ># uname -a >Linux fox22hv 4.19.0-1.el7.elrepo.x86_64 #1 SMP Mon Oct 22 10:40:32 EDT 2018 >x86_64 x86_64 x86_64 GNU/Linux > > > -- Wei Yang Help you, Help me

[Qemu-devel] [PATCH 2/3] hw/acpi: remove unused function acpi_table_add_builtin()

2019-01-24 Thread Wei Yang
Function acpi_table_add_builtin() is now used in no place. Remove the definition and declaration. Signed-off-by: Wei Yang --- hw/acpi/core.c | 6 -- include/hw/acpi/acpi.h | 1 - 2 files changed, 7 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index d6f0709691

[Qemu-devel] [PATCH 1/3] hw/i386/pc.c: remove unused function pc_acpi_init()

2019-01-24 Thread Wei Yang
Function pc_acpi_init() is now used in no place. Remove the definition and declaration. Signed-off-by: Wei Yang --- hw/i386/pc.c | 27 --- include/hw/i386/pc.h | 1 - 2 files changed, 28 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5317e08f60

[Qemu-devel] [PATCH 3/3] hw/acpi: remove unnecessary variable acpi_table_builtin

2019-01-24 Thread Wei Yang
acpi_table_builtin is now always false, it is not necessary to check it again. This patch just removes it. Signed-off-by: Wei Yang --- hw/acpi/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index e9b1a85e54..f9c96535d1 100644

Re: [Qemu-devel] [RFC PATCH 3/3] hw/acpi: Extract build_mcfg

2019-04-01 Thread Wei Yang
On Wed, Mar 13, 2019 at 05:09:43PM +0100, Igor Mammedov wrote: >On Wed, 13 Mar 2019 13:33:59 +0000 >Wei Yang wrote: > >> >> I am lost at this place. >> >> sig is a part of ACPI table header, you mean the sig is not necessary to >> be set in ACPI tabl

[Qemu-devel] [PATCH] vmstate: check subsection_found is enough

2019-04-01 Thread Wei Yang
subsection_found is true implies vmdesc is not NULL. Signed-off-by: Wei Yang --- migration/vmstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/vmstate.c b/migration/vmstate.c index e2bbb7b5f7..8327179eea 100644 --- a/migration/vmstate.c +++ b/migration

Re: [Qemu-devel] [PATCH 1/2] vl.c: make find_default_machine() local

2019-04-02 Thread Wei Yang
On Tue, Apr 02, 2019 at 08:33:08AM +0200, Markus Armbruster wrote: >Wei Yang writes: > >> Function find_default_machine() is introduced by commit 2c8cffa599b7 >> "vl: make find_default_machine externally visible", while it seems no >> one outside use it. >It

Re: [Qemu-devel] [PATCH 2/2] vl.c: allocate TYPE_MACHINE list once during bootup

2019-04-02 Thread Wei Yang
On Tue, Apr 02, 2019 at 03:28:48PM +0200, Markus Armbruster wrote: >Wei Yang writes: > >> Now all the functions used to select machine is local and the call flow >> looks like below: >> >> select_machine() >> find_defaul

Re: [Qemu-devel] [PATCH] migration: remove not used field xfer_limit

2019-03-31 Thread Wei Yang
On Wed, Mar 27, 2019 at 08:24:21PM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> MigrationState->xfer_limit is only set to 0 in migrate_init(). >> >> Remove this unnecessary field. >> >> Signed-off-by: Wei Yang

[Qemu-devel] [PATCH v2] vmstate: check subsection_found is enough

2019-04-02 Thread Wei Yang
subsection_found is true implies vmdesc is not NULL. This patch remove the additional check on vmdesc and rename subsection_found to vmdesc_has_subsections to make it more self-explain. Signed-off-by: Wei Yang --- v2: * rename it to vmdesc_has_subsections --- migration/vmstate.c | 8

Re: [Qemu-devel] [PATCH 2/2] vl.c: allocate TYPE_MACHINE list once during bootup

2019-04-02 Thread Wei Yang
On Tue, Apr 02, 2019 at 06:10:23PM +0200, Markus Armbruster wrote: >Wei Yang writes: [...] >>>> >>>> @@ -2659,7 +2655,8 @@ static const QEMUOption *lookup_opt(int argc, char >>>> **argv, >>>> >>>> static MachineClass *sel

Re: [Qemu-devel] [PATCH] vmstate: check subsection_found is enough

2019-04-02 Thread Wei Yang
On Tue, Apr 02, 2019 at 07:44:23PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> subsection_found is true implies vmdesc is not NULL. >> >> Signed-off-by: Wei Yang >> --- >> migration/vmstate.c | 2 +- >> 1 f

[Qemu-devel] [PATCH 4/6] exec.c: subpage->sub_section is already initialized to 0

2019-03-21 Thread Wei Yang
setup for a new subpage and also fix the code style. Signed-off-by: Wei Yang --- exec.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exec.c b/exec.c index 78bf810ae8..788a8c3f69 100644 --- a/exec.c +++ b/exec.c @@ -1494,8 +1494,8 @@ hwaddr memory_region_section_get

[Qemu-devel] [PATCH 6/6] exec.c: add a check between constants to see whether we could skip

2019-03-21 Thread Wei Yang
The maximum level is defined as P_L2_LEVELS and skip is defined with 6 bits, which means if P_L2_LEVELS < (1 << 6), skip never exceeds the boundary. Since this check is between two constants, which leverages compiler to optimize the code based on different configuration. Signed-off-by:

[Qemu-devel] [PATCH v4] hw/acpi: extract acpi_add_rom_blob()

2019-03-20 Thread Wei Yang
arm and i386 has almost the same function acpi_add_rom_blob(), except giving different FWCfgCallback function. This patch moves acpi_add_rom_blob() to utils.c by passing FWCfgCallback to it. Signed-off-by: Wei Yang --- v4: * extract -> moves * adjust comment in source to make checkpa

[Qemu-devel] [PATCH 5/6] exec.c: correct the maximum skip value during compact

2019-03-21 Thread Wei Yang
skip is defined with 6 bits. So the maximum value should be (1 << 6). Signed-off-by: Wei Yang --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 788a8c3f69..6c660f656c 100644 --- a/exec.c +++ b/exec.c @@ -322,7 +322,7 @@ stati

[Qemu-devel] [PATCH 3/6] exec.c: get nodes_nb_alloc with one MAX calculation

2019-03-21 Thread Wei Yang
simplify the calculation a bit. Signed-off-by: Wei Yang --- exec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 8e8b6bb1f9..78bf810ae8 100644 --- a/exec.c +++ b/exec.c @@ -226,8 +226,7 @@ static void phys_map_node_reserve(PhysPageMap *map, unsig

[Qemu-devel] [PATCH 2/6] exec.c: remove an unnecessary assert on PHYS_MAP_NODE_NIL in phys_map_node_alloc()

2019-03-21 Thread Wei Yang
PHYS_MAP_NODE_NIL is assigned to PhysPageEntry.ptr in case this is not a leaf entry, while map->nodes_nb range in [0, nodes_nb_alloc). Seems we are asserting on two different things, just remove it. Signed-off-by: Wei Yang --- exec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/exec.

[Qemu-devel] [PATCH 1/6] exec.c: replace hwaddr with uint64_t for better understanding

2019-03-21 Thread Wei Yang
Function phys_page_set() and phys_page_set_level() 's argument *nb* stands for number of pages to set instead of hardware address. This would be more proper to use uint64_t instead of hwaddr for its type. Signed-off-by: Wei Yang --- exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[Qemu-devel] [PATCH 0/6] Refine exec

2019-03-21 Thread Wei Yang
This serial refine exec a little. Wei Yang (6): exec.c: replace hwaddr with uint64_t for better understanding exec.c: remove an unnecessary assert on PHYS_MAP_NODE_NIL in phys_map_node_alloc() exec.c: get nodes_nb_alloc with one MAX calculation exec.c: subpage->sub_section is alre

Re: [Qemu-devel] [PATCH v5] hw/acpi: extract acpi_add_rom_blob()

2019-03-25 Thread Wei Yang
On Mon, Mar 25, 2019 at 10:55:04AM +0100, Igor Mammedov wrote: >On Mon, 25 Mar 2019 13:59:10 +0800 >Wei Yang wrote: > >> arm and i386 has almost the same function acpi_add_rom_blob(), except >> giving different FWCfgCallback function. >> >> This patch mov

[Qemu-devel] [PATCH v6] hw/acpi: extract acpi_add_rom_blob()

2019-03-25 Thread Wei Yang
arm and i386 has almost the same function acpi_add_rom_blob(), except giving different FWCfgCallback function. This patch moves acpi_add_rom_blob() to utils.c by passing FWCfgCallback to it. Signed-off-by: Wei Yang Reviewed-by: Igor Mammedov --- v6: * change author from Igor to Michael v5

[Qemu-devel] [PATCH] migration: remove not used field xfer_limit

2019-03-25 Thread Wei Yang
MigrationState->xfer_limit is only set to 0 in migrate_init(). Remove this unnecessary field. Signed-off-by: Wei Yang --- migration/migration.c | 1 - migration/migration.h | 1 - 2 files changed, 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index e88acab

[Qemu-devel] [PATCH v5] hw/acpi: extract acpi_add_rom_blob()

2019-03-25 Thread Wei Yang
arm and i386 has almost the same function acpi_add_rom_blob(), except giving different FWCfgCallback function. This patch moves acpi_add_rom_blob() to utils.c by passing FWCfgCallback to it. Signed-off-by: Wei Yang --- v5: * remove unnecessary header glib/gprintf.h * rearrange include

Re: [Qemu-devel] [PATCH 4/4] vl: Simplify machine_parse()

2019-04-03 Thread Wei Yang
ly on is_help_option(). And no it exit when !is_help_option(), while before this change it exit when is_help_option(). I don't understand the reason behind this. My suggestion is you may split this patch into two: 1. remove check on name 2. refine the logic with explanations. > } > > void qemu_add_exit_notifier(Notifier *notify) >-- >2.17.2 -- Wei Yang Help you, Help me

Re: [Qemu-devel] [PATCH 3/4] vl: Clean up after previous commit

2019-04-03 Thread Wei Yang
uggestion here is to define MachineClass *mc = el->data; just as it does in find_machin() and return mc instead of raw el->data. If you agree with that I will modify this at my place. > >-return mc; >+return NULL; > } > > MachineInfoList *qmp_query_machines(Error **errp) >-- >2.17.2 -- Wei Yang Help you, Help me

[Qemu-devel] [PATCH] migration: remove unused field bytes_xfer

2019-04-01 Thread Wei Yang
MigrationState->bytes_xfer is only set to 0 in migrate_init(). Remove this unnecessary field. Signed-off-by: Wei Yang --- migration/migration.c | 1 - migration/migration.h | 1 - 2 files changed, 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index dea7078

[Qemu-devel] [PATCH v2 3/4] vl: Clean up after previous commit

2019-04-05 Thread Wei Yang
From: Markus Armbruster Since the previous commit, find_machine() and find_default_machine() don't have to deallocate on return. This permits further simplifications. Signed-off-by: Markus Armbruster Reviewed-by: Wei Yang --- vl.c | 25 - 1 file changed, 8 insertions

[Qemu-devel] [PATCH v2 0/4] cleanup select_machine

2019-04-05 Thread Wei Yang
] * Markus provides [3-4] Markus Armbruster (2): vl: Clean up after previous commit vl: Simplify machine_parse() Wei Yang (2): vl.c: make find_default_machine() local vl.c: allocate TYPE_MACHINE list once during bootup include/hw/boards.h | 1 - vl.c| 69

[Qemu-devel] [PATCH v2 1/4] vl.c: make find_default_machine() local

2019-04-05 Thread Wei Yang
om_only property" removed the only user of find_default_machine() outside vl.c, but neglected to make it static. Do that now. Signed-off-by: Wei Yang --- v2: * refactor changelog as suggested by Markus * move one not related change to patch 2 --- include/hw/boards.h | 1 - vl.c

[Qemu-devel] [PATCH v2 4/4] vl: Simplify machine_parse()

2019-04-05 Thread Wei Yang
igned-off-by: Markus Armbruster Reviewed-by: Wei Yang --- vl.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/vl.c b/vl.c index 99f9cb2533..4f4d440bc4 100644 --- a/vl.c +++ b/vl.c @@ -2529,19 +2529,10 @@ static gint machine_class_cmp(gconstpointer

Re: [Qemu-devel] [PATCH 4/4] vl: Simplify machine_parse()

2019-04-04 Thread Wei Yang
On Thu, Apr 04, 2019 at 06:05:25PM +0200, Markus Armbruster wrote: >Wei Yang writes: > >> On Tue, Apr 02, 2019 at 03:26:50PM +0200, Markus Armbruster wrote: >>>Exploit that argument @name is nerver null. Check is_help_option() >>>first, because that's what we d

[Qemu-devel] [PATCH v2 2/4] vl.c: allocate TYPE_MACHINE list once during bootup

2019-04-05 Thread Wei Yang
time we use it, while this is not necessary to do so because we don't need to modify this. This patch make the TYPE_MACHINE list allocation in select_machine and pass this to its child for use. Signed-off-by: Wei Yang Reviewed-by: Markus Armbruster --- vl.c | 24 +++- 1 file

Re: [Qemu-devel] [RFC PATCH 3/3] hw/acpi: Extract build_mcfg

2019-04-05 Thread Wei Yang
On Tue, Apr 02, 2019 at 08:15:12AM +0200, Igor Mammedov wrote: >On Tue, 2 Apr 2019 11:53:43 +0800 >Wei Yang wrote: > > >> The migration infrastructure has several SaveStateEntry to help migrate >> different elements. The one with name "ram" take charge of R

Re: [Qemu-devel] [PATCH] migration: remove not used field xfer_limit

2019-03-27 Thread Wei Yang
On Wed, Mar 27, 2019 at 08:24:21PM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> MigrationState->xfer_limit is only set to 0 in migrate_init(). >> >> Remove this unnecessary field. >> >> Signed-off-by: Wei Yang

[Qemu-devel] [PATCH] migration: cleanup check on ops in savevm.handlers iteration

2019-04-01 Thread Wei Yang
in savevm.c to check ops only once in those iterations. Signed-off-by: Wei Yang --- migration/savevm.c | 35 ++- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 5f0ca7fac2..92af2471cd 100644 --- a/migration

Re: [Qemu-devel] [PATCH] migration: remove not used field xfer_limit

2019-04-01 Thread Wei Yang
On Mon, Apr 01, 2019 at 09:51:55AM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> On Wed, Mar 27, 2019 at 08:24:21PM +, Dr. David Alan Gilbert wrote: >> >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> >> Migratio

Re: [Qemu-devel] [PATCH for-4.0] hw/i386/pc: Fix crash when hot-plugging nvdimm on older machine types

2019-04-08 Thread Wei Yang
_state->is_enabled) { > error_setg(errp, "nvdimm is not enabled: missing 'nvdimm' in '-M'"); > return; > } > >+hotplug_handler_pre_plug(pcms->acpi_dev, dev, _err); >+if (local_err) { >+error_propagate(errp, local_err); >+return; >+} >+ > pc_dimm_pre_plug(PC_DIMM(dev), MACHINE(hotplug_dev), > pcmc->enforce_aligned_dimm ? NULL : _align, errp); > } >-- >2.21.0 -- Wei Yang Help you, Help me

[Qemu-devel] [PATCH] migration: not necessary to check ops again

2019-03-26 Thread Wei Yang
During each iteration, se->ops is checked before each loop. So it is not necessary to check it again and simplify the following check a little. Signed-off-by: Wei Yang --- migration/savevm.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/migration/savevm.

Re: [Qemu-devel] [PATCH v2] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-18 Thread Wei Yang
On Mon, Feb 18, 2019 at 02:53:36PM +0100, Igor Mammedov wrote: >On Mon, 18 Feb 2019 13:21:29 +0000 >Wei Yang wrote: > >> On Mon, Feb 18, 2019 at 01:56:02PM +0100, Igor Mammedov wrote: >> >On Mon, 18 Feb 2019 12:13:24 + >> >Wei Yang wrote: >> > >

[Qemu-devel] [PATCH v3] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-18 Thread Wei Yang
Fix it by checking if memory hotplug is enabled at pre_plug stage where we can gracefully abort hotplug request. Signed-off-by: Wei Yang CC: Igor Mammedov CC: Eric Blake --- v3: * replace acpi_memory_hotplug with memory-hotplug-support in changelog * fix code alignment of ich9_pm_device_pre_plug

[Qemu-devel] [PATCH 0/2] PCDIMM cleanup

2019-02-18 Thread Wei Yang
Two trivial cleanup for pc-dimm. Patch [1] remove the check on class->hotpluggable since pc-dimm is always hotpluggable. Patch [2] remove realized callback since the task is done in pre_plug stage. Wei Yang (2): pc-dimm: remove check on pc-dimm hotpluggable pc-dimm: remove realize callb

[Qemu-devel] [PATCH 2/2] pc-dimm: remove realize callback

2019-02-18 Thread Wei Yang
-by: Wei Yang --- hw/acpi/memory_hotplug.c | 1 - hw/mem/nvdimm.c | 11 --- hw/mem/pc-dimm.c | 5 - include/hw/mem/pc-dimm.h | 3 --- 4 files changed, 20 deletions(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index b19673d337..cb5284d36f 100644

[Qemu-devel] [PATCH 1/2] pc-dimm: remove check on pc-dimm hotpluggable

2019-02-18 Thread Wei Yang
Function acpi_memory_plug_cb() is only invoked when dev is a PCDIMM, which is hotpluggable. This means it is not necessary to check this property again. This patch removes this check. Signed-off-by: Wei Yang --- hw/acpi/memory_hotplug.c | 4 1 file changed, 4 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-18 Thread Wei Yang
We didn't specify the indent rule for multiline code here, which may misleading users. And in current code, the code use different rules. Add this rule in CODING_STYLE to make sure this is clear to every one. Signed-off-by: Wei Yang Suggested-by: Igor Mammedov --- CODING_STYLE | 26

[Qemu-devel] [PATCH 0/2] CODING_STYLE: trivial update

2019-02-18 Thread Wei Yang
The first one is suggested by Igor Mammedov to provide rule for multiline code. The second is a trivial fix to make example code all indented with 4 spaces. Wei Yang (2): CODING_STYLE: specify the indent rule for multiline code CODING_STYLE: indent example code as all others CODING_STYLE

[Qemu-devel] [PATCH 2/2] CODING_STYLE: indent example code as all others

2019-02-18 Thread Wei Yang
All the example code are indented with four spaces except this one. Fix this by adding four spaces here. Signed-off-by: Wei Yang --- CODING_STYLE | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CODING_STYLE b/CODING_STYLE index 73f66ca185..27581d80c1 100644

[Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs

2019-02-25 Thread Wei Yang
Leverage __ATTR_RO_MODE to define rev sysfs instead of using open code to define the attribute. Signed-off-by: Wei Yang --- drivers/firmware/qemu_fw_cfg.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware

Re: [Qemu-devel] [PATCH v5] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-25 Thread Wei Yang
On Mon, Feb 25, 2019 at 09:15:34AM +0800, Wei Yang wrote: >On Mon, Feb 25, 2019 at 09:07:08AM +0800, Wei Yang wrote: >>Currently we do device realization like below: >> >> hotplug_handler_pre_plug() >> dc->realize() >> hotplug_handler_plug() >> >

Re: [Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs

2019-02-27 Thread Wei Yang
On Wed, Feb 27, 2019 at 08:51:11AM -0500, Michael S. Tsirkin wrote: >On Wed, Feb 27, 2019 at 01:33:19PM +0800, Wei Yang wrote: >> On Tue, Feb 26, 2019 at 11:10:06AM -0500, Michael S. Tsirkin wrote: >> >On Tue, Feb 26, 2019 at 03:31:59PM +0800, Wei Yang wrote: >> &g

Re: [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-27 Thread Wei Yang
On Wed, Feb 27, 2019 at 02:12:42PM +0100, Igor Mammedov wrote: >On Mon, 25 Feb 2019 12:47:14 +0000 >Wei Yang wrote: > >> On Mon, Feb 25, 2019 at 09:05:37AM +0100, Igor Mammedov wrote: >> >On Sat, 23 Feb 2019 00:02:49 + >> >Wei Yang wrote: >> > >

Re: [Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs

2019-02-27 Thread Wei Yang
On Wed, Feb 27, 2019 at 08:54:58AM -0500, Michael S. Tsirkin wrote: >On Wed, Feb 27, 2019 at 11:07:16AM +0800, Wei Yang wrote: >> On Tue, Feb 26, 2019 at 07:45:46PM +0100, Philippe Mathieu-Daudé wrote: >> >Hi Wei, >> > >> >On 2/26/19 8:31 AM, Wei Yang wrote: >

Re: [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-27 Thread Wei Yang
On Wed, Feb 27, 2019 at 06:27:49PM +0100, Igor Mammedov wrote: >On Wed, 27 Feb 2019 13:59:20 +0000 >Wei Yang wrote: > >> On Wed, Feb 27, 2019 at 02:12:42PM +0100, Igor Mammedov wrote: >> >On Mon, 25 Feb 2019 12:47:14 + >> >Wei Yang wrote: >> > >

[Qemu-devel] [PATCH v6] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-28 Thread Wei Yang
Fix it by checking if memory hotplug is enabled at pre_plug stage where we can gracefully abort hotplug request. Signed-off-by: Wei Yang CC: Igor Mammedov CC: Eric Blake Signed-off-by: Wei Yang --- v6: * fix the check in piix4_device_pre_plug_cb v5: * rebase on latest upstream * remove a comm

[Qemu-devel] [PATCH v7] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-28 Thread Wei Yang
Fix it by checking if memory hotplug is enabled at pre_plug stage where we can gracefully abort hotplug request. Signed-off-by: Wei Yang CC: Igor Mammedov CC: Eric Blake Signed-off-by: Wei Yang --- v7: * fix code style v6: * fix the check in piix4_device_pre_plug_cb v5: * rebase on lat

Re: [Qemu-devel] [PATCH v4 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-28 Thread Wei Yang
On Thu, Feb 28, 2019 at 03:36:14PM +0100, Igor Mammedov wrote: >On Mon, 25 Feb 2019 09:25:29 +0800 >Wei Yang wrote: > >> We didn't specify the indent rule for multiline code here, which may >> mislead users. And in current code, the code use different rules. >diffrent fro

[Qemu-devel] [PATCH v5 0/2] CODING_STYLE: trivial update

2019-02-28 Thread Wei Yang
: * adjust Patch 1 as suggested by Eric Wei Yang (2): CODING_STYLE: specify the indent rule for multiline code CODING_STYLE: indent example code as all others CODING_STYLE | 47 +++ 1 file changed, 43 insertions(+), 4 deletions(-) -- 2.19.1

[Qemu-devel] [PATCH v5 2/2] CODING_STYLE: indent example code as all others

2019-02-28 Thread Wei Yang
All the example code are indented with four spaces except this one. Fix this by adding four spaces here. Signed-off-by: Wei Yang Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov --- CODING_STYLE | 8 1 file changed, 4 insertions(+), 4 deletions

Re: [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-28 Thread Wei Yang
On Thu, Feb 28, 2019 at 02:57:07PM +0100, Igor Mammedov wrote: >On Thu, 28 Feb 2019 08:46:10 +0800 >Wei Yang wrote: > >> On Wed, Feb 27, 2019 at 06:27:49PM +0100, Igor Mammedov wrote: >> >On Wed, 27 Feb 2019 13:59:20 + >> >Wei Yang wrote: >> > >

  1   2   3   4   5   6   7   8   >