[Xen-devel] [PATCHv6] xenbus: fix deadlock on writes to /proc/xen/xenbus

2016-12-09 Thread David Vrabel
this device to always get character device like sematics. Signed-off-by: David Vrabel --- v6: - clear flag after calling nonseekable_open(). --- drivers/xen/xenbus/xenbus_dev_frontend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen

Re: [Xen-devel] [PATCH 4/4] xen/x86: Correct mandatory and SMP barrier definitions

2016-12-05 Thread David Vrabel
On 05/12/16 10:05, Andrew Cooper wrote: > > + * Loads may be reordered ahead of an unaliasing store. It might be useful to summarize what an "unaliasing store" is. David ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-dev

Re: [Xen-devel] [DOC v1] Xen transport for 9pfs

2016-12-02 Thread David Vrabel
On 02/12/16 00:29, Stefano Stabellini wrote: > On Wed, 30 Nov 2016, David Vrabel wrote: >> On 29/11/16 23:34, Stefano Stabellini wrote: >>> >>> The producer (the backend for **in**, the frontend for **out**) writes to >>> the >>> array in the following

Re: [Xen-devel] [DOC v1] Xen transport for 9pfs

2016-11-30 Thread David Vrabel
On 29/11/16 23:34, Stefano Stabellini wrote: > > The producer (the backend for **in**, the frontend for **out**) writes to the > array in the following way: > - read memory barrier > - read *cons*, *prod* from shared memory > - write to array at position *prod* up to *cons*, wrapping around the c

Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring request pointer in case of error

