Re: [Xen-devel] [PATCH v3 10/25] usb-redir: Verify usbredirparser_write get called with positive count

2019-02-19 Thread Gerd Hoffmann
On Wed, Feb 20, 2019 at 02:02:17AM +0100, Philippe Mathieu-Daudé wrote: > The usbredirparser_write handler should never be called with a negative > size payload, return an error if this is not the case. > Now that we are sure the 'count' value is positive, make it obvious by > casting it to a size_

Re: [Xen-devel] [PATCH v3 08/25] ui/gtk: Remove pointless cast

2019-02-19 Thread Gerd Hoffmann
On Wed, Feb 20, 2019 at 02:02:15AM +0100, Philippe Mathieu-Daudé wrote: > The 'size' value is of type 'guint' which is already unsigned. > Remove the useless cast. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann ___ Xen-devel ma

Re: [Xen-devel] [PATCH v3 03/25] chardev/wctablet: Use unsigned type to hold unsigned value

2019-02-19 Thread Gerd Hoffmann
On Wed, Feb 20, 2019 at 02:02:10AM +0100, Philippe Mathieu-Daudé wrote: > TabletChardev::query is an array of uint8_t. > Use the same type to hold it (this also silent a -Wsign-conversion > warning in the trace function). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann > -

Re: [Xen-devel] [PATCH for-4.12] libs/gnttab: add missing FreeBSD functions

2019-02-19 Thread Oleksandr Andrushchenko
On 2/19/19 5:26 PM, Roger Pau Monne wrote: > The FreeBSD implementation is missing the following functions: > > osdep_gnttab_dmabuf_exp_from_refs > osdep_gnttab_dmabuf_exp_wait_released > osdep_gnttab_dmabuf_imp_to_refs > osdep_gnttab_dmabuf_imp_release > > Which all deal with dmabufs, that only ex

[Xen-devel] [PATCH] x86/pmtimer: Fix hvm_acpi_sleep_button behavior

2019-02-19 Thread Varad Gautam
Commit 19fb14622e941 "x86/pmtimer: move ACPI registers from PMTState to hvm_domain" misconfigures pm1a_sts for hvm_acpi_sleep_button with PWRBTN_STS instead of SLPBTN_STS, which leads to XEN_DOMCTL_SENDTRIGGER_SLEEP causing guest powerdowns. Fix this. Signed-off-by: Varad Gautam CC: Amit Shah CC

[Xen-devel] [RESEND PATCH 3/7] mm/gup: Change GUP fast to use flags rather than a write 'bool'

2019-02-19 Thread ira . weiny
From: Ira Weiny To facilitate additional options to get_user_pages_fast() change the singular write parameter to be gup_flags. This patch does not change any functionality. New functionality will follow in subsequent patches. Some of the get_user_pages_fast() call sites were unchanged because

[Xen-devel] [RESEND PATCH 2/7] mm/gup: Change write parameter to flags in fast walk

2019-02-19 Thread ira . weiny
From: Ira Weiny In order to support more options in the GUP fast walk, change the write parameter to flags throughout the call stack. This patch does not change functionality and passes FOLL_WRITE where write was previously used. Signed-off-by: Ira Weiny --- mm/gup.c | 52

