Re: [PATCH v4 00/19] contrib/elf2dmp: Improve robustness

2024-03-10 Thread Viktor Prutyanov
+--- > contrib/elf2dmp/download.c | 12 ++-- > contrib/elf2dmp/main.c | 168 > contrib/elf2dmp/pdb.c | 61 +++- > contrib/elf2dmp/qemu_elf.c | 150 ++- > contrib/elf2dmp/meson.build | 2 +- > 11 files changed, 238 insertions(+), 231 deletions(-) > --- > base-commit: bfe8020c814a30479a4241aaa78b63960655962b > change-id: 20240301-elf2dmp-1a6a551f8663 > > Best regards, > > -- > Akihiko Odaki Hi, I've tested the series with Windows Server 2022 Standard (Build 20348), 4GiB, 4 vCPUs. Tested-by: Viktor Prutyanov

Re: [PATCH v4 15/19] MAINTAINERS: Add Akihiko Odaki as a elf2dmp reviewer

2024-03-10 Thread Viktor Prutyanov
,6 +3583,7 @@ F: util/iova-tree.c > > elf2dmp > M: Viktor Prutyanov > +R: Akihiko Odaki > S: Maintained > F: contrib/elf2dmp/ > > -- > 2.44.0 Reviewed-by: Viktor Prutyanov

[PATCH v2 1/2] elf2dmp: limit print length for sign_rsds

2023-09-30 Thread Viktor Prutyanov
String sign_rsds isn't terminated, so the print length must be limited. Fixes: Coverity CID 1521598 Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index 5db163bdbe

[PATCH v2 0/2] elf2dmp: fixes of code analysis warnings

2023-09-30 Thread Viktor Prutyanov
This series tries to fix Coverity warnings. v2: fix commit authorship, add CIDs Viktor Prutyanov (2): elf2dmp: limit print length for sign_rsds elf2dmp: check array bounds in pdb_get_file_size contrib/elf2dmp/main.c | 2 +- contrib/elf2dmp/pdb.c | 13 + 2 files changed, 10

[PATCH v2 2/2] elf2dmp: check array bounds in pdb_get_file_size

2023-09-30 Thread Viktor Prutyanov
Index in file_size array must be checked against num_files, because the entries we are looking for may be absent in the PDB. Fixes: Coverity CID 1521597 Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/pdb.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git

[PATCH 1/2] elf2dmp: limit print length for sign_rsds

2023-09-30 Thread Viktor Prutyanov
From: Viktor Prutyanov String sign_rsds isn't terminated, so the print length must be limited. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index 5db163bdbe

[PATCH 0/2] elf2dmp: fixes of code analysis warnings

2023-09-30 Thread Viktor Prutyanov
This series is dedicated to fixes of Coverity warnings. Viktor Prutyanov (2): elf2dmp: limit print length for sign_rsds elf2dmp: check array bounds in pdb_get_file_size contrib/elf2dmp/main.c | 2 +- contrib/elf2dmp/pdb.c | 13 + 2 files changed, 10 insertions(+), 5 deletions

[PATCH 2/2] elf2dmp: check array bounds in pdb_get_file_size

2023-09-30 Thread Viktor Prutyanov
Index in file_size array must be checked against num_files, because the entries we are looking for may be absent in the PDB. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/pdb.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/elf2dmp/pdb.c b

[PATCH v2 4/5] elf2dmp: use Linux mmap with MAP_NORESERVE when possible

2023-09-15 Thread Viktor Prutyanov
Glib's g_mapped_file_new maps file with PROT_READ|PROT_WRITE and MAP_PRIVATE. This leads to premature physical memory allocation of dump file size on Linux hosts and may fail. On Linux, mapping the file with MAP_NORESERVE limits the allocation by available memory. Signed-off-by: Viktor Prutyanov

[PATCH v2 3/5] elf2dmp: introduce merging of physical memory runs

2023-09-15 Thread Viktor Prutyanov
DMP supports 42 physical memory runs at most. So, merge adjacent physical memory ranges from QEMU ELF when possible to minimize total number of runs. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 56 -- 1 file changed, 48 insertions(+), 8

[PATCH v2 5/5] elf2dmp: rework PDB_STREAM_INDEXES::segments obtaining

2023-09-15 Thread Viktor Prutyanov
PDB for Windows 11 kernel has slightly different structure compared to previous versions. Since elf2dmp don't use the other fields, copy only 'segments' field from PDB_STREAM_INDEXES. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/pdb.c | 15 --- contrib/elf2dmp/pdb.h | 2

[PATCH v2 2/5] elf2dmp: introduce physical block alignment

2023-09-15 Thread Viktor Prutyanov
Physical memory ranges may not be aligned to page size in QEMU ELF, but DMP can only contain page-aligned runs. So, align them. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/addrspace.c | 31 +-- contrib/elf2dmp/addrspace.h | 1 + contrib/elf2dmp/main.c

[PATCH v2 1/5] elf2dmp: replace PE export name check with PDB name check

2023-09-15 Thread Viktor Prutyanov
searching for Windows kernel image. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2165917 Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 93 +++--- 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/contrib/elf2dmp/main.c b

