[Qemu-devel] [PATCH] intel_iommu: allow updating FEADDR and FEUADDR with one 64bit write

2018-01-24 Thread Marek Marczykowski-Górecki
Allow updating those two adjacent 32bit fields with one 64bit write. This fixes qemu crash when booting Xen inside. See discussion on Xen side of the thing here: http://xen.markmail.org/message/6mrmemrnmhxvaxba Signed-off-by: Marek Marczykowski-Górecki <marma...@invisiblethingslab.com> -

Re: [Qemu-devel] [PATCH] intel_iommu: allow updating FEADDR and FEUADDR with one 64bit write

2018-02-16 Thread Marek Marczykowski-Górecki
On Wed, Jan 24, 2018 at 03:18:48PM +0100, Marek Marczykowski-Górecki wrote: > Allow updating those two adjacent 32bit fields with one 64bit write. > This fixes qemu crash when booting Xen inside. > > See discussion on Xen side of the thing here: > http://xen.markmail.org/message/6

Re: [Qemu-devel] [Xen-devel] [PATCH v3] xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored

2019-03-18 Thread Marek Marczykowski-Górecki
due to certain circumstances (i.e. on resume > now) > */ > vaddr_base = mmap(vaddr, size, PROT_READ | PROT_WRITE, > - MAP_ANON | MAP_SHARED, -1, 0); > + MAP_ANON | MAP_SHARED | (vaddr ? MAP_FIXED : 0), > + -1, 0);

Re: [Qemu-devel] [Xen-devel] [PATCH 5/6] xen-pt: Hide MSI-X from xen stubdoms

2019-03-12 Thread Marek Marczykowski-Górecki
t can be worked around by enabling permissive mode. Jason, did you had a chance to test it with any MSI-X device? I'm not aware of anything thing particular that breaks MSI-X but not MSI. Besides much less devices lying around to test MSI-X... -- Best Regards, Marek Marczykowski-Górecki Invisible

Re: [Qemu-devel] [Xen-devel] [PATCH 5/6] xen-pt: Hide MSI-X from xen stubdoms

2019-03-12 Thread Marek Marczykowski-Górecki
On Tue, Mar 12, 2019 at 09:58:56AM -0400, Jason Andryuk wrote: > On Tue, Mar 12, 2019 at 8:38 AM Marek Marczykowski-Górecki > wrote: > > > > On Tue, Mar 12, 2019 at 01:04:19PM +0100, Roger Pau Monné wrote: > > > On Mon, Mar 11, 2019 at 02:02:15PM -0400, Jason A

Re: [Qemu-devel] [Xen-devel] Commit 331b51 breaks live migration on FreeBSD/Xen dom0

2019-03-14 Thread Marek Marczykowski-Górecki
the addr argument is only a hint. -- Best Regards, Marek Marczykowski-Górecki Invisible Things Lab A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? signature.asc Description: PGP signature

[PATCH] crypto: add "none" random provider

2020-05-20 Thread Marek Marczykowski-Górecki
are needed at all. Signed-off-by: Marek Marczykowski-Górecki --- configure| 11 +++ crypto/Makefile.objs | 3 ++- crypto/random-none.c | 38 ++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 crypto/random-none.c diff

Re: [PATCH] migration: Truncate state file in xen-save-devices-state

2020-09-28 Thread Marek Marczykowski-Górecki
a linux stubdomain? > Can we truncate the "save file" which seems to be stubdomain's console 1? No, truncate won't work on the stubdomain's console. I mean, the operation won't fail, but the actual file connected to the console on the other end won't get truncated. But I think in case o

[PATCH] i386/kvm: fix setting up nested_state for SVM

2020-10-25 Thread Marek Marczykowski-Górecki
nested_state->format needs to ne set appropriately for VMX/SVM, otherwise KVM_SET_NESTED_STATE ioctl will fail. Signed-off-by: Marek Marczykowski-Górecki --- target/i386/kvm.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/target/i386/kvm.c b/target/i

[PATCH] i386: load kernel on xen using DMA

2021-04-25 Thread Marek Marczykowski-Górecki
initially here: https://lore.kernel.org/xen-devel/20180216204031.5...@gmail.com/ Apparently this alone is already enough to get massive speedup. Signed-off-by: Marek Marczykowski-Górecki --- hw/i386/pc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386

