[PATCH] target/i386: kvm: print info when the kernel doesn't support ioctl(KVM_CAP_GET_MSR_FEATURES)

2020-01-03 Thread Li Qiang
The ioctl(KVM_CAP_GET_MSR_FEATURES) is quite new. In old platform that doesn't support this ioctl will sometimes make the user confusion. For example, when we do nested virtualiztion using host-passthrough model the VM will has quite different cpu feature with the host. Signed-off-by: Li

Re: Questions about the VFIO BAR region

2019-11-05 Thread Li Qiang
Auger Eric 于2019年11月5日周二 下午9:17写道: > Hi Li, > > On 11/5/19 2:16 AM, Li Qiang wrote: > > > > > > Alex Williamson > <mailto:alex.william...@redhat.com>> 于2019年11月5日周二 上午2:49写道: > > > > On Tue, 5 Nov 2019 00:40:39 +0800 > > Li Qian

Re: Questions about the VFIO BAR region

2019-11-04 Thread Li Qiang
Alex Williamson 于2019年11月5日周二 上午2:49写道: > On Tue, 5 Nov 2019 00:40:39 +0800 > Li Qiang wrote: > > > Hello Alex, Auger and all, > > > > I have a question about the VFIO virtual device BAR. > > > > In vfio_region_setup, it initialize a ‘region->mem’

Questions about the VFIO BAR region

2019-11-04 Thread Li Qiang
ad’ we need to call ‘vbasedev->ops->vfio_eoi(vbasedev);’? Thanks, Li Qiang

Re: [PATCH v2 09/20] hw/mips/mips_malta: Create IDE hard drive array dynamically

2019-10-21 Thread Li Qiang
; Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/mips/mips_malta.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c > index 528c34a1c3..774bb810f6 100644 > --- a/hw/mi

Re: [PATCH v2 06/20] piix4: Add a i8257 DMA Controller as specified in datasheet

2019-10-21 Thread Li Qiang
> +/* DMA */ > +i8257_dma_init(isa_bus, 0); > + > piix4_dev = dev; > } > > Could you please explain why this is better calling 'i8257_dma_init' in piix4 realize function instead of calling it in mips_malta_init. I'm still a little of which things

Re: [PATCH v2 05/20] piix4: Rename PIIX4 object to piix4-isa

2019-10-21 Thread Li Qiang
Poussineau > Message-Id: <20171216090228.28505-15-hpous...@reactos.org> > Reviewed-by: Aleksandar Markovic > [PMD: rebased] > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/isa/piix4.c | 1 - > hw/mips/mips_malta.c | 2 +- > inc

Re: [PATCH v2 04/20] Revert "irq: introduce qemu_irq_proxy()"

2019-10-21 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月18日周五 下午9:50写道: > From: Philippe Mathieu-Daudé > > This function isn't used anymore. > > This reverts commit 22ec3283efba9ba0792790da786d6776d83f2a92. > > Reviewed-by: Thomas Huth > Signed-off-by: Philippe Mathieu-Daudé > Revi

Re: [PATCH v2 03/20] piix4: Add a i8259 Interrupt Controller as specified in datasheet

