Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-19 Thread Juergen Gross
On 11/19/2014 08:43 PM, Konrad Rzeszutek Wilk wrote: On Fri, Nov 14, 2014 at 06:14:06PM +0100, Juergen Gross wrote: On 11/14/2014 05:47 PM, Konrad Rzeszutek Wilk wrote: On Fri, Nov 14, 2014 at 05:53:19AM +0100, Juergen Gross wrote: On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: +

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-19 Thread Konrad Rzeszutek Wilk
On Fri, Nov 14, 2014 at 06:14:06PM +0100, Juergen Gross wrote: > On 11/14/2014 05:47 PM, Konrad Rzeszutek Wilk wrote: > >On Fri, Nov 14, 2014 at 05:53:19AM +0100, Juergen Gross wrote: > >>On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: > >>+ mfn_save = virt_to_mfn(buf); > >>+ >

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-19 Thread Konrad Rzeszutek Wilk
On Fri, Nov 14, 2014 at 06:14:06PM +0100, Juergen Gross wrote: On 11/14/2014 05:47 PM, Konrad Rzeszutek Wilk wrote: On Fri, Nov 14, 2014 at 05:53:19AM +0100, Juergen Gross wrote: On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: + mfn_save = virt_to_mfn(buf); + + while

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-19 Thread Juergen Gross
On 11/19/2014 08:43 PM, Konrad Rzeszutek Wilk wrote: On Fri, Nov 14, 2014 at 06:14:06PM +0100, Juergen Gross wrote: On 11/14/2014 05:47 PM, Konrad Rzeszutek Wilk wrote: On Fri, Nov 14, 2014 at 05:53:19AM +0100, Juergen Gross wrote: On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: +

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-14 Thread Juergen Gross
On 11/14/2014 05:47 PM, Konrad Rzeszutek Wilk wrote: On Fri, Nov 14, 2014 at 05:53:19AM +0100, Juergen Gross wrote: On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: + mfn_save = virt_to_mfn(buf); + + while (xen_remap_mfn != INVALID_P2M_ENTRY) { So the 'list' is constructed by

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-14 Thread Konrad Rzeszutek Wilk
On Fri, Nov 14, 2014 at 05:53:19AM +0100, Juergen Gross wrote: > On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: > + mfn_save = virt_to_mfn(buf); > + > + while (xen_remap_mfn != INVALID_P2M_ENTRY) { > >>> > >>>So the 'list' is constructed by going forward - that is from

Re: [Xen-devel] [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-14 Thread David Vrabel
On 14/11/14 04:53, Juergen Gross wrote: > > Using BUG() instead would make the code less complex. Do you really > think xen_update_mem_tables() would ever fail in a sane system? > > - set_phys_to_machine() would fail only on a memory shortage. Just > going on without adding more memory

Re: [Xen-devel] [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-14 Thread David Vrabel
On 14/11/14 04:53, Juergen Gross wrote: Using BUG() instead would make the code less complex. Do you really think xen_update_mem_tables() would ever fail in a sane system? - set_phys_to_machine() would fail only on a memory shortage. Just going on without adding more memory wouldn't lead

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-14 Thread Konrad Rzeszutek Wilk
On Fri, Nov 14, 2014 at 05:53:19AM +0100, Juergen Gross wrote: On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: + mfn_save = virt_to_mfn(buf); + + while (xen_remap_mfn != INVALID_P2M_ENTRY) { So the 'list' is constructed by going forward - that is from low-numbered PFNs to higher

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-14 Thread Juergen Gross
On 11/14/2014 05:47 PM, Konrad Rzeszutek Wilk wrote: On Fri, Nov 14, 2014 at 05:53:19AM +0100, Juergen Gross wrote: On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: + mfn_save = virt_to_mfn(buf); + + while (xen_remap_mfn != INVALID_P2M_ENTRY) { So the 'list' is constructed by

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-13 Thread Juergen Gross
On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: + mfn_save = virt_to_mfn(buf); + + while (xen_remap_mfn != INVALID_P2M_ENTRY) { So the 'list' is constructed by going forward - that is from low-numbered PFNs to higher numbered ones. But the 'xen_remap_mfn' is going the other

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-13 Thread Konrad Rzeszutek Wilk
> >>+ mfn_save = virt_to_mfn(buf); > >>+ > >>+ while (xen_remap_mfn != INVALID_P2M_ENTRY) { > > > >So the 'list' is constructed by going forward - that is from low-numbered > >PFNs to higher numbered ones. But the 'xen_remap_mfn' is going the > >other way - from the highest PFN to the lowest

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-13 Thread Konrad Rzeszutek Wilk
+ mfn_save = virt_to_mfn(buf); + + while (xen_remap_mfn != INVALID_P2M_ENTRY) { So the 'list' is constructed by going forward - that is from low-numbered PFNs to higher numbered ones. But the 'xen_remap_mfn' is going the other way - from the highest PFN to the lowest PFN. Won't that

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-13 Thread Juergen Gross
On 11/13/2014 08:56 PM, Konrad Rzeszutek Wilk wrote: + mfn_save = virt_to_mfn(buf); + + while (xen_remap_mfn != INVALID_P2M_ENTRY) { So the 'list' is constructed by going forward - that is from low-numbered PFNs to higher numbered ones. But the 'xen_remap_mfn' is going the other

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-12 Thread Juergen Gross
On 11/12/2014 10:45 PM, Konrad Rzeszutek Wilk wrote: On Tue, Nov 11, 2014 at 06:43:40AM +0100, Juergen Gross wrote: diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index a8a1a3d..d3e492b 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1223,6 +1223,10 @@ static void __init

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-12 Thread Konrad Rzeszutek Wilk
On Tue, Nov 11, 2014 at 06:43:40AM +0100, Juergen Gross wrote: > Early in the boot process the memory layout of a pv-domain is changed > to match the E820 map (either the host one for Dom0 or the Xen one) > regarding placement of RAM and PCI holes. This requires removing memory > pages initially

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-12 Thread Konrad Rzeszutek Wilk
On Tue, Nov 11, 2014 at 06:43:40AM +0100, Juergen Gross wrote: Early in the boot process the memory layout of a pv-domain is changed to match the E820 map (either the host one for Dom0 or the Xen one) regarding placement of RAM and PCI holes. This requires removing memory pages initially

Re: [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-12 Thread Juergen Gross
On 11/12/2014 10:45 PM, Konrad Rzeszutek Wilk wrote: On Tue, Nov 11, 2014 at 06:43:40AM +0100, Juergen Gross wrote: diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index a8a1a3d..d3e492b 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1223,6 +1223,10 @@ static void __init

Re: [Xen-devel] [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-11 Thread Juergen Gross
On 11/11/2014 12:45 PM, Andrew Cooper wrote: On 11/11/14 05:43, Juergen Gross wrote: diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index fa75842..f67f8cf 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -268,6 +271,22 @@ static void p2m_init(unsigned long *p2m)

Re: [Xen-devel] [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-11 Thread Andrew Cooper
On 11/11/14 05:43, Juergen Gross wrote: > diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c > index fa75842..f67f8cf 100644 > --- a/arch/x86/xen/p2m.c > +++ b/arch/x86/xen/p2m.c > @@ -268,6 +271,22 @@ static void p2m_init(unsigned long *p2m) > p2m[i] = INVALID_P2M_ENTRY; > } >

Re: [Xen-devel] [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-11 Thread Andrew Cooper
On 11/11/14 05:43, Juergen Gross wrote: diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index fa75842..f67f8cf 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -268,6 +271,22 @@ static void p2m_init(unsigned long *p2m) p2m[i] = INVALID_P2M_ENTRY; } +static

Re: [Xen-devel] [PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-11 Thread Juergen Gross
On 11/11/2014 12:45 PM, Andrew Cooper wrote: On 11/11/14 05:43, Juergen Gross wrote: diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index fa75842..f67f8cf 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -268,6 +271,22 @@ static void p2m_init(unsigned long *p2m)

[PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-10 Thread Juergen Gross
Early in the boot process the memory layout of a pv-domain is changed to match the E820 map (either the host one for Dom0 or the Xen one) regarding placement of RAM and PCI holes. This requires removing memory pages initially located at positions not suitable for RAM and adding them later at

[PATCH V3 2/8] xen: Delay remapping memory of pv-domain

2014-11-10 Thread Juergen Gross
Early in the boot process the memory layout of a pv-domain is changed to match the E820 map (either the host one for Dom0 or the Xen one) regarding placement of RAM and PCI holes. This requires removing memory pages initially located at positions not suitable for RAM and adding them later at