Re: [PATCH 1/2] hw/xen/xen_pt: Call default handler only if no custom one is set

2023-09-26 Thread Marek Marczykowski-Górecki
On Tue, Nov 22, 2022 at 05:12:59PM +, Anthony PERARD wrote: > On Mon, Nov 14, 2022 at 08:20:10PM +0100, Marek Marczykowski-Górecki wrote: > > diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c > > index 0ec7e52183..269bd26109 100644 > > --- a/hw/xen/xen_pt.c > > +++ b/hw

Re: [PATCH 2/2] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2022-11-16 Thread Marek Marczykowski-Górecki
On Wed, Nov 16, 2022 at 02:15:22PM -0500, Jason Andryuk wrote: > On Mon, Nov 14, 2022 at 2:21 PM Marek Marczykowski-Górecki > wrote: > > > > The /dev/mem is used for two purposes: > > - reading PCI_MSIX_ENTRY_CTRL_MASKBIT > > - reading Pending Bit Arr

Re: [PATCH 2/2] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2022-11-17 Thread Marek Marczykowski-Górecki
On Thu, Nov 17, 2022 at 09:04:40AM +0100, Jan Beulich wrote: > On 17.11.2022 04:34, Marek Marczykowski-Górecki wrote: > > Ok, I found what is wrong. Enabling MSI-X is refused, because INTx isn't > > disabled at this point yet. And apparently I was testing this with &

Re: [PATCH 2/2] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2022-11-16 Thread Marek Marczykowski-Górecki
On Wed, Nov 16, 2022 at 10:40:02PM +0100, Marek Marczykowski-Górecki wrote: > On Wed, Nov 16, 2022 at 02:15:22PM -0500, Jason Andryuk wrote: > > On Mon, Nov 14, 2022 at 2:21 PM Marek Marczykowski-Górecki > > wrote: > > > > > > The /dev/mem is used f

[PATCH] hw/xen/xen_pt: fix uninitialized variable

2023-01-26 Thread Marek Marczykowski-Górecki
fails if any of those higher bits are set. Fix this by initializing 'val' with zero. Signed-off-by: Marek Marczykowski-Górecki --- hw/xen/xen_pt_config_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index

[PATCH 1/2] hw/xen/xen_pt: Call default handler only if no custom one is set

2022-11-14 Thread Marek Marczykowski-Górecki
xen_pt_*_reg_write()). 2. Not setting value early allows the hooks to see the old value too. If it would be only about the first point, setting PCIDevice.wmask would probably be sufficient, but given the second point, restructure those writes. Signed-off-by: Marek Marczykowski-Górecki --- hw

[PATCH 2/2] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2022-11-14 Thread Marek Marczykowski-Górecki
is not necessary anymore. Removing /dev/mem access is useful to work within stubdomain, and necessary when dom0 kernel runs in lockdown mode. Signed-off-by: Marek Marczykowski-Górecki --- hw/xen/xen_pt.h | 1 - hw/xen/xen_pt_msi.c | 51 - 2 files

Re: [PATCH 2/2] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2022-11-14 Thread Marek Marczykowski-Górecki
On Mon, Nov 14, 2022 at 07:39:48PM +, Andrew Cooper wrote: > On 14/11/2022 19:20, Marek Marczykowski-Górecki wrote: > > The /dev/mem is used for two purposes: > > - reading PCI_MSIX_ENTRY_CTRL_MASKBIT > > - reading Pending Bit Array (PBA) > > > > The firs

Re: [PATCH 2/2] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2022-11-15 Thread Marek Marczykowski-Górecki
On Tue, Nov 15, 2022 at 09:14:07AM +0100, Jan Beulich wrote: > On 14.11.2022 20:20, Marek Marczykowski-Górecki wrote: > > The /dev/mem is used for two purposes: > > - reading PCI_MSIX_ENTRY_CTRL_MASKBIT > > - reading Pending Bit Array (PBA) > > > > The first one

[PATCH] configure: do not require gcc runtime library for firmwares