2019-10-21 Thread Li Qiang
> -/* > - * Interrupt controller > - * The 8259 is attached to the MIPS CPU INT0 pin, ie interrupt 2 > - */ > -s->i8259 = i8259_init(isa_bus, i8259_irq); > +/* Interrupt controller */ > +qdev_connect_gpio_out_named(dev, "intr", 0, i8259

Re: [PATCH v2 02/20] piix4: Add the Reset Control Register

2019-10-20 Thread Li Qiang
- piix4_dev = &d->dev; > + > +memory_region_init_io(&s->rcr_mem, OBJECT(dev), &piix4_rcr_ops, s, > + "reset-control", 1); > +memory_region_add_subregion_overlap(pci_address_space_io(dev), 0xcf9, > Can we use 'RCR_IOPORT' instead of constant value here? Also don't see this change in later patches of this seirals. Anyway Reviewed-by: Li Qiang Thanks, Li Qiang > +&s->rcr_mem, 1); > + > +piix4_dev = dev; > } > > int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn) > -- > 2.21.0 > > >

Re: [PATCH v2 01/20] MAINTAINERS: Keep PIIX4 South Bridge separate from PC Chipsets

2019-10-20 Thread Li Qiang
r Markovic > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > MAINTAINERS | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index fe4dc51b08..c9f625fc2e 100644 > --- a/MAINTAINERS > ++

Re: [PATCH v3 3/8] hw/ide/piix: Convert reset handler to DeviceReset

2019-10-10 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月10日周四 下午9:16写道: > The PIIX/IDE is a PCI device within a PIIX chipset, it will be reset > when the PCI bus it stands on is reset. > > Convert its reset handler into a proper Device reset method. > > Signed-off-by: Philippe Mathieu-Daudé >

Re: [PATCH v2 8/8] hw/misc/vmcoreinfo: Add comment about reset handler

2019-10-09 Thread Li Qiang
method. > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang There are some other device-related code using 'qemu_register_reset'. Maybe we can also add theses comment. Thanks, Li Qiang > --- > hw/misc/vmcoreinfo.c | 4 > 1 file changed, 4 insertio

Re: [PATCH v2 7/8] hw/input/lm832x: Convert reset handler to DeviceReset

2019-10-09 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月8日周二 下午10:38写道: > The LM8323 key-scan controller is a I2C device, it will be reset > when the I2C bus it stands on is reset. > > Convert its reset handler into a proper Device reset method. > > Signed-off-by: Philippe Mathieu-Daudé >

Re: [PATCH v2 6/8] hw/isa/vt82c686: Convert reset handler to DeviceReset

2019-10-09 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月8日周二 下午10:39写道: > The VIA VT82C686 Southbridge is a PCI device, it will be reset > when the PCI bus it stands on is reset. > > Convert its reset handler into a proper Device reset method. > > Signed-off-by: Philippe Mathieu-Daudé >

Re: [PATCH v2 5/8] hw/ide/via82c: Convert reset handler to DeviceReset

2019-10-09 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月8日周二 下午10:36写道: > The VIA82C686B IDE controller is a PCI device, it will be reset > when the PCI bus it stands on is reset. > > Convert its reset handler into a proper Device reset method. > > Signed-off-by: Philippe Mathieu-Daudé >

Re: [PATCH v2 4/8] hw/ide/sii3112: Convert reset handler to DeviceReset

2019-10-09 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月8日周二 下午10:32写道: > The SiI3112A SATA controller is a PCI device, it will be reset > when the PCI bus it stands on is reset. > > Convert its reset handler into a proper Device reset method. > > Signed-off-by: Philippe Mathieu-Daudé >

Re: [PATCH v2 0/8] hw: Convert various reset() handler to DeviceReset

2019-10-09 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月10日周四 上午3:54写道: > Hi Li, > > On 10/9/19 4:28 AM, Li Qiang wrote: > > Philippe Mathieu-Daudé mailto:phi...@redhat.com>> 于 > > 2019年10月8日周二 下午10:47写道: > > > > Since v1: > > - Removed the pci-host devices >

Re: [PATCH v2 0/8] hw: Convert various reset() handler to DeviceReset

2019-10-09 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月8日周二 下午10:47写道: > Since v1: > - Removed the pci-host devices > Hello I want to know why remove this? Thanks, Li Qiang > - Removed the vmcoreinfo conversion (elmarco) but add a comment. > - Added Igor's R-b tag. > > Following the

Re: [PATCH v2 3/8] hw/ide/piix: Convert reset handler to DeviceReset

2019-10-08 Thread Li Qiang
RESS_SPACE_IO, &d->bmdma_bar); > > @@ -247,6 +244,7 @@ static void piix3_ide_class_init(ObjectClass *klass, > void *data) > DeviceClass *dc = DEVICE_CLASS(klass); > PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); > > +dc->reset = piix3_ide_reset; > k->realize = pci_piix_ide_realize; > k->exit = pci_piix_ide_exitfn; > k->vendor_id = PCI_VENDOR_ID_INTEL; > -- > Shouldn't we also add the reset callback for piix4 ide device? Thanks, Li Qiang > 2.21.0 > > >

Re: [PATCH v2 2/8] hw/isa/piix4: Convert reset handler to DeviceReset

2019-10-08 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月8日周二 下午10:49写道: > The PIIX4/ISA is a PCI device within the PIIX4 chipset, it will be reset > when the PCI bus it stands on is reset. > > Convert its reset handler into a proper Device reset method. > > Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH v2 1/8] hw/acpi/piix4: Convert reset handler to DeviceReset

2019-10-08 Thread Li Qiang
-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/acpi/piix4.c | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > index 5742c3df87..4e079b39bd 100644 > --- a/hw/acpi/piix4.c > +++ b/hw/acpi

Re: [PATCH v2 7/7] tests/fw_cfg: Run the tests on big-endian targets

2019-10-08 Thread Li Qiang
Laszlo Ersek 于2019年10月9日周三 上午4:27写道: > On 10/08/19 17:04, Li Qiang wrote: > > Philippe Mathieu-Daudé 于2019年10月7日周一 下午11:20写道: > > > >> We have been restricting our fw_cfg tests to the PC machine, > >> which is a little-endian architecture. > >> The f

Re: [PATCH v2 7/7] tests/fw_cfg: Run the tests on big-endian targets

2019-10-08 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月8日周二 下午11:14写道: > Hi Li, > > On 10/8/19 5:04 PM, Li Qiang wrote: > > Philippe Mathieu-Daudé mailto:phi...@redhat.com>> 于 > > 2019年10月7日周一 下午11:20写道: > > > > We have been restricting our fw_cfg tests to the PC ma

Re: [PATCH v2 7/7] tests/fw_cfg: Run the tests on big-endian targets

