[PATCH v2] xen: fix build without pci passthrough

2020-05-19 Thread Roger Pau Monne
has_igd_gfx_passthru is only available when QEMU is built with CONFIG_XEN_PCI_PASSTHROUGH, and hence shouldn't be used in common code without checking if it's available. Fixes: 46472d82322d0 ('xen: convert "-machine igd-passthru" to an accelerator property') Signed-off-by: Roger Pau Monné ---

[PATCH] xen: fix build without pci passthrough

2020-05-04 Thread Roger Pau Monne
has_igd_gfx_passthru is only available when QEMU is built with CONFIG_XEN_PCI_PASSTHROUGH, and hence shouldn't be used in common code without checking if it's available. Fixes: 46472d82322d0 ('xen: convert "-machine igd-passthru" to an accelerator property') Signed-off-by: Roger Pau Monné ---

[PATCH] qemu-user: fix build with LLVM lld 10

2020-03-26 Thread Roger Pau Monne
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available. This fixes the build of QEMU on systems using lld 10 or greater. Signed-off-by: Dimitry Andric Signed-off-by: Roger Pau Monné --- Cc: Laurent Vivier Cc: Richard

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

2019-03-18 Thread Roger Pau Monne
Or if it's not possible to honor the hinted address an error is returned instead. This makes it easier to spot the actual failure, instead of failing later on when the caller of xen_remap_bucket realizes the mapping has not been created at the requested address. Also note that at least on FreeBSD

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

2019-03-18 Thread Roger Pau Monne
Or if it's not possible to honor the hinted address an error is returned instead. This makes it easier to spot the actual failure, instead of failing later on when the caller of xen_remap_bucket realizes the mapping has not been created at the requested address. Also note that at least on FreeBSD

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

2019-03-15 Thread Roger Pau Monne
Or if it's not possible to honor the hinted address an error is returned instead. This makes it easier to spot the actual failure, instead of failing later on when the caller of xen_remap_bucket realizes the mapping has not been created at the requested address. Also note that at least on FreeBSD

[Qemu-devel] [PATCH QEMU v4] xen/pt: allow QEMU to request MSI unmasking at bind time

2017-08-24 Thread Roger Pau Monne
When a MSI interrupt is bound to a guest using xc_domain_update_msi_irq (XEN_DOMCTL_bind_pt_irq) the interrupt is left masked by default. This causes problems with guests that first configure interrupts and clean the per-entry MSIX table mask bit and afterwards enable MSIX globally. In such

[Qemu-devel] [PATCH QEMU v3] xen/pt: allow QEMU to request MSI unmasking at bind time

2017-08-24 Thread Roger Pau Monne
When a MSI interrupt is bound to a guest using xc_domain_update_msi_irq (XEN_DOMCTL_bind_pt_irq) the interrupt is left masked by default. This causes problems with guests that first configure interrupts and clean the per-entry MSIX table mask bit and afterwards enable MSIX globally. In such

Re: [Qemu-devel] [PATCH QEMU v2] xen/pt: allow QEMU to request MSI unmasking at bind time

2017-08-24 Thread Roger Pau Monne
On Thu, Aug 24, 2017 at 07:09:08AM -0600, Jan Beulich wrote: > >>> On 24.08.17 at 14:19, wrote: > > When a MSI interrupt is bound to a guest using > > xc_domain_update_msi_irq (XEN_DOMCTL_bind_pt_irq) the interrupt is > > left masked by default. > > > > This causes problems

[Qemu-devel] [PATCH QEMU v2] xen/pt: allow QEMU to request MSI unmasking at bind time

2017-08-24 Thread Roger Pau Monne
When a MSI interrupt is bound to a guest using xc_domain_update_msi_irq (XEN_DOMCTL_bind_pt_irq) the interrupt is left masked by default. This causes problems with guests that first configure interrupts and clean the per-entry MSIX table mask bit and afterwards enable MSIX globally. In such

Re: [Qemu-devel] [PATCH QEMU] xen/pt: allow QEMU to request MSI unmasking at bind time

