Re: [PATCH] xen-hvm: Avoid livelock while handling buffered ioreqs

2024-05-23 Thread Ross Lagerwall
On Tue, Apr 9, 2024 at 3:19 PM Ross Lagerwall wrote: > > On Tue, Apr 9, 2024 at 11:20 AM Anthony PERARD > wrote: > > > > On Thu, Apr 04, 2024 at 03:08:33PM +0100, Ross Lagerwall wrote: > > > diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c > >

Re: [PATCH] xen-hvm: Avoid livelock while handling buffered ioreqs

2024-04-09 Thread Ross Lagerwall
On Tue, Apr 9, 2024 at 11:20 AM Anthony PERARD wrote: > > On Thu, Apr 04, 2024 at 03:08:33PM +0100, Ross Lagerwall wrote: > > diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c > > index 1627da739822..1116b3978938 100644 > > --- a/hw/xen/xen-hvm-common.c

Re: [PATCH] xen-hvm: Avoid livelock while handling buffered ioreqs

2024-04-08 Thread Ross Lagerwall
On Sat, Apr 6, 2024 at 11:58 AM Durrant, Paul wrote: > > On 04/04/2024 15:08, Ross Lagerwall wrote: > > A malicious or buggy guest may generated buffered ioreqs faster than > > QEMU can process them in handle_buffered_iopage(). The result is a > > livelock - QEMU continuo

[PATCH] xen-hvm: Avoid livelock while handling buffered ioreqs

2024-04-04 Thread Ross Lagerwall
back to the main loop and catch up. Signed-off-by: Ross Lagerwall --- hw/xen/xen-hvm-common.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 1627da739822..1116b3978938 100644 --- a/hw/xen/xen

Re: [PATCH] main-loop: Avoid some unnecessary poll calls

2024-03-06 Thread Ross Lagerwall
On Mon, Feb 12, 2024 at 11:45 AM Ross Lagerwall wrote: > > A common pattern is seen where a timer fires, the callback does some > work, then rearms the timer which implicitly calls qemu_notify_event(). > > qemu_notify_event() is supposed to interrupt the main loop's

[PATCH] main-loop: Avoid some unnecessary poll calls

2024-02-12 Thread Ross Lagerwall via
f the default main context is currently owned by the caller. i.e. it is being called as part of a poll / timer callback. Adjust the scope of the main context acquire / release to cover the timer callbacks in qemu_clock_run_all_timers(). Signed-off-by: Ross Lagerwall --- util/main-loop.c

[PATCH] xen/pt: Emulate multifunction bit in header type

2023-11-03 Thread Ross Lagerwall via
devices appear as functions in a Xen guest. Signed-off-by: Ross Lagerwall --- hw/xen/xen_pt_config_init.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index 2b8680b112fa..e6ec32e3ccd2 100644 --- a/hw/xen

[PATCH] ps2: Don't send key release event for Lang1, Lang2 keys

2023-02-27 Thread Ross Lagerwall via
ensures that Windows behaves correctly and interprets it as a single keypress rather than two consecutive keypresses. Signed-off-by: Ross Lagerwall --- hw/input/ps2.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 3253ab6a92..45af76a837 100644 --- a/hw

[PATCH] tpm_crb: Avoid backend startup just before shutdown under Xen

2022-08-26 Thread Ross Lagerwall via
-off-by: Ross Lagerwall --- This conditional logic is ugly. Is there a cleaner way of doing this? hw/tpm/tpm_crb.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c index 67db594c48..ea930da545 100644 --- a/hw/tpm/tpm_crb.c +++ b/hw/tpm

[PATCH] tpm_emulator: Avoid double initialization during migration

2022-08-01 Thread Ross Lagerwall via
: Ross Lagerwall --- backends/tpm/tpm_emulator.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c index 87d061e9bb..9b50c5b3e2 100644 --- a/backends/tpm/tpm_emulator.c +++ b/backends/tpm/tpm_emulator.c @@ -32,6 +32,7

[PATCH] xen/pt: Avoid initializing BARs from the host ones

2022-04-27 Thread Ross Lagerwall via
PTReg consistently and rename the existing emu_mask in XenPTRegInfo to emu_mask_init to help with refactoring. Signed-off-by: Ross Lagerwall --- hw/xen/xen_pt.c | 2 +- hw/xen/xen_pt.h | 5 +- hw/xen/xen_pt_config_init.c | 221 ++-- 3