2019-10-08 Thread Li Qiang
t;fw_cfg/boot_menu", &ctx, test_fw_cfg_boot_menu); > qtest_add_data_func("fw_cfg/reboot_timeout", &ctx, > test_fw_cfg_reboot_timeout); > qtest_add_data_func("fw_cfg/splash_time", &ctx, > test_fw_cfg_splash_time); > > -ret = g_test_run(); > +if (has_numa) { > +qtest_add_data_func("fw_cfg/numa", &ctx, test_fw_cfg_numa); > +} > > +if (ctx.machine_name) { > +ret = g_test_run(); > +} > I think we can omit this if statement. In which case the ctx.machine_name will be NULL? Thanks, Li Qiang > g_free(ctx.fw_cfg); > > return ret; > -- > 2.21.0 > >

Re: [PATCH v2 6/7] tests/fw_cfg: Declare one QFWCFG for all tests

2019-10-08 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年10月7日周一 下午11:20写道: > It is pointless to create/remove a QFWCFG object for each test. > Move it to the test context and create/remove it only once. > > Reviewed-by: Laszlo Ersek > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang

Re: [PATCH v2 5/7] tests/libqos/fw_cfg: Pass QTestState as argument

2019-10-08 Thread Li Qiang
factor the qfw_cfg* API to take QTestState as argument. > > Reviewed-by: Laszlo Ersek > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > tests/boot-order-test.c | 12 > tests/fw_cfg-test.c | 49 --

Re: [PATCH v2 4/7] tests/fw_cfg: Let the tests use a context

2019-10-08 Thread Li Qiang
the > x86 architecture). > > Reviewed-by: Laszlo Ersek > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > v2: Use const QTestCtx *ctx, do not g_new(QTestCtx) (Laszlo) > --- > tests/fw_cfg-test.c | 87 -

Re: [PATCH v2 3/7] tests/libqos/fw_cfg: Document pc_fw_cfg_init to drop pc_fw_cfg_uninit

2019-10-08 Thread Li Qiang
c_fw_cfg_uninit() and use it" > > Reviewed-by: Laszlo Ersek > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > tests/fw_cfg-test.c | 22 +++--- > tests/libqos/fw_cfg.h| 14 +- > tests/libqos/malloc-pc.c |

Re: [PATCH v2 2/7] tests/libqos/fw_cfg: Document mm_fw_cfg_init to drop mm_fw_cfg_uninit

2019-10-08 Thread Li Qiang
ewed-by: Laszlo Ersek > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > tests/libqos/fw_cfg.c | 5 - > tests/libqos/fw_cfg.h | 10 +- > 2 files changed, 9 insertions(+), 6 deletions(-) > > diff --git a/tests/libqos/fw_cfg.c b/test

Re: [PATCH v2 1/7] tests/libqos/fw_cfg: Document io_fw_cfg_init to drop io_fw_cfg_uninit

2019-10-08 Thread Li Qiang
libqos: Add io_fw_cfg_uninit()" > > Reviewed-by: Laszlo Ersek > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > tests/libqos/fw_cfg.c | 5 - > tests/libqos/fw_cfg.h | 11 +-- > 2 files changed, 9 insertions(+), 7 deletions(-) > > dif

Re: Questions about the real mode in kvm/qemu

2019-09-29 Thread Li Qiang
you mean when the guest in real mode emulation(vm86) can do something to disable EPT? I don't find the code. Seems my understanding is wrong. Thanks, Li Qiang > > Let's see if Avi is listening... :) > > Paolo >

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Li Qiang
Paolo Bonzini 于2019年9月26日周四 下午5:53写道: > On 26/09/19 11:35, Li Qiang wrote: > > So without unrestrict guest the mainline is this: KVM set guest's > > rflag bit X86_EFLAGS_VM, so when the guest enter guest mode, it is in > > vm86 mode. In this mode, the CPU will access th

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Li Qiang
Paolo Bonzini 于2019年9月26日周四 下午5:15写道: > On 26/09/19 09:52, Li Qiang wrote: > > Hi Paolo and all, > > > > There are some question about the emulation for real mode in kvm/qemu. > > For all the > > question I suppose the 'unstrict guest' is not ena

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Li Qiang
Maxim Levitsky 于2019年9月26日周四 下午4:31写道: > On Thu, 2019-09-26 at 15:52 +0800, Li Qiang wrote: > > Hi Paolo and all, > > > > There are some question about the emulation for real mode in kvm/qemu. > For all the > > question I suppose the 'unstrict guest' is n

Questions about the real mode in kvm/qemu

2019-09-26 Thread Li Qiang
The EPT is for GVA->GPA->HPA, however there is no GVA, seems the identity mapping does something. But there also some confusion for me. For example the real mode uses CS*4 + IP to address the code. Who does this calculation? In the kernel emulator? Thanks, Li Qiang

Re: [PATCH] vhost-user-gpu: Drop trailing json comma

2019-09-20 Thread Li Qiang
Cole Robinson 于2019年9月20日周五 上午4:34写道: > Trailing comma is not valid json: > > $ cat contrib/vhost-user-gpu/50-qemu-gpu.json.in | jq > parse error: Expected another key-value pair at line 5, column 1 > > Signed-off-by: Cole Robinson > Reviewed-by: Li Qiang > --- >

Re: [Qemu-devel] Discussion: vnc: memory leak in zrle_compress_data

