* [PATCH] xen/p2m: fix extra memory regions accounting
@ 2015-09-03 12:03 Roger Pau Monne
0 siblings, 0 replies; 8+ messages in thread
From: Roger Pau Monne @ 2015-09-03 12:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Roger Pau Monne
On systems with memory maps with ranges that don't end at page boundaries,
like:
[...]
(XEN) 0000000000100000 - 00000000dfdf9c00 (usable)
(XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS)
[...]
xen_add_extra_mem will create a protected range that ends up at 0xdfdf9c00,
but the function used to check if a memory address is inside of a protected
range works with pfns, which means that an attempt to map 0xdfdf9c00 will be
refused because the check is performed against 0xdfdf9000 instead of
0xdfdf9c00.
In order to fix this, make sure that the ranges that are added to the
xen_extra_mem array are aligned to page boundaries.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
AFAICT this patch needs to be backported to 3.19, 4.0, 4.1 and 4.2.
---
arch/x86/xen/setup.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 55f388e..dcf5865 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -68,6 +68,9 @@ static void __init xen_add_extra_mem(phys_addr_t start, phys_addr_t size)
{
int i;
+ start = PAGE_ALIGN(start);
+ size &= PAGE_MASK;
+
for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
/* Add new region. */
if (xen_extra_mem[i].size == 0) {
@@ -92,6 +95,9 @@ static void __init xen_del_extra_mem(phys_addr_t start, phys_addr_t size)
int i;
phys_addr_t start_r, size_r;
+ start = PAGE_ALIGN(start);
+ size &= PAGE_MASK;
+
for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
start_r = xen_extra_mem[i].start;
size_r = xen_extra_mem[i].size;
--
1.9.5 (Apple Git-50.3)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] xen/p2m: fix extra memory regions accounting
2015-09-03 14:38 ` Roger Pau Monné
2015-09-03 14:45 ` David Vrabel
@ 2015-09-03 14:50 ` Juergen Gross
1 sibling, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2015-09-03 14:50 UTC (permalink / raw)
To: Roger Pau Monné, linux-kernel
Cc: Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel, xen-devel
On 09/03/2015 04:38 PM, Roger Pau Monné wrote:
> El 03/09/15 a les 14.25, Juergen Gross ha escrit:
>> On 09/03/2015 02:05 PM, Roger Pau Monne wrote:
>>> On systems with memory maps with ranges that don't end at page
>>> boundaries,
>>> like:
>>>
>>> [...]
>>> (XEN) 0000000000100000 - 00000000dfdf9c00 (usable)
>>> (XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS)
>>> [...]
>>>
>>> xen_add_extra_mem will create a protected range that ends up at
>>> 0xdfdf9c00,
>>> but the function used to check if a memory address is inside of a
>>> protected
>>> range works with pfns, which means that an attempt to map 0xdfdf9c00
>>> will be
>>> refused because the check is performed against 0xdfdf9000 instead of
>>> 0xdfdf9c00.
>>>
>>> In order to fix this, make sure that the ranges that are added to the
>>> xen_extra_mem array are aligned to page boundaries.
>>>
>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>> Cc: David Vrabel <david.vrabel@citrix.com>
>>> Cc: Juergen Gross <jgross@suse.com>
>>> Cc: xen-devel@lists.xenproject.org
>>> ---
>>> AFAICT this patch needs to be backported to 3.19, 4.0, 4.1 and 4.2.
>>> ---
>>> arch/x86/xen/setup.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>>
>>> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
>>> index 55f388e..dcf5865 100644
>>> --- a/arch/x86/xen/setup.c
>>> +++ b/arch/x86/xen/setup.c
>>> @@ -68,6 +68,9 @@ static void __init xen_add_extra_mem(phys_addr_t
>>> start, phys_addr_t size)
>>> {
>>> int i;
>>>
>>> + start = PAGE_ALIGN(start);
>>> + size &= PAGE_MASK;
>>
>> This is not correct. If start wasn't page aligned and size was, you'll
>> add one additional page to xen_extra_mem.
>
> I'm not understanding this, let's put an example:
>
> start = 0x8c00
> size = 0x1000
>
> After the fixup added above this would become:
>
> start = 0x9000
> size = 0x1000
>
> So if anything, I'm adding one page less (because 0x8000 was partly
> added, and with the fixup it is not added).
You'd add 9c00-9cff which shouldn't be added (in this example you
shouldn't add anything as no complete page is covered by the range).
You need something like:
end = (start + size) & PAGE_MASK;
start = PAGE_ALIGN(start);
size = end - start;
if (!size)
return;
Juergen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] xen/p2m: fix extra memory regions accounting
2015-09-03 14:38 ` Roger Pau Monné
@ 2015-09-03 14:45 ` David Vrabel
2015-09-03 14:50 ` Juergen Gross
1 sibling, 0 replies; 8+ messages in thread
From: David Vrabel @ 2015-09-03 14:45 UTC (permalink / raw)
To: Roger Pau Monné, Juergen Gross, linux-kernel
Cc: Konrad Rzeszutek Wilk, Boris Ostrovsky, xen-devel
On 03/09/15 15:38, Roger Pau Monné wrote:
> El 03/09/15 a les 14.25, Juergen Gross ha escrit:
>> On 09/03/2015 02:05 PM, Roger Pau Monne wrote:
>>> On systems with memory maps with ranges that don't end at page
>>> boundaries,
>>> like:
>>>
>>> [...]
>>> (XEN) 0000000000100000 - 00000000dfdf9c00 (usable)
>>> (XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS)
>>> [...]
>>>
>>> xen_add_extra_mem will create a protected range that ends up at
>>> 0xdfdf9c00,
>>> but the function used to check if a memory address is inside of a
>>> protected
>>> range works with pfns, which means that an attempt to map 0xdfdf9c00
>>> will be
>>> refused because the check is performed against 0xdfdf9000 instead of
>>> 0xdfdf9c00.
>>>
>>> In order to fix this, make sure that the ranges that are added to the
>>> xen_extra_mem array are aligned to page boundaries.
>>>
>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>> Cc: David Vrabel <david.vrabel@citrix.com>
>>> Cc: Juergen Gross <jgross@suse.com>
>>> Cc: xen-devel@lists.xenproject.org
>>> ---
>>> AFAICT this patch needs to be backported to 3.19, 4.0, 4.1 and 4.2.
>>> ---
>>> arch/x86/xen/setup.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>>
>>> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
>>> index 55f388e..dcf5865 100644
>>> --- a/arch/x86/xen/setup.c
>>> +++ b/arch/x86/xen/setup.c
>>> @@ -68,6 +68,9 @@ static void __init xen_add_extra_mem(phys_addr_t
>>> start, phys_addr_t size)
>>> {
>>> int i;
>>>
>>> + start = PAGE_ALIGN(start);
>>> + size &= PAGE_MASK;
>>
>> This is not correct. If start wasn't page aligned and size was, you'll
>> add one additional page to xen_extra_mem.
>
> I'm not understanding this, let's put an example:
>
> start = 0x8c00
> size = 0x1000
>
> After the fixup added above this would become:
>
> start = 0x9000
> size = 0x1000
>
> So if anything, I'm adding one page less (because 0x8000 was partly
> added, and with the fixup it is not added).
We expand the reserved (i.e., non-RAM) areas down so they're fully
covered with whole pages when we depopulate and 1:1 map them, we should
add extra memory regions that cover these same areas.
See the use of PFN_DOWN() and PFN_UP() in xen_set_identify_and_remap().
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] xen/p2m: fix extra memory regions accounting
2015-09-03 12:25 ` Juergen Gross
@ 2015-09-03 14:38 ` Roger Pau Monné
2015-09-03 14:45 ` David Vrabel
2015-09-03 14:50 ` Juergen Gross
0 siblings, 2 replies; 8+ messages in thread
From: Roger Pau Monné @ 2015-09-03 14:38 UTC (permalink / raw)
To: Juergen Gross, linux-kernel
Cc: Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel, xen-devel
El 03/09/15 a les 14.25, Juergen Gross ha escrit:
> On 09/03/2015 02:05 PM, Roger Pau Monne wrote:
>> On systems with memory maps with ranges that don't end at page
>> boundaries,
>> like:
>>
>> [...]
>> (XEN) 0000000000100000 - 00000000dfdf9c00 (usable)
>> (XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS)
>> [...]
>>
>> xen_add_extra_mem will create a protected range that ends up at
>> 0xdfdf9c00,
>> but the function used to check if a memory address is inside of a
>> protected
>> range works with pfns, which means that an attempt to map 0xdfdf9c00
>> will be
>> refused because the check is performed against 0xdfdf9000 instead of
>> 0xdfdf9c00.
>>
>> In order to fix this, make sure that the ranges that are added to the
>> xen_extra_mem array are aligned to page boundaries.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: David Vrabel <david.vrabel@citrix.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: xen-devel@lists.xenproject.org
>> ---
>> AFAICT this patch needs to be backported to 3.19, 4.0, 4.1 and 4.2.
>> ---
>> arch/x86/xen/setup.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
>> index 55f388e..dcf5865 100644
>> --- a/arch/x86/xen/setup.c
>> +++ b/arch/x86/xen/setup.c
>> @@ -68,6 +68,9 @@ static void __init xen_add_extra_mem(phys_addr_t
>> start, phys_addr_t size)
>> {
>> int i;
>>
>> + start = PAGE_ALIGN(start);
>> + size &= PAGE_MASK;
>
> This is not correct. If start wasn't page aligned and size was, you'll
> add one additional page to xen_extra_mem.
I'm not understanding this, let's put an example:
start = 0x8c00
size = 0x1000
After the fixup added above this would become:
start = 0x9000
size = 0x1000
So if anything, I'm adding one page less (because 0x8000 was partly
added, and with the fixup it is not added).
Roger.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] xen/p2m: fix extra memory regions accounting
2015-09-03 12:15 ` Roger Pau Monné
@ 2015-09-03 12:26 ` Juergen Gross
0 siblings, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2015-09-03 12:26 UTC (permalink / raw)
To: Roger Pau Monné, linux-kernel
Cc: Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel, xen-devel
On 09/03/2015 02:15 PM, Roger Pau Monné wrote:
> El 03/09/15 a les 14.05, Roger Pau Monne ha escrit:
>> On systems with memory maps with ranges that don't end at page boundaries,
>> like:
>>
>> [...]
>> (XEN) 0000000000100000 - 00000000dfdf9c00 (usable)
>> (XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS)
>> [...]
>>
>> xen_add_extra_mem will create a protected range that ends up at 0xdfdf9c00,
>> but the function used to check if a memory address is inside of a protected
>> range works with pfns, which means that an attempt to map 0xdfdf9c00 will be
>> refused because the check is performed against 0xdfdf9000 instead of
>> 0xdfdf9c00.
>>
>> In order to fix this, make sure that the ranges that are added to the
>> xen_extra_mem array are aligned to page boundaries.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: David Vrabel <david.vrabel@citrix.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: xen-devel@lists.xenproject.org
>> ---
>> AFAICT this patch needs to be backported to 3.19, 4.0, 4.1 and 4.2.
>> ---
>> arch/x86/xen/setup.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
>> index 55f388e..dcf5865 100644
>> --- a/arch/x86/xen/setup.c
>> +++ b/arch/x86/xen/setup.c
>> @@ -68,6 +68,9 @@ static void __init xen_add_extra_mem(phys_addr_t start, phys_addr_t size)
>> {
>> int i;
>>
>> + start = PAGE_ALIGN(start);
>
> Sorry, I didn't remember to update the patch before sending it, but I
> think this should instead be:
>
> start = round_up(start, PAGE_SIZE);
No, PAGE_ALIGN() already does that.
Juergen
>
> Here and below.
>
>> + size &= PAGE_MASK;
>> +
>> for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
>> /* Add new region. */
>> if (xen_extra_mem[i].size == 0) {
>> @@ -92,6 +95,9 @@ static void __init xen_del_extra_mem(phys_addr_t start, phys_addr_t size)
>> int i;
>> phys_addr_t start_r, size_r;
>>
>> + start = PAGE_ALIGN(start);
>> + size &= PAGE_MASK;
>> +
>> for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
>> start_r = xen_extra_mem[i].start;
>> size_r = xen_extra_mem[i].size;
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] xen/p2m: fix extra memory regions accounting
2015-09-03 12:05 Roger Pau Monne
2015-09-03 12:15 ` Roger Pau Monné
@ 2015-09-03 12:25 ` Juergen Gross
2015-09-03 14:38 ` Roger Pau Monné
1 sibling, 1 reply; 8+ messages in thread
From: Juergen Gross @ 2015-09-03 12:25 UTC (permalink / raw)
To: Roger Pau Monne, linux-kernel
Cc: Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel, xen-devel
On 09/03/2015 02:05 PM, Roger Pau Monne wrote:
> On systems with memory maps with ranges that don't end at page boundaries,
> like:
>
> [...]
> (XEN) 0000000000100000 - 00000000dfdf9c00 (usable)
> (XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS)
> [...]
>
> xen_add_extra_mem will create a protected range that ends up at 0xdfdf9c00,
> but the function used to check if a memory address is inside of a protected
> range works with pfns, which means that an attempt to map 0xdfdf9c00 will be
> refused because the check is performed against 0xdfdf9000 instead of
> 0xdfdf9c00.
>
> In order to fix this, make sure that the ranges that are added to the
> xen_extra_mem array are aligned to page boundaries.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: xen-devel@lists.xenproject.org
> ---
> AFAICT this patch needs to be backported to 3.19, 4.0, 4.1 and 4.2.
> ---
> arch/x86/xen/setup.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index 55f388e..dcf5865 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -68,6 +68,9 @@ static void __init xen_add_extra_mem(phys_addr_t start, phys_addr_t size)
> {
> int i;
>
> + start = PAGE_ALIGN(start);
> + size &= PAGE_MASK;
This is not correct. If start wasn't page aligned and size was, you'll
add one additional page to xen_extra_mem.
> +
> for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
> /* Add new region. */
> if (xen_extra_mem[i].size == 0) {
> @@ -92,6 +95,9 @@ static void __init xen_del_extra_mem(phys_addr_t start, phys_addr_t size)
> int i;
> phys_addr_t start_r, size_r;
>
> + start = PAGE_ALIGN(start);
> + size &= PAGE_MASK;
Not really needed, as xen_del_extra_mem() is called with aligned values
only. OTOH it does no harm, as long as you correct size as above.
> +
> for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
> start_r = xen_extra_mem[i].start;
> size_r = xen_extra_mem[i].size;
>
Juergen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] xen/p2m: fix extra memory regions accounting
2015-09-03 12:05 Roger Pau Monne
@ 2015-09-03 12:15 ` Roger Pau Monné
2015-09-03 12:26 ` Juergen Gross
2015-09-03 12:25 ` Juergen Gross
1 sibling, 1 reply; 8+ messages in thread
From: Roger Pau Monné @ 2015-09-03 12:15 UTC (permalink / raw)
To: linux-kernel
Cc: Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel,
Juergen Gross, xen-devel
El 03/09/15 a les 14.05, Roger Pau Monne ha escrit:
> On systems with memory maps with ranges that don't end at page boundaries,
> like:
>
> [...]
> (XEN) 0000000000100000 - 00000000dfdf9c00 (usable)
> (XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS)
> [...]
>
> xen_add_extra_mem will create a protected range that ends up at 0xdfdf9c00,
> but the function used to check if a memory address is inside of a protected
> range works with pfns, which means that an attempt to map 0xdfdf9c00 will be
> refused because the check is performed against 0xdfdf9000 instead of
> 0xdfdf9c00.
>
> In order to fix this, make sure that the ranges that are added to the
> xen_extra_mem array are aligned to page boundaries.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: xen-devel@lists.xenproject.org
> ---
> AFAICT this patch needs to be backported to 3.19, 4.0, 4.1 and 4.2.
> ---
> arch/x86/xen/setup.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index 55f388e..dcf5865 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -68,6 +68,9 @@ static void __init xen_add_extra_mem(phys_addr_t start, phys_addr_t size)
> {
> int i;
>
> + start = PAGE_ALIGN(start);
Sorry, I didn't remember to update the patch before sending it, but I
think this should instead be:
start = round_up(start, PAGE_SIZE);
Here and below.
> + size &= PAGE_MASK;
> +
> for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
> /* Add new region. */
> if (xen_extra_mem[i].size == 0) {
> @@ -92,6 +95,9 @@ static void __init xen_del_extra_mem(phys_addr_t start, phys_addr_t size)
> int i;
> phys_addr_t start_r, size_r;
>
> + start = PAGE_ALIGN(start);
> + size &= PAGE_MASK;
> +
> for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
> start_r = xen_extra_mem[i].start;
> size_r = xen_extra_mem[i].size;
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] xen/p2m: fix extra memory regions accounting
@ 2015-09-03 12:05 Roger Pau Monne
2015-09-03 12:15 ` Roger Pau Monné
2015-09-03 12:25 ` Juergen Gross
0 siblings, 2 replies; 8+ messages in thread
From: Roger Pau Monne @ 2015-09-03 12:05 UTC (permalink / raw)
To: linux-kernel
Cc: Roger Pau Monne, Konrad Rzeszutek Wilk, Boris Ostrovsky,
David Vrabel, Juergen Gross, xen-devel
On systems with memory maps with ranges that don't end at page boundaries,
like:
[...]
(XEN) 0000000000100000 - 00000000dfdf9c00 (usable)
(XEN) 00000000dfdf9c00 - 00000000dfe4bc00 (ACPI NVS)
[...]
xen_add_extra_mem will create a protected range that ends up at 0xdfdf9c00,
but the function used to check if a memory address is inside of a protected
range works with pfns, which means that an attempt to map 0xdfdf9c00 will be
refused because the check is performed against 0xdfdf9000 instead of
0xdfdf9c00.
In order to fix this, make sure that the ranges that are added to the
xen_extra_mem array are aligned to page boundaries.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org
---
AFAICT this patch needs to be backported to 3.19, 4.0, 4.1 and 4.2.
---
arch/x86/xen/setup.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 55f388e..dcf5865 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -68,6 +68,9 @@ static void __init xen_add_extra_mem(phys_addr_t start, phys_addr_t size)
{
int i;
+ start = PAGE_ALIGN(start);
+ size &= PAGE_MASK;
+
for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
/* Add new region. */
if (xen_extra_mem[i].size == 0) {
@@ -92,6 +95,9 @@ static void __init xen_del_extra_mem(phys_addr_t start, phys_addr_t size)
int i;
phys_addr_t start_r, size_r;
+ start = PAGE_ALIGN(start);
+ size &= PAGE_MASK;
+
for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
start_r = xen_extra_mem[i].start;
size_r = xen_extra_mem[i].size;
--
1.9.5 (Apple Git-50.3)
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-09-03 14:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-03 12:03 [PATCH] xen/p2m: fix extra memory regions accounting Roger Pau Monne
2015-09-03 12:05 Roger Pau Monne
2015-09-03 12:15 ` Roger Pau Monné
2015-09-03 12:26 ` Juergen Gross
2015-09-03 12:25 ` Juergen Gross
2015-09-03 14:38 ` Roger Pau Monné
2015-09-03 14:45 ` David Vrabel
2015-09-03 14:50 ` Juergen Gross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®