[PATCH v2] xen-mapcache: Avoid entry->lock overflow

2022-01-24 Thread Ross Lagerwall via
(since remap is not atomic). Avoid this overflow by increasing the lock field to a uint32_t and also detect it and abort rather than continuing regardless. Signed-off-by: Ross Lagerwall --- Changes in v2: Change type to uint32_t since there is a hole there anyway. The struct size remains at 48

[PATCH] xen-mapcache: Avoid entry->lock overflow

2022-01-21 Thread Ross Lagerwall via
(since remap is not atomic). Avoid this overflow by increasing the lock field to a uint16_t and also detect it and abort rather than continuing regardless. Signed-off-by: Ross Lagerwall --- hw/i386/xen/xen-mapcache.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw

Re: [Qemu-devel] [PATCH 16/16] nvme: support multiple namespaces

2019-11-04 Thread Ross Lagerwall
On 11/4/19 9:04 AM, Klaus Birkelund wrote: > On Mon, Nov 04, 2019 at 08:46:29AM +0000, Ross Lagerwall wrote: >> On 8/23/19 9:10 AM, Klaus Birkelund wrote: >>> On Thu, Aug 22, 2019 at 02:18:05PM +0100, Ross Lagerwall wrote: >>>> On 7/5/19 8:23 AM, Klaus Birkelund J

Re: [Qemu-devel] [PATCH 16/16] nvme: support multiple namespaces

2019-11-04 Thread Ross Lagerwall
On 8/23/19 9:10 AM, Klaus Birkelund wrote: > On Thu, Aug 22, 2019 at 02:18:05PM +0100, Ross Lagerwall wrote: >> On 7/5/19 8:23 AM, Klaus Birkelund Jensen wrote: >> >> I tried this patch series by installing Windows with a single NVME >> controller having two namespaces.

Re: [Qemu-devel] [PATCH 16/16] nvme: support multiple namespaces

2019-08-22 Thread Ross Lagerwall
ed to be working well. Thanks for your work on this patch series. Thanks, -- Ross Lagerwall

[Qemu-devel] [PATCH] xen_pt: Present the size of 64 bit BARs correctly

2018-05-14 Thread Ross Lagerwall
The full size of the BAR is stored in the lower PCIIORegion.size. The upper PCIIORegion.size is 0. Calculate the size of the upper half correctly from the lower half otherwise the size read by the guest will be incorrect. Signed-off-by: Ross Lagerwall --- hw/xen/xen_pt_config_init.c | 2 ++ 1

Re: [Qemu-devel] [PATCH] vga: fix region calculation

2018-03-08 Thread Ross Lagerwall
. Fixes: CVE-2018- Cc: P J P Cc: Ross Lagerwall Signed-off-by: Gerd Hoffmann --- Tested-by: Ross Lagerwall Thanks! -- Ross Lagerwall

[Qemu-devel] [PATCH] migration/xen: Check return value of qemu_fclose

2018-02-06 Thread Ross Lagerwall
(). Signed-off-by: Ross Lagerwall --- migration/savevm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index b7908f6..4b9d5be 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2267,8 +2267,7 @@ void qmp_xen_save_devices_state

Re: [Qemu-devel] [PATCH v5 0/8] xen: xen-domid-restrict improvements

2018-01-24 Thread Ross Lagerwall
#x27;s the status of this patch series? There don't seem to be many outstanding complaints but they haven't been pushed into master. At least the Xen changes have all been reviewed by Anthony (except for configure changes) so they could probably go in. Thanks, -- Ross Lagerwall

Re: [Qemu-devel] [PATCH v2 1/4] migration: Don't leak IO channels

2018-01-18 Thread Ross Lagerwall
On 11/01/2017 02:25 PM, Ross Lagerwall wrote: Since qemu_fopen_channel_{in,out}put take references on the underlying IO channels, make sure to release our references to them. Signed-off-by: Ross Lagerwall --- New in v2. migration/savevm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [Qemu-devel] [PATCH v2 0/4] QIOChannelFile bug fixes

2018-01-18 Thread Ross Lagerwall
On 11/01/2017 02:25 PM, Ross Lagerwall wrote: Hi, Here is a bug fix with the use of QIOChannelFile and 2 bug fixes and an improvement to implementation of QIOChannelFile. Regards, Ross Lagerwall Ross Lagerwall (4): migration: Don't leak IO channels io: Fix QIOChannelFile when cre