2019-09-19 Thread Li Qiang
Gerd Hoffmann 于2019年9月19日周四 下午4:54写道: > On Sun, Sep 01, 2019 at 10:43:42PM +0800, Li Qiang wrote: > > fangying 于2019年9月1日周日 下午8:29写道: > > > > > Nice work, your patch does fix this issue in my test. > > > > > > I think we should make VncState.zlib to be

Re: [Qemu-devel] [PULL 4/4] vnc: fix memory leak when vnc disconnect

2019-09-19 Thread Li Qiang
Gerd Hoffmann 于2019年9月19日周四 下午3:12写道: > From: Li Qiang > > Currently when qemu receives a vnc connect, it creates a 'VncState' to > represent this connection. In 'vnc_worker_thread_loop' it creates a > local 'VncState'. The connection '

Re: [Qemu-devel] [PATCH] vnc: fix memory leak when vnc disconnect

2019-09-17 Thread Li Qiang
Gerd Hoffmann 于2019年9月17日周二 下午7:45写道: > On Sat, Aug 31, 2019 at 08:39:22AM -0700, Li Qiang wrote: > > Currently when qemu receives a vnc connect, it creates a 'VncState' to > > represent this connection. In 'vnc_worker_thread_loop' it creates a > > local

Re: [Qemu-devel] Discussion: vnc: memory leak in zrle_compress_data

2019-09-01 Thread Li Qiang
a better way than using pointer before sending the revision. Thanks, Li Qiang > > Thanks. > Ying Fang > *发件人: *Li Qiang > *收件人: *fangying > *抄送: *Gerd > Hoffmann;qemu-devel;Daniel > P. Berrange;zhouyibo > *主题: *Re: [Qemu-devel] Discussion: vnc: memory leak in zrle_compr

Re: [Qemu-devel] [PATCH] vnc: fix memory leak when vnc disconnect

2019-08-31 Thread Li Qiang
also see this error in scripts/checkpatch.pl. However when I add sapces around '*". I got following error: ERROR: space prohibited before that close parenthesis ')' #124: FILE: ui/vnc-enc-tight.c:355: +data = (uint##bpp##_t * )vs->tight->tight.buffer;

Re: [Qemu-devel] Discussion: vnc: memory leak in zrle_compress_data

2019-08-31 Thread Li Qiang
iced that deflateInit2 is called with the local vs, > however deflateEnd is called with the origin vs. > The local vs is copied to the origin vs in vnc_async_encoding_start and > vnc_async_encoding_end on the contrary. > > Have you got any idea on this issue ? > > Hello Ying, I have posted a

[Qemu-devel] [PATCH] vnc: fix memory leak when vnc disconnect

2019-08-31 Thread Li Qiang
'deflateInit2'. The reason this happens is that the 'VncState' contains the whole 'VncZrle', so when calling 'deflateInit2', the 's->strm' will be the local address. So 's->strm != strm' will be true. To fix this iss

[Qemu-devel] 答复: Questions about 'emulated_config_bits' in vfio pci

2019-08-30 Thread Li Qiang
So detailed explanation, I got the point. Thank you Alex! Li Qiang 发件人: Alex Williamson 发送时间: 2019年8月31日 10:23 收件人: Li Qiang 抄送: Alex Williamson; qemu-devel@nongnu.org 主题: Re: [Qemu-devel] Questions about 'emulated_config_bits' in vfio pci On Sat, 31 Aug 2019 09:31:59 +0800 Li Qi

[Qemu-devel] [PATCH] block: qcow2: free 'refcount_table' in error path

2019-08-30 Thread Li Qiang
etely_empty' is wrong. The patch frees the 's->refcount_table' in error path. Signed-off-by: Li Qiang --- block/qcow2.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 7c5a4859f7..23fe713d4c 100644 --- a/block/qcow2

[Qemu-devel] Questions about 'emulated_config_bits' in vfio pci

2019-08-30 Thread Li Qiang
anding, I think ‘emulated_config_bits’ should be set to 0xff just as other places. But here use ‘PCI_HEADER_TYPE_MULTI_FUNCTION’ and ‘PCI_STATUS_CAP_LIST’. In fact, this doesn’t affect the results, but it’s confusion. Just a typo? Or other reasons. Thanks, Li Qiang

Re: [Qemu-devel] [PATCH] xhci: Fix memory leak in xhci_address_slot

2019-08-27 Thread Li Qiang
_REQ_SET_ADDRESS, >slotid, 0, 0, NULL); > assert(p.status != USB_RET_ASYNC); > +usb_packet_cleanup(&p); > } > > Looks good to me. Reviewed-by: Li Qiang > res = xhci_enable_ep(xhci, slotid, 1, octx+32, ep0_ctx); > -- > 2.19.1 > > > >

Re: [Qemu-devel] [PATCH] qmp: Fix memory leak in migrate_params_test_apply

