Re: [Xen-devel] [PATCH] x86/hvm: Unify hvm_event_pending()'s API with the !CONFIG_HVM version

2018-11-09 Thread Boris Ostrovsky
On 11/9/18 9:42 AM, Andrew Cooper wrote: > No functional change. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Wei Liu > CC: Jun Nakajima > CC: Kevin Tian > CC: Boris Ostrovsky > CC: Suravee Suthikulpanit > CC: Brian Woods >

Re: [Xen-devel] [PATCH] x86/msr: Handle MSR_AMD64_DR{0-3}_ADDRESS_MASK in the new MSR infrastructure

2018-11-16 Thread Boris Ostrovsky
_domctl 95819099-482 > Total: Before=3314610, After=3313581, chg -0.03% > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Wei Liu > CC: Roger Pau Monné > CC: Boris Ostrovsky > CC: Suravee Suthikulpanit > CC:

Re: [Xen-devel] [PATCH] x86/xen: cleanup includes in arch/x86/xen/spinlock.c

2018-11-19 Thread Boris Ostrovsky
On 11/19/18 8:59 AM, Juergen Gross wrote: > arch/x86/xen/spinlock.c includes several headers which are not needed. > Remove the #includes. > > Signed-off-by: Juergen Gross > --- Reviewed-by: Boris Ostrovsky ___ Xen-devel mailing

Re: [Xen-devel] [PATCH 0/9] Use vm_insert_range

2018-11-21 Thread Boris Ostrovsky
On 11/21/18 1:24 AM, Souptick Joarder wrote: > On Thu, Nov 15, 2018 at 9:09 PM Souptick Joarder wrote: >> Previouly drivers have their own way of mapping range of >> kernel pages/memory into user vma and this was done by >> invoking vm_insert_page() within a loop. >> >> As this pattern is common a

Re: [Xen-devel] [PATCH 0/9] Use vm_insert_range

2018-11-21 Thread Boris Ostrovsky
On 11/21/18 2:56 PM, Souptick Joarder wrote: > On Thu, Nov 22, 2018 at 1:08 AM Boris Ostrovsky > wrote: >> On 11/21/18 1:24 AM, Souptick Joarder wrote: >>> On Thu, Nov 15, 2018 at 9:09 PM Souptick Joarder >>> wrote: >>>> Previouly drivers have their own

Re: [Xen-devel] [PATCH V3 2/2] Xen/PCIback: Implement PCI flr/slot/bus reset with 'reset' SysFS attribute