[PATCH v2 0/5] elf2dmp: improve Win2022, Win11 and large dumps

2023-09-15 Thread Viktor Prutyanov
Windows Server 2022 and Windows 11 require more careful kernel PE image search and handling of PDB than previous Windows versions. Also, improve support of large ELF dump files, dumps with unaligned memory ranges and with big number of ranges. Viktor Prutyanov (5): elf2dmp: replace PE export

Re: [PATCH 4/5] elf2dmp: use Linux mmap with MAP_NORESERVE when possible

2023-09-15 Thread Viktor Prutyanov
> On 2023/09/14 7:46, Viktor Prutyanov wrote: > >> Glib's g_mapped_file_new maps file with PROT_READ|PROT_WRITE and >> MAP_PRIVATE. This leads to premature physical memory allocation of dump >> file size on Linux hosts and may fail. On Linux, mapping the file with

[PATCH 2/5] elf2dmp: introduce physical block alignment

2023-09-13 Thread Viktor Prutyanov
Physical memory ranges may not be aligned to page size in QEMU ELF, but DMP can only contain page-aligned runs. So, align them. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/addrspace.c | 31 +-- contrib/elf2dmp/addrspace.h | 1 + contrib/elf2dmp/main.c

[PATCH 3/5] elf2dmp: introduce merging of physical memory runs

2023-09-13 Thread Viktor Prutyanov
DMP supports 42 physical memory runs at most. So, merge adjacent physical memory ranges from QEMU ELF when possible to minimize total number of runs. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 56 -- 1 file changed, 48 insertions(+), 8

[PATCH 4/5] elf2dmp: use Linux mmap with MAP_NORESERVE when possible

2023-09-13 Thread Viktor Prutyanov
Glib's g_mapped_file_new maps file with PROT_READ|PROT_WRITE and MAP_PRIVATE. This leads to premature physical memory allocation of dump file size on Linux hosts and may fail. On Linux, mapping the file with MAP_NORESERVE limits the allocation by available memory. Signed-off-by: Viktor Prutyanov

[PATCH 1/5] elf2dmp: replace PE export name check with PDB name check

2023-09-13 Thread Viktor Prutyanov
searching for Windows kernel image. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2165917 Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 93 +++--- 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/contrib/elf2dmp/main.c b

[PATCH 0/5] elf2dmp: improve Win2022, Win11 and large dumps

2023-09-13 Thread Viktor Prutyanov
Windows Server 2022 and Windows 11 require more careful kernel PE image search and handling of PDB than previous Windows versions. Also, improve support of large ELF dump files, dumps with unaligned memory ranges and with big number of ranges. Viktor Prutyanov (5): elf2dmp: replace PE export

[PATCH 5/5] elf2dmp: rework PDB_STREAM_INDEXES::segments obtaining

2023-09-13 Thread Viktor Prutyanov
PDB for Windows 11 kernel has slightly different structure compared to previous versions. Since elf2dmp don't use the other fields, copy only 'segments' field from PDB_STREAM_INDEXES. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/pdb.c | 10 +++--- 1 file changed, 3 insertions(+), 7

Re: [PATCH] elf2dmp: Don't abandon when Prcb is set to 0

2023-07-30 Thread Viktor Prutyanov
>> On 2023/06/12 12:42, Viktor Prutyanov wrote: >> >>>> Prcb may be set to 0 for some CPUs if the dump was taken before they >>>> start. The dump may still contain valuable information for started CPUs >>>> so don't abandon conversion in suc

Re: [PATCH v5 0/2] vhost: register and change IOMMU flag depending on ATS state

2023-07-18 Thread Viktor Prutyanov
On Mon, Jun 26, 2023 at 12:13 PM Viktor Prutyanov wrote: > > When IOMMU and vhost are enabled together, QEMU tracks IOTLB or > Device-TLB unmap events depending on whether Device-TLB is enabled. But > even if Device-TLB and PCI ATS is enabled, the guest can reject to use >

Re: [PATCH v3 1/3] virtio-pci: add handling of PCI ATS and Device-TLB enable/disable

2023-07-18 Thread Viktor Prutyanov
Add qemu-sta...@nongnu.org On Thu, May 18, 2023 at 9:10 AM Jason Wang wrote: > > On Fri, May 12, 2023 at 9:51 PM Viktor Prutyanov wrote: > > > > According to PCIe Address Translation Services specification 5.1.3., > > ATS Control Register has Enable bit to enabl

Re: [PATCH v5 0/2] vhost: register and change IOMMU flag depending on ATS state

2023-07-10 Thread Viktor Prutyanov
ping On Mon, Jul 3, 2023 at 11:25 AM Viktor Prutyanov wrote: > > On Mon, Jun 26, 2023 at 12:13 PM Viktor Prutyanov wrote: > > > > When IOMMU and vhost are enabled together, QEMU tracks IOTLB or > > Device-TLB unmap events depending on whether Device-TLB is enabled. Bu

Re: [PATCH v5 0/2] vhost: register and change IOMMU flag depending on ATS state