2019-08-27 Thread Li Qiang
tls_creds->type == QTYPE_QSTRING); > + if (dest->tls_creds) { > +g_free(dest->tls_creds); > +} > g_free can handle NULL, no need to do the NULL check. Thanks, Li Qiang > dest->tls_creds = g_strdup(params->tls_creds->u.s

Re: [Qemu-devel] [PATCH] vfio: fix a typo

2019-08-22 Thread Li Qiang
Chen Zhang via Qemu-devel 于2019年8月22日周四 下午2:49写道: > Signed-off-by: Chen Zhang > Reviewed-by: Li Qiang > --- > hw/vfio/pci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c > index dc3479c..c5e6fe6 1006

Re: [Qemu-devel] [PATCH] usbredir: fix buffer-overflow on vmload

2019-08-07 Thread Li Qiang
4207106c47 in coroutine_trampoline > /home/elmarco/src/qemu/util/coroutine-ucontext.c:115 > #9 0x7f0c0604e37f (/lib64/libc.so.6+0x4d37f) > > Signed-off-by: Marc-André Lureau Reviewed-by: Li Qiang > --- > hw/usb/redirect.c | 5 + > 1 file changed, 5 insertions(

Re: [Qemu-devel] How to configure QEMU to support APIC virtualization

2019-08-04 Thread Li Qiang
this feature,such as > emulate it based on pure software, not rely on hardware. > > IIUC there is no APICv emulate. Thanks, Li Qiang > Thanks! > > > At 2019-08-05 12:42:55, "Li Qiang" wrote: > > > > ddm 于2019年8月5日周一 上午11:55写道: > >>

Re: [Qemu-devel] How to configure QEMU to support APIC virtualization

2019-08-04 Thread Li Qiang
KVM or QEMU to support APIC virtualizaion > feature? > > AFAICT APICv is hardware feature, but I still don't know accurately after which CPU support it. You may refer the code about 'enable_apicv' related code in kvm to see how to detect this capability. Thanks, Li Qiang

[Qemu-devel] [PATCH] hw: intel_iommu: initialize 'name' in vtd_find_add_as

2019-08-01 Thread Li Qiang
After this patch, it is more clear: (gdb) p name $1 = "vtd-00.0", '\000' Signed-off-by: Li Qiang --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index de86f53b4e..e379c2a512

[Qemu-devel] [PATCH] target-i386: kvm: 'kvm_get_supported_msrs' cleanup

2019-07-25 Thread Li Qiang
Function 'kvm_get_supported_msrs' is only called once now, get rid of the static variable 'kvm_supported_msrs'. Signed-off-by: Li Qiang --- target/i386/kvm.c | 185 +++--- 1 file changed, 91 insertions(+), 94 deletions(-) diff --git a

Re: [Qemu-devel] [PATCH] pc-dimm: fix crash when invalid slot number is used

2019-07-23 Thread Li Qiang
1,memdev=mem1,slot=-2 > > fix it by checking that slot number is within valid range. > > Signed-off-by: Igor Mammedov > Reviewed-by: Li Qiang > --- > hw/mem/pc-dimm.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm

Re: [Qemu-devel] [PATCH v4 3/3] net: tap: replace snprintf with g_strdup_printf calls

2019-07-23 Thread Li Qiang
c? > IIUC, if we pass the NULL argument in g_strdup_printf, the 'helper_cmd' will contain the '(null)' char. If we pass "" to g_strdup_printf, there is nothing in 'helper_cmd'. The original is like this. So here Prasad has to check the 'fd_buf'. So: Reviewed-by: Li Qiang Thanks, Li Qiang

Re: [Qemu-devel] [PATCH v4 2/3] qemu-bridge-helper: move repeating code in parse_acl_file

2019-07-23 Thread Li Qiang
P J P 于2019年7月23日周二 下午6:50写道: > From: Prasad J Pandit > > Move repeating error handling sequence in parse_acl_file routine > to an 'err' label. > > Signed-off-by: Prasad J Pandit > Reviewed-by: Li Qiang > --- > qemu-bridge-helper.c | 19 +-

Re: [Qemu-devel] [PATCH v4 1/3] qemu-bridge-helper: restrict interface name to IFNAMSIZ

2019-07-23 Thread Li Qiang
form ACL rules. If user supplied '--br=bridge' name > is not restricted to the same length, it could lead to ACL bypass > issue. Restrict interface name to IFNAMSIZ, including null byte. > > Reported-by: Riccardo Schirone > Signed-off-by: Prasad J Pandit > Reviewed-b

Re: [Qemu-devel] [PULL 19/21] ioapic: allow buggy guests mishandling level-triggered interrupts to make progress

2019-07-04 Thread Li Qiang
I have posted a fix for this several weeks ago: -->https://www.mail-archive.com/qemu-devel@nongnu.org/msg626186.html Thanks, Li Qiang Marc-André Lureau 于2019年7月4日周四 下午8:57写道: > Hi > > On Thu, May 16, 2019 at 1:04 AM Paolo Bonzini wrote: > > > > From: Vitaly Kuznets

Re: [Qemu-devel] [PATCH v3 3/3] net: tap: refactor net_bridge_run_helper routine

2019-07-01 Thread Li Qiang
ts. > > Signed-off-by: Prasad J Pandit > My two cents: You do two things here(avoid buffer formatting and get rid of calling shell), I would suggest you split these into split patch. Thanks, Li Qiang --- > net/tap.c | 43 +-- > 1 file ch

Re: [Qemu-devel] [PATCH v3 2/3] qemu-bridge-helper: move repeating code in parse_acl_file

2019-07-01 Thread Li Qiang
P J P 于2019年7月1日周一 下午8:38写道: > From: Prasad J Pandit > > Move repeating error handling sequence in parse_acl_file routine > to an 'err' label. > > Signed-off-by: Prasad J Pandit > Reviewed-by: Li Qiang > --- > qemu-bridge-helper.c | 19 +-

Re: [Qemu-devel] [PATCH v3 1/3] qemu-bridge-helper: restrict interface name to IFNAMSIZ

2019-07-01 Thread Li Qiang
mp; strlen(arg) >= IFNAMSIZ) { > +fprintf(stderr, "name `%s' too long: %zu\n", arg, > strlen(arg)); > +fclose(f); > +errno = EINVAL; > +return -1; > +} > + > g_str_equal is not consistent style with the ot