[Xen-devel] [RESEND PATCH 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-02-19 Thread ira . weiny
From: Ira Weiny DAX pages were previously unprotected from longterm pins when users called get_user_pages_fast(). Use the new FOLL_LONGTERM flag to check for DEVMAP pages and fall back to regular GUP processing if a DEVMAP page is encountered. Signed-off-by: Ira Weiny --- mm/gup.c | 24 ++

[Xen-devel] [RESEND PATCH 0/7] Add FOLL_LONGTERM to GUP fast and use it

2019-02-19 Thread ira . weiny
From: Ira Weiny Resending these as I had only 1 minor comment which I believe we have covered in this series. I was anticipating these going through the mm tree as they depend on a cleanup patch there and the IB changes are very minor. But they could just as well go through the IB tree. NOTE:

[Xen-devel] [RESEND PATCH 1/7] mm/gup: Replace get_user_pages_longterm() with FOLL_LONGTERM

2019-02-19 Thread ira . weiny
From: Ira Weiny Rather than have a separate get_user_pages_longterm() call, introduce FOLL_LONGTERM and change the longterm callers to use it. This patch does not change any functionality. FOLL_LONGTERM can only be supported with get_user_pages() as it requires vmas to determine if DAX is in us

[Xen-devel] [RESEND PATCH 7/7] IB/mthca: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-02-19 Thread ira . weiny
From: Ira Weiny Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against FS DAX pages being mapped. Signed-off-by: Ira Weiny --- drivers/infiniband/hw/mthca/mthca_memfree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mthca/mthca_memf

[Xen-devel] [RESEND PATCH 5/7] IB/hfi1: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-02-19 Thread ira . weiny
From: Ira Weiny Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against FS DAX pages being mapped. Signed-off-by: Ira Weiny --- drivers/infiniband/hw/hfi1/user_pages.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/user_pages.

[Xen-devel] [RESEND PATCH 6/7] IB/qib: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-02-19 Thread ira . weiny
From: Ira Weiny Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against FS DAX pages being mapped. Signed-off-by: Ira Weiny --- drivers/infiniband/hw/qib/qib_user_sdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c

[Xen-devel] [linux-4.19 test] 133304: regressions - trouble: blocked/broken/fail/pass

2019-02-19 Thread osstest service owner
flight 133304 linux-4.19 real [real] http://logs.test-lab.xenproject.org/osstest/logs/133304/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-pair broken test-amd64-i386-xl-qemut-win10-i386

Re: [Xen-devel] [PATCH v3 15/25] spapr-vty: Let vty_putchars() use size_t

2019-02-19 Thread David Gibson
On Wed, Feb 20, 2019 at 02:02:22AM +0100, Philippe Mathieu-Daudé wrote: > Both callers (h_put_term_char and rtas_display_character) use > an unsigned value. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson > --- > hw/char/spapr_vty.c| 2 +- > include/hw/ppc/spapr_vio.h

[Xen-devel] [libvirt test] 133306: regressions - trouble: broken/fail/pass

2019-02-19 Thread osstest service owner
flight 133306 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/133306/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-libvirt-xsm broken test-amd64-i386-libvirt-xsm 4 host-install(4

[Xen-devel] [PATCH v3 22/25] s390x/sclp: Let write_console_data() take a size_t

2019-02-19 Thread Philippe Mathieu-Daudé
Since all callers provide an unsigned value, we can safely use a size_t argument. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sclpconsole-lm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index 48c76d863e..290d3118a

[Xen-devel] [PATCH v3 23/25] hw/ipmi: Assert outlen > outpos

2019-02-19 Thread Philippe Mathieu-Daudé
A througfull audit show that all time data is added to outbuf[], 'outlen' is incremented. Then at creation and each time continue_send() returns it pass thru check_reset which resets 'outpos', thus we always have 'outlen >= outpos'. Also due to the check on entry, we know outlen != 0. We can then a

[Xen-devel] [PATCH v3 25/25] chardev: Let qemu_chr_write[_all] use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
We now know all callers use a size_t argument. We can convert qemu_chr_write() and qemu_chr_write_all() to use a size_t argument. Signed-off-by: Philippe Mathieu-Daudé --- chardev/char.c | 8 include/chardev/char.h | 2 +- include/sysemu/replay.h | 2 +- replay/replay-char.c

[Xen-devel] [PATCH v3 24/25] chardev: Let qemu_chr_fe_write[_all] use size_t type argument

2019-02-19 Thread Philippe Mathieu-Daudé
All caller have been audited and call these functions with unsigned arguments. Most of them use a size_t argument, or directly pass sizeof(). One case is unclear: the mux_chr_write() call in chardev/char-mux.c. There we add an assert (which will be removed in few patches) and cast the parameter a

[Xen-devel] [PATCH v3 21/25] s390x/sclp: Use size_t in process_mdb()

2019-02-19 Thread Philippe Mathieu-Daudé
Since it is unlikely we have sizeof(mdbo->mto.message) < 0, we can convert this variable to an unsigned type. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sclpconsole-lm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm

[Xen-devel] [PATCH v3 18/25] s390x/3270: Let insert_IAC_escape_char() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
This function takes size_t argument and return a size_t. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/terminal3270.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index 35b079d5c4..1cb48a3c6f 100644 --- a/hw/char/t

[Xen-devel] [PATCH v3 20/25] s390x/sclp: Use a const variable to improve readability

2019-02-19 Thread Philippe Mathieu-Daudé
We will reuse this variable in the next patch. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sclpconsole-lm.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index dbc91a1e5b..49543e2c83 100644 --- a/hw/char/sclpc

[Xen-devel] [PATCH v3 19/25] s390/ebcdic: Use size_t to iterate over arrays

2019-02-19 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/s390x/ebcdic.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/s390x/ebcdic.h b/include/hw/s390x/ebcdic.h index 69a04cab62..d89174e113 100644 --- a/include/hw/s390x/ebcdic.h +++ b/include/hw/s390x/ebcdic.h

[Xen-devel] [PATCH v3 16/25] tpm: Use size_t to hold sizes

2019-02-19 Thread Philippe Mathieu-Daudé
Avoid to use a signed type to hold an unsigned value. Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/tpm_emulator.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c index 70f4b10284..931e56f6ed 100644 --- a/hw/tpm/tpm_emul

[Xen-devel] [PATCH v3 17/25] net/filter-mirror: Use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
Since iov_size() returns a size_t, no need to use a signed type. Signed-off-by: Philippe Mathieu-Daudé --- net/filter-mirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 3a61cf21e8..97b52d0544 100644 --- a/net/filter-mirror

[Xen-devel] [PATCH v3 11/25] xen: Let xencons_send() take a 'size' argument

2019-02-19 Thread Philippe Mathieu-Daudé
The single caller of xencons_send(), con_event() already use the difference 'con->buffer.size - con->buffer.consumed'. Deduplicate by passing the difference as an argument. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/xen_console.c | 12 +++- 1 file changed, 7 insertions(+), 5 delet

[Xen-devel] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
Both callers in hw/char/virtio-serial-bus.c provide unsigned values, even the trace event display an unsigned value. Convert the have_data() handler to take an unsigned value. Signed-off-by: Philippe Mathieu-Daudé --- It is funny/scary that there are big comments about how to treat errors to set

[Xen-devel] [PATCH v3 10/25] usb-redir: Verify usbredirparser_write get called with positive count

2019-02-19 Thread Philippe Mathieu-Daudé
The usbredirparser_write handler should never be called with a negative size payload, return an error if this is not the case. Now that we are sure the 'count' value is positive, make it obvious by casting it to a size_t. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/redirect.c | 6 +- 1

[Xen-devel] [PATCH v3 15/25] spapr-vty: Let vty_putchars() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
Both callers (h_put_term_char and rtas_display_character) use an unsigned value. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/spapr_vty.c| 2 +- include/hw/ppc/spapr_vio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.

[Xen-devel] [PATCH v3 12/25] xen: Let buffer_append() return the size consumed

2019-02-19 Thread Philippe Mathieu-Daudé
The buffer.size and buffer.consumed fields are only updated within the buffer_append() body. We can simply let buffer_append() return the difference (the buffer consumed). Signed-off-by: Philippe Mathieu-Daudé --- hw/char/xen_console.c | 13 - 1 file changed, 8 insertions(+), 5 delet

[Xen-devel] [RFC PATCH v3 13/25] xen: Let buffer_append() return a size_t

2019-02-19 Thread Philippe Mathieu-Daudé
To the Xen team: this is not trivial to me to demonstrate this assertion can never happen, but then the whole series is justified and I can convert qemu_chr_fe_write() to use size_t argument. Can you help me here? Signed-off-by: Philippe Mathieu-Daudé --- hw/char/xen_console.c | 1 + 1 file chan

[Xen-devel] [PATCH v3 09/25] vhost-user: Express sizeof with size_t

2019-02-19 Thread Philippe Mathieu-Daudé
VHOST_USER_HDR_SIZE uses offsetof(), thus is an expression of type size_t. Update the format string accordingly. Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/vhost-user.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/

[Xen-devel] [PATCH v3 07/25] gdbstub: Let put_buffer() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
All callers provide a size_t argument, we can safely use size_t for this function. Signed-off-by: Philippe Mathieu-Daudé --- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 69340d7cd1..860e9bb7c7 100644 --- a/gdbstub.c +++ b/gdbstub.c

[Xen-devel] [PATCH v3 08/25] ui/gtk: Remove pointless cast

2019-02-19 Thread Philippe Mathieu-Daudé
The 'size' value is of type 'guint' which is already unsigned. Remove the useless cast. Signed-off-by: Philippe Mathieu-Daudé --- ui/gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index 949b143e4e..b5879fdece 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@

[Xen-devel] [PATCH v3 05/25] gdbstub: Use size_t for strlen() return value

2019-02-19 Thread Philippe Mathieu-Daudé
Since strlen() returns an unsigned value, it is pointless to convert it to a signed one. Use size_t to hold its return value. Signed-off-by: Philippe Mathieu-Daudé --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index bc774ae992..76eca3bb7e

[Xen-devel] [PATCH v3 04/25] chardev: Let qemu_chr_be_can_write() return a size_t types

2019-02-19 Thread Philippe Mathieu-Daudé
In the previous commit we added an assert to be sure than qemu_chr_be_can_write() will never return a negative value. We can now change its prototype to return a size_t. Adapt the backends accordingly. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- chardev/baum.c

[Xen-devel] [PATCH v3 06/25] gdbstub: Use size_t to hold GDBState::last_packet_len

2019-02-19 Thread Philippe Mathieu-Daudé
In put_packet_binary() we have: uint8_t *p; for(;;) { p = s->last_packet; *(p++) = ... s->last_packet_len = p - s->last_packet; put_buffer(s, (uint8_t *)s->last_packet, s->last_packet_len); The 'p' pointer start at s->last_packet, then is only incremented.

[Xen-devel] [PATCH v3 02/25] chardev: Assert IOCanReadHandler can not be negative

2019-02-19 Thread Philippe Mathieu-Daudé
The backend should not return a negative length to read. We will later change the prototype of IOCanReadHandler to return an unsigned length. Meanwhile make sure the return length is positive. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- chardev/char.c | 5 - 1 file

[Xen-devel] [PATCH v3 01/25] chardev: Simplify IOWatchPoll::fd_can_read as a GSourceFunc

2019-02-19 Thread Philippe Mathieu-Daudé
IOWatchPoll::fd_can_read() really is a GSourceFunc type, it simply returns a boolean value. Update the backends to return a boolean, whether there is data to read from the source or not. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- chardev/char-fd.c | 4 ++-- ch

[Xen-devel] [PATCH v3 00/25] chardev: Convert qemu_chr_write() to take a size_t argument

2019-02-19 Thread Philippe Mathieu-Daudé
Hi, This series convert the chardev::qemu_chr_write() to take unsigned length argument. To do so I went through all caller and checked if there are no negative value possible. I'm having headaches with the Xen backend, talking with Marc-André he suggested I ask help to the Xen maintainers. Since

[Xen-devel] [PATCH v3 03/25] chardev/wctablet: Use unsigned type to hold unsigned value

2019-02-19 Thread Philippe Mathieu-Daudé
TabletChardev::query is an array of uint8_t. Use the same type to hold it (this also silent a -Wsign-conversion warning in the trace function). Signed-off-by: Philippe Mathieu-Daudé --- chardev/trace-events | 2 +- chardev/wctablet.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)

[Xen-devel] [ovmf test] 133305: trouble: broken/pass

2019-02-19 Thread osstest service owner
flight 133305 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/133305/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-qemuu-ovmf-amd64 broken test-amd64-i386-xl-qe

Re: [Xen-devel] xen/evtchn and forced threaded irq

2019-02-19 Thread Boris Ostrovsky
On Tue, Feb 19, 2019 at 05:31:10PM +, Julien Grall wrote: > Hi all, > > I have been looking at using Linux RT in Dom0. Once the guest is started, > the console is ending to have a lot of warning (see trace below). > > After some investigation, this is because the irq handler will now be > th

[Xen-devel] [qemu-mainline test] 133302: regressions - trouble: broken/fail/pass

2019-02-19 Thread osstest service owner
flight 133302 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/133302/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-rtds broken test-amd64-i386-pair

Re: [Xen-devel] [admin] [Pkg-xen-devel] [BUG] task jbd2/xvda4-8:174 blocked for more than 120 seconds.

2019-02-19 Thread Samuel Thibault
Dongli Zhang, le lun. 18 févr. 2019 08:09:56 +0800, a ecrit: > > > On 2/18/19 5:29 AM, Samuel Thibault wrote: > > Hello, > > > > Dongli Zhang, le mar. 12 févr. 2019 12:11:20 +0800, a ecrit: > >> On 02/12/2019 06:10 AM, Samuel Thibault wrote: > >>> Hans van Kranenburg, le lun. 11 févr. 2019 22:59

Re: [Xen-devel] [PATCH 4/4] x86/vmx: Properly flush the TLB when an altp2m is modified

2019-02-19 Thread Razvan Cojocaru
On 2/20/19 12:18 AM, Andrew Cooper wrote: > Modificaitons to an altp2m mark the p2m as needing flushing, but this was > never wired up in the return-to-guest path. As a result, stale TLB entries > can remain after resuming the guest. > > In practice, this manifests as a missing EPT_VIOLATION or #

Re: [Xen-devel] [PATCH 2/4] x86/altp2m: Rework #VE enable/disable paths

2019-02-19 Thread Razvan Cojocaru
On 2/20/19 12:18 AM, Andrew Cooper wrote: > Split altp2m_vcpu_{enable,disable}_ve() out of the > HVMOP_altp2m_vcpu_{enable,disable}_notify marshalling logic. A future change > is going to need to call altp2m_vcpu_disable_ve() from the domain_kill() path. > > While at it, clean up the logic in alt

[Xen-devel] [PATCH] drm: add func to better detect wether swiotlb is needed

2019-02-19 Thread Michael D Labriola
This commit fixes DRM failures on Xen PV systems that were introduced in v4.17 by the following commits: 82626363 drm: add func to get max iomem address v2 fd5fd480 drm/amdgpu: only enable swiotlb alloc when need v2 1bc3d3cc drm/radeon: only enable swiotlb path when need v2 The introduction of ->

Re: [Xen-devel] [PATCH 1/4] xen/common: Break domain_unmap_resources() out of domain_kill()

2019-02-19 Thread Andrew Cooper
On 19/02/2019 22:39, Razvan Cojocaru wrote: > On 2/20/19 12:18 AM, Andrew Cooper wrote: >> A subsequent change is going to need an x86-specific unmapping step, so take >> the opportunity to split the current vcpu unmapping out into a dedicated >> path. >> >> No practical change. >> >> Signed-off-b

Re: [Xen-devel] [PATCH 1/4] xen/common: Break domain_unmap_resources() out of domain_kill()

2019-02-19 Thread Razvan Cojocaru
On 2/20/19 12:18 AM, Andrew Cooper wrote: > A subsequent change is going to need an x86-specific unmapping step, so take > the opportunity to split the current vcpu unmapping out into a dedicated path. > > No practical change. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Wei L

[Xen-devel] [PATCH 4/4] x86/vmx: Properly flush the TLB when an altp2m is modified

2019-02-19 Thread Andrew Cooper
Modificaitons to an altp2m mark the p2m as needing flushing, but this was never wired up in the return-to-guest path. As a result, stale TLB entries can remain after resuming the guest. In practice, this manifests as a missing EPT_VIOLATION or #VE exception when the guest subsequently accesses a

[Xen-devel] [PATCH 1/4] xen/common: Break domain_unmap_resources() out of domain_kill()

2019-02-19 Thread Andrew Cooper
A subsequent change is going to need an x86-specific unmapping step, so take the opportunity to split the current vcpu unmapping out into a dedicated path. No practical change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné CC: Razvan Cojocaru CC: Tamas K Le

[Xen-devel] [PATCH 2/4] x86/altp2m: Rework #VE enable/disable paths

2019-02-19 Thread Andrew Cooper
Split altp2m_vcpu_{enable,disable}_ve() out of the HVMOP_altp2m_vcpu_{enable,disable}_notify marshalling logic. A future change is going to need to call altp2m_vcpu_disable_ve() from the domain_kill() path. While at it, clean up the logic in altp2m_vcpu_{initialise,destroy}(). altp2m_vcpu_reset()

[Xen-devel] [PATCH 3/4] x86/vmx: Fix security issue when a guest balloons out the #VE info page

2019-02-19 Thread Andrew Cooper
The logic in altp2m_vcpu_{en,dis}able_ve() and vmx_vcpu_update_vmfunc_ve() is dangerous. After #VE has been set up, the guest can balloon out and free the nominated GFN, after which the processor may write to it. Also, the unlocked GFN query means the MFN is stale by the time it is used. Alterna

[Xen-devel] [PATCH tentitively for-4.12 0/4] x86/altp2m: Fix multiple security issues

2019-02-19 Thread Andrew Cooper
There are no XSAs because altp2m isn't security supported. However, it would be very nice to have it in a less broken state for 4.12. Overall the risk of regression to other parts of Xen is minimal, as most of these changes are only in altp2m-enabled paths. Andrew Cooper (4): xen/common: Break

[Xen-devel] [xen-unstable test] 133300: trouble: broken/fail/pass

2019-02-19 Thread osstest service owner
flight 133300 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/133300/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-qemuu-ws16-amd64 broken Tests which a

Re: [Xen-devel] [PATCH SpectreV1+L1TF v6 8/9] common/grant_table: block speculative out-of-bound accesses

2019-02-19 Thread Norbert Manthey
On 2/18/19 17:08, Jan Beulich wrote: On 18.02.19 at 14:49, wrote: >> On 2/15/19 11:34, Jan Beulich wrote: >> On 15.02.19 at 10:55, wrote: On 2/13/19 12:50, Jan Beulich wrote: On 08.02.19 at 14:44, wrote: >> Guests can issue grant table operations and provide guest cont

Re: [Xen-devel] [PATCH] iommu: leave IOMMU enabled by default during kexec crash transition

2019-02-19 Thread Andrew Cooper
On 19/02/2019 07:43, Jan Beulich wrote: > >>> An option is left for compatibility with ancient crash kernels which >>> didn't like to have IOMMU active under their feet on boot. >>> >>> Signed-off-by: Igor Druzhinin >> To provide a bit of extra background, it turns out that in hindsight, >> turnin

Re: [Xen-devel] Enhancing Xen's Kconfig infrastructure to support tailored solutions

2019-02-19 Thread P S
On Feb 19, 2019, at 14:13, Stefano Stabellini wrote: > >> On Mon, 18 Feb 2019, Lars Kurth wrote: >> On 18 Feb 2019, at 12:16, George Dunlap >> wrote: >> >> On 2/18/19 12:11 PM, George Dunlap wrote: >> On 2/18/19 12:01 PM, Andrew Cooper wrote: >>On 18/02/2019 11:57, Wei Li

[Xen-devel] [linux-next test] 133298: regressions - FAIL

2019-02-19 Thread osstest service owner
flight 133298 linux-next real [real] http://logs.test-lab.xenproject.org/osstest/logs/133298/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-qemut-rhel6hvm-amd 12 guest-start/redhat.repeat fail REGR. vs. 133280 test-armhf-a

Re: [Xen-devel] [PATCH] x86/pmtimer: Fix hvm_acpi_sleep_button behavior

2019-02-19 Thread Andrew Cooper
On 19/02/2019 17:40, Varad Gautam wrote: > Commit 19fb14622e941 "x86/pmtimer: move ACPI registers from PMTState to > hvm_domain" misconfigures pm1a_sts for hvm_acpi_sleep_button with > PWRBTN_STS instead of SLPBTN_STS, which leads to > XEN_DOMCTL_SENDTRIGGER_SLEEP causing guest powerdowns. Fix this

Re: [Xen-devel] Enhancing Xen's Kconfig infrastructure to support tailored solutions

2019-02-19 Thread Stefano Stabellini
On Mon, 18 Feb 2019, Lars Kurth wrote: > On 18 Feb 2019, at 12:16, George Dunlap > wrote: > > On 2/18/19 12:11 PM, George Dunlap wrote: > On 2/18/19 12:01 PM, Andrew Cooper wrote: > On 18/02/2019 11:57, Wei Liu wrote: > On Mon, Feb 18, 2019 at 11:53:15AM

Re: [Xen-devel] [PATCH] tools/xentop : replace use of deprecated vwprintw

2019-02-19 Thread Wei Liu
On Tue, Feb 19, 2019 at 05:45:40PM +, George Dunlap wrote: > On Wed, Jul 18, 2018 at 11:23 PM Christopher Clark > wrote: > > > > gcc-8.1 complains: > > > > | xentop.c: In function 'print': > > | xentop.c:304:4: error: 'vwprintw' is deprecated > > [-Werror=deprecated-declarations] > > | vw

Re: [Xen-devel] [PATCH] tools/xentop : replace use of deprecated vwprintw

2019-02-19 Thread George Dunlap
On Wed, Jul 18, 2018 at 11:23 PM Christopher Clark wrote: > > gcc-8.1 complains: > > | xentop.c: In function 'print': > | xentop.c:304:4: error: 'vwprintw' is deprecated > [-Werror=deprecated-declarations] > | vwprintw(stdscr, (curses_str_t)fmt, args); > | ^~~~ > > vw_printw (note the

[Xen-devel] xen/evtchn and forced threaded irq

2019-02-19 Thread Julien Grall
Hi all, I have been looking at using Linux RT in Dom0. Once the guest is started, the console is ending to have a lot of warning (see trace below). After some investigation, this is because the irq handler will now be threaded. I can reproduce the same error with the vanilla Linux when passing th

Re: [Xen-devel] XEN on R-CAR H3

2019-02-19 Thread Amit Tomer
Hi > [1] https://elinux.org/R-Car/Boards/Yocto-Gen3 We tried BSP release v3.15.0 from above link but see following message: [ 45.518865] => setenv xen_addr_r 0x4800;setenv fdt_addr_r 0x4a00;setenv kernel_addr_r 0x7a00 [ 52.430467] => setenv fdt_high 0x;fdt addr $fdt_add

Re: [Xen-devel] [PATCH] xen-block: stop leaking memory in xen_block_drive_create()

2019-02-19 Thread Paul Durrant
Apologies... typo-ed qemu-devel... > -Original Message- > From: Paul Durrant [mailto:paul.durr...@citrix.com] > Sent: 19 February 2019 16:35 > To: qeme-de...@nongnu.org; qemu-bl...@nongnu.org; xen- > de...@lists.xenproject.org > Cc: Paul Durrant ; Peter Maydell > ; Stefano Stabellini ; > A

Re: [Xen-devel] [PATCH] xen-block: stop leaking memory in xen_block_drive_create()

2019-02-19 Thread Peter Maydell
Hi Paul -- you typoed the qemu-devel list email address; cc'd the right one. thanks -- PMM On Tue, 19 Feb 2019 at 16:35, Paul Durrant wrote: > > The locally allocated QDict-s need to be freed. ('file_layer' will be > freed implicitly since it is added as an object to 'driver_layer'). > > Spotted

[Xen-devel] [PATCH] xen-block: stop leaking memory in xen_block_drive_create()

2019-02-19 Thread Paul Durrant
The locally allocated QDict-s need to be freed. ('file_layer' will be freed implicitly since it is added as an object to 'driver_layer'). Spotted by Coverity: CID 1398649 While in the neighbourhood free 'driver' and 'filename' as soon as they are added to the QDicts. Freeing after the 'done' labe

Re: [Xen-devel] [PATCH v3 09/11] optee: add support for RPC commands

2019-02-19 Thread Volodymyr Babchuk
Hi Julien, Julien Grall writes: > Hi Volodymyr, > > On 18/12/2018 21:11, Volodymyr Babchuk wrote: >> From: Volodymyr Babchuk >> >> OP-TEE can issue multiple RPC requests. We are interested mostly in >> request that asks NW to allocate/free shared memory for OP-TEE >> needs, because mediator nee

Re: [Xen-devel] [PATCH for-4.12] libs/gnttab: add missing FreeBSD functions

2019-02-19 Thread Juergen Gross
On 19/02/2019 16:26, Roger Pau Monne wrote: > The FreeBSD implementation is missing the following functions: > > osdep_gnttab_dmabuf_exp_from_refs > osdep_gnttab_dmabuf_exp_wait_released > osdep_gnttab_dmabuf_imp_to_refs > osdep_gnttab_dmabuf_imp_release > > Which all deal with dmabufs, that only

Re: [Xen-devel] [PATCH for-4.12] libs/gnttab: add missing FreeBSD functions

2019-02-19 Thread Wei Liu
On Tue, Feb 19, 2019 at 04:26:08PM +0100, Roger Pau Monne wrote: > The FreeBSD implementation is missing the following functions: > > osdep_gnttab_dmabuf_exp_from_refs > osdep_gnttab_dmabuf_exp_wait_released > osdep_gnttab_dmabuf_imp_to_refs > osdep_gnttab_dmabuf_imp_release > > Which all deal wi

Re: [Xen-devel] [PATCH v3 08/11] optee: add support for arbitrary shared memory

2019-02-19 Thread Volodymyr Babchuk
Hello Julien, Julien Grall writes: > Hi Volodymyr, > > On 18/12/2018 21:11, Volodymyr Babchuk wrote: >> From: Volodymyr Babchuk >> >> Shared memory is widely used by NW to communicate with >> TAs in OP-TEE. NW can share part of own memory with >> TA or OP-TEE core, by registering it OP-TEE, or b

[Xen-devel] [PATCH for-4.12] libs/gnttab: add missing FreeBSD functions

2019-02-19 Thread Roger Pau Monne
The FreeBSD implementation is missing the following functions: osdep_gnttab_dmabuf_exp_from_refs osdep_gnttab_dmabuf_exp_wait_released osdep_gnttab_dmabuf_imp_to_refs osdep_gnttab_dmabuf_imp_release Which all deal with dmabufs, that only exists on Linux. Implement them using abort, since such fun

Re: [Xen-devel] [PATCH RFC] drm: add func to better detect wether swiotlb is needed

2019-02-19 Thread Michael Labriola
On Sat, Feb 16, 2019 at 2:00 PM Koenig, Christian wrote: > > Am 15.02.19 um 22:29 schrieb Michael D Labriola: > > This commit fixes DRM failures on Xen PV systems that were introduced in > > v4.17 by the following commits: > > > > 82626363 drm: add func to get max iomem address v2 > > fd5fd480 drm

Re: [Xen-devel] [PATCH] x86/shadow: don't pass wrong L4 MFN to guest_walk_tables()

2019-02-19 Thread George Dunlap
On 2/19/19 12:01 PM, Jan Beulich wrote: > 64-bit PV guest user mode runs on a different L4 table. Make sure > - the accessed bit gets set in the correct table (and in log-dirty > mode the correct page gets marked dirty) during guest walks, > - the correct table gets audited by sh_audit_gw(), > -

Re: [Xen-devel] [PATCH v4 3/4] x86/mm: handle foreign mappings in p2m_entry_modify

2019-02-19 Thread Roger Pau Monné
On Tue, Feb 19, 2019 at 06:14:00AM +, Tian, Kevin wrote: > > From: Roger Pau Monne [mailto:roger@citrix.com] > > Sent: Tuesday, February 19, 2019 1:27 AM > > diff --git a/xen/arch/x86/mm/shadow/common.c > > b/xen/arch/x86/mm/shadow/common.c > > index fe48c4a02b..ad670de515 100644 > > --- a/

Re: [Xen-devel] [PATCH v4 3/4] x86/mm: handle foreign mappings in p2m_entry_modify

2019-02-19 Thread George Dunlap
On 2/19/19 6:14 AM, Tian, Kevin wrote: >> From: Roger Pau Monne [mailto:roger@citrix.com] >> Sent: Tuesday, February 19, 2019 1:27 AM >> >> So that the specific handling can be removed from >> atomic_write_ept_entry and be shared with npt and shadow code. >> >> This commit also removes the chec

[Xen-devel] [xen-unstable-smoke test] 133312: tolerable all pass - PUSHED

2019-02-19 Thread osstest service owner
flight 133312 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/133312/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-arm64-arm64-xl-xsm 13 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm 1

[Xen-devel] [xen-4.9-testing test] 133295: regressions - FAIL

2019-02-19 Thread osstest service owner
flight 133295 xen-4.9-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/133295/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-xsm broken in 133252 build-arm64-pvops

Re: [Xen-devel] [PATCH] iommu: leave IOMMU enabled by default during kexec crash transition

2019-02-19 Thread Igor Druzhinin
On 19/02/2019 07:43, Jan Beulich wrote: On 18.02.19 at 19:30, wrote: >> On 18/02/2019 16:21, Igor Druzhinin wrote: >>> It's unsafe to disable IOMMU on a live system which is the case >>> if we're crashing since remapping hardware doesn't usually know what >>> to do with ongoing bus transactio

Re: [Xen-devel] [PATCH v4 2/4] p2m: change write_p2m_entry to return an error code

2019-02-19 Thread Jan Beulich
>>> On 19.02.19 at 12:56, wrote: > On Tue, Feb 19, 2019 at 02:05:37AM -0700, Jan Beulich wrote: >> >>> On 18.02.19 at 18:27, wrote: >> > --- a/xen/arch/x86/mm/p2m-pt.c >> > +++ b/xen/arch/x86/mm/p2m-pt.c >> > @@ -184,6 +184,7 @@ p2m_next_level(struct p2m_domain *p2m, void **table, >> > l1_pg

Re: [Xen-devel] [PATCH] x86/shadow: don't pass wrong L4 MFN to guest_walk_tables()

2019-02-19 Thread Juergen Gross
On 19/02/2019 13:01, Jan Beulich wrote: > 64-bit PV guest user mode runs on a different L4 table. Make sure > - the accessed bit gets set in the correct table (and in log-dirty > mode the correct page gets marked dirty) during guest walks, > - the correct table gets audited by sh_audit_gw(), > -

Re: [Xen-devel] [PATCH] iommu: leave IOMMU enabled by default during kexec crash transition

2019-02-19 Thread Igor Druzhinin
On 19/02/2019 08:13, Jan Beulich wrote: On 18.02.19 at 17:21, wrote: > > First of all - please follow patch submission rules: They get sent _to_ > the list, with maintainers and others _cc_-ed. > >> It's unsafe to disable IOMMU on a live system which is the case >> if we're crashing since r

Re: [Xen-devel] [PATCH] x86/shadow: don't pass wrong L4 MFN to guest_walk_tables()

2019-02-19 Thread Andrew Cooper
On 19/02/2019 12:01, Jan Beulich wrote: > 64-bit PV guest user mode runs on a different L4 table. Make sure > - the accessed bit gets set in the correct table (and in log-dirty > mode the correct page gets marked dirty) during guest walks, > - the correct table gets audited by sh_audit_gw(), > -

[Xen-devel] [linux-linus test] 133293: regressions - FAIL

2019-02-19 Thread osstest service owner
flight 133293 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/133293/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-qemuu-nested-intel 17 debian-hvm-install/l1/l2 fail REGR. vs. 132911 Tests which

Re: [Xen-devel] [PATCH v4 2/4] p2m: change write_p2m_entry to return an error code

2019-02-19 Thread Roger Pau Monné
On Tue, Feb 19, 2019 at 02:05:37AM -0700, Jan Beulich wrote: > >>> On 18.02.19 at 18:27, wrote: > > --- a/xen/arch/x86/mm/p2m-pt.c > > +++ b/xen/arch/x86/mm/p2m-pt.c > > @@ -184,6 +184,7 @@ p2m_next_level(struct p2m_domain *p2m, void **table, > > l1_pgentry_t *p2m_entry, new_entry; > > v

[Xen-devel] [PATCH] x86/shadow: don't pass wrong L4 MFN to guest_walk_tables()

2019-02-19 Thread Jan Beulich
64-bit PV guest user mode runs on a different L4 table. Make sure - the accessed bit gets set in the correct table (and in log-dirty mode the correct page gets marked dirty) during guest walks, - the correct table gets audited by sh_audit_gw(), - correct info gets logged by print_gw(). Signed-of

Re: [Xen-devel] [PATCH RFC 0/6] Slotted channels for sync vm_events

2019-02-19 Thread Razvan Cojocaru
On 2/12/19 7:01 PM, Tamas K Lengyel wrote: On Thu, Feb 7, 2019 at 9:06 AM Petre Ovidiu PIRCALABU wrote: On Thu, 2019-02-07 at 11:46 +, George Dunlap wrote: On 2/6/19 2:26 PM, Petre Ovidiu PIRCALABU wrote: On Wed, 2018-12-19 at 20:52 +0200, Petre Pircalabu wrote: This patchset is a rewor

Re: [Xen-devel] [PATCH v4 1/4] x86/mm: split p2m ioreq server pages special handling into helper

2019-02-19 Thread Roger Pau Monné
On Tue, Feb 19, 2019 at 01:49:18AM -0700, Jan Beulich wrote: > >>> On 18.02.19 at 18:27, wrote: > > --- a/xen/arch/x86/mm/shadow/common.c > > +++ b/xen/arch/x86/mm/shadow/common.c > > @@ -3188,6 +3188,9 @@ shadow_write_p2m_entry(struct domain *d, unsigned > > long gfn, > > if ( likely(d->arc

Re: [Xen-devel] [PATCH V2 3/3] xen/arm: Add SCIFA UART support for early printk

2019-02-19 Thread Julien Grall
Hi Oleksandr, On 2/18/19 8:45 PM, Oleksandr wrote: On 18.02.19 22:41, Oleksandr wrote: On 18.02.19 16:05, Julien Grall wrote: Hi, Hi On 01/02/2019 12:37, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko Add support for Renesas "Stout" development board based on R-Car H2 SoC w

Re: [Xen-devel] [PATCH V2 1/3] xen/arm: drivers: scif: Add support for SCIFA compatible UARTs

2019-02-19 Thread Julien Grall
Hi Oleksandr, On 2/18/19 8:14 PM, Oleksandr wrote: On 18.02.19 16:00, Julien Grall wrote: Hi, Hi On 01/02/2019 12:37, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko Extend existing driver to be able to handle SCIFA interface as well. In general a patch should do only one thi

Re: [Xen-devel] [PATCH for-4.12] vpci: reduce verboseness of BAR write warnings

2019-02-19 Thread Wei Liu
On Tue, Feb 19, 2019 at 06:56:00AM +0100, Juergen Gross wrote: > On 18/02/2019 17:24, Roger Pau Monne wrote: > > Avoid printing a warning message when writing to a BAR register with > > memory decoding enabled if the value written is the same as the > > current one. > > > > No functional change. >

Re: [Xen-devel] [PATCH v4 1/4] x86/mm: split p2m ioreq server pages special handling into helper

2019-02-19 Thread Roger Pau Monné
On Tue, Feb 19, 2019 at 05:47:34AM +, Tian, Kevin wrote: > > From: Roger Pau Monne [mailto:roger@citrix.com] > > Sent: Tuesday, February 19, 2019 1:27 AM > > > > So that it can be shared by both ept, npt and shadow code, instead of > > duplicating it. > > > > No change in functionality in

[Xen-devel] Changes to Xen Project websites: xenproject.org & blog.xenproject.org

2019-02-19 Thread Lars Kurth
Dear Community members, today and tomorrow, we are making changes to Xen Project web real-estate. Specifically, the Xen project website at xenproject.org is replaced by a new website and the content of blog.xenproject.org will move to xenproject.org/blog While we execute the switch-over there

[Xen-devel] [xen-4.10-testing test] 133292: trouble: broken/fail/pass

2019-02-19 Thread osstest service owner
flight 133292 xen-4.10-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/133292/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-qemut-debianhvm-amd64-xsmbroken test-

Re: [Xen-devel] [PATCH v4 2/4] p2m: change write_p2m_entry to return an error code

2019-02-19 Thread Jan Beulich
>>> On 18.02.19 at 18:27, wrote: > --- a/xen/arch/x86/mm/p2m-pt.c > +++ b/xen/arch/x86/mm/p2m-pt.c > @@ -184,6 +184,7 @@ p2m_next_level(struct p2m_domain *p2m, void **table, > l1_pgentry_t *p2m_entry, new_entry; > void *next; > unsigned int flags; > +int rc; > > if ( !(p2

Re: [Xen-devel] [PATCH v4 1/4] x86/mm: split p2m ioreq server pages special handling into helper

2019-02-19 Thread Jan Beulich
>>> On 18.02.19 at 18:27, wrote: > --- a/xen/arch/x86/mm/shadow/common.c > +++ b/xen/arch/x86/mm/shadow/common.c > @@ -3188,6 +3188,9 @@ shadow_write_p2m_entry(struct domain *d, unsigned long > gfn, > if ( likely(d->arch.paging.shadow.total_pages != 0) ) > sh_unshadow_for_p2m_chang

Re: [Xen-devel] [PATCH v4 3/4] x86/mm: handle foreign mappings in p2m_entry_modify

2019-02-19 Thread Jan Beulich
>>> On 19.02.19 at 07:14, wrote: >> From: Roger Pau Monne [mailto:roger@citrix.com] >> Sent: Tuesday, February 19, 2019 1:27 AM >> >> @@ -734,8 +735,15 @@ hap_write_p2m_entry(struct domain *d, unsigned >> long gfn, l1_pgentry_t *p, >> && perms_strictly_increased(old_flags, l1e_g

  1   2   >