2024-02-16 Thread Marek Marczykowski-Górecki
, but its gcc is otherwise perfectly capable of building firmwares in pc-bios/optionrom dir. Make configure recognize this situation. Keep requiring functional -lgcc in other places. Signed-off-by: Marek Marczykowski-Górecki --- configure | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions

[PATCH v2] configure: do not require gcc runtime library for firmwares

2024-02-19 Thread Marek Marczykowski-Górecki
, but its gcc is otherwise perfectly capable of building firmwares in pc-bios/optionrom dir. Make configure recognize this situation. Keep requiring functional -lgcc in other places. Few more may not need it, but I don't have an easy way to test. Signed-off-by: Marek Marczykowski-Górecki --- Changes

Re: [PATCH 2/2] xen: fix stubdom PCI addr

2024-02-19 Thread Marek Marczykowski-Górecki
On Mon, Feb 19, 2024 at 07:16:06PM +0100, Marek Marczykowski-Górecki wrote: > From: Frédéric Pierret (fepitre) This shouldn't be here, it's my patch. > When running in a stubdomain, the config space access via sysfs needs to > use BDF as seen inside stubdomain (connected via xen

Re: [PATCH] i386: load kernel on xen using DMA

2024-02-16 Thread Marek Marczykowski-Górecki
On Fri, Jun 18, 2021 at 09:54:14AM +0100, Alex Bennée wrote: > > Marek Marczykowski-Górecki writes: > > > Kernel on Xen is loaded via fw_cfg. Previously it used non-DMA version, > > which loaded the kernel (and initramfs) byte by byte. Change this > > to DM

[PATCH 1/2] hw/xen: detect when running inside stubdomain

2024-02-19 Thread Marek Marczykowski-Górecki
Introduce global xen_is_stubdomain variable when qemu is running inside a stubdomain instead of dom0. This will be relevant for subsequent patches, as few things like accessing PCI config space need to be done differently. Signed-off-by: Marek Marczykowski-Górecki --- hw/xen/xen-legacy

[PATCH 2/2] xen: fix stubdom PCI addr

2024-02-19 Thread Marek Marczykowski-Górecki
the in-stubdomain BDF by looking up relevant PV PCI xenstore entries. Signed-off-by: Marek Marczykowski-Górecki --- hw/xen/xen-host-pci-device.c | 77 +++- hw/xen/xen-host-pci-device.h | 6 +++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen

[PATCH v2 1/2] hw/xen: detect when running inside stubdomain

2024-03-05 Thread Marek Marczykowski-Górecki
Introduce global xen_is_stubdomain variable when qemu is running inside a stubdomain instead of dom0. This will be relevant for subsequent patches, as few things like accessing PCI config space need to be done differently. Signed-off-by: Marek Marczykowski-Górecki --- Changes in v2: - use sigend

[PATCH v2 2/2] xen: fix stubdom PCI addr

2024-03-05 Thread Marek Marczykowski-Górecki
the in-stubdomain BDF by looking up relevant PV PCI xenstore entries. Signed-off-by: Marek Marczykowski-Górecki --- Changes in v2: - use xs_node_scanf - use %d instead of %u to read values written as %d - add a comment from another iteration of this patch by Jason Andryuk --- hw/xen/xen-host-pci

Re: [PATCH v2 1/2] hw/xen: detect when running inside stubdomain

2024-03-26 Thread Marek Marczykowski-Górecki
On Tue, Mar 26, 2024 at 05:06:50PM +, Anthony PERARD wrote: > On Tue, Mar 05, 2024 at 08:12:29PM +0100, Marek Marczykowski-Górecki wrote: > > diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c > > index 124dd5f3d6..6bd4e6eb2f 100644 > > --- a/hw/xen

[PATCH v3 0/2] Changes necessary to work inside Xen device model stubdomain

2024-03-26 Thread Marek Marczykowski-Górecki
This is minimal set of changes necessary to run Xen device model inside a stubdomain and still support PCI passthrough. Marek Marczykowski-Górecki (2): hw/xen: detect when running inside stubdomain xen: fix stubdom PCI addr hw/i386/xen/xen-hvm.c| 22 +++- hw/xen/xen-host-pci

[PATCH v3 1/2] hw/xen: detect when running inside stubdomain

2024-03-26 Thread Marek Marczykowski-Górecki
Introduce global xen_is_stubdomain variable when qemu is running inside a stubdomain instead of dom0. This will be relevant for subsequent patches, as few things like accessing PCI config space need to be done differently. Signed-off-by: Marek Marczykowski-Górecki --- Changes in v3: - move

[PATCH v3 2/2] xen: fix stubdom PCI addr

2024-03-26 Thread Marek Marczykowski-Górecki
relevant PV PCI xenstore entries. Signed-off-by: Marek Marczykowski-Górecki --- Changes in v3: - reduce 'path' size - add two missing error_setg() calls - coding style Changes in v2: - use xs_node_scanf - use %d instead of %u to read values written as %d - add a comment from another iteration

[PATCH v2 0/3] Fix MSI-X handling for Xen HVM

2024-04-30 Thread Marek Marczykowski-Górecki
another register there). It should be no-op, but due to a bug in xen_pt code, it broke MSI-X detection. All those patches have been shipped in Qubes OS 4.2 already, and prove to fix the issue. See individual commit messages for details. Marek Marczykowski-Górecki (3): hw/xen/xen_pt: Save back