2017-12-18 Thread Boris Ostrovsky
On 12/18/2017 02:36 AM, Jan Beulich wrote: On 15.12.17 at 20:52, wrote: > +static int pcistub_device_reset(struct pci_dev *dev) > +{ > + struct xen_pcibk_dev_data *dev_data; > + bool slot = false, bus = false; > + struct pcistub_args arg = {}; > + > + if (!dev) >>>

[Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-18 Thread Boris Ostrovsky
plug. Signed-off-by: Boris Ostrovsky --- Changes in v2: In enlighten.c: - Fix 32-bit build problem (include bootmem.h), make variables 32-bit safe - Add a test to avoid inserting a resource into hostmem which is beyond hostmem's end - Replace 'while' loop with 'for' to simpli

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Boris Ostrovsky
On 12/19/2017 03:23 AM, Jan Beulich wrote: On 18.12.17 at 23:22, wrote: + + xen_e820_table = kzalloc(sizeof(*xen_e820_table), GFP_KERNEL); > Wouldn't kmalloc() suffice here? Yes. > >> +if (!xen_e820_table) >> +return; > Not saying "out of memory" here is cert

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Boris Ostrovsky
On 12/19/2017 09:40 AM, Jan Beulich wrote: On 19.12.17 at 15:25, wrote: >> On 12/19/2017 03:23 AM, Jan Beulich wrote: >> On 18.12.17 at 23:22, wrote: + if (!xen_e820_table) + return; >>> Not saying "out of memory" here is certainly fine, but shouldn't >>> there nevert

[Xen-devel] [PATCH v3] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-20 Thread Boris Ostrovsky
plug. Signed-off-by: Boris Ostrovsky --- Changes in v3: * Use PFN_PHYS * Replace kzalloc with kmalloc * Declare arch_xen_balloon_init prototype in balloon.h * Rename resources (s/memory/RAM/) * Clarify (I think) comment when populating hostmem_resource * Print open-ended interval on insert_resourc

Re: [Xen-devel] [PATCH 2/2] x86/svm: Add checks for nested HW features

2017-12-21 Thread Boris Ostrovsky
On 12/21/2017 10:26 AM, Brian Woods wrote: > Add a nestedhvm_enable() check to the existing checks for setting the > virtual GIF and virtual VMLOAD/VMSAVE features. If it isn't a nestedhvm > guest, do not enable the features in the VMCB. > > Signed-off-by: Brian Woods

Re: [Xen-devel] [PATCH 1/2] x86/svm: Add SVME checking for SVM intercepts

2017-12-21 Thread Boris Ostrovsky
On 12/21/2017 10:26 AM, Brian Woods wrote: > Checks the hvm EFER.SVME bit to make sure the EFER.SVME bit it high s/it/is > before allowing nested SVM intercepts to be handled successfully. On > SVME being low, it generates a #UD as per the AMD APM vol2 15.4. > > Reported-by: Andrew Cooper > Sig

Re: [Xen-devel] OProfile with Xen-4.9

2017-12-22 Thread Boris Ostrovsky
On 12/21/2017 11:06 AM, Сергей wrote: > Hello. > > I have installed Xen-4.9 from Ubuntu 17.10 package. And I would like to > profile it with OProfile (as far as I know this is the only option). > > With instruction from > http://wiki.prgmr.com/mediawiki/index.php/Chapter_10:_Profiling_and_Benchm

Re: [Xen-devel] [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()

2018-01-02 Thread Boris Ostrovsky
On 12/23/2017 09:50 PM, Nick Desaulniers wrote: > The header declares this function as __init but is defined in __ref > section. > > Signed-off-by: Nick Desaulniers AFAIK section attributes in header files are ignored by compiler anyway so I'd remove all of them. -boris > --- > arch/x86/xen/x

Re: [Xen-devel] [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()

2018-01-02 Thread Boris Ostrovsky
On 01/02/2018 09:32 AM, Andrew Cooper wrote: > On 02/01/18 14:24, Juergen Gross wrote: >> On 02/01/18 15:18, Boris Ostrovsky wrote: >>> On 12/23/2017 09:50 PM, Nick Desaulniers wrote: >>>> The header declares this function as __init but is defined in __ref >>

Re: [Xen-devel] [PATCH -next] xen/pvcalls: use GFP_ATOMIC under spin lock

2018-01-02 Thread Boris Ostrovsky
On 12/27/2017 10:46 PM, Wei Yongjun wrote: > A spin lock is taken here so we should use GFP_ATOMIC. > > Fixes: 9774c6cca266 ("xen/pvcalls: implement accept command") > Signed-off-by: Wei Yongjun Applied to for-linus-4.15 -boris ___ Xen-devel mailing

Re: [Xen-devel] [PATCH 1/3] xen: remove tests for pvh mode in pure pv paths

2018-01-08 Thread Boris Ostrovsky
On 01/08/2018 01:50 AM, Juergen Gross wrote: > On 06/01/18 06:55, HW42 wrote: >> >> Not sure if you prefer to change the grant-table code or to revert this >> part of the commit. The patch bellow works for me: > The patch looks fine. > >> From: Simon Gaiser >> Date: Sat, 6 Jan 2018 06:40:32 +0100

Re: [Xen-devel] [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()

2018-01-08 Thread Boris Ostrovsky
On 01/06/2018 03:35 PM, Nick Desaulniers wrote: > On Tue, Jan 2, 2018 at 7:00 AM, Boris Ostrovsky > wrote: >> On 01/02/2018 09:32 AM, Andrew Cooper wrote: >>> On 02/01/18 14:24, Juergen Gross wrote: >>>> On 02/01/18 15:18, Boris Ostrovsky wrote: >>>&

Re: [Xen-devel] [PATCH] xen-netfront: enable device after manual module load

2018-01-08 Thread Boris Ostrovsky
ate would communicate the netback to create its > device and establish the connection between them. > > Signed-off-by: Eduardo Otubo Reviewed-by: Boris Ostrovsky Should this go to stable trees as well? -boris > --- > drivers/net/xen-netfront.c | 1 + > 1 file changed, 1 inser

Re: [Xen-devel] [PATCH v2] x86: xen: remove the use of VLAIS

2018-01-08 Thread Boris Ostrovsky
On 01/06/2018 04:39 PM, Nick Desaulniers wrote: > Variable Length Arrays In Structs (VLAIS) is not supported by Clang, and > frowned upon by others. > > https://lkml.org/lkml/2013/9/23/500 > > Here, the VLAIS was used because the size of the bitmap returned from > xen_mc_entry() depended on possibl

Re: [Xen-devel] [PATCH v2] x86: xen: remove the use of VLAIS

2018-01-08 Thread Boris Ostrovsky
On 01/08/2018 11:10 AM, Peter Zijlstra wrote: > On Sat, Jan 06, 2018 at 01:39:48PM -0800, Nick Desaulniers wrote: >> Variable Length Arrays In Structs (VLAIS) is not supported by Clang, and >> frowned upon by others. >> >> https://lkml.org/lkml/2013/9/23/500 >> >> Here, the VLAIS was used because t

Re: [Xen-devel] [PATCH v2] x86: xen: remove the use of VLAIS

2018-01-08 Thread Boris Ostrovsky
On 01/08/2018 11:28 AM, Juergen Gross wrote: > On 08/01/18 17:20, Boris Ostrovsky wrote: >> On 01/08/2018 11:10 AM, Peter Zijlstra wrote: >>> On Sat, Jan 06, 2018 at 01:39:48PM -0800, Nick Desaulniers wrote: >>>> Variable Length Arrays In Structs (VLAIS) is not suppor

Re: [Xen-devel] Linux 4.15-rc6 + xen-unstable: BUG: unable to handle kernel NULL pointer dereference at (null), [ 0.000000] IP: zero_resv_unavail+0x8e/0xe1

2018-01-09 Thread Boris Ostrovsky
On 01/09/2018 11:31 AM, Sander Eikelenboom wrote: > On 09/01/18 17:16, Pavel Tatashin wrote: >> Hi Juergen, >> >> Do you have this patch applied: >> >> https://github.com/torvalds/linux/commit/e8c24773d6b2cd9bc8b36bd6e60beff599be14be > Seems this hasn't made it to Linus yet ? > > I will give it a t

Re: [Xen-devel] [PATCH 1/2] xen/gntdev: Fix off-by-one error when unmapping with holes

2018-01-09 Thread Boris Ostrovsky
On 01/09/2018 07:10 AM, Ross Lagerwall wrote: If the requested range has a hole, the calculation of the number of pages to unmap is off by one. Fix it. Signed-off-by: Ross Lagerwall Reviewed-by: Boris Ostrovsky ___ Xen-devel mailing list Xen

Re: [Xen-devel] [PATCH 2/2] xen/gntdev: Fix partial gntdev_mmap() cleanup

2018-01-09 Thread Boris Ostrovsky
: Bad page map in process" if Xen is in release mode. This is only needed when use_ptemod is true because gntdev_put_map() will unmap grant pages itself when use_ptemod is false. Signed-off-by: Ross Lagerwall Reviewed-by: Boris Ostrovsky although I wonder whether it may be possib

Re: [Xen-devel] [PATCH v8 10/17] x86/hvm: Permit guests direct access to MSR_{SPEC_CTRL, PRED_CMD}

2018-01-15 Thread Boris Ostrovsky
VMX and SVM code I think you should have Cc-ed the maintainers (now added, and leaving the full patch in context for them. Reviewed-by: Boris Ostrovsky ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman

Re: [Xen-devel] [PATCH v8 13/17] x86/boot: Calculate the most appropriate BTI mitigation to use

2018-01-16 Thread Boris Ostrovsky
On 01/12/2018 01:01 PM, Andrew Cooper wrote: > > +if ( boot_cpu_has(X86_FEATURE_IBRSB) ) > +{ > +/* > + * Even if we've chosen to not have IBRS set in Xen context, we still > + * need the IBRS entry/exit logic to virtualise IBRS support for > + * guests. >

Re: [Xen-devel] [PATCH v8 13/17] x86/boot: Calculate the most appropriate BTI mitigation to use

2018-01-16 Thread Boris Ostrovsky
On 01/16/2018 09:13 AM, Andrew Cooper wrote: > On 16/01/18 14:10, Boris Ostrovsky wrote: >> On 01/12/2018 01:01 PM, Andrew Cooper wrote: >>> >>> +if ( boot_cpu_has(X86_FEATURE_IBRSB) ) >>> +{ >>> +/* >>> + * Even i

Re: [Xen-devel] [PATCH 1/2] xen/grant-table: Use put_page instead of free_page

2018-01-16 Thread Boris Ostrovsky
between calling > get_page() and free_page() on a compound page causes a reference > counting error which is detected when DEBUG_VM is enabled. > > Signed-off-by: Ross Lagerwall Reviewed-by: Boris Ostrovsky ___ Xen-devel mailing li

Re: [Xen-devel] [PATCH 2/2] xen-netfront: Fix race between device setup and open

2018-01-16 Thread Boris Ostrovsky
we fail to recreate the queues so check for this > in the open function. > > Signed-off-by: Ross Lagerwall Reviewed-by: Boris Ostrovsky ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v9 05/11] x86/hvm: Permit guests direct access to MSR_{SPEC_CTRL, PRED_CMD}

2018-01-18 Thread Boris Ostrovsky
On 01/18/2018 10:46 AM, Andrew Cooper wrote: > For performance reasons, HVM guests should have direct access to these MSRs > when possible. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Jun Nakajima > CC: Kevin Tian > CC: Boris Ostrovsky > CC:

Re: [Xen-devel] [PATCH v9 06/11] x86/entry: Organise the use of MSR_SPEC_CTRL at each entry/exit point

2018-01-22 Thread Boris Ostrovsky
On 01/19/2018 08:36 AM, Andrew Cooper wrote: > On 19/01/18 11:43, Jan Beulich wrote: > >>> @@ -99,6 +106,10 @@ UNLIKELY_END(realmode) >>> .Lvmx_vmentry_fail: >>> sti >>> SAVE_ALL >>> + >>> +SPEC_CTRL_ENTRY_FROM_PV /* Req: %rsp=regs/cpuinfo Clob: acd */ >> I think the use

Re: [Xen-devel] [PATCH v9 06/11] x86/entry: Organise the use of MSR_SPEC_CTRL at each entry/exit point

2018-01-22 Thread Boris Ostrovsky
On 01/22/2018 07:17 PM, Andrew Cooper wrote: On 22/01/2018 22:27, Boris Ostrovsky wrote: On 01/19/2018 08:36 AM, Andrew Cooper wrote: On 19/01/18 11:43, Jan Beulich wrote: @@ -99,6 +106,10 @@ UNLIKELY_END(realmode) .Lvmx_vmentry_fail: sti SAVE_ALL

Re: [Xen-devel] [PATCH v2 3/3] drop "domain_" prefix from struct domain's dirty CPU mask

2018-01-23 Thread Boris Ostrovsky
ges (consolidate split line statements into single > line ones). Re-base. Reviewed-by: Boris Ostrovsky ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v2] libxl: put RSDP for PVH guest near 4GB

2018-01-23 Thread Boris Ostrovsky
On 01/18/2018 05:33 AM, Wei Liu wrote: > On Thu, Jan 18, 2018 at 11:31:32AM +0100, Juergen Gross wrote: >> Wei, >> >> On 01/12/17 15:14, Juergen Gross wrote: >>> Instead of locating the RSDP table below 1MB put it just below 4GB >>> like the rest of the ACPI tables in case of PVH guests. This will

Re: [Xen-devel] [PATCH v2] libxl: put RSDP for PVH guest near 4GB

2018-01-24 Thread Boris Ostrovsky
On 01/24/2018 07:06 AM, Juergen Gross wrote: > On 24/01/18 11:54, Roger Pau Monné wrote: >> On Wed, Jan 24, 2018 at 10:42:39AM +, George Dunlap wrote: >>> On Wed, Jan 24, 2018 at 2:41 AM, Boris Ostrovsky >>> wrote: >>>> On 01/18/2018 05:33 AM, Wei Liu

Re: [Xen-devel] [PATCH v2] libxl: put RSDP for PVH guest near 4GB

2018-01-24 Thread Boris Ostrovsky
On 01/24/2018 09:25 AM, Juergen Gross wrote: > On 24/01/18 15:10, Boris Ostrovsky wrote: >> >> I suspect we can do as little as removing "#ifdef CONFIG_KEXEC" around >> acpi_rsdp in drivers/acpi/osl.c and then assigning it the value in >> pvh_start_info.rsdp_p

Re: [Xen-devel] [PATCH v2] libxl: put RSDP for PVH guest near 4GB

2018-01-24 Thread Boris Ostrovsky
On 01/24/2018 10:26 AM, George Dunlap wrote: > On Wed, Jan 24, 2018 at 3:20 PM, Juergen Gross wrote: >> On 24/01/18 16:07, George Dunlap wrote: >>> On Wed, Jan 24, 2018 at 2:10 PM, Boris Ostrovsky >>> wrote: >>>> On 01/24/2018 07:06 AM, Juergen Gross wr

Re: [Xen-devel] [PATCH v2] libxl: put RSDP for PVH guest near 4GB

2018-01-24 Thread Boris Ostrovsky
On 01/24/2018 11:15 AM, Juergen Gross wrote: > On 24/01/18 17:10, Boris Ostrovsky wrote: > >> >>>> So what is the problem here? >>>> >>>> - current Linux can't be booted as PVH guest with xen-unstable due to >>>> a bug in Linux, pa

Re: [Xen-devel] [PATCH v2 2/2] xen: add acpi_arch_get_root_pointer() for pvh guests

2018-01-25 Thread Boris Ostrovsky
to that change it was pure luck that the legacy method to locate the RSDP was working when running as PVH mode. Cc: # 4.11 Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https

[Xen-devel] [PATCH] flask: Remove reference to DOMCTL_getmemlist

2018-01-28 Thread Boris Ostrovsky
Commit 94450e36bfbb ("xen: Drop DOMCTL_getmemlist and xc_get_pfn_list()") missed reference to DOMCTL_getmemlist in hooks.s Signed-off-by: Boris Ostrovsky --- xen/xsm/flask/hooks.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c ind

Re: [PATCH 1/2] xen/gntdev.c: Mark pages as dirty

2020-09-11 Thread boris . ostrovsky
ch, set > it in gntdev_grant_copy_seg() (and drop `writeable` argument to > gntdev_get_page()) and then, based on batch->writeable, use > set_page_dirty_lock(). > > Fixes: a4cdb556cae0 (xen/gntdev: add ioctl for grant copy) > Suggested-by: Boris Ostrovsky > Signed-off-by: Souptick J

Re: [PATCH 2/2] xen/gntdev.c: Convert get_user_pages*() to pin_user_pages*()

2020-09-11 Thread boris . ostrovsky
umentation/core-api/pin_user_pages.rst > > [2] "Explicit pinning of user-space pages": > https://lwn.net/Articles/807108/ > > Signed-off-by: Souptick Joarder > Cc: John Hubbard > Cc: Boris Ostrovsky > Cc: Juergen Gross > Cc: David Vrabel Reviewed-by: Boris Ostrovsky

Re: [PATCH v3 00/11] Fix PM hibernation in Xen guests

2020-09-11 Thread boris . ostrovsky
On 8/21/20 6:22 PM, Anchal Agarwal wrote: > > Known issues: > 1.KASLR causes intermittent hibernation failures. VM fails to resumes and > has to be restarted. I will investigate this issue separately and shouldn't > be a blocker for this patch series. Is there any change in status for this? Thi

Re: [PATCH v3 01/11] xen/manage: keep track of the on-going suspend mode

2020-09-13 Thread boris . ostrovsky
On 8/21/20 6:25 PM, Anchal Agarwal wrote: > From: Munehisa Kamata > > Guest hibernation is different from xen suspend/resume/live migration. > Xen save/restore does not use pm_ops as is needed by guest hibernation. > Hibernation in guest follows ACPI path and is guest inititated , the > hibe

Re: [PATCH v3 02/11] xenbus: add freeze/thaw/restore callbacks support

2020-09-13 Thread boris . ostrovsky
On 8/21/20 6:26 PM, Anchal Agarwal wrote: > From: Munehisa Kamata > > Since commit b3e96c0c7562 ("xen: use freeze/restore/thaw PM events for > suspend/resume/chkpt"), xenbus uses PMSG_FREEZE, PMSG_THAW and > PMSG_RESTORE events for Xen suspend. However, they're actually assigned > to xenbus_dev

Re: [PATCH v3 01/11] xen/manage: keep track of the on-going suspend mode

2020-09-13 Thread boris . ostrovsky
On 8/21/20 6:25 PM, Anchal Agarwal wrote: > From: Munehisa Kamata > > Guest hibernation is different from xen suspend/resume/live migration. > Xen save/restore does not use pm_ops as is needed by guest hibernation. > Hibernation in guest follows ACPI path and is guest inititated , the > hibern

Re: [PATCH v3 04/11] x86/xen: add system core suspend and resume callbacks

2020-09-13 Thread boris . ostrovsky
On 8/21/20 6:27 PM, Anchal Agarwal wrote: > From: Munehisa Kamata > > Add Xen PVHVM specific system core callbacks for PM > hibernation support. The callbacks suspend and resume > Xen primitives like shared_info, pvclock and grant table. > These syscore_ops are specifically for domU hibernation.

Re: [PATCH v3 10/11] xen: Update sched clock offset to avoid system instability in hibernation

2020-09-13 Thread boris . ostrovsky
On 8/21/20 6:30 PM, Anchal Agarwal wrote: > Save/restore xen_sched_clock_offset in syscore suspend/resume during PM > hibernation. Commit '867cefb4cb1012: ("xen: Fix x86 sched_clock() interface > for xen")' fixes xen guest time handling during migration. A similar issue > is seen during PM hibern

Re: [PATCH v3 01/11] xen/manage: keep track of the on-going suspend mode

2020-09-14 Thread boris . ostrovsky
On 9/14/20 5:47 PM, Anchal Agarwal wrote: > On Sun, Sep 13, 2020 at 11:43:30AM -0400, boris.ostrov...@oracle.com wrote: >> CAUTION: This email originated from outside of the organization. Do not >> click links or open attachments unless you can confirm the sender and know >> the content is safe

Re: [PATCH v3 01/11] xen/manage: keep track of the on-going suspend mode

2020-09-15 Thread boris . ostrovsky
>> >> > + > +static int xen_setup_pm_notifier(void) > +{ > + if (!xen_hvm_domain() || xen_initial_domain()) > + return -ENODEV; I don't think this works anymore. >>> What do you mean? >>> The first check is for xen domain types and other is for archi

Re: [PATCH 6/6] x86/xen: open code alloc_vm_area in arch_gnttab_valloc

2020-09-21 Thread boris . ostrovsky
On 9/18/20 12:37 PM, Christoph Hellwig wrote: > > +static int gnttab_apply(pte_t *pte, unsigned long addr, void *data) > +{ > + pte_t ***p = data; > + > + **p = pte; > + (*p)++; > + return 0; > +} > + > static int arch_gnttab_valloc(struct gnttab_vm_area *area, unsigned > nr_f

Re: [PATCH 6/6] x86/xen: open code alloc_vm_area in arch_gnttab_valloc

2020-09-22 Thread boris . ostrovsky
On 9/22/20 10:58 AM, Christoph Hellwig wrote: > On Mon, Sep 21, 2020 at 04:44:10PM -0400, boris.ostrov...@oracle.com wrote: >> This will end up incrementing area->ptes pointer. So perhaps something like >> >> >> pte_t **ptes = area->ptes; >> >> if (apply_to_page_range(&init_mm, (unsigned long)are

Re: [PATCH 6/6] x86/xen: open code alloc_vm_area in arch_gnttab_valloc

2020-09-22 Thread boris . ostrovsky
On 9/22/20 11:27 AM, Christoph Hellwig wrote: > On Tue, Sep 22, 2020 at 11:24:20AM -0400, boris.ostrov...@oracle.com wrote: >> On 9/22/20 10:58 AM, Christoph Hellwig wrote: >>> On Mon, Sep 21, 2020 at 04:44:10PM -0400, boris.ostrov...@oracle.com wrote: This will end up incrementing area->pte

Re: [PATCH v3 01/11] xen/manage: keep track of the on-going suspend mode

2020-09-22 Thread boris . ostrovsky
On 9/21/20 5:54 PM, Anchal Agarwal wrote: > Thanks for the above suggestion. You are right I didn't find a way to declare > a global state either. I just broke the above check in 2 so that once we have > support for ARM we should be able to remove aarch64 condition easily. Let me > know if I am m

Re: [PATCH 09/11] xen/xenbus: use apply_to_page_range directly in xenbus_map_ring_pv

2020-09-24 Thread boris . ostrovsky
On 9/24/20 9:58 AM, Christoph Hellwig wrote: > Replacing alloc_vm_area with get_vm_area_caller + apply_page_range > allows to fill put the phys_addr values directly instead of doing > another loop over all addresses. > > Signed-off-by: Christoph Hellwig Reviewed-by: Boris Ostrovsky -boris

Re: [PATCH 10/11] x86/xen: open code alloc_vm_area in arch_gnttab_valloc

2020-09-24 Thread boris . ostrovsky
On 9/24/20 9:58 AM, Christoph Hellwig wrote: > Replace the last call to alloc_vm_area with an open coded version using > an iterator in struct gnttab_vm_area instead of the triple indirection > magic in alloc_vm_area. > > Signed-off-by: Christoph Hellwig Reviewed-by: Boris Ostrovsky

Re: [PATCH] x86/xen: disable Firmware First mode for correctable memory errors

2020-09-25 Thread boris . ostrovsky
t; + * errors, as this is the duty of the hypervisor to decide. > + */ > + acpi_disable_cmcff = 1; > +#endif Not that it matters greatly but should this go under if (xen_initial_domain()) clause a bit further down? Either way: Reviewed-by: Boris Ostrovsky

Re: [PATCH v3 01/11] xen/manage: keep track of the on-going suspend mode

2020-09-25 Thread boris . ostrovsky
On 9/25/20 3:04 PM, Anchal Agarwal wrote: > On Tue, Sep 22, 2020 at 11:17:36PM +, Anchal Agarwal wrote: >> On Tue, Sep 22, 2020 at 12:18:05PM -0400, boris.ostrov...@oracle.com wrote: >>> CAUTION: This email originated from outside of the organization. Do not >>> click links or open attachmen

Re: [PATCH v3 01/11] xen/manage: keep track of the on-going suspend mode

2020-09-28 Thread boris . ostrovsky
On 9/25/20 6:28 PM, Anchal Agarwal wrote: > On Fri, Sep 25, 2020 at 04:02:58PM -0400, boris.ostrov...@oracle.com wrote: >> CAUTION: This email originated from outside of the organization. Do not >> click links or open attachments unless you can confirm the sender and know >> the content is safe

Re: [PATCH 2/2] xen/gntdev.c: Convert get_user_pages*() to pin_user_pages*()

2020-09-29 Thread boris . ostrovsky
] & [2] could >>> be referred for more information. This is case 5 as per document [1]. >>> >>> [1] Documentation/core-api/pin_user_pages.rst >>> >>> [2] "Explicit pinning of user-space pages": >>> https://lwn.net/Articles/8

Re: [PATCH] xen/events: don't use chip_data for legacy IRQs

2020-09-30 Thread boris . ostrovsky
30fb1ddc0a ("XEN uses irqdesc::irq_data_common::handler_data to > store a per interrupt XEN data pointer which contains XEN specific > information.") > Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky

Re: [PATCH 2/2] xen/gntdev.c: Convert get_user_pages*() to pin_user_pages*()

2020-09-30 Thread boris . ostrovsky
gt;>> [1] Documentation/core-api/pin_user_pages.rst >>>>> >>>>> [2] "Explicit pinning of user-space pages": >>>>> https://lwn.net/Articles/807108/ >>>>> >>>>> Signed-off-by: Souptick Joarder >>>&

Re: [PATCH] xen: remove redundant initialization of variable ret

2020-09-30 Thread boris . ostrovsky
On 9/18/20 11:17 PM, Jing Xiangfeng wrote: > After commit 9f51c05dc41a ("pvcalls-front: Avoid > get_free_pages(GFP_KERNEL) under spinlock"), the variable ret is being > initialized with '-ENOMEM' that is meaningless. So remove it. > > Signed-off-by: Jing Xiangfeng Applied to for-linus-5.10

Re: [PATCH v2] x86/xen: disable Firmware First mode for correctable memory errors

2020-09-30 Thread boris . ostrovsky
nks for guests. > > Cc: sta...@vger.kernel.org > Signed-off-by: Juergen Gross > Reviewed-by: Boris Ostrovsky Applied to for-linus-5.10 -boris

Re: [PATCH] arch/x86: fix some typos in xen_pagetable_p2m_free()

2020-09-30 Thread boris . ostrovsky
On 9/27/20 1:28 PM, Hui Su wrote: > arch/x86: fix some typos in xen_pagetable_p2m_free(): > s/Fortunatly/Fortunately > > Signed-off-by: Hui Su Applied to for-linus-5.10 (after rewording slightly the commit message) -boris

Re: [PATCH v3 01/11] xen/manage: keep track of the on-going suspend mode

2020-10-01 Thread boris . ostrovsky
>>> Also, wrt KASLR stuff, that issue is still seen sometimes but I haven't >>> had >>> bandwidth to dive deep into the issue and fix it. So what's the plan there? You first mentioned this issue early this year and judged by your response it is not clear whether you will e

Re: [PATCH 2/2] xen: Kconfig: nest Xen guest options

2020-10-15 Thread boris . ostrovsky
On 10/14/20 1:53 PM, Jason Andryuk wrote: > +config XEN_512GB > + bool "Limit Xen pv-domain memory to 512GB" > + depends on XEN_PV && X86_64 Why is X86_64 needed here? -boris

Re: [PATCH 2/2] xen: Kconfig: nest Xen guest options

2020-10-15 Thread boris . ostrovsky
On 10/15/20 9:10 AM, Andrew Cooper wrote: > On 15/10/2020 13:37, boris.ostrov...@oracle.com wrote: >> On 10/14/20 1:53 PM, Jason Andryuk wrote: >>> +config XEN_512GB >>> + bool "Limit Xen pv-domain memory to 512GB" >>> + depends on XEN_PV && X86_64 >> Why is X86_64 needed here? >> 512G suppor

Re: [PATCH] xen/blkfront: fix memory allocation flags in blkfront_setup_indirect()

2020-04-03 Thread Boris Ostrovsky
ion") > Cc: sta...@vger.kernel.org > Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky

Re: [PATCH] x86/xen: fix booting 32-bit pv guest

2020-04-09 Thread Boris Ostrovsky
86/xen: Make the boot CPU idle task reliable") > Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky > --- > arch/x86/xen/xen-head.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S > inde

Re: [PATCH] x86/xen: drop an unused parameter gsi_override

2020-04-28 Thread Boris Ostrovsky
On 4/28/20 11:36 AM, Wei Liu wrote: > All callers within the same file pass in -1 (no override). > > Signed-off-by: Wei Liu Reviewed-by: Boris Ostrovsky

Re: [PATCH] xenbus: avoid stack overflow warning

2020-05-05 Thread Boris Ostrovsky
On 5/5/20 12:02 PM, Jürgen Groß wrote: > On 05.05.20 17:01, Arnd Bergmann wrote: >> On Tue, May 5, 2020 at 4:34 PM Jürgen Groß wrote: >>> On 05.05.20 16:15, Arnd Bergmann wrote: The __xenbus_map_ring() function has two large arrays, 'map' and 'unmap' on its stack. When clang decides to

Re: Troubles running Xen on Raspberry Pi 4 with 5.6.1 DomU

2020-05-05 Thread Boris Ostrovsky
On 5/5/20 6:34 PM, Stefano Stabellini wrote: > > > The crash happens here: > > if (!WARN_ON((dev_addr + size - 1 > dma_mask) || >range_straddles_page_boundary(phys, size)) && > TestClearPageXenRemapped(virt_to_page(vaddr))) > xen_destroy_contigu

Re: Troubles running Xen on Raspberry Pi 4 with 5.6.1 DomU

2020-05-06 Thread Boris Ostrovsky
On 5/6/20 9:08 AM, Nataliya Korovkina wrote: > Hello, > > What I found out: rpi_firmware_property_list() allocates memory from > dma_atomic_pool which was mapped to VMALLOC region, so virt_to_page() > is not eligible in this case. So then it seems it didn't go through xen_swiotlb_alloc_coherent

Re: Troubles running Xen on Raspberry Pi 4 with 5.6.1 DomU

2020-05-06 Thread Boris Ostrovsky
On 5/6/20 12:14 PM, Nataliya Korovkina wrote: > On Wed, May 6, 2020 at 9:43 AM Boris Ostrovsky > wrote: >> >> On 5/6/20 9:08 AM, Nataliya Korovkina wrote: >>> Hello, >>> >>> What I found out: rpi_firmware_property_list() allocates memory from &g

[PATCH] xen/cpuhotplug: Fix initial CPU offlining for PV(H) guests

2020-05-08 Thread Boris Ostrovsky
all offlining steps in setup_cpu_watcher() simply call disable_hotplug_cpu(). Fixes: a926f81d2f6c (xen/cpuhotplug: Replace cpu_up/down() with device_online/offline()" Signed-off-by: Boris Ostrovsky --- drivers/xen/cpu_hotplug.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) di

Re: [PATCH 1/2] xen/xenbus: avoid large structs and arrays on the stack

2020-05-11 Thread Boris Ostrovsky
On 5/11/20 3:31 AM, Juergen Gross wrote: > > static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev, I wonder whether we can drop valloc/vfree from xenbus_ring_ops' names. > + struct map_ring_valloc *info, > grant

Re: [PATCH 2/2] xen/xenbus: let xenbus_map_ring_valloc() return errno values only

2020-05-11 Thread Boris Ostrovsky
ing errors into -ENOENT. This is > no problem as all callers of xenbus_map_ring_valloc() only use the > return value to print an error message, and in case of mapping errors > the grant status value has already been printed by __xenbus_map_ring() > before. > > Signed-off-by: Ju

Re: [PATCH 1/1] xen/manage: enable C_A_D to force reboot

2020-05-15 Thread Boris Ostrovsky
hink 'xl reboot -F' should do be handling this scenario but (1) it is currently not quite set up for this and (2) I can't see how it works at all given that noone handles LIBXL_TRIGGER_RESET in arch_do_domctl(XEN_DOMCTL_sendtrigger). -boris > > > Juergen > >> >&

Re: grant table issues mapping a ring order 10

2020-05-19 Thread Boris Ostrovsky
On 5/19/20 5:21 PM, Stefano Stabellini wrote: > Hi Juergen, Boris, > > I am trying to increase the size of the rings used for Xen 9pfs > connections for performance reasons and also to reduce the likehood of > the backend having to wait on the frontend to free up space from the > ring. > > FYI I re

Re: [Xen-devel] [PATCH v3 2/4] x86/xen: add basic KASAN support for PV kernel

2020-02-10 Thread Boris Ostrovsky
his enables to use Outline instrumentation for Xen PV kernels. > KASAN_INLINE and KASAN_VMALLOC options currently lead to boot crashes > and hence disabled. > > Signed-off-by: Sergey Dyasli Xen bits: Reviewed-by: Boris Ostrovsky ___ Xe

Re: [Xen-devel] [PATCH v3 3/4] xen: teach KASAN about grant tables

2020-02-10 Thread Boris Ostrovsky
On 2/7/20 9:26 AM, Sergey Dyasli wrote: > From: Ross Lagerwall > > Otherwise it produces lots of false positives when a guest starts using > PV I/O devices. > > Signed-off-by: Ross Lagerwall > Signed-off-by: Sergey Dyasli > Revi

Re: [Xen-devel] [PATCH 14/30] x86/xen: Add missing annotation for xen_pte_lock()

2020-02-14 Thread Boris Ostrovsky
ned-off-by: Jules Irenge Reviewed-by: Boris Ostrovsky although I'd prefer this and the next patch to be merged into a single one. ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] x86/xen: Distribute switch variables for initialization

2020-02-20 Thread Boris Ostrovsky
On 2/20/20 1:37 AM, Jürgen Groß wrote: > On 20.02.20 07:23, Kees Cook wrote: >> Variables declared in a switch statement before any case statements >> cannot be automatically initialized with compiler instrumentation (as >> they are not part of any execution flow). With GCC's proposed automatic >

Re: [Xen-devel] [PATCH] xen: Replace zero-length array with flexible-array member

2020-02-28 Thread Boris Ostrovsky
On 2/27/20 4:31 AM, Jürgen Groß wrote: > On 26.02.20 22:26, Gustavo A. R. Silva wrote: >> The current codebase makes use of the zero-length array language >> extension to the C90 standard, but the preferred mechanism to declare >> variable-length types such as these ones is a flexible array >> me

Re: [Xen-devel] [PATCH] xen: Use 'unsigned int' instead of 'unsigned'

2020-03-03 Thread Boris Ostrovsky
On 3/3/20 3:30 AM, Jan Beulich wrote: > On 02.03.2020 23:18, Yan Yankovskyi wrote: >> On Mon, Mar 2, 2020 at 10:11 Jan Beulich wrote: >>> ... evtchn_port_t here and elsewhere. >> There are some interfaces with signed int as a type for port, e.g. in >> include/xen/events.h. >> Should I create addi

Re: [Xen-devel] [PATCH] xen/xenbus: fix locking

2020-03-05 Thread Boris Ostrovsky
060eabe8fbe726 ("xenbus/backend: Protect xenbus callback with lock") > Signed-off-by: Juergen Gross > Reviewed-by: Boris Ostrovsky ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v3 2/2] xenbus: req->err should be updated before req->state

2020-03-06 Thread Boris Ostrovsky
On 3/3/20 5:14 PM, Dongli Zhang wrote: > This patch adds the barrier to guarantee that req->err is always updated > before req->state. > > Otherwise, read_reply() would not return ERR_PTR(req->err) but > req->body, when process_writes()->xb_write() is failed. > > Signed-off-by: Dongli Zhang App

Re: [Xen-devel] [PATCH] xen/xenbus: fix locking

2020-03-06 Thread Boris Ostrovsky
On 3/5/20 5:03 AM, Juergen Gross wrote: > Commit 060eabe8fbe726 ("xenbus/backend: Protect xenbus callback with > lock") introduced a bug by holding a lock while calling a function > which might schedule. > > Fix that by using a semaphore instead. > > Fixes: 060eabe8fbe726 ("xenbus/backend: Protec

Re: [Xen-devel] [PATCH v3] xen/blkfront: fix ring info addressing

2020-03-06 Thread Boris Ostrovsky
On 3/5/20 10:51 AM, Juergen Gross wrote: > Commit 0265d6e8ddb890 ("xen/blkfront: limit allocated memory size to > actual use case") made struct blkfront_ring_info size dynamic. This is > fine when running with only one queue, but with multiple queues the > addressing of the single queues has to b

Re: [Xen-devel] [PATCH] xen: Use evtchn_type_t as a type for event channels

2020-03-06 Thread Boris Ostrovsky
On 3/5/20 4:57 AM, Yan Yankovskyi wrote: > Make event channel functions pass event channel port using > evtchn_port_t type. It eliminates signed <-> unsigned conversion. > Also rename 'evtchn' variables to 'port' in case if 'port' is not > ambiguous. > @@ -171,10 +171,10 @@ static int xen_irq_i

Re: [Xen-devel] [PATCH v2] xen: Use evtchn_type_t as a type for event channels

2020-03-07 Thread Boris Ostrovsky
On 3/7/20 8:43 AM, Yan Yankovskyi wrote: > Make event channel functions pass event channel port using > evtchn_port_t type. It eliminates signed <-> unsigned conversion. > > static int find_virq(unsigned int virq, unsigned int cpu) > { > struct evtchn_status status; > - int port, rc

Re: [Xen-devel] [PATCH v2] xen: Use evtchn_type_t as a type for event channels

2020-03-09 Thread Boris Ostrovsky
On 3/8/20 9:19 AM, Yan Yankovskyi wrote: > On Sat, Mar 07, 2020 at 02:41:44PM -0500, Boris Ostrovsky wrote: > >> I also think that, given that this patch is trying to get types in >> order, find_virq() will need more changes: it is supposed to return >> evtchn_port_t. B

Re: [Xen-devel] [PATCH] xen/xenbus: remove unused xenbus_map_ring()

2020-03-10 Thread Boris Ostrovsky
On 3/9/20 11:54 AM, Juergen Gross wrote: > xenbus_map_ring() is used nowhere in the tree, remove it. > xenbus_unmap_ring() is used only locally, so make it static and move it > up. > > Signed-off-by: Juergen Gross > Reviewed-by: Boris Ostrovsky Applied

Re: [Xen-devel] [PATCH 1/2] x86/xen: Make the boot CPU idle task reliable

2020-03-16 Thread Boris Ostrovsky
On 3/12/20 10:20 AM, Miroslav Benes wrote: > --- a/arch/x86/xen/xen-head.S > +++ b/arch/x86/xen/xen-head.S > @@ -35,7 +35,7 @@ SYM_CODE_START(startup_xen) > rep __ASM_SIZE(stos) > > mov %_ASM_SI, xen_start_info > - mov $init_thread_union+THREAD_SIZE, %_ASM_SP > + mov $init_t

Re: [Xen-devel] [PATCH] xen-pciback: fix INTERRUPT_TYPE_* defines

2020-03-19 Thread Boris Ostrovsky
On 3/19/20 12:06 AM, Marek Marczykowski-Górecki wrote: INTERRUPT_TYPE_NONE should be 0, Would   return ret ?: INTERRUPT_TYPE_NONE in xen_pcibk_get_interrupt_type() work? I think it's better not to tie macro name to a particular value. -boris as it is assumed in xen_pcibk_get_interr

Re: [Xen-devel] [PATCH] xen/events: avoid NULL pointer dereference in evtchn_from_irq()

2020-03-19 Thread Boris Ostrovsky
On 3/19/20 3:14 AM, Juergen Gross wrote: There have been reports of races in evtchn_from_irq() where the info pointer has been NULL. Do you have an example of how this race happens (and how moving kfree to rcu will help)? (I am mostly wondering whether we'd be masking a more serious proble

Re: [Xen-devel] [PATCH v2] xen-pciback: fix INTERRUPT_TYPE_* defines

2020-03-20 Thread Boris Ostrovsky
holes. > But also, do not assume INTERRUPT_TYPE_NONE being 0 anymore to avoid > similar confusions in the future. > > Fixes: 476878e4b2be ("xen-pciback: optionally allow interrupt enable flag > writes") > Signed-off-by: Marek Marczykowski

Re: [Xen-devel] [PATCH v3 1/2] xen: Use evtchn_type_t as a type for event channels

2020-03-23 Thread Boris Ostrovsky
On 3/23/20 1:33 AM, Yan Yankovskyi wrote: > Make event channel functions pass event channel port using > evtchn_port_t type. It eliminates signed <-> unsigned conversion. > > Signed-off-by: Yan Yankovskyi Reviewed-by: Boris Ostrovsky > > @@ -1275,7 +1276,7 @@ vo

<    2   3   4   5   6   7   8   9   10   11   >