2017-08-24 Thread Roger Pau Monne
On Thu, Aug 24, 2017 at 04:13:58AM -0600, Jan Beulich wrote: > >>> On 24.08.17 at 12:06, wrote: > > On Thu, Aug 24, 2017 at 03:54:21AM -0600, Jan Beulich wrote: > >> >>> On 24.08.17 at 11:47, wrote: > >> > @@ -274,7 +278,7 @@ int

Re: [Qemu-devel] [PATCH QEMU] xen/pt: allow QEMU to request MSI unmasking at bind time

2017-08-24 Thread Roger Pau Monne
On Thu, Aug 24, 2017 at 03:54:21AM -0600, Jan Beulich wrote: > >>> On 24.08.17 at 11:47, wrote: > > @@ -274,7 +278,7 @@ int xen_pt_msi_update(XenPCIPassthroughState *s) > > { > > XenPTMSI *msi = s->msi; > > return msi_msix_update(s, msi_addr64(msi), msi->data,

[Qemu-devel] [PATCH QEMU] xen/pt: allow QEMU to request MSI unmasking at bind time

2017-08-24 Thread Roger Pau Monne
When a MSIX interrupt is bound to a guest using xc_domain_update_msi_irq (XEN_DOMCTL_bind_pt_irq) the interrupt is left masked by default. This causes problems with guests that first configure interrupts and clean the per-entry MSIX table mask bit and afterwards enable MSIX globally. In such

Re: [Qemu-devel] [PATCH 1/3] xen-disk: only advertize feature-persistent if grant copy is not available

2017-06-21 Thread Roger Pau Monne
On Wed, Jun 21, 2017 at 11:40:00AM +0100, Paul Durrant wrote: > > -Original Message- > > From: Qemu-devel [mailto:qemu-devel- > > bounces+paul.durrant=citrix@nongnu.org] On Behalf Of Paul Durrant > > Sent: 21 June 2017 10:36 > > To: Roger Pau Monne &

[Qemu-devel] [PATCH QEMU v2 2/2] xen: fix usage of xc_domain_create in domain builder

2015-11-13 Thread Roger Pau Monne
Due to the addition of HVMlite and the requirement to always provide a valid xc_domain_configuration_t, xc_domain_create now always takes an arch domain config, which can be NULL in order to mimic previous behaviour. Add a small stub called xen_domain_create that encapsulates the correct call to

[Qemu-devel] [PATCH QEMU v3 2/2] xen: fix usage of xc_domain_create in domain builder

2015-11-13 Thread Roger Pau Monne
Due to the addition of HVMlite and the requirement to always provide a valid xc_domain_configuration_t, xc_domain_create now always takes an arch domain config, which can be NULL in order to mimic previous behaviour. Add a small stub called xen_domain_create that encapsulates the correct call to

[Qemu-devel] [PATCH QEMU 2/2] xen: fix usage of xc_domain_create in domain builder

2015-11-13 Thread Roger Pau Monne
Due to the addition of HVMlite and the requirement to always provide a valid xc_domain_configuration_t, xc_domain_create now always takes an arch domain config, which can be NULL in order to mimic previous behaviour. Signed-off-by: Roger Pau Monné --- Cc: Stefano Stabellini

[Qemu-devel] [PATCH v2 for-xen-4.5] xen_disk: fix unmapping of persistent grants

2014-11-13 Thread Roger Pau Monne
This patch fixes two issues with persistent grants and the disk PV backend (Qdisk): - Keep track of memory regions where persistent grants have been mapped since we need to unmap them as a whole. It is not possible to unmap a single grant if it has been batch-mapped. - Unmap persistent

[Qemu-devel] [PATCH v3 for-xen-4.5] xen_disk: fix unmapping of persistent grants

2014-11-13 Thread Roger Pau Monne
This patch fixes two issues with persistent grants and the disk PV backend (Qdisk): - Keep track of memory regions where persistent grants have been mapped since we need to unmap them as a whole. It is not possible to unmap a single grant if it has been batch-mapped. A new check has also

[Qemu-devel] [PATCH] xen_disk: fix unmapping of persistent grants

2014-11-12 Thread Roger Pau Monne
This patch fixes two issues with persistent grants and the disk PV backend (Qdisk): - Don't use batch mappings when using persistent grants, doing so prevents unmapping single grants (the whole area has to be unmapped at once). - Unmap persistent grants before switching to the closed state,

[Qemu-devel] [PATCH v2] block: char devices on FreeBSD are not behind a pager

2014-10-21 Thread Roger Pau Monne
Introduce a new flag to mark devices that require requests to be aligned and replace the usage of BDRV_O_NOCACHE and O_DIRECT with this flag when appropriate. If a character device is used as a backend on a FreeBSD host set this flag unconditionally. Signed-off-by: Roger Pau Monné

[Qemu-devel] [PATCH v3] block: char devices on FreeBSD are not behind a pager

2014-10-21 Thread Roger Pau Monne
Introduce a new flag to mark devices that require requests to be aligned and replace the usage of BDRV_O_NOCACHE and O_DIRECT with this flag when appropriate. If a character device is used as a backend on a FreeBSD host set this flag unconditionally. Signed-off-by: Roger Pau Monné

[Qemu-devel] [PATCH] block: char devices on FreeBSD are not behind a pager

2014-10-20 Thread Roger Pau Monne
Acknowledge this and forcefully set BDRV_O_NOCACHE and O_DIRECT in order to force QEMU to use aligned buffers. Signed-off-by: Roger Pau Monné roger@citrix.com Cc: Kevin Wolf kw...@redhat.com Cc: Stefan Hajnoczi stefa...@redhat.com --- block/raw-posix.c | 12 1 file changed, 12

[Qemu-devel] [PATCH v2 3/3] serial: poll the serial console with G_IO_HUP

2014-05-23 Thread Roger Pau Monne
On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

[Qemu-devel] [PATCH v2 0/3] qemu-freebsd: fixes for running Xen guests

2014-05-23 Thread Roger Pau Monne
This three patches allow FreeBSD Xen Dom0 to use Qemu (i.e., launch HVM guests). First patch fixes the usage of ENODATA, which doesn't exist on FreeBSD and is replaced with ENOENT instead. The second patch is more controversial probably, since it introduces a FreeBSD specific version of tap_open

[Qemu-devel] [PATCH v2 1/3] xen: fix usage of ENODATA

2014-05-23 Thread Roger Pau Monne
ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the hypervisor are translated to ENOENT. Also, the error code is returned in errno if the call returns -1, so compare the error code with the value in errno instead of the value returned by the function. Signed-off-by: Roger Pau

[Qemu-devel] [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

2014-05-23 Thread Roger Pau Monne
The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart. This is specially

[Qemu-devel] [PATCH] serial: poll the serial console with G_IO_HUP

2014-04-22 Thread Roger Pau Monne
On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

[Qemu-devel] [PATCH 2/2] tap-bsd: implement a FreeBSD only version of tap_open

2014-04-15 Thread Roger Pau Monne
The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart. This is specially

[Qemu-devel] [PATCH 0/2] qemu-freebsd: fixes for running Xen guests

2014-04-15 Thread Roger Pau Monne
This two patches allow FreeBSD Xen Dom0 to use Qemu (i.e., launch HVM guests). First patch fixes the usage of ENODATA, which doesn't exist on FreeBSD and is replaced with ENOENT instead. The second patch is more controversial probably, since it introduces a FreeBSD specific version of tap_open

[Qemu-devel] [PATCH 1/2] xen: fix usage of ENODATA

2014-04-15 Thread Roger Pau Monne
ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the hypervisor are translated to ENOENT. Also, the error code is returned in errno if the call returns -1, so compare the error code with the value in errno instead of the value returned by the function. Signed-off-by: Roger Pau

[Qemu-devel] [PATCH v2] qemu/xen: make use of xenstore relative paths

2013-09-27 Thread Roger Pau Monne
Qemu has several hardcoded xenstore paths that are only valid on Dom0. Attempts to launch a Qemu instance (to act as a userspace backend for PV disks) will fail because Qemu is not able to access those paths when running on a domain different than Dom0. Instead make the xenstore paths relative to

[Qemu-devel] [PATCH] qemu-xen: make use of xenstore relative paths

2013-09-18 Thread Roger Pau Monne
Qemu has several hardcoded xenstore paths that are only valid on Dom0. Attempts to launch a Qemu instance (to act as a userspace backend for PV disks) will fail because Qemu is not able to access those paths when running on a domain different than Dom0. Instead make the xenstore paths relative to

[Qemu-devel] [PATCH v2] xen_disk: add persistent grant support to xen_disk backend

2013-01-08 Thread Roger Pau Monne
This protocol extension reuses the same set of grant pages for all transactions between the front/back drivers, avoiding expensive tlb flushes, grant table lock contention and switches between userspace and kernel space. The full description of the protocol can be found in the public blkif.h

[Qemu-devel] [PATCH RFC 2/3] xen_disk: fix memory leak

2012-12-31 Thread Roger Pau Monne
On ioreq_release the full ioreq was memset to 0, loosing all the data and memory allocations inside the QEMUIOVector, which leads to a memory leak. Create a new function to specifically reset ioreq. Reported-by: Maik Wessler maik.wess...@yahoo.com Signed-off-by: Roger Pau Monné

[Qemu-devel] [PATCH RFC 0/3] xen pv disk persistent grants implementation

2012-12-31 Thread Roger Pau Monne
This series contains two bug fixes for xen_disk (patches 1 2) and the implementation of the persistent grants extensions (patch 3), that brings a considerable speed improvement. Thanks for the reviews, Roger.

[Qemu-devel] [PATCH RFC 1/3] xen_disk: handle disk files on ramfs/tmpfs

2012-12-31 Thread Roger Pau Monne
Files that reside on ramfs or tmpfs cannot be opened with O_DIRECT, if first call to bdrv_open fails with errno = EINVAL, try a second call without BDRV_O_NOCACHE. Signed-off-by: Roger Pau Monné roger@citrix.com Cc: xen-de...@lists.xen.org Cc: Stefano Stabellini

[Qemu-devel] [PATCH RFC 3/3] xen_disk: add persistent grant support to xen_disk backend

2012-12-31 Thread Roger Pau Monne
This protocol extension reuses the same set of grant pages for all transactions between the front/back drivers, avoiding expensive tlb flushes, grant table lock contention and switches between userspace and kernel space. The full description of the protocol can be found in the public blkif.h

Re: [Qemu-devel] Status of query-netdev QMP command

2012-06-19 Thread Roger Pau Monne
Stefan Hajnoczi wrote: On Mon, Jun 18, 2012 at 3:19 PM, Roger Pau Monneroger@citrix.com wrote: I've read from the GSoC/2010 that some work was being done creating a query-netdev QMP command: http://wiki.qemu.org/Google_Summer_of_Code_2010/QMP#query-netdev The status says that mentor has

[Qemu-devel] Status of query-netdev QMP command

2012-06-18 Thread Roger Pau Monne
Hello, I've read from the GSoC/2010 that some work was being done creating a query-netdev QMP command: http://wiki.qemu.org/Google_Summer_of_Code_2010/QMP#query-netdev The status says that mentor has merged it into his tree, but I cannot see this command anywhere upstream, and it will come

[Qemu-devel] [PATCH] audio: split IN_T into two separate constants

2012-05-18 Thread Roger Pau Monne
and NetBSD 6.0BETA. Cc: Vassili Karpov (malc) av1...@comtv.ru Signed-off-by: Roger Pau Monne roger@citrix.com --- audio/mixeng.c | 36 audio/mixeng_template.h |4 +++- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/audio

Re: [Qemu-devel] [PATCH] audio: split IN_T into two separate constants

2012-05-18 Thread Roger Pau Monne
malc wrote: On Fri, 18 May 2012, Roger Pau Monne wrote: Split IN_T into BSIZE and ITYPE, to avoid expansion if the OS has defined macros for the intX_t and uintX_t types. The IN_T constant is then defined in mixeng_template.h so it can be used by the functions/macros on this header file

Re: [Qemu-devel] [PATCH] audio: fix bug in mixeng_template.h build on NetBSD

2012-05-14 Thread Roger Pau Monne
malc escribió: On Fri, 11 May 2012, Roger Pau Monne wrote: This is a bug fix for rc1, although I think this bug has been present for a long time. If there's a bug than it's within NetBSD itself, this issue has been discussed few times (at least twice it hink) in the past, please search

[Qemu-devel] [PATCH] audio: fix bug in mixeng_template.h build on NetBSD

2012-05-11 Thread Roger Pau Monne
. Cc: Vassili Karpov (malc) av1...@comtv.ru Signed-off-by: Roger Pau Monne roger@citrix.com --- audio/mixeng_template.h | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/audio/mixeng_template.h b/audio/mixeng_template.h index e644c23..33e6b61 100644 --- a/audio

[Qemu-devel] [PATCH 1/3] build: replace librt check function

2012-03-12 Thread Roger Pau Monne
Replace clock_gettime with timer_gettime, since at least under uclibc 0.9.33 the clock_getttime function can be used without linking against librt (although the manual page states the opposite). Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- configure |3 ++- 1 files changed, 2

[Qemu-devel] [PATCH 2/3] build: add librt to libs_qga

2012-03-12 Thread Roger Pau Monne
librt is needed to link qemu-ga. Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- configure |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 68eb3fa..790d495 100755 --- a/configure +++ b/configure @@ -2521,6 +2521,7 @@ if compile_prog

[Qemu-devel] [PATCH 3/3] build: check if libm is needed in configure

2012-03-12 Thread Roger Pau Monne
Remove the hardcoded use of libm and instead rely on configure to check for it. It is needed at least for qemu-ga and qemu-system. Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- Makefile.target |4 configure | 14 ++ 2 files changed, 14 insertions(+), 4

[Qemu-devel] [PATCH 1/3] build: replace librt check function

2012-02-27 Thread Roger Pau Monne
Replace clock_gettime with timer_gettime, since at least under uclibc 0.9.33 the clock_getttime function can be used without linking against librt (although the manual page states the opposite). Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- configure |3 ++- 1 files changed, 2

[Qemu-devel] [PATCH 3/3] build: check if libm is needed in configure

2012-02-27 Thread Roger Pau Monne
Remove the hardcoded use of libm and instead rely on configure to check for it. It is needed at least for qemu-ga and qemu-system. Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- Makefile.target |4 configure | 14 ++ 2 files changed, 14 insertions(+), 4

[Qemu-devel] [PATCH 2/3] build: add librt to libs_qga

2012-02-27 Thread Roger Pau Monne
librt is needed to link qemu-ga. Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- configure |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 68eb3fa..790d495 100755 --- a/configure +++ b/configure @@ -2521,6 +2521,7 @@ if compile_prog

[Qemu-devel] [PATCH 1/2] build: check if libm is needed in configure

2012-02-20 Thread Roger Pau Monne
Remove the hardcoded use of libm and instead rely on configure to check for it. It is needed at least for qemu-ga and qemu-system. Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- Makefile.target |4 configure | 14 ++ 2 files changed, 14 insertions(+), 4

[Qemu-devel] [PATCH 2/2] build: replace librt check function

2012-02-20 Thread Roger Pau Monne
Replace clock_gettime with timer_gettime, since at least under uclibc 0.9.33 the clock_getttime function can be used without linking against librt (although the manual page states the opposite). Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- configure |3 ++- 1 files changed, 2

[Qemu-devel] [PATCH] build: add needed missing libraries libm and librt

2012-02-17 Thread Roger Pau Monne
/3/modf [1] http://linux.die.net/man/2/timer_gettime Signed-off-by: Roger Pau Monne roger@entel.upc.edu --- Makefile|4 ++-- Makefile.target |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 301c75e..e2c3cd4 100644 --- a/Makefile