[Qemu-devel] [PATCH] virtio-gpu: check if the resource already exists in virtio_gpu_load()

2019-06-28 Thread Li Qiang
While loading virtio-gpu, the data can be malicious, we should check if the resource already exists. Signed-off-by: Li Qiang --- hw/display/virtio-gpu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 2b0f66b1d6..f1ebed9959 100644

Re: [Qemu-devel] [PATCH] docs/devel/testing: Fix typo in dockerfile path

2019-06-28 Thread Li Qiang
Liam Merwick 于2019年6月28日周五 下午9:38写道: > Signed-off-by: Liam Merwick > Reviewed-by: Li Qiang > --- > docs/devel/testing.rst | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst > index da2d0fc96

Re: [Qemu-devel] [PATCH] virtio-gpu: fix unmap in error path

2019-06-28 Thread Li Qiang
ed-off-by: Gerd Hoffmann > It is reasonable, so Reviewed-by: Li Qiang btw: Does it break something before this patch? AFAICS, the 'len' is not used for the unmap, only the 'access_len' is used. Thanks, Li Qiang > --- > hw/display/virtio-gpu.c | 4 ++-- > 1 fi

Re: [Qemu-devel] [PATCH] qemu-bridge-helper: restrict bridge name to IFNAMSIZ

2019-06-28 Thread Li Qiang
7 @@ int main(int argc, char **argv) > if (strcmp(argv[index], "--use-vnet") == 0) { > use_vnet = 1; > } else if (strncmp(argv[index], "--br=", 5) == 0) { > -bridge = &argv[index][5]; > + bridge = strndup(&argv[inde

Re: [Qemu-devel] [PATCH v2] ioapic: use irq number instead of vector in ioapic_eoi_broadcast

2019-06-27 Thread Li Qiang
Ping, what's the status of this patch. Li Qiang 于2019年6月22日周六 上午8:21写道: > When emulating irqchip in qemu, such as following command: > > x86_64-softmmu/qemu-system-x86_64 -m 1024 -smp 4 -hda /home/test/test.img > -machine kernel-irqchip=off --enable-kvm -vnc :0 -device e

[Qemu-devel] [PATCH] ioapic: clear irq_eoi when updating the ioapic redirect table entry

2019-06-24 Thread Li Qiang
irq_eoi is used to count the number of irq injected during eoi broadcast. It should be set to 0 when updating the ioapic's redirect table entry. Suggested-by: Peter Xu Signed-off-by: Li Qiang --- hw/intc/ioapic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/ioapic.c b/hw

Re: [Qemu-devel] [PATCH v2] ioapic: use irq number instead of vector in ioapic_eoi_broadcast

2019-06-24 Thread Li Qiang
Peter Xu 于2019年6月24日周一 下午7:21写道: > On Mon, Jun 24, 2019 at 07:08:30PM +0800, Li Qiang wrote: > > Do you mean the redirect table entry of ioapic update? > > Yes. > > > I think this is reasonable, I will prepare a separate patch with this one > > as a patchset later.

Re: [Qemu-devel] [PATCH v2] ioapic: use irq number instead of vector in ioapic_eoi_broadcast

2019-06-24 Thread Li Qiang
Peter Xu 于2019年6月24日周一 下午5:42写道: > On Fri, Jun 21, 2019 at 05:21:19PM -0700, Li Qiang wrote: > > When emulating irqchip in qemu, such as following command: > > > > x86_64-softmmu/qemu-system-x86_64 -m 1024 -smp 4 -hda /home/test/test.img > > -machine kernel-irqch

[Qemu-devel] [PATCH v2] ioapic: use irq number instead of vector in ioapic_eoi_broadcast

2019-06-21 Thread Li Qiang
a) #14 0x7fd01436088e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x12188e This is because in ioapic_eoi_broadcast function, we uses 'vector' to index the 's->irq_eoi'. To fix this, we should uses the irq number. Signed-off-by: Li Qiang --- Change since v1: remove auto-genera

Re: [Qemu-devel] [PATCH] ioapic: use irq number instead of vector in ioapic_eoi_broadcast

2019-06-21 Thread Li Qiang
Li Qiang 于2019年6月22日周六 上午12:15写道: > When emulating irqchip in qemu, such as following command: > > x86_64-softmmu/qemu-system-x86_64 -m 1024 -smp 4 -hda /home/test/test.img > -machine kernel-irqchip=off --enable-kvm -vnc :0 -device edu -monitor stdio > > We will get a crash w

[Qemu-devel] [PATCH] ioapic: use irq number instead of vector in ioapic_eoi_broadcast

2019-06-21 Thread Li Qiang
0001-migration-fix-a-typo.patch # roms/vgabios/ # vhost-user-input # Signed-off-by: Li Qiang --- hw/intc/ioapic.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 7074489fdf..711775cc6f 100644 --- a/hw/intc/ioa

Re: [Qemu-devel] [PATCH v5] vfio/common: Introduce vfio_set_irq_signaling helper

2019-06-12 Thread Li Qiang
ror message, we now use errno in case of any > VFIO_DEVICE_SET_IRQS ioctl failure. > > Signed-off-by: Eric Auger > > Reviewed-by: Li Qiang > --- > > v4 -> v5: > - output errno instead of ioctl returned value. Issue > reported by Li > - vfio_set_irq_signali

Re: [Qemu-devel] [PATCH v4] vfio/common: Introduce vfio_set_irq_signaling helper

2019-06-12 Thread Li Qiang
FIO_DEVICE_SET_IRQS, irq_set); > + > +g_free(irq_set); > + > +if (!ret) { > + return 0; > +} > + > +error_setg_errno(errp, -ret, "VFIO_DEVICE_SET_IRQS failure"); > Hello Eric, I noticed an issue several days ago not related with this pat

Re: [Qemu-devel] [Qemu-devel PATCH v2 2/2] util/main-loop: Fix incorrect assertion

2019-06-04 Thread Li Qiang
, w->num). > > Signed-off-by: Lidong Chen > Reviewed-by: Liran Alon > Reviewed-by: Darren Kenny > Reviewed-by: Li Qiang Thanks, Li Qiang > --- > util/main-loop.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/util/main-loop.c b/