2023-07-03 Thread Viktor Prutyanov
On Mon, Jun 26, 2023 at 12:13 PM Viktor Prutyanov wrote: > > When IOMMU and vhost are enabled together, QEMU tracks IOTLB or > Device-TLB unmap events depending on whether Device-TLB is enabled. But > even if Device-TLB and PCI ATS is enabled, the guest can reject to use >

[PATCH v5 0/2] vhost: register and change IOMMU flag depending on ATS state

2023-06-26 Thread Viktor Prutyanov
vhost_ops, use device_iotlb name Viktor Prutyanov (2): vhost: register and change IOMMU flag depending on Device-TLB state virtio-net: pass Device-TLB enable/disable events to vhost hw/net/virtio-net.c | 1 + hw/virtio/vhost-stub.c| 4 hw/virtio/vhost.c | 38

[PATCH v5 2/2] virtio-net: pass Device-TLB enable/disable events to vhost

2023-06-26 Thread Viktor Prutyanov
If vhost is enabled for virtio-net, Device-TLB enable/disable events must be passed to vhost for proper IOMMU unmap flag selection. Signed-off-by: Viktor Prutyanov Acked-by: Jason Wang --- hw/net/virtio-net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/virtio-net.c b/hw/net

[PATCH v5 1/2] vhost: register and change IOMMU flag depending on Device-TLB state

2023-06-26 Thread Viktor Prutyanov
. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2001312 Signed-off-by: Viktor Prutyanov Acked-by: Jason Wang --- hw/virtio/vhost-stub.c| 4 hw/virtio/vhost.c | 38 ++ include/hw/virtio/vhost.h | 1 + 3 files changed, 31 insertions(+), 12

Re: [PATCH] elf2dmp: Don't abandon when Prcb is set to 0

2023-06-16 Thread Viktor Prutyanov
> On 2023/06/12 12:42, Viktor Prutyanov wrote: > >>> Prcb may be set to 0 for some CPUs if the dump was taken before they >>> start. The dump may still contain valuable information for started CPUs >>> so don't abandon conversion in such a case. >

Re: [PATCH] elf2dmp: Don't abandon when Prcb is set to 0

2023-06-12 Thread Viktor Prutyanov
> Prcb may be set to 0 for some CPUs if the dump was taken before they > start. The dump may still contain valuable information for started CPUs > so don't abandon conversion in such a case. > > Signed-off-by: Akihiko Odaki > --- > contrib/elf2dmp/main.c | 5 + > 1 file changed, 5

[PATCH v4 2/2] virtio-net: pass Device-TLB enable/disable events to vhost

2023-05-25 Thread Viktor Prutyanov
If vhost is enabled for virtio-net, Device-TLB enable/disable events must be passed to vhost for proper IOMMU unmap flag selection. Signed-off-by: Viktor Prutyanov --- hw/net/virtio-net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index

[PATCH v4 1/2] vhost: register and change IOMMU flag depending on Device-TLB state

2023-05-25 Thread Viktor Prutyanov
. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2001312 Signed-off-by: Viktor Prutyanov --- hw/virtio/vhost.c | 38 ++ include/hw/virtio/vhost.h | 1 + 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio

[PATCH v4 0/2] vhost: register and change IOMMU flag depending on ATS state

2023-05-25 Thread Viktor Prutyanov
regardless of vhost backend, move vhost_started check to generic part v3: call virtio_pci_ats_ctrl_trigger directly, remove IOMMU_NOTIFIER_UNMAP fallbacks v2: remove memory_region_iommu_notify_flags_changed, move trigger to VirtioDeviceClass, use vhost_ops, use device_iotlb name Viktor

Re: [PATCH v3 2/3] vhost: register and change IOMMU flag depending on Device-TLB state

2023-05-25 Thread Viktor Prutyanov
On Wed, May 24, 2023 at 11:25 AM Jason Wang wrote: > > On Sat, May 20, 2023 at 1:50 AM Viktor Prutyanov wrote: > > > > On Thu, May 18, 2023 at 9:14 AM Jason Wang wrote: > > > > > > On Fri, May 12, 2023 at 9:51 PM Viktor Prutyanov > > > wrote: &

Re: [PATCH v3 2/3] vhost: register and change IOMMU flag depending on Device-TLB state

2023-05-19 Thread Viktor Prutyanov
On Thu, May 18, 2023 at 9:14 AM Jason Wang wrote: > > On Fri, May 12, 2023 at 9:51 PM Viktor Prutyanov wrote: > > > > The guest can disable or never enable Device-TLB. In these cases, > > it can't be used even if enabled in QEMU. So, check Device-TLB state > > bef

Re: [RFC PATCH v2 3/4] vhost: register and change IOMMU flag depending on Device-TLB state

2023-05-12 Thread Viktor Prutyanov
On Mon, May 8, 2023 at 8:28 AM Jason Wang wrote: > > On Mon, May 8, 2023 at 1:25 PM Jason Wang wrote: > > > > On Mon, May 1, 2023 at 10:02 AM Viktor Prutyanov wrote: > > > > > > The guest can disable or never enable Device-TLB. In these cases, > > >

Re: [RFC PATCH v2 4/4] virtio-net: pass Device-TLB enable/disable events to vhost

