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

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 16:03, wrote: > 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: > + memmap.nr_entries = ARRAY_SIZE(xen_e820_table->entries); Is it

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

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 16:03, wrote: > 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: > + memmap.nr_entries = ARRAY_SIZE(xen_e820_table->entries); Is it really reasonable to have a static upper bound here? As we

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

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

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

2017-12-19 Thread Jan Beulich
>>> 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 >>

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

2017-12-19 Thread Jan Beulich
>>> 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 nevertheless be a warning, as failure to go through

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

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

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

2017-12-19 Thread Juergen Gross
On 19/12/17 10:27, Jan Beulich wrote: On 19.12.17 at 10:21, wrote: >> On 19/12/17 09:23, Jan Beulich wrote: >> On 18.12.17 at 23:22, wrote: +void __init arch_xen_balloon_init(struct resource *hostmem_resource) +{ + struct

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

2017-12-19 Thread Juergen Gross
On 19/12/17 10:27, Jan Beulich wrote: On 19.12.17 at 10:21, wrote: >> On 19/12/17 09:23, Jan Beulich wrote: >> On 18.12.17 at 23:22, wrote: +void __init arch_xen_balloon_init(struct resource *hostmem_resource) +{ + struct xen_memory_map memmap; + int rc; +

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

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 10:21, wrote: > On 19/12/17 09:23, Jan Beulich wrote: > On 18.12.17 at 23:22, wrote: >>> +void __init arch_xen_balloon_init(struct resource *hostmem_resource) >>> +{ >>> + struct xen_memory_map memmap; >>> + int rc; >>> +

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

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 10:21, wrote: > On 19/12/17 09:23, Jan Beulich wrote: > On 18.12.17 at 23:22, wrote: >>> +void __init arch_xen_balloon_init(struct resource *hostmem_resource) >>> +{ >>> + struct xen_memory_map memmap; >>> + int rc; >>> + unsigned int i, last_guest_ram; >>> +

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

2017-12-19 Thread Juergen Gross
On 19/12/17 09:23, Jan Beulich wrote: On 18.12.17 at 23:22, wrote: >> +void __init arch_xen_balloon_init(struct resource *hostmem_resource) >> +{ >> +struct xen_memory_map memmap; >> +int rc; >> +unsigned int i, last_guest_ram; >> +phys_addr_t

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

2017-12-19 Thread Juergen Gross
On 19/12/17 09:23, Jan Beulich wrote: On 18.12.17 at 23:22, wrote: >> +void __init arch_xen_balloon_init(struct resource *hostmem_resource) >> +{ >> +struct xen_memory_map memmap; >> +int rc; >> +unsigned int i, last_guest_ram; >> +phys_addr_t max_addr = max_pfn <<

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

2017-12-19 Thread Jan Beulich
>>> On 18.12.17 at 23:22, wrote: > +void __init arch_xen_balloon_init(struct resource *hostmem_resource) > +{ > + struct xen_memory_map memmap; > + int rc; > + unsigned int i, last_guest_ram; > + phys_addr_t max_addr = max_pfn << PAGE_SHIFT; PFN_PHYS()

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

2017-12-19 Thread Jan Beulich
>>> On 18.12.17 at 23:22, wrote: > +void __init arch_xen_balloon_init(struct resource *hostmem_resource) > +{ > + struct xen_memory_map memmap; > + int rc; > + unsigned int i, last_guest_ram; > + phys_addr_t max_addr = max_pfn << PAGE_SHIFT; PFN_PHYS() as right now you still have

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

2017-12-19 Thread Juergen Gross
On 18/12/17 23:22, Boris Ostrovsky wrote: > Commit f5775e0b6116 ("x86/xen: discard RAM regions above the maximum > reservation") left host memory not assigned to dom0 as available for > memory hotplug. > > Unfortunately this also meant that those regions could be used by > others. Specifically,

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

2017-12-19 Thread Juergen Gross
On 18/12/17 23:22, Boris Ostrovsky wrote: > Commit f5775e0b6116 ("x86/xen: discard RAM regions above the maximum > reservation") left host memory not assigned to dom0 as available for > memory hotplug. > > Unfortunately this also meant that those regions could be used by > others. Specifically,

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

2017-12-18 Thread Boris Ostrovsky
Commit f5775e0b6116 ("x86/xen: discard RAM regions above the maximum reservation") left host memory not assigned to dom0 as available for memory hotplug. Unfortunately this also meant that those regions could be used by others. Specifically, commit fa564ad96366 ("x86/PCI: Enable a 64bit BAR on

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

2017-12-18 Thread Boris Ostrovsky
Commit f5775e0b6116 ("x86/xen: discard RAM regions above the maximum reservation") left host memory not assigned to dom0 as available for memory hotplug. Unfortunately this also meant that those regions could be used by others. Specifically, commit fa564ad96366 ("x86/PCI: Enable a 64bit BAR on