[PATCH v2 3/3] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2024-04-30 Thread Marek Marczykowski-Górecki
conditions. Removing /dev/mem access is useful to work within stubdomain (avoids emulated reads and potential races), and necessary when dom0 kernel runs in lockdown mode (where /dev/mem is unavailable at all). Signed-off-by: Marek Marczykowski-Górecki --- Changes in v2: - Make change conditional on new X

[PATCH v2 1/3] hw/xen/xen_pt: Save back data only for declared registers

2024-04-30 Thread Marek Marczykowski-Górecki
Marczykowski-Górecki --- v2: - rewrite commit message, previous one was very misleading - fix loop saving register values - fix int overflow when calculating write mask --- hw/xen/xen_pt.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen_pt.c b/hw/xen

[PATCH v2 2/3] Update Xen's features.h header

2024-04-30 Thread Marek Marczykowski-Górecki
Update it to get XENFEAT_dm_msix_all_writes for the next patch. Signed-off-by: Marek Marczykowski-Górecki --- include/hw/xen/interface/features.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/hw/xen/interface/features.h b/include/hw/xen/interface/features.h

[PATCH v3 1/3] hw/xen/xen_pt: Save back data only for declared registers

2024-05-05 Thread Marek Marczykowski-Górecki
space, call the pci_default_write_config() only for its side effects. Signed-off-by: Marek Marczykowski-Górecki --- v3: - use emulated register value for pci_default_write_config() call, not the one for writting back to the hardware - greatly simplify the patch by calling

[PATCH v3 0/3] Fix MSI-X handling for Xen HVM

2024-05-05 Thread Marek Marczykowski-Górecki
another register there). It should be no-op, but due to a bug in xen_pt code, it broke MSI-X detection. All those patches have been shipped in Qubes OS 4.2 already, and prove to fix the issue. See individual commit messages for details. Marek Marczykowski-Górecki (3): hw/xen/xen_pt: Save back

[PATCH v3 3/3] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2024-05-05 Thread Marek Marczykowski-Górecki
conditions. Removing /dev/mem access is useful to work within stubdomain (avoids emulated reads and potential races), and necessary when dom0 kernel runs in lockdown mode (where /dev/mem is unavailable at all). Signed-off-by: Marek Marczykowski-Górecki --- Changes in v2: - Make change conditional on new X

[PATCH v3 2/3] Update Xen's features.h header

2024-05-05 Thread Marek Marczykowski-Górecki
Update it to get XENFEAT_dm_msix_all_writes for the next patch. Signed-off-by: Marek Marczykowski-Górecki --- include/hw/xen/interface/features.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/hw/xen/interface/features.h b/include/hw/xen/interface/features.h

Re: [PATCH v3 0/3] Fix MSI-X handling for Xen HVM

2024-05-05 Thread Marek Marczykowski-Górecki
On Mon, May 06, 2024 at 02:33:19AM +0200, Marek Marczykowski-Górecki wrote: > This series fixes handling MSI-X when device model is running in a stubdomain. > The main part is to avoid accessing /dev/mem, which also fixes running dom0 > with lockdown enabled. > > It depends on a