2023-05-12 Thread Viktor Prutyanov
On Mon, May 8, 2023 at 8:26 AM Jason Wang wrote: > > On Mon, May 1, 2023 at 10:02 AM Viktor Prutyanov wrote: > > > > If vhost is enabled for virtio-net, Device-TLB enable/disable events > > must be passed to vhost for proper IOMMU unmap flag selection. > > The

[PATCH v3 2/3] vhost: register and change IOMMU flag depending on Device-TLB state

2023-05-12 Thread Viktor Prutyanov
. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2001312 Signed-off-by: Viktor Prutyanov --- hw/virtio/vhost-backend.c | 6 ++ hw/virtio/vhost.c | 30 ++ include/hw/virtio/vhost-backend.h | 3 +++ include/hw/virtio/vhost.h | 1

[PATCH v3 1/3] virtio-pci: add handling of PCI ATS and Device-TLB enable/disable

2023-05-12 Thread Viktor Prutyanov
implementation. Signed-off-by: Viktor Prutyanov --- hw/virtio/virtio-pci.c | 36 include/hw/virtio/virtio.h | 2 ++ 2 files changed, 38 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 02fb84a8fa..edbc0daa18 100644

[PATCH v3 3/3] virtio-net: pass Device-TLB enable/disable events to vhost

2023-05-12 Thread Viktor Prutyanov
If vhost is enabled for virtio-net, Device-TLB enable/disable events must be passed to vhost for proper IOMMU unmap flag selection. Signed-off-by: Viktor Prutyanov --- hw/net/vhost_net.c | 11 +++ hw/net/virtio-net.c | 7 +++ include/net/vhost_net.h | 2 ++ 3 files

[PATCH v3 0/3] vhost: register and change IOMMU flag depending on ATS state

2023-05-12 Thread Viktor Prutyanov
: remove memory_region_iommu_notify_flags_changed, move trigger to VirtioDeviceClass, use vhost_ops, use device_iotlb name Viktor Prutyanov (3): virtio-pci: add handling of PCI ATS and Device-TLB enable/disable vhost: register and change IOMMU flag depending on Device-TLB state virtio-net

Re: [RFC PATCH 1/4] pci: add handling of Enable bit in ATS Control Register

2023-05-02 Thread Viktor Prutyanov
On Wed, Apr 26, 2023 at 8:32 AM Jason Wang wrote: > > > 在 2023/4/24 19:21, Viktor Prutyanov 写道: > > According to PCIe Address Translation Services specification 5.1.3., > > ATS Control Register has Enable bit to enable/disable ATS. > > Add a new field for a trigg

[RFC PATCH v2 0/4] vhost: register and change IOMMU flag depending on ATS state

2023-04-30 Thread Viktor Prutyanov
,iommu_platform=on,ats=on -netdev tap,id=nd0,ifname=tap1,script=no,downscript=no,vhost=on -device intel-iommu,intremap=on,eim=on,device-iotlb=on/off Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2001312 Viktor Prutyanov (4): pci: add handling of Enable bit in ATS Control Register virtio-pci

[RFC PATCH v2 2/4] virtio-pci: add handling of ATS and Device-TLB enable

2023-04-30 Thread Viktor Prutyanov
Guest may enable or disable PCI ATS and, accordingly, Device-TLB for the device. Add a flag and a trigger function to handle Device-TLB enable/disable in VirtIO devices and hook it to ATS enable/disable for PCI transport. Signed-off-by: Viktor Prutyanov --- hw/virtio/virtio-pci.c | 17

[RFC PATCH v2 1/4] pci: add handling of Enable bit in ATS Control Register

2023-04-30 Thread Viktor Prutyanov
According to PCIe Address Translation Services specification 5.1.3., ATS Control Register has Enable bit to enable/disable ATS. A trigger function is called at the Enable bit change, so that PCIe devices can handle ATS enable/disable. Signed-off-by: Viktor Prutyanov --- hw/pci/pcie.c

[RFC PATCH v2 3/4] vhost: register and change IOMMU flag depending on Device-TLB state

2023-04-30 Thread Viktor Prutyanov
. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2001312 Signed-off-by: Viktor Prutyanov --- hw/virtio/vhost-backend.c | 6 ++ hw/virtio/vhost.c | 26 -- include/hw/virtio/vhost-backend.h | 4 include/hw/virtio/vhost.h | 1 + 4

[RFC PATCH v2 4/4] virtio-net: pass Device-TLB enable/disable events to vhost

2023-04-30 Thread Viktor Prutyanov
If vhost is enabled for virtio-net, Device-TLB enable/disable events must be passed to vhost for proper IOMMU unmap flag selection. Signed-off-by: Viktor Prutyanov --- hw/net/vhost_net.c | 11 +++ hw/net/virtio-net.c | 8 include/net/vhost_net.h | 2 ++ 3 files

[RFC PATCH 1/4] pci: add handling of Enable bit in ATS Control Register

2023-04-24 Thread Viktor Prutyanov
According to PCIe Address Translation Services specification 5.1.3., ATS Control Register has Enable bit to enable/disable ATS. Add a new field for a trigger function which is called at the Enable bit change, so that PCIe devices can handle ATS enable/disable. Signed-off-by: Viktor Prutyanov