Re: [Qemu-devel] QMP event missed during startup

2017-11-10 Thread Ross Lagerwall
On 11/09/2017 02:14 PM, Markus Armbruster wrote: "Dr. David Alan Gilbert" writes: * Ross Lagerwall (ross.lagerw...@citrix.com) wrote: Hi, I have found an issue where QEMU emits the RESUME event during startup when it starts VM execution, but it is not possible to receive this

[Qemu-devel] [PATCH v2 4/4] io: Add /dev/fdset/ support to QIOChannelFile

2017-11-01 Thread Ross Lagerwall
Add /dev/fdset/ support to QIOChannelFile by calling qemu_open() instead of open() and qemu_close() instead of close(). There is a subtle semantic change since qemu_open() automatically sets O_CLOEXEC, but this doesn't affect any of the users of the function. Signed-off-by: Ross Lage

[Qemu-devel] [PATCH v2 2/4] io: Fix QIOChannelFile when creating and opening read-write

2017-11-01 Thread Ross Lagerwall
change the existing testcase to check that the mode of the created file is correct. Signed-off-by: Ross Lagerwall --- Changed in v2: * Separated from qemu_open() change. include/io/channel-file.h| 2 +- io/channel-file.c| 6 +- tests/test-io-channel-file.c | 29

[Qemu-devel] [PATCH v2 0/4] QIOChannelFile bug fixes

2017-11-01 Thread Ross Lagerwall
Hi, Here is a bug fix with the use of QIOChannelFile and 2 bug fixes and an improvement to implementation of QIOChannelFile. Regards, Ross Lagerwall Ross Lagerwall (4): migration: Don't leak IO channels io: Fix QIOChannelFile when creating and opening read-write io: Don't

[Qemu-devel] [PATCH v2 1/4] migration: Don't leak IO channels

2017-11-01 Thread Ross Lagerwall
Since qemu_fopen_channel_{in,out}put take references on the underlying IO channels, make sure to release our references to them. Signed-off-by: Ross Lagerwall --- New in v2. migration/savevm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index

[Qemu-devel] [PATCH v2 3/4] io: Don't call close multiple times in QIOChannelFile

2017-11-01 Thread Ross Lagerwall
If the file descriptor underlying QIOChannelFile is closed in the io_close() method, don't close it again in the finalize() method since the file descriptor number may have been reused in the meantime. Signed-off-by: Ross Lagerwall --- New in v2. io/channel-file.c | 1 + 1 file chang

Re: [Qemu-devel] [PATCH] io: Fix QIOChannelFile when creating and opening read-write

2017-11-01 Thread Ross Lagerwall
On 11/01/2017 10:04 AM, Daniel P. Berrange wrote: On Tue, Oct 31, 2017 at 04:09:02PM +, Ross Lagerwall wrote: The code wrongly passes the mode to open() only if O_WRONLY is set. Instead, the mode should be passed when O_CREAT is set (or O_TMPFILE on Linux). Fix this by always passing the

[Qemu-devel] [PATCH] io: Fix QIOChannelFile when creating and opening read-write

2017-10-31 Thread Ross Lagerwall
at it, add /dev/fdset/ support to QIOChannelFile by calling qemu_open() instead open(). There is a subtle semantic change since qemu_open() automatically sets O_CLOEXEC, but this doesn't affect any of the users of the function. Signed-off-by: Ross Lagerwall --- include/io/channel-file.h

[Qemu-devel] QMP event missed during startup

2017-10-30 Thread Ross Lagerwall
just a bug that should be fixed? Thanks, -- Ross Lagerwall

Re: [Qemu-devel] [PATCH v1] os-posix: Add -unshare option

2017-10-23 Thread Ross Lagerwall
On 10/23/2017 03:50 PM, Daniel P. Berrange wrote: On Mon, Oct 23, 2017 at 03:30:05PM +0100, Ross Lagerwall wrote: On 10/19/2017 05:24 PM, Daniel P. Berrange wrote: On Thu, Oct 19, 2017 at 05:04:19PM +0100, Ross Lagerwall wrote: Add an option to allow calling unshare() just before starting