[Qemu-devel] [PATCH] migration: fix a typo

2019-05-24 Thread Li Qiang
'postocpy' should be 'postcopy'. CC: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 4c60869226..359dc8f1bc 100644 --- a/migration/ram.c +

Re: [Qemu-devel] [PATCH 10/20] hw/i386/pc: Pass the boot_cpus value by argument

2019-05-24 Thread Li Qiang
tic FWCfgState *x86_create_fw_cfg(PCMachineState *pcms) > +static FWCfgState *x86_create_fw_cfg(PCMachineState *pcms, uint16_t > boot_cpus) > For the patches 10/11/12, I don't think this is an elegant solution. When we add more data like 'boot_cpus' we need add more arg

Re: [Qemu-devel] [PATCH 08/20] hw/i386/pc: Use address_space_memory in place

2019-05-24 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月24日周五 下午2:38写道: > The address_space_memory variable is used once. > Use it in place and remove the argument. > > Suggested-by: Samuel Ortiz > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/i386/pc.c | 7

Re: [Qemu-devel] [PATCH 09/20] hw/i386/pc: Rename bochs_bios_init() more generic as x86_create_fw_cfg()

2019-05-24 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月24日周五 下午2:46写道: > The bochs_bios_init() is not restricted to the Bochs BIOS and is > useful to other BIOS. Rename it to be more generic. > > Suggested-by: Samuel Ortiz > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --

Re: [Qemu-devel] [PATCH 07/20] hw/i386/pc: Extract e820 memory layout code

2019-05-24 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月24日周五 下午2:41写道: > Suggested-by: Samuel Ortiz > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/i386/Makefile.objs| 2 +- > hw/i386/e820_memory_layout.c | 62 + > hw/i386/e820

Re: [Qemu-devel] [PATCH 06/20] hw/i386/pc: Use e820_get_num_entries() to access e820_entries

2019-05-24 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月24日周五 下午2:48写道: > To be able to extract the e820* code out of this file (in the next > patch), access e820_entries with its correct helper. > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/i386/pc.c | 2 +-

Re: [Qemu-devel] [PATCH 04/20] hw/i386/pc: Add the E820Type enum type

2019-05-24 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月24日周五 下午2:45写道: > This ensure we won't use an incorrect value. > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/i386/pc.c | 12 +++- > include/hw/i386/pc.h | 16 ++-- > 2 files changed, 17 insertions(+), 11 deletions(-) > > diff --git

Re: [Qemu-devel] [PATCH 01/20] hw/i386/pc: Use unsigned type to index arrays

2019-05-24 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月24日周五 下午2:40写道: > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/i386/pc.c | 5 +++-- > include/hw/i386/pc.h | 2 +- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/hw/i386/pc.

Re: [Qemu-devel] [PATCH 03/20] hw/i386/pc: Let e820_add_entry() return a ssize_t type

2019-05-24 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月24日周五 下午2:43写道: > e820_add_entry() returns an array size on success, or a negative > value on error. > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/i386/pc.c | 2 +- > include/hw/i386/pc.h | 2

Re: [Qemu-devel] [PATCH 02/20] hw/i386/pc: Use size_t type to hold/return a size of array