[RFC PATCH 2/4] virtio-pci: add handling of ATS state change

2023-04-24 Thread Viktor Prutyanov
Guest may enable or disable ATS for the device. Add logic for handling these events. Signed-off-by: Viktor Prutyanov --- hw/virtio/virtio-pci.c | 12 include/hw/virtio/virtio.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio

[RFC PATCH 0/4] vhost: register and change IOMMU flag depending on ATS state

2023-04-24 Thread Viktor Prutyanov
,iommu_platform=on,ats=on -netdev tap,id=nd0,ifname=tap1,script=no,downscript=no,vhost=on -device intel-iommu,intremap=on,eim=on,device-iotlb=on/off Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2001312 Viktor Prutyanov (4): pci: add handling of Enable bit in ATS Control Register virtio-pci

[RFC PATCH 4/4] vhost: register and change IOMMU flag depending on ATS state

2023-04-24 Thread Viktor Prutyanov
The guest can disable or never enable ATS. In these cases, Device-TLB can't be used even if enabled in QEMU. So, check ATS state before registering IOMMU notifier and select flag depending on that. Also, change IOMMU notifier flag if ATS state is changed. Signed-off-by: Viktor Prutyanov --- hw

[RFC PATCH 3/4] memory: add interface for triggering IOMMU notify_flag_changed handler

2023-04-24 Thread Viktor Prutyanov
This interface helps if IOMMU notify_flag_changed should be triggered after changing IOMMU notifier flags in the runtime. Signed-off-by: Viktor Prutyanov --- include/exec/memory.h | 2 ++ softmmu/memory.c | 12 2 files changed, 14 insertions(+) diff --git a/include/exec

Re: [RFC PATCH] vhost: enable IOMMU_NOTIFIER_UNMAP events handling when device-iotlb=on

2023-04-13 Thread Viktor Prutyanov
On Thu, Mar 30, 2023 at 7:49 PM Viktor Prutyanov wrote: > > Even if Device-TLB and PCI ATS is enabled, the guest can reject to use > it. For example, this situation appears when Windows Server 2022 is > running with intel-iommu with device-iotlb=on and virtio-net-pci with > vhos

[RFC PATCH] vhost: enable IOMMU_NOTIFIER_UNMAP events handling when device-iotlb=on

2023-03-30 Thread Viktor Prutyanov
-TLB unmap events (IOMMU_NOTIFIER_DEVIOTLB_UNMAP) handling for proper vhost IOTLB unmapping when the guest isn't aware of Device-TLB. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2001312 Signed-off-by: Viktor Prutyanov --- Tested on Windows Server 2022 and Fedora guests with -device

Re:[PATCH v2 0/3] contrib/elf2dmp: Windows Server 2022 support

2023-03-17 Thread Viktor Prutyanov
Thank you! Personally, I agree with any way to get the elf2dmp patch series into the tree. Best regards, Viktor Prutyanov

Re: [PATCH v2 0/3] contrib/elf2dmp: Windows Server 2022 support

2023-03-16 Thread Viktor Prutyanov
> Hi, > > For now, elf2dmp is unable to convert ELF-dump to DMP-dump made of > Windows Server 2022 guest. This patch series fixes it. > > v1: improve code-style fix > v2: don't remove data directory entry RVA print and DOS header size check > > Viktor Prutyanov

[PATCH v2 2/3] contrib/elf2dmp: move PE dir search to pe_get_data_dir_entry

2023-02-22 Thread Viktor Prutyanov
Move out PE directory search functionality to be reused not only for Debug Directory processing but for arbitrary PE directory. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 71 +- 1 file changed, 42 insertions(+), 29 deletions(-) diff

[PATCH v2 3/3] contrib/elf2dmp: add PE name check and Windows Server 2022 support

2023-02-22 Thread Viktor Prutyanov
is 'ntoskrnl.exe' actually. So, introduce additional validation by checking image name from Export Directory against 'ntoskrnl.exe'. Signed-off-by: Viktor Prutyanov Tested-by: Yuri Benditovich --- contrib/elf2dmp/main.c | 28 ++-- contrib/elf2dmp/pe.h | 15 +++ 2

[PATCH v2 1/3] contrib/elf2dmp: fix code style

2023-02-22 Thread Viktor Prutyanov
Originally elf2dmp were added with some code style issues, especially in pe.h header, and some were introduced by 2d0fc797faaa73fbc1d30f5f9e90407bf3dd93f0. Fix them now. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/addrspace.c | 1 + contrib/elf2dmp/main.c | 9 ++-- contrib

[PATCH v2 0/3] contrib/elf2dmp: Windows Server 2022 support

2023-02-22 Thread Viktor Prutyanov
Hi, For now, elf2dmp is unable to convert ELF-dump to DMP-dump made of Windows Server 2022 guest. This patch series fixes it. v1: improve code-style fix v2: don't remove data directory entry RVA print and DOS header size check Viktor Prutyanov (3): contrib/elf2dmp: fix code style contrib

Re: [PATCH v1 2/3] contrib/elf2dmp: move PE dir search to pe_get_data_dir_entry