Re: [Qemu-devel] [PATCH v1] os-posix: Add -unshare option

2017-10-23 Thread Ross Lagerwall
On 10/19/2017 05:24 PM, Daniel P. Berrange wrote: On Thu, Oct 19, 2017 at 05:04:19PM +0100, Ross Lagerwall wrote: Add an option to allow calling unshare() just before starting guest execution. The option allows unsharing one or more of the mount namespace, the network namespace, and the IPC

[Qemu-devel] [PATCH v1] os-posix: Add -unshare option

2017-10-19 Thread Ross Lagerwall
even to other processes on the same machine. Signed-off-by: Ross Lagerwall --- os-posix.c | 34 ++ qemu-options.hx | 14 ++ 2 files changed, 48 insertions(+) diff --git a/os-posix.c b/os-posix.c index b9c2343..cfc5c38 100644 --- a/os-posix.c +++

Re: [Qemu-devel] [PATCH 3/8] xen: defer call to xen_restrict until just before os_setup_post

2017-10-13 Thread Ross Lagerwall
s its new root has a /dev/null). -- Ross Lagerwall

[Qemu-devel] [PATCH] xen: Log errno rather than return value

2017-10-11 Thread Ross Lagerwall
xen_modified_memory() sets errno to communicate what went wrong so log this rather than the return value which is not interesting. Signed-off-by: Ross Lagerwall --- hw/i386/xen/xen-hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen

Re: [Qemu-devel] [Xen-devel] [PATCH v2 0/*] xen: xen-domid-restrict improvements

2017-10-10 Thread Ross Lagerwall
On 10/06/2017 02:19 PM, Paul Durrant wrote: -Original Message- From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of Ross Lagerwall Sent: 06 October 2017 13:58 To: Ian Jackson ; qemu-devel@nongnu.org Cc: Anthony Perard ; xen- de...@lists.xenproject.org; Stefano Stabellini

Re: [Qemu-devel] [PATCH v2 0/*] xen: xen-domid-restrict improvements

2017-10-06 Thread Ross Lagerwall
ctory has to contain a valid /dev/null. This is a bit annoying and prevents the chroot being on a "nodev" mount. Regards, -- Ross Lagerwall

Re: [Qemu-devel] [PATCH 7/8] os-posix: Provide new -runasid option

2017-10-06 Thread Ross Lagerwall
user_gid) < 0) { fprintf(stderr, "Failed to setuid(%d)\n", user_pwd->pw_uid); exit(1); } This last one should be user_uid, not user_gid. -- Ross Lagerwall

[Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

2017-08-23 Thread Ross Lagerwall
RTC. This patch by itself doesn't affect any of the toolstacks that I checked; the libxl toolstack doesn't currently handle this event nor does the XAPI toolstack. If nothing handles the event, it is simply ignored. We plan on modifying XAPI to handle it. Signed-off-by: Ross

Re: [Qemu-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

2017-08-22 Thread Ross Lagerwall
On 08/21/2017 11:30 PM, Stefano Stabellini wrote: On Mon, 21 Aug 2017, Ross Lagerwall wrote: When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP message when this happens rather than ignoring it so that something useful can be done with

[Qemu-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

2017-08-21 Thread Ross Lagerwall
When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP message when this happens rather than ignoring it so that something useful can be done with the information. Signed-off-by: Ross Lagerwall --- hw/i386/xen/xen-hvm.c | 2 ++ 1 file changed

[Qemu-devel] [PATCH v2] xen-platform: Cleanup network infrastructure when emulated NICs are unplugged

2017-06-30 Thread Ross Lagerwall
When the guest unplugs the emulated NICs, cleanup the peer for each NIC as it is not needed anymore. Most importantly, this allows the tap interfaces which QEMU holds open to be closed and removed. Signed-off-by: Ross Lagerwall --- In v2: Don't call nic_cleanup(), just remove the peer o

[Qemu-devel] [PATCH] xen-platform: Cleanup network infrastructure when emulated NICs are unplugged

2017-06-19 Thread Ross Lagerwall
When the guest unplugs the emulated NICs, call net_cleanup() to cleanup the network infrastructure in QEMU as it is not needed anymore. Most importantly, this allows the tap interfaces which QEMU holds open to be closed and removed. Signed-off-by: Ross Lagerwall --- hw/i386/xen/xen_platform.c