2016-11-29 Thread David Vrabel
On 29/11/16 11:19, Juergen Gross wrote: > On 29/11/16 12:14, Jan Beulich wrote: > On 29.11.16 at 11:50, wrote: >>> --- a/drivers/scsi/xen-scsifront.c >>> +++ b/drivers/scsi/xen-scsifront.c >>> @@ -184,8 +184,6 @@ static struct vscsiif_request *scsifront_pre_req(struct >>> vscsifrnt_info *info

[Xen-devel] [PATCHv1] MAINTAINERS: update EVENT CHANNEL and KEXEC maintainer

2016-11-17 Thread David Vrabel
I am no longer in a position to be a Xen maintainer. Andrew has kindly volunteered to continue maintainance of the KEXEC subsystem. EVENT CHANNELS (FIFO-BASED ABI) will be maintained by the "Other" hypervisor maintainers. Signed-off-by: David Vrabel Cc: Andrew Cooper --- MAINT

[Xen-devel] [PATCHv1] MAINTAINERS: update XEN HYPERVISOR INTERFACE

2016-11-17 Thread David Vrabel
I am no longer in a postion to be a maintainer of the Xen subsystem. Signed-off-by: David Vrabel --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 2a58eea..32a36da 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13196,7 +13196,6 @@ F: drivers

Re: [Xen-devel] [PATCH] xen/gntdev: Use mempolicy instead of VM_IO flag to avoid NUMA balancing

2016-11-16 Thread David Vrabel
t; > To avoid this, instead of setting VM_IO use mempolicy that prohibits page > migration (i.e. clear policy's MPOL_F_MOF|MPOL_F_MORON) Reviewed-by: David Vrabel With the corrected commit message. David ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v8] This is ABI for the two halves of a Para-virtual sound driver to communicate with each to other.

2016-11-16 Thread David Vrabel
On 16/11/16 13:12, Volodymyr Babchuk wrote: > Hello David, > > I helped Oleksandr with parts of this protocol, so I want to address > some questions you asked. > > On 16 November 2016 at 12:38, David Vrabel wrote: >> >> Sound is not my area of expertise but I

Re: [Xen-devel] [PATCH v8] This is ABI for the two halves of a Para-virtual sound driver to communicate with each to other.

2016-11-16 Thread David Vrabel
Sound is not my area of expertise but I have a few points that you may like to consider. 1. You can only say how many channels a stream has, not what the channels correspond to (e.g., "left", "right" for a 2 channel stereo stream; or "left-front", "rear-right", etc. for a 6 channel 5.1 surround s

Re: [Xen-devel] [RFC PATCH KERNEL 1/4] x86/xen: start untangling PV and PVHVM guest support code

2016-11-15 Thread David Vrabel
On 14/11/16 17:17, Vitaly Kuznetsov wrote: > Introduce CONFIG_XEN_PV config option and split enlighten.c into > 3 files. Temporary add #ifdef CONFIG_XEN_PV to smp.c and mmu.c to > not break the build and not make the patch even bigger. > > xen_cpu_up_prepare*/xen_cpu_die hooks require separation t

Re: [Xen-devel] [PATCH v1 1/2] xen/kexec: Find out whether an kexec type is loaded.

2016-11-15 Thread David Vrabel
On 14/11/16 22:12, Konrad Rzeszutek Wilk wrote: > The tools that use kexec are asynchronous in nature and do > not keep state changes. As such provide an hypercall to find > out whether an image has been loaded for either type. > > Note: No need to modify XSM as it has one size fits all > check an

Re: [Xen-devel] [RFC PATCH KERNEL 0/4] x86/xen: untangle PV and PVHVM guest support code

2016-11-14 Thread David Vrabel
On 14/11/16 17:17, Vitaly Kuznetsov wrote: > Hi, > > I have a long-standing idea to separate PV and PVHVM code in kernel and > introduce Kconfig options to make it possible to enable the required > parts only breaking the current 'all or nothing' approach. > > Motivation: > - Xen related x86 cod

[Xen-devel] [PATCHv5 2/2] xenfs: Use proc_create_mount_point() to create /proc/xen

2016-11-14 Thread David Vrabel
al. Export this interface to modules, then use it in xenbus when creating /proc/xen. Signed-off-by: Seth Forshee Signed-off-by: David Vrabel --- drivers/xen/xenbus/xenbus_probe.c | 2 +- fs/proc/generic.c | 1 + fs/proc/internal.h| 1 - include/linux/proc_fs.h

[Xen-devel] [PATCH v5 0/2] xenfs: xenbus and container related bug fixes

2016-11-14 Thread David Vrabel
Using /proc/xen/xenbus can cause deadlocks on the atomic file position mutex since this file should behave like a character device and not a regular file. This is easiest to achive by clearing FMODE_ATOMIC_POS. David Changes in v5: - Clear FMODE_ATOMIC_POS instead of using symlinks. Changes in

[Xen-devel] [PATCHv5 1/2] xenbus: fix deadlock on writes to /proc/xen/xenbus

2016-11-14 Thread David Vrabel
this device to always get character device like sematics. Signed-off-by: David Vrabel --- drivers/xen/xenbus/xenbus_dev_frontend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c index 1e8be12..ce389b4 100644

Re: [Xen-devel] [PATCH RESEND] xen/gntdev: Grant maps should not be subject to NUMA balancing

2016-11-10 Thread David Vrabel
On 10/11/16 17:47, Olaf Hering wrote: > On Thu, Nov 10, Boris Ostrovsky wrote: > >> Are you sure it's this patch that causes the failure? >> >> I commented out '| VM_IO' and still unable to boot with this option. > > Yes, this works for me, sles12sp2 dom0+domU, which is linux-4.4 based: > > +++

Re: [Xen-devel] [PATCH 00/12] xen: add common function for reading optional value

2016-11-07 Thread David Vrabel
ith the call of the new function > where appropriate. Acked-by: David Vrabel Please queue for the next release. David ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 01/12] xen: introduce xenbus_read_unsigned()

2016-11-07 Thread David Vrabel
On 31/10/16 16:48, Juergen Gross wrote: > There are multiple instances of code reading an optional unsigned > parameter from Xenstore via xenbus_scanf(). Instead of repeating the > same code over and over add a service function doing the job. Reviewed-by: David Vrabe

[Xen-devel] [PATCHv4 3/3] xenfs: Use proc_create_mount_point() to create /proc/xen

2016-10-28 Thread David Vrabel
al. Export this interface to modules, then use it in xenbus when creating /proc/xen. Signed-off-by: Seth Forshee Signed-off-by: David Vrabel --- drivers/xen/xenbus/xenbus_probe.c | 2 +- fs/proc/generic.c | 1 + fs/proc/internal.h| 1 - include/linux/proc_fs.h

[Xen-devel] [PATCHv4 1/3] libfs: allow simple_fill_super() to add symlinks

2016-10-28 Thread David Vrabel
simple_fill_super() will add symlinks if an entry has mode & S_IFLNK. The target is provided in the new "link" field. Signed-off-by: David Vrabel --- v4: - Use switch for file type. v2: - simplified. --- fs/libfs.c | 27 --- include/linux/fs.h |

[Xen-devel] [PATCH v4 0/3] libfs, xenfs: replace /proc/xen/xenbus with a symlink

2016-10-28 Thread David Vrabel
Using /proc/xen/xenbus can cause deadlocks on the atomic file position mutex since this file should behave like a character device and not a regular file. This is easiest to achive by making it a symlink to the existing /dev/xen/xenbus device. This requires extending simple_fill_super() to add sy

[Xen-devel] [PATCHv4 2/3] xenfs: replace xenbus and privcmd with symlinks

2016-10-28 Thread David Vrabel
identical to the character device /dev/xen/xenbus so replace the file with a symlink. Similarly, replace /proc/xen/privcmd with a symlink since it should be the same as /dev/xen/privcmd. Signed-off-by: David Vrabel --- v4: - Make xen_xenbus_fops and xen_privcmd_fops static. --- drivers/xen/privcmd.c

Re: [Xen-devel] Why cast to "signed short" before checking the return value of gnttab_claim_grant_reference() in xen-netfront.c?

2016-10-28 Thread David Vrabel
On 28/10/16 07:46, Dongli Zhang wrote: > Hi, > > Would anyone please help with a question on xen-netfront.c code? > > In xen-netfront.c, the return value of gnttab_claim_grant_reference() is > checked with "BUG_ON((signed short)ref < 0);". Why we use signed short here > while the return value is

[Xen-devel] [GIT PULL] xen: xenfs fixes for 4.9-rc2

2016-10-24 Thread David Vrabel
++ 11 files changed, 24 insertions(+), 22 deletions(-) David Vrabel (2): libfs: allow simple_fill_super() to add symlinks xenfs: replace xenbus and privcmd with symlinks Seth Forshee (1): xenbus: Use proc_create_mount_point() to create /proc/xen -BEGIN PGP SIGNATURE

[Xen-devel] [GIT PULL] xen: fixes for 4.9-rc2

2016-10-24 Thread David Vrabel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-4.9-rc2-tag xen: fixes for 4.9-rc2 - - Advertise control feature flags in xenstore. - - Fix x86 build when XEN_PVHVM is disabled. Than

Re: [Xen-devel] libxencall/linux: prevent page migration for hypercall buffers

2016-10-24 Thread David Vrabel
On 03/08/16 18:27, David Vrabel wrote: > This is the libxencall side of the "xen/privcmd: prevent page > migration for hypercall buffers​" series for Linux. It calls the > necessary LOCK/UNLOCK ioctls. > > This should not be applied until after the Linux series is appli

Re: [Xen-devel] [PATCH RFC 1/2] usbif.h: don't require PAGE_SIZE to be present

2016-10-19 Thread David Vrabel
On 19/10/16 11:46, Wei Liu wrote: > If it is present, use it; otherwise use 4096. Also provide two new > macros to let user have control over the page size used to do > calculation. [...] > index 4053c24..ac38318 100644 > --- a/xen/include/public/io/usbif.h > +++ b/xen/include/public/io/usbif.h > @

[Xen-devel] [PATCHv1 net] xen-netback: fix guest Rx stall detection (after guest Rx refactor)

2016-10-11 Thread David Vrabel
uests are placed on the ring, permanently stalling the VIF. This is a regression introduced by eb1723a29b9a7 (xen-netback: refactor guest rx). Fix this by reinstating the setting of queue->last_rx_time when placing a packet onto the guest Rx ring. Signed-off-by: David Vrabel --- drivers

Re: [Xen-devel] [PATCH v3] xenbus: advertize control feature flags

2016-10-11 Thread David Vrabel
ant feature-flag keys. >> >> Signed-off-by: Paul Durrant >> Cc: Boris Ostrovsky >> Cc: David Vrabel >> Cc: Juergen Gross > > Hmm, I'd prefer node[] allocated on the stack over dynamic allocation. > > What about something like the following? It will at

Re: [Xen-devel] [PATCHv2 0/2] xen/privcmd: prevent page migration for hypercall buffers

2016-10-10 Thread David Vrabel
On 04/08/16 16:16, David Vrabel wrote: > Currently libxencall using mlocked buffers for hypercall buffers. > This pages are subject to compaction and page migration. A userspace > process may see a hypercall fail with -EFAULT if a page backing a > hypercall buffer is in the proc

Re: [Xen-devel] [PATCH v2] xenbus: advertize control feature flags

2016-10-10 Thread David Vrabel
On 10/10/16 10:43, Paul Durrant wrote: > The Xen docs specify several flags which a guest can set to advertize > which values of the xenstore control/shutdown key it will recognize. > This patch adds code to write all the relevant feature-flag keys. [...] > static int setup_shutdown_watcher(void)

Re: [Xen-devel] [PATCH] xen/x86: Update topology map for PV VCPUs

2016-10-06 Thread David Vrabel
On 05/10/16 18:09, Boris Ostrovsky wrote: > Early during boot topology_update_package_map() computes > logical_pkg_ids for all present processors. > > Later, when processors are brought up, identify_cpu() updates > these values based on phys_pkg_id which is a function of > initial_apicid. On PV gu

[Xen-devel] [GIT PULL] xen: features and fixes for 4.9-rc0

2016-10-06 Thread David Vrabel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-4.9-rc0-tag xen: features and fixes for 4.9-rc0 - - Switch to new CPU hotplug mechanism. - - Support driver_override in pciback. - - Re

Re: [Xen-devel] [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier

2016-10-05 Thread David Vrabel
On 02/10/16 23:45, Boris Ostrovsky wrote: > xen_cpuhp_setup() calls mutex_lock() which, when CONFIG_DEBUG_MUTEXES > is defined, ends up calling xen_save_fl(). That routine expects > per_cpu(xen_vcpu, 0) to be already initialized. Applied to for-linus-4.9, thanks. David __

Re: [Xen-devel] [PATCH v2 net-next 5/7] xen-netback: process guest rx packets in batches

2016-10-04 Thread David Vrabel
On 04/10/16 13:47, Konrad Rzeszutek Wilk wrote: > On Tue, Oct 04, 2016 at 10:29:16AM +0100, Paul Durrant wrote: >> From: David Vrabel >> >> Instead of only placing one skb on the guest rx ring at a time, process >> a batch of up-to 64. This improves performance by ~

Re: [Xen-devel] [PATCH v2 net-next 7/7] xen/netback: add fraglist support for to-guest rx

2016-10-04 Thread David Vrabel
On 04/10/16 10:29, Paul Durrant wrote: > From: Ross Lagerwall > > This allows full 64K skbuffs (with 1500 mtu ethernet, composed of 45 > fragments) to be handled by netback for to-guest rx. Reviewed-by: David Vrabel David ___ Xen-devel

Re: [Xen-devel] [PATCH v2 net-next 2/7] xen-netback: retire guest rx side prefix GSO feature

2016-10-04 Thread David Vrabel
stead being fragmented in the backend. Reviewed-by: David Vrabel David ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2 0/2] Convert to new CPU hotplug framework

2016-09-30 Thread David Vrabel
On 07/09/16 18:18, Boris Ostrovsky wrote: > New CPU hotplug framework was introduced recently. These patches convert Xen > CPU hotplug code to this infrastructure. Applied to for-linus-4.9, thanks. David ___ Xen-devel mailing list Xen-devel@lists.xen.o

Re: [Xen-devel] [PATCH v3 0/3] xen/pciback: support driver_override

2016-09-30 Thread David Vrabel
On 22/09/16 09:45, Juergen Gross wrote: > Support the driver_override scheme introduced with commit 782a985d7af2 > ("PCI: Introduce new device binding path using pci_dev.driver_override") Applied to for-linus-4.9, thanks. David ___ Xen-devel mailing li

Re: [Xen-devel] [PATCH] xen: Remove event channel notification through Xen PCI platform device

2016-09-30 Thread David Vrabel
On 26/08/16 22:55, KarimAllah Ahmed wrote: > Ever since commit 254d1a3f02eb ("xen/pv-on-hvm kexec: shutdown watches > from old kernel") using the INTx interrupt from Xen PCI platform device for > event channel notification would just lockup the guest during bootup. > postcore_initcall now calls xs_

Re: [Xen-devel] Adding new custom devices to Xen via QEMU

2016-09-30 Thread David Vrabel
On 30/09/16 14:35, Jason Dickens wrote: > Hi Wei, > > Thanks for the response. It make sense to me that if the device were on > the PCI bus (or other such bus, e.g. USB) that it could be discovered, > at least by an OS. Its something to consider. I should mention that our > guest VM doesn't actual

Re: [Xen-devel] PVHv2 vs HVMlite

2016-09-27 Thread David Vrabel
On 27/09/16 15:08, Boris Ostrovsky wrote: > I will be dusting off Linux domU PVHv2 patches now that ACPI changes are > getting close to being accepted. > > Last version of that patch referred to these guests as 'hvmlite', > including in names of variables, routines etc. I was hesitant to remove >

Re: [Xen-devel] [PATCH v3 2/3] xen/pciback: avoid multiple entries in slot list

2016-09-23 Thread David Vrabel
On 22/09/16 22:02, Boris Ostrovsky wrote: > On 09/22/2016 04:45 AM, Juergen Gross wrote: >> The Xen pciback driver has a list of all pci devices it is ready to >> seize. There is no check whether a to be added entry already exists. >> While this might be no problem in the common case it might confu

Re: [Xen-devel] [PATCH net-next RESEND] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread David Vrabel
On 19/09/16 11:22, Vitaly Kuznetsov wrote: > David Miller writes: > >> From: Vitaly Kuznetsov >> Date: Fri, 16 Sep 2016 12:59:14 +0200 >> >>> @@ -595,6 +596,19 @@ static int xennet_start_xmit(struct sk_buff *skb, >>> struct net_device *dev) >>> offset = offset_in_page(skb->data); >>> le

Re: [Xen-devel] [PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-15 Thread David Vrabel
On 14/09/16 22:35, Dave Hansen wrote: > On 09/14/2016 02:01 PM, Kyle Huey wrote: >> Xen advertises the underlying support for CPUID faulting but not does pass >> through writes to the relevant MSR, nor does it virtualize it, so it does >> not actually work. For now mask off the relevant bit on MSR_

Re: [Xen-devel] [PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-15 Thread David Vrabel
break; > + case MSR_PLATFORM_INFO: > + val &= ~CPUID_FAULTING_SUPPORT; > + break; > } > return val; > } Acked-by: David Vrabel David ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

[Xen-devel] [GIT PULL] xen: regression fix for 4.8-rc6

2016-09-14 Thread David Vrabel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-4.8b-rc6-tag xen: regression fix for 4.8-rc6 - - Fix SMP boot in arm guests. Thanks. David arch/arm/xen/enlighten.c | 7 +++ 1

Re: [Xen-devel] Device model operation hypercall (DMOP, re qemu depriv)

2016-09-13 Thread David Vrabel
On 12/09/16 15:32, Jan Beulich wrote: On 09.09.16 at 17:16, wrote: >> The following code illustrates this idea: >> >> typedef struct dm_op_buffer { >> XEN_GUEST_HANDLE(void) h; >> size_t len; >> } dm_op_buffer_t; > > This implies that we'll lose all type safety on the handles passe

Re: [Xen-devel] Device model operation hypercall (DMOP, re qemu depriv)

2016-09-09 Thread David Vrabel
On 09/09/16 16:16, Jennifer Herbert wrote: > On 01/08/16 12:32, Ian Jackson wrote: >> I think we need to introduce a new hypercall (which I will call DMOP >> for now) which may augment or replace some of HVMCTL. Let me explain: >> > > I believe the new 'DMOP' hypercall is a good idea, but follow

Re: [Xen-devel] [PATCH v2] xen/pciback: support driver_override

2016-09-09 Thread David Vrabel
On 09/09/16 07:14, Juergen Gross wrote: > On 08/09/16 16:10, Boris Ostrovsky wrote: >> On 09/02/2016 08:30 AM, Juergen Gross wrote: >>> Support the driver_override scheme introduced with commit 782a985d7af2 >>> ("PCI: Introduce new device binding path using pci_dev.driver_override") >>> >>> As pcis

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-09 Thread David Vrabel
at's what > this patch is trying to achieve with skb_copy(). > > Signed-off-by: Vitaly Kuznetsov We should probably fix the backend to handle this (by grant copying a minimum amount in the linear area, but since netfront needs to work with older netback. Acked-by: David Vrabel David ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH linux v3 3/9] xen: introduce xen_vcpu_id mapping

2016-09-07 Thread David Vrabel
pu xen_vcpu_id mapping. ARM and PV guests get direct >>>>>>> mapping >>>>>>> for now. Boot CPU for PVHVM guest gets its id from CPUID. With secondary >>>>>>> CPUs it is a bit more trickier. Currently, we initialize IPI ve

Re: [Xen-devel] [PATCH v2 1/1] xen: move TLB-flush filtering out into populate_physmap

2016-09-06 Thread David Vrabel
On 06/09/16 10:52, George Dunlap wrote: > On 06/09/16 10:39, David Vrabel wrote: >> On 06/09/16 09:42, Dongli Zhang wrote: >>> This patch implemented parts of TODO left in commit id >>> a902c12ee45fc9389eb8fe54eeddaf267a555c58. It moved TLB-flush filtering ou

Re: [Xen-devel] [PATCH v2 1/1] xen: move TLB-flush filtering out into populate_physmap

2016-09-06 Thread David Vrabel
On 06/09/16 09:42, Dongli Zhang wrote: > This patch implemented parts of TODO left in commit id > a902c12ee45fc9389eb8fe54eeddaf267a555c58. It moved TLB-flush filtering out > into populate_physmap. > > Because of TLB-flush in alloc_heap_pages, it's very slow to create a guest > with memory size of

Re: [Xen-devel] [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen

2016-08-30 Thread David Vrabel
On 30/08/16 16:10, Seth Forshee wrote: > On Tue, Aug 30, 2016 at 04:00:03PM +0100, David Vrabel wrote: >> On 29/08/16 16:03, Seth Forshee wrote: >>> Mounting proc in user namespace containers fails if the xenbus >>> filesystem is mounted on /proc/xen because t

Re: [Xen-devel] [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen

2016-08-30 Thread David Vrabel
tpoints in proc but is currently > proc-internal. Export this interface to modules, then use it in > xenbus when creating /proc/xen. Acked-by: David Vrabel This either needs to be acked by the fs maintainer or go via their tree but you don't appear to have Cc'

Re: [Xen-devel] find_next{,_zero}_bit() inconsistencies

2016-08-30 Thread David Vrabel
On 29/08/16 12:59, Jan Beulich wrote: > Hello, > > in the context of > https://lists.xenproject.org/archives/html/xen-devel/2016-08/msg03068.html > I once again came across the different behavior our various > implementations of the $subject functions, in particular their varying > handling of the

Re: [Xen-devel] [PATCH] xen/grant-table: Use kmalloc_array() in arch_gnttab_valloc()

2016-08-26 Thread David Vrabel
On 25/08/16 12:30, SF Markus Elfring wrote: > From: Markus Elfring > Date: Thu, 25 Aug 2016 13:23:06 +0200 > > * A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus reuse the corresponding function "kmalloc_ar

Re: [Xen-devel] [PATCH v3] xen: Make VPMU init message look less scary

2016-08-24 Thread David Vrabel
On 02/08/16 08:22, Juergen Gross wrote: > The default for the Xen hypervisor is to not enable VPMU in order to > avoid security issues. In this case the Linux kernel will issue the > message "Could not initialize VPMU for cpu 0, error -95" which looks > more like an error than a normal state. > >

Re: [Xen-devel] [PATCH v2] xen: rename xen_pmu_init() in sys-hypervisor.c

2016-08-24 Thread David Vrabel
On 02/08/16 07:53, Juergen Gross wrote: > There are two functions with name xen_pmu_init() in the kernel. Rename > the one in drivers/xen/sys-hypervisor.c to avoid shadowing the one in > arch/x86/xen/pmu.c > > To avoid the same problem in future rename some more functions. Applied to for-linus-4.

Re: [Xen-devel] [PATCH v2 0/2] Reinstate irq alloc/dealloc locking patch

2016-08-24 Thread David Vrabel
On 03/08/16 18:22, Boris Ostrovsky wrote: > Original version of that patch (commit a89941816726) had to be reverted > due to Xen allocating irqs in its cpu_up ops. > > The first patch moves allocations into hotplug notifiers and the second > one restores the original patch (with minor adjustments

Re: [Xen-devel] [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t

2016-08-24 Thread David Vrabel
On 29/07/16 10:06, Vitaly Kuznetsov wrote: > We pass xen_vcpu_id mapping information to hypercalls which require > uint32_t type so it would be cleaner to have it as uint32_t. The > initializer to -1 can be dropped as we always do the mapping before using > it and we never check the 'not set' value

Re: [Xen-devel] [PATCH] xenbus: don't look up transaction IDs for ordinary writes

2016-08-24 Thread David Vrabel
On 15/08/16 16:02, Jan Beulich wrote: > This should really only be done for XS_TRANSACTION_END messages, or > else at least some of the xenstore-* tools don't work anymore. Applied to for-linus-4.8b, thanks. David ___ Xen-devel mailing list Xen-devel@l

[Xen-devel] [GIT PULL] xen: regression fix for 4.8-rc3

2016-08-24 Thread David Vrabel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-4.8b-rc3-tag xen: regression fix for 4.8-rc3 - - Fix a regression in the xenbus device preventing userspace tools from working. Than

Re: [Xen-devel] [PATCH] Xen: remove -fshort-wchar gcc flag

2016-08-24 Thread David Vrabel
or good. I don't see > any reason for having the flag in the first place, as the Xen code > does not use wchar_t at all. > > Signed-off-by: Arnd Bergmann > Fixes: 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi") Acked-by: David Vrabel David __

Re: [Xen-devel] [PATCHv2 0/2] xen/privcmd: prevent page migration for hypercall buffers

2016-08-22 Thread David Vrabel
On 04/08/16 16:16, David Vrabel wrote: > Currently libxencall using mlocked buffers for hypercall buffers. > This pages are subject to compaction and page migration. A userspace > process may see a hypercall fail with -EFAULT if a page backing a > hypercall buffer is in the proc

Re: [Xen-devel] [PATCHv2 2/2] xen/privcmd: add ioctls for locking/unlocking hypercall buffers

2016-08-22 Thread David Vrabel
>> populate a VMA with "special", non-migratable pages. But the >> LOCK/UNLOCK ioctls are more flexible as they allow any page to be used >> for hypercalls (e.g., stack, mmap'd files, etc.). This could be used >> to minimize bouncing for performance critical

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-08-22 Thread David Vrabel
On 22/08/16 16:42, Vitaly Kuznetsov wrote: > > I see two ways to fix the issue: > - Change the 'wire' protocol between netfront and netback to start keeping > the original SKB structure. We'll have to add a flag indicating the fact > that the particular request is a part of the original linear

Re: [Xen-devel] [PATCH 1/2] libs/gnttab: do not use alloca(3)

2016-08-22 Thread David Vrabel
On 22/08/16 11:10, Wei Liu wrote: > On Mon, Aug 22, 2016 at 10:46:50AM +0100, David Vrabel wrote: >> On 17/08/16 15:33, Wei Liu wrote: >>> The semantics of alloca(3) is not very nice. If the stack overflows, >>> program behaviour is undefined. >>> >>&g

Re: [Xen-devel] [PATCH 1/2] libs/gnttab: do not use alloca(3)

2016-08-22 Thread David Vrabel
On 17/08/16 15:33, Wei Liu wrote: > The semantics of alloca(3) is not very nice. If the stack overflows, > program behaviour is undefined. > > Remove the use of alloca(3) and always use mmap. This is only using alloca() if the allocation is < PAGE_SIZE. I think assuming there's this much extra s

Re: [Xen-devel] [PATCH 2/2] xen/events: Convert to hotplug state machine

2016-08-15 Thread David Vrabel
On 15/08/16 15:46, Boris Ostrovsky wrote: > From: Sebastian Andrzej Siewior > > Install the callbacks via the state machine. [...] > +static int xen_evtchn_cpu_dead(unsigned int cpu) > +{ > + __evtchn_fifo_handle_events(cpu, true); > + return 0; > +} I'm not familiar with the new state m

Re: [Xen-devel] Device model operation hypercall (DMOP, re qemu depriv)

2016-08-15 Thread David Vrabel
On 09/08/16 11:29, Jan Beulich wrote: On 08.08.16 at 15:46, wrote: >> Jan Beulich writes ("Re: Device model operation hypercall (DMOP, re qemu >> depriv)"): >>> On 05.08.16 at 18:28, wrote: That is, a bug of class 2 would allow the unprivileged qemu process in dom0 to cause damage

[Xen-devel] [PATCHv2 2/2] xen/privcmd: add ioctls for locking/unlocking hypercall buffers

2016-08-04 Thread David Vrabel
ould be used to minimize bouncing for performance critical hypercalls. Signed-off-by: David Vrabel --- v2: - Only take one reference per buffer. - Interate over the tree to unlock/free all buffers. - Max 1GB size per buffer. - Only use one memory allocation per buffer. - Fix overflow issues in privc

[Xen-devel] [PATCHv2 1/2] xen/prvicmd: use ENOTTY if the IOCTL is not supported

2016-08-04 Thread David Vrabel
The standard return value for ioctl(2) where the cmd is not supported is ENOTTY, not EINVAL. Signed-off-by: David Vrabel --- drivers/xen/privcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 702040f..ac76bc4 100644

[Xen-devel] [PATCHv2 0/2] xen/privcmd: prevent page migration for hypercall buffers

2016-08-04 Thread David Vrabel
Currently libxencall using mlocked buffers for hypercall buffers. This pages are subject to compaction and page migration. A userspace process may see a hypercall fail with -EFAULT if a page backing a hypercall buffer is in the process of being migrated. Page migration can be prevented by taking a

Re: [Xen-devel] [PATCH] CODING_STYLE: Allow single-sentence comments without full stops

2016-08-04 Thread David Vrabel
On 04/08/16 10:37, George Dunlap wrote: > One of the common ways in which contributors trip up over the > CODING_STYLE guides is by not putting a full stop at the end of a > comment when there is only a single sentence. Calling these out is a > waste of everybody's time: The full stop at the end o

Re: [Xen-devel] [PATCH v4 1/2] Interface for grant copy operation in libs.

2016-08-04 Thread David Vrabel
On 03/08/16 15:36, David Vrabel wrote: > On 02/08/16 15:06, Paulina Szubarczyk wrote: >> >> +/** >> + * Copy memory from or to grant references. The information of each >> operations >> + * are contained in 'xengnttab_grant_copy_segment_t'. The @flag va

[Xen-devel] [PATCHv1 2/2] libxencall: release the buffer cache before closing the fd

2016-08-03 Thread David Vrabel
Freeing a buffer may now call the IOCTL_PRIVCMD_HCALL_BUF_UNLOCK ioctl on the fd, so the fd should only be closed after the buffer cache is released. Signed-off-by: David Vrabel --- tools/libs/call/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/call/core.c

[Xen-devel] libxencall/linux: prevent page migration for hypercall buffers

2016-08-03 Thread David Vrabel
This is the libxencall side of the "xen/privcmd: prevent page migration for hypercall buffers​" series for Linux. It calls the necessary LOCK/UNLOCK ioctls. This should not be applied until after the Linux series is applied. David ___ Xen-devel maili

[Xen-devel] [PATCHv1 1/2] libxencall/linux: use LOCK/UNLOCK ioctls for hypercall buffers

2016-08-03 Thread David Vrabel
ngs of the hypercall buffers. Signed-off-by: David Vrabel --- tools/include/xen-sys/Linux/privcmd.h | 37 +++ tools/libs/call/linux.c | 47 --- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/tools/include/xen

[Xen-devel] [PATCHv1 2/2] xen/privcmd: add ioctls for locking/unlocking hypercall buffers

2016-08-03 Thread David Vrabel
ould be used to minimize bouncing for performance critical hypercalls. Locked buffers are stored in a rbtree for faster lookup during UNLOCK, and stored in a list so all buffers can be unlocked when the file descriptor is closed. Signed-off-by: David Vrabel --- drivers/xen/privc

[Xen-devel] [PATCHv1 0/2] xen/privcmd: prevent page migration for hypercall buffers

2016-08-03 Thread David Vrabel
Currently libxencall using mlocked buffers for hypercall buffers. This pages are subject to compaction and page migration. A userspace process may see a hypercall fail with -EFAULT if a page backing a hypercall buffer is in the process of being migrated. Page migration can be prevented by taking a

[Xen-devel] [PATCHv1 1/2] xen/prvicmd: use ENOTTY if the IOCTL is not supported

2016-08-03 Thread David Vrabel
The standard return value for ioctl(2) where the cmd is not supported is ENOTTY, not EINVAL. Signed-off-by: David Vrabel --- drivers/xen/privcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 702040f..ac76bc4 100644

Re: [Xen-devel] [PATCH v4 1/2] Interface for grant copy operation in libs.

2016-08-03 Thread David Vrabel
SIZE." might be better. With or without the above change: Reviewed-by: David Vrabel David ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] Device model operation hypercall (DMOP, re qemu depriv)

2016-08-02 Thread David Vrabel
On 02/08/16 12:58, Jan Beulich wrote: On 02.08.16 at 13:38, wrote: >> On Mon, Aug 01, 2016 at 06:41:20AM -0600, Jan Beulich wrote: >> On 01.08.16 at 13:32, wrote: 4. We could invent a new hypercall `DMOP' for hypercalls which device models should be able to use, which always

Re: [Xen-devel] [PATCHv1] xen/evtchn: add IOCTL_EVTCHN_RESTRICT

2016-08-01 Thread David Vrabel
On 01/08/16 12:15, Jan Beulich wrote: On 11.07.16 at 16:57, wrote: >> @@ -553,6 +570,27 @@ static long evtchn_ioctl(struct file *file, >> break; >> } >> >> +case IOCTL_EVTCHN_RESTRICT_DOMID: { >> +struct ioctl_evtchn_restrict_domid ierd; >> + >> +

Re: [Xen-devel] [PATCH linux] xen: change the type of xen_vcpu_id to uint32_t

2016-07-28 Thread David Vrabel
On 28/07/16 17:24, Vitaly Kuznetsov wrote: > We pass xen_vcpu_id mapping information to hypercalls which require > uint32_t type so it would be cleaner to have it as uint32_t. The > initializer to -1 can be dropped as we always do the mapping before using > it and we never check the 'not set' value

[Xen-devel] [RFC PATCHv1] xen/privcmd: add IOCTL_PRIVCMD_RESTRICT_DOMID

2016-07-28 Thread David Vrabel
file descriptor being used to escalate privleges if the process is compromised. FIXME: This is not good enough (yet) as it does not restrict what hypercalls may be performed. Fixing this requires a hypervisor ABI change. Signed-off-by: David Vrabel --- drivers/xen/privcmd.c | 75

Re: [Xen-devel] [PATCH v3] xen-blkfront: dynamic configuration of per-vbd resources

2016-07-28 Thread David Vrabel
On 27/07/16 04:21, Bob Liu wrote: > The current VBD layer reserves buffer space for each attached device based on > three statically configured settings which are read at boot time. > * max_indirect_segs: Maximum amount of segments. > * max_ring_page_order: Maximum order of pages to be used for t

[Xen-devel] [GIT PULL] xen: features and fixes for 4.8-rc0

2016-07-27 Thread David Vrabel
): xen/PMU: Log VPMU initialization error at lower level David Vrabel (1): xen/evtchn: add IOCTL_EVTCHN_RESTRICT Jan Beulich (11): xen-pciback: drop unused function parameter of read_dev_bar() xen-pciback: drop rom_init() xen-pciback: fold read_dev_bar() into its now

Re: [Xen-devel] [PATCH] xen: add static initialization of steal_clock op to xen_time_ops

2016-07-26 Thread David Vrabel
On 26/07/16 13:15, Juergen Gross wrote: > pv_time_ops might be overwritten with xen_time_ops after the > steal_clock operation has been initialized already. To prevent calling > a now uninitialized function pointer add the steal_clock static > initialization to xen_time_ops. Applied to for-linus-4

Re: [Xen-devel] [PATCH linux v3 0/9] xen: pvhvm: support bootup on secondary vCPUs

2016-07-26 Thread David Vrabel
On 26/07/16 13:30, Vitaly Kuznetsov wrote: > It may happen that Xen's and Linux's ideas of vCPU id diverge. In > particular, when we crash on a secondary vCPU we may want to do kdump > and unlike plain kexec where we do migrate_to_reboot_cpu() we try booting > on the vCPU which crashed. This doesn'

Re: [Xen-devel] [PATCH linux v2 0/9] xen: pvhvm: support bootup on secondary vCPUs

2016-07-25 Thread David Vrabel
On 25/07/16 15:01, Julien Grall wrote: > Hello, > > On 25/07/16 14:39, Vitaly Kuznetsov wrote: >> Julien Grall writes: >> >>> Hi David, >>> >>> On 25/07/16 13:38, David Vrabel wrote: >>>> On 30/06/16 16:56, Vitaly Kuznetsov wrote:

Re: [Xen-devel] [PATCH linux v2 0/9] xen: pvhvm: support bootup on secondary vCPUs

2016-07-25 Thread David Vrabel
On 25/07/16 14:17, Julien Grall wrote: > Hi David, > > On 25/07/16 13:38, David Vrabel wrote: >> On 30/06/16 16:56, Vitaly Kuznetsov wrote: >>> It may happen that Xen's and Linux's ideas of vCPU id diverge. In >>> particular, when we crash on a sec

Re: [Xen-devel] [PATCH 2/4] tools/libxc: Tolerate zero-length records in migration v2 streams

2016-07-25 Thread David Vrabel
On 25/07/16 13:46, Andrew Cooper wrote: > On 25/07/16 13:21, David Vrabel wrote: >> On 21/07/16 18:17, Andrew Cooper wrote: >>> Under some circumstances, the migration v2 save code would generate valid >>> records with zero content, when the intended behaviour

Re: [Xen-devel] [PATCH linux v2 0/9] xen: pvhvm: support bootup on secondary vCPUs

2016-07-25 Thread David Vrabel
On 30/06/16 16:56, Vitaly Kuznetsov wrote: > It may happen that Xen's and Linux's ideas of vCPU id diverge. In > particular, when we crash on a secondary vCPU we may want to do kdump > and unlike plain kexec where we do migrate_to_reboot_cpu() we try booting > on the vCPU which crashed. This doesn'

Re: [Xen-devel] [PATCH 2/4] tools/libxc: Tolerate zero-length records in migration v2 streams

2016-07-25 Thread David Vrabel
On 21/07/16 18:17, Andrew Cooper wrote: > Under some circumstances, the migration v2 save code would generate valid > records with zero content, when the intended behaviour was to omit the record As explained, this is not the intended behaviour. I wou

Re: [Xen-devel] Kernel panic on Xen virtualisation in Debian

2016-07-25 Thread David Vrabel
On 25/07/16 10:38, Ingo Jürgensmann wrote: > On 22.07.2016 12:21, Ingo Jürgensmann wrote: >> On 22.07.2016 11:03, Ingo Jürgensmann wrote: >> >>> In the meanwhile, I activated IPv6 again on Tuesday evening and today >>> the server crashed again some minutes ago. Here's the output from >>> netconsole

Re: [Xen-devel] [PATCH 1/4] docs: Clarify the expected behaviour of zero length records

2016-07-25 Thread David Vrabel
On 25/07/16 11:38, Andrew Cooper wrote: > On 25/07/16 11:35, David Vrabel wrote: >> On 25/07/16 11:25, Andrew Cooper wrote: >>> On 25/07/16 11:21, David Vrabel wrote: >>>> On 21/07/16 18:17, Andrew Cooper wrote: >>>>> The sending side shouldn&#

  1   2   3   4   5   6   7   8   9   10   >