2023-02-22 Thread Viktor Prutyanov
Hello, On Wed, Feb 22, 2023 at 10:07 PM Annie.li wrote: > > Hello Viktor, > > See my following comments inline, > > On 11/29/2022 7:03 PM, Viktor Prutyanov wrote: > > Move out PE directory search functionality to be reused not only > > for Debug Directory p

Re: [PATCH v1 3/3] contrib/elf2dmp: add PE name check and Windows Server 2022 support

2023-02-22 Thread Viktor Prutyanov
On Wed, Feb 22, 2023 at 10:07 PM Annie.li wrote: > > > On 11/29/2022 7:03 PM, Viktor Prutyanov wrote: > > Since its inception elf2dmp has checked MZ signatures within an > > address space above IDT[0] interrupt vector and took first PE image > > found as Windows Kernel

Re: [PATCH 0/3] Fix UNMAP notifier for intel-iommu

2023-01-15 Thread Viktor Prutyanov
as we discussed, I'm waiting for the series to be accepted in some form to continue my work about supporting guests who refuse Device-TLB on systems with device-iotlb=on. Tested-by: Viktor Prutyanov Best regards, Viktor Prutyanov

Re: [PATCH v1 0/3] contrib/elf2dmp: Windows Server 2022 support

2023-01-10 Thread Viktor Prutyanov
On 11/30/22 3:03 AM, Viktor Prutyanov wrote: Hi, For now, elf2dmp is unable to convert ELF-dump to DMP-dump made of Windows Server 2022 guest. This patch series fixes it. v1: improve code-style fix Viktor Prutyanov (3): contrib/elf2dmp: fix code style contrib/elf2dmp: move PE dir search

[PATCH v1 3/3] contrib/elf2dmp: add PE name check and Windows Server 2022 support

2022-11-29 Thread Viktor Prutyanov
is 'ntoskrnl.exe' actually. So, introduce additional validation by checking image name from Export Directory against 'ntoskrnl.exe'. Signed-off-by: Viktor Prutyanov Tested-by: Yuri Benditovich --- contrib/elf2dmp/main.c | 28 ++-- contrib/elf2dmp/pe.h | 15 +++ 2

[PATCH v1 1/3] contrib/elf2dmp: fix code style

2022-11-29 Thread Viktor Prutyanov
Originally elf2dmp were added with some code style issues, especially in pe.h header, and some were introduced by 2d0fc797faaa73fbc1d30f5f9e90407bf3dd93f0. Fix them now. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/addrspace.c | 1 + contrib/elf2dmp/main.c | 9 ++-- contrib

[PATCH v1 2/3] contrib/elf2dmp: move PE dir search to pe_get_data_dir_entry

2022-11-29 Thread Viktor Prutyanov
Move out PE directory search functionality to be reused not only for Debug Directory processing but for arbitrary PE directory. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 66 +++--- 1 file changed, 37 insertions(+), 29 deletions(-) diff

[PATCH v1 0/3] contrib/elf2dmp: Windows Server 2022 support

2022-11-29 Thread Viktor Prutyanov
Hi, For now, elf2dmp is unable to convert ELF-dump to DMP-dump made of Windows Server 2022 guest. This patch series fixes it. v1: improve code-style fix Viktor Prutyanov (3): contrib/elf2dmp: fix code style contrib/elf2dmp: move PE dir search to pe_get_data_dir_entry contrib/elf2dmp: add

Re: [PATCH RESEND] elf2dmp: free memory in failure

2022-10-20 Thread Viktor Prutyanov
)) { eprintf("Failed to extract entire KDBG\n"); +free(kdbg); return NULL; } I suppose Philippe's R-b should be on this version of the patch, not previous one. Also I'm not sure if this patch should go through Paolo's branch or QEMU Trivial. Reviewed-by: Viktor Prutyanov

[PATCH] dump/win_dump: limit number of processed PRCBs

2022-10-19 Thread Viktor Prutyanov
Windows driver. Signed-off-by: Viktor Prutyanov --- dump/win_dump.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/dump/win_dump.c b/dump/win_dump.c index fd91350fbb..f20b6051b6 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -273,6 +273,13 @@ static void patch_and_save_context

[PATCH v2] contrib/elf2dmp: add ELF dump header checking

2022-05-20 Thread Viktor Prutyanov
Add ELF header checking to prevent processing input file which is not QEMU x86_64 guest memory dump or even not ELF. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1013 Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/qemu_elf.c | 53 ++ 1 file

[PATCH] contrib/elf2dmp: add ELF dump header checking

2022-05-19 Thread Viktor Prutyanov
Add ELF header checking to prevent processing input file which is not QEMU guest memory dump or even not ELF. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1013 Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/qemu_elf.c | 38 ++ 1 file changed

Re: [PULL v2 13/13] dump/win_dump: add 32-bit guest Windows support

2022-04-22 Thread Viktor Prutyanov
Hello, Thank you for the compiler warning fix. Best regards, Viktor Prutyanov On Fri, Apr 22, 2022 at 1:16 PM wrote: > From: Viktor Prutyanov > > Before this patch, 'dump-guest-memory -w' was accepting only 64-bit > dump header provided by guest through vmcoreinfo and thu