2019-05-24 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月24日周五 下午2:37写道: > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Li Qiang > --- > hw/i386/pc.c | 4 ++-- > include/hw/i386/pc.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/i386/pc.

[Qemu-devel] [PATCH v2 4/4] pci: msix: move 'MSIX_CAP_LENGTH' to header file

2019-05-21 Thread Li Qiang
'MSIX_CAP_LENGTH' is defined in two .c file. Move it to hw/pci/msix.h file to reduce duplicated code. CC: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/pci/msix.c | 2 -- hw/vfio/pci.c | 2 -- include/hw/pci/msix.h | 2 ++ 3 files changed, 2 insertions(+), 4

[Qemu-devel] [PATCH v2 2/4] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription

2019-05-21 Thread Li Qiang
It's recommended that VMStateDescription names are decoupled from QOM type names as the latter may freely change without consideration of migration compatibility. Link: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02175.html CC: qemu-triv...@nongnu.org Signed-off-by: Li

[Qemu-devel] [PATCH v2 3/4] vfio: platform: fix a typo

2019-05-21 Thread Li Qiang
'eventd' should be 'eventfd'. CC: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index e59a0234dd..d52d6552e0 100644 --- a/hw/vfio/plat

[Qemu-devel] [PATCH v2 0/4] hw: vfio: some trivial fix

2019-05-21 Thread Li Qiang
These patchset fix some trivial issues, The first patch makes the code more QOMConventions. The second decouples VMStateDescription's name with QOM TypeInfo's name. The third fixes a typo. The fourth reduce duplicated code. Change since v1: Add more commit message. Li Qiang (4):

[Qemu-devel] [PATCH v2 1/4] vfio: pci: make "vfio-pci-nohotplug" as MACRO

2019-05-21 Thread Li Qiang
The QOMConventions recommends we should use TYPE_FOO for a TypeInfo's name. Though "vfio-pci-nohotplug" is not used in other parts, for consistency we should make this change. CC: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/vfio/pci.c | 6 -- 1 file changed, 4 i

Re: [Qemu-devel] [PATCH v4 0/3] hw: edu: some fixes

2019-05-21 Thread Li Qiang
Ping Paolo, could you merge these to your misc tree? Thanks, Li Qiang Li Qiang 于2019年5月11日周六 上午12:44写道: > Recently I am considering write a driver for edu device. > After reading the spec, I found these three small issue. > Two first two related the MMIO access and the third is

Re: [Qemu-devel] [PATCH v2 0/5] fw_cfg_test refactor and add two test cases

2019-05-20 Thread Li Qiang
Philippe Mathieu-Daudé 于2019年5月21日周二 上午5:29写道: > Hi Li, > > On 5/17/19 4:28 AM, Li Qiang wrote: > > Ping..... > > > > Li Qiang mailto:liq...@gmail.com>> 于2019年5月9日周四 > > 下午5:57写道: > > > > Ping this serials. > > I apologize I

Re: [Qemu-devel] [PATCH 2/4] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription

2019-05-19 Thread Li Qiang
Alex Williamson 于2019年5月18日周六 下午10:20写道: > On Fri, 17 May 2019 20:28:09 -0700 > Li Qiang wrote: > > > As the vmstate structure names aren't related with > > the QOM type names. > > Seems contrary to the first patch in the series. > > No, once t

Re: [Qemu-devel] [PATCH 1/4] vfio: pci: make "vfio-pci-nohotplug" as MACRO

2019-05-19 Thread Li Qiang
Alex Williamson 于2019年5月18日周六 下午10:18写道: > On Fri, 17 May 2019 20:28:08 -0700 > Li Qiang wrote: > > Why? (No commit message, nor cover letter) > > Once I think these are trivial so no cover letter and lack some commit message. I will add some commit message in the next r

[Qemu-devel] [PATCH 3/4] vfio: platform: fix a typo

2019-05-17 Thread Li Qiang
CC: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index e59a0234dd..d52d6552e0 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -72,7 +72,7

[Qemu-devel] [PATCH 1/4] vfio: pci: make "vfio-pci-nohotplug" as MACRO

2019-05-17 Thread Li Qiang
CC: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/vfio/pci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8cecb53d5c..08729e5875 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -40,6 +40,8 @@ #define TYPE_VFIO_PCI "

[Qemu-devel] [PATCH 4/4] pci: msix: move 'MSIX_CAP_LENGTH' to header file

2019-05-17 Thread Li Qiang
CC: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/pci/msix.c | 2 -- hw/vfio/pci.c | 2 -- include/hw/pci/msix.h | 2 ++ 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 4e336416a7..d39dcf32e8 100644 --- a/hw/pci/msix.c

[Qemu-devel] [PATCH 2/4] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription

2019-05-17 Thread Li Qiang
As the vmstate structure names aren't related with the QOM type names. CC: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/vfio/amd-xgbe.c | 2 +- hw/vfio/ap.c| 2 +- hw/vfio/calxeda-xgmac.c | 2 +- hw/vfio/ccw.c | 2 +- hw/vfio/platform.c | 2 +- 5

<    1   2   3   4   5   6   7   8   9   >