Re: [PATCH v4 0/4] dump: add 32-bit guest Windows support

2022-04-20 Thread Viktor Prutyanov
ping On Wed, 6 Apr 2022 20:15:54 +0300 Viktor Prutyanov wrote: > From: Viktor Prutyanov > > Since 32-bit versions of Windows still exist, there is a need to take > live and crash dumps of such guests along with 64-bit guests. So, add > an ability for 'dump-guest-memory -w' to

[PATCH v4 4/4] dump/win_dump: add 32-bit guest Windows support

2022-04-06 Thread Viktor Prutyanov
Before this patch, 'dump-guest-memory -w' was accepting only 64-bit dump header provided by guest through vmcoreinfo and thus was unable to produce 32-bit guest Windows dump. So, add 32-bit guest Windows dumping support. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé

[PATCH v4 3/4] include/qemu: add 32-bit Windows dump structures

2022-04-06 Thread Viktor Prutyanov
These structures are required to produce 32-bit guest Windows Complete Memory Dump. Add 32-bit Windows dump header, CPU context and physical memory descriptor structures along with corresponding definitions. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Marc

[PATCH v4 2/4] dump/win_dump: add helper macros for Windows dump header access

2022-04-06 Thread Viktor Prutyanov
Perform read access to Windows dump header fields via helper macros. This is preparation for the next 32-bit guest Windows dump support. Signed-off-by: Viktor Prutyanov Reviewed-by: Marc-André Lureau --- dump/win_dump.c | 100 +++- 1 file changed, 65

[PATCH v4 1/4] include/qemu: rename Windows context definitions to expose bitness

2022-04-06 Thread Viktor Prutyanov
Context structure in 64-bit Windows differs from 32-bit one and it should be reflected in its name. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau --- contrib/elf2dmp/main.c | 6 +++--- dump/win_dump.c | 14

[PATCH v4 0/4] dump: add 32-bit guest Windows support

2022-04-06 Thread Viktor Prutyanov
From: Viktor Prutyanov Since 32-bit versions of Windows still exist, there is a need to take live and crash dumps of such guests along with 64-bit guests. So, add an ability for 'dump-guest-memory -w' to take dumps from 32-bit guest. When running the command QEMU consumes 32-bit Complete Memory

Re: [PATCH v3 4/4] dump/win_dump: add 32-bit guest Windows support

2022-04-06 Thread Viktor Prutyanov
Hi On Wed, Apr 6, 2022 at 11:00 AM Marc-André Lureau wrote: > > Hi > > On Fri, Mar 25, 2022 at 11:51 PM Viktor Prutyanov > wrote: > > > > Before this patch, 'dump-guest-memory -w' was accepting only 64-bit > > dump header provided by guest through vmcoreinfo a

Re: [PATCH v3 3/4] include/qemu: add 32-bit Windows dump structures

2022-04-06 Thread Viktor Prutyanov
Hi On Wed, Apr 6, 2022 at 10:51 AM Marc-André Lureau wrote: > > Hi > > On Fri, Mar 25, 2022 at 11:51 PM Viktor Prutyanov > wrote: > > > > These structures are required to produce 32-bit guest Windows Complete > > Memory Dump. Add 32-bit Windows dump header, CP

[PATCH v3 4/4] dump/win_dump: add 32-bit guest Windows support

2022-03-25 Thread Viktor Prutyanov
Before this patch, 'dump-guest-memory -w' was accepting only 64-bit dump header provided by guest through vmcoreinfo and thus was unable to produce 32-bit guest Windows dump. So, add 32-bit guest Windows dumping support. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé

[PATCH v3 1/4] include/qemu: rename Windows context definitions to expose bitness

2022-03-25 Thread Viktor Prutyanov
Context structure in 64-bit Windows differs from 32-bit one and it should be reflected in its name. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé --- contrib/elf2dmp/main.c | 6 +++--- dump/win_dump.c | 14 +++--- include/qemu/win_dump_defs.h

[PATCH v3 3/4] include/qemu: add 32-bit Windows dump structures

2022-03-25 Thread Viktor Prutyanov
These structures are required to produce 32-bit guest Windows Complete Memory Dump. Add 32-bit Windows dump header, CPU context and physical memory descriptor structures along with corresponding definitions. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé --- include/qemu

[PATCH v3 2/4] dump/win_dump: add helper macros for Windows dump header access

2022-03-25 Thread Viktor Prutyanov
Perform read access to Windows dump header fields via helper macros. This is preparation for the next 32-bit guest Windows dump support. Signed-off-by: Viktor Prutyanov --- dump/win_dump.c | 100 +++- 1 file changed, 65 insertions(+), 35 deletions

[PATCH v3 0/4] dump: add 32-bit guest Windows support

2022-03-25 Thread Viktor Prutyanov
in logic, just split patches - first introduce WIN_DUMP_* macros for x64 in a separate patch - rename WinContext to WinContext64 in a separate patch Viktor Prutyanov (4): include/qemu: rename Windows context definitions to expose bitness dump/win_dump: add helper macros for Windows dump

Re: [PATCH v2 2/4] dump/win_dump: add helper macros for Windows dump header access

2022-01-23 Thread Viktor Prutyanov
On Thu, 13 Jan 2022 03:52:46 +0300 Viktor Prutyanov wrote: > Perform read access to Windows dump header fields via helper macros. > This is preparation for the next 32-bit guest Windows dump support. > > Signed-off-by: Viktor Prutyanov > --- > dum

[PATCH v2 4/4] dump/win_dump: add 32-bit guest Windows support

2022-01-12 Thread Viktor Prutyanov
Before this patch, 'dump-guest-memory -w' was accepting only 64-bit dump header provided by guest through vmcoreinfo and thus was unable to produce 32-bit guest Windows dump. So, add 32-bit guest Windows dumping support. Signed-off-by: Viktor Prutyanov --- dump/win_dump.c | 231

[PATCH v2 3/4] include/qemu: add 32-bit Windows dump structures

2022-01-12 Thread Viktor Prutyanov
These structures are required to produce 32-bit guest Windows Complete Memory Dump. Add 32-bit Windows dump header, CPU context and physical memory descriptor structures along with corresponding definitions. Signed-off-by: Viktor Prutyanov --- include/qemu/win_dump_defs.h | 107

[PATCH v2 1/4] include/qemu: rename Windows context definitions to expose bitness

2022-01-12 Thread Viktor Prutyanov
Context structure in 64-bit Windows differs from 32-bit one and it should be reflected in its name. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 6 +++--- dump/win_dump.c | 14 +++--- include/qemu/win_dump_defs.h | 8 3 files changed, 14

[PATCH v2 2/4] dump/win_dump: add helper macros for Windows dump header access

2022-01-12 Thread Viktor Prutyanov
Perform read access to Windows dump header fields via helper macros. This is preparation for the next 32-bit guest Windows dump support. Signed-off-by: Viktor Prutyanov --- dump/win_dump.c | 100 +++- 1 file changed, 65 insertions(+), 35 deletions

[PATCH v2 0/4] dump: add 32-bit guest Windows support

2022-01-12 Thread Viktor Prutyanov
- rename WinContext to WinContext64 in a separate patch Viktor Prutyanov (4): include/qemu: rename Windows context definitions to expose bitness dump/win_dump: add helper macros for Windows dump header access include/qemu: add 32-bit Windows dump structures dump/win_dump: add 32-bit guest Windows

[PATCH 2/2] dump/win_dump: add 32-bit guest Windows support

2021-12-29 Thread Viktor Prutyanov
Before this patch, 'dump-guest-memory -w' was accepting only 64-bit dump header provided by guest through vmcoreinfo and thus was unable to produce 32-bit guest Windows dump. So, add 32-bit guest Windows dumping support. Signed-off-by: Viktor Prutyanov --- dump/win_dump.c | 293

[PATCH 1/2] include/qemu: add 32-bit Windows dump structures

2021-12-29 Thread Viktor Prutyanov
These structures are required to produce 32-bit guest Windows Complete Memory Dump. Add 32-bit Windows dump header, CPU context and physical memory descriptor structures along with corresponding definitions. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 6 +- include/qemu

[PATCH 0/2] dump: add 32-bit guest Windows support

2021-12-29 Thread Viktor Prutyanov
by guest driver through vmcoreinfo device as it was previously done for 64-bit headers. 32-bit vmcoreinfo guest driver in upstream virtio-win can fill such a header. Viktor Prutyanov (2): include/qemu: add 32-bit Windows dump structures and definitions dump/win_dump: add 32-bit guest Windows support

[PATCH 2/3] contrib/elf2dmp: move PE dir search to pe_get_data_dir_entry

2021-11-03 Thread Viktor Prutyanov
Move out PE directory search functionality to be reused not only for Debug Directory processing but for arbitrary PE directory. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 66 +++--- 1 file changed, 37 insertions(+), 29 deletions(-) diff

[PATCH 3/3] contrib/elf2dmp: add PE name check and Windows Server 2022 support

2021-11-03 Thread Viktor Prutyanov
is 'ntoskrnl.exe' actually. So, introduce additional validation by checking image name from Export Directory against 'ntoskrnl.exe'. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 28 ++-- contrib/elf2dmp/pe.h | 15 +++ 2 files changed, 41 insertions

[PATCH 1/3] contrib/elf2dmp: fix code style

2021-11-03 Thread Viktor Prutyanov
Originally elf2dmp were added with some code style issues, especially in pe.h header, and some were introduced by 2d0fc797faaa73fbc1d30f5f9e90407bf3dd93f0. Fix them now. Signed-off-by: Viktor Prutyanov --- contrib/elf2dmp/main.c | 9 ++-- contrib/elf2dmp/pe.h | 100

[PATCH 0/3] contrib/elf2dmp: Windows Server 2022 support

2021-11-03 Thread Viktor Prutyanov
Hi, For now, elf2dmp is unable to convert ELF-dump to DMP-dump made of Windows Server 2022 guest. This patch series fixes it. Viktor Prutyanov (3): contrib/elf2dmp: fix code style contrib/elf2dmp: move PE dir search to pe_get_data_dir_entry contrib/elf2dmp: add PE name check and Windows

  1   2   >