diff mbox

hdata: Respect OCC and HOMER resevations

Message ID 20170515063103.17347-1-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran May 15, 2017, 6:31 a.m. UTC
In the past we've ignored these since Hostboot insisted in exporting
broken reservations and the OCC was not being used yet. This situation
seems to have resolved itself so we should respect the reservations that
hostboot provides.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hdata/memory.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Vaidyanathan Srinivasan May 15, 2017, 7:19 a.m. UTC | #1
* Oliver O'Halloran <oohall@gmail.com> [2017-05-15 16:31:03]:

> In the past we've ignored these since Hostboot insisted in exporting
> broken reservations and the OCC was not being used yet. This situation
> seems to have resolved itself so we should respect the reservations that
> hostboot provides.
> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Acked-by:  Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>

> ---
>  hdata/memory.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/hdata/memory.c b/hdata/memory.c
> index 2df1136c3627..0c6c0811f61a 100644
> --- a/hdata/memory.c
> +++ b/hdata/memory.c
> @@ -457,12 +457,6 @@ static void get_hb_reserved_mem(struct HDIF_common_hdr *ms_vpd)
>  		if (label_size > 64)
>  			label_size = 64;
>  
> -		/* these are broken, just ignore them */
> -		if (!strncmp(hb_resv_mem->label, "ibm,homer-image", label_size))
> -				continue;
> -		if (!strncmp(hb_resv_mem->label, "ibm,occ-common-area", label_size))
> -				continue;
> -
>  		label = malloc(label_size+1);
>  		assert(label);
>  
> -- 
> 2.9.3
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
Vaidyanathan Srinivasan May 15, 2017, 9:09 a.m. UTC | #2
* Oliver O'Halloran <oohall@gmail.com> [2017-05-15 16:31:03]:

> In the past we've ignored these since Hostboot insisted in exporting
> broken reservations and the OCC was not being used yet. This situation
> seems to have resolved itself so we should respect the reservations that
> hostboot provides.
> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Tested-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>

Current build of hostboot has the right HDAT.  Tested on Witherspoon
system.

HDAT reservations:

[  300.082700783,7] MEM: Reserve 'ibm,homer-image' 200ffd800000-200ffdbfffff (type/inst=0x04000000)
[  300.082706054,7] MEM: Reserve 'ibm,homer-image' 200ffdc00000-200ffdffffff (type/inst=0x04000008)
[  300.082711349,7] MEM: Reserve 'ibm,occ-common-area' 200fff800000-200fffffffff (type/inst=0x04000000)

HOMER init:

[  300.084272795,6] MEM: parsing reserved memory from reserved-names/-ranges properties
[  300.084276473,7] HOMER: Init chip 0
[  300.084279370,7]   PBA BAR0 : 0x0000200ffd800000
[  300.084281869,7]   PBA MASK0: 0x0000000000300000
[  300.084284232,7]   HOMER Image at 0x200ffd800000 size 4MB
[  300.084288071,7]   PBA BAR2 : 0x0000200fff800000
[  300.084290377,7]   PBA MASK2: 0x0000000000700000
[  300.084292721,7]   OCC Common Area at 0x200fff800000 size 8MB
[  300.084295446,7] HOMER: Init chip 8
[  300.084298096,7]   PBA BAR0 : 0x0000200ffdc00000
[  300.084300411,7]   PBA MASK0: 0x0000000000300000
[  300.084302755,7]   HOMER Image at 0x200ffdc00000 size 4MB
[  300.084306306,7]   PBA BAR2 : 0x0000200fff800000
[  300.084308602,7]   PBA MASK2: 0x0000000000700000
[  300.084310913,7]   OCC Common Area at 0x200fff800000 size 8MB
[  300.084321885,7] CPU idle state device tree init

HOMER init detected that the regions are already reserved. Good.

If not we will see additional reservations like:

[  303.155949473,7] HOMER: Init chip 0
[  303.155952508,7]   PBA BAR0 : 0x0000200ffd800000
[  303.155954832,7]   PBA MASK0: 0x0000000000300000
[  303.155957157,7]   HOMER Image at 0x200ffd800000 size 4MB
[  303.155959782,4] HOMER image is not reserved! Reserving
[  303.156015736,7]   PBA BAR2 : 0x0000200fff800000
[  303.156018029,7]   PBA MASK2: 0x0000000000700000
[  303.156020313,7]   OCC Common Area at 0x200fff800000 size 8MB
[  303.156022966,7] HOMER: Init chip 8
[  303.156025609,7]   PBA BAR0 : 0x0000200ffdc00000
[  303.156027887,7]   PBA MASK0: 0x0000000000300000
[  303.156030182,7]   HOMER Image at 0x200ffdc00000 size 4MB
[  303.156032812,4] HOMER image is not reserved! Reserving
[  303.156076474,7]   PBA BAR2 : 0x0000200fff800000
[  303.156078755,7]   PBA MASK2: 0x0000000000700000
[  303.156081049,7]   OCC Common Area at 0x200fff800000 size 8MB
[  303.156083912,4] OCC common area is not reserved! Reserving


Final reservations:
[    4.367890400,5] Releasing unused memory:
[    4.367918768,5]     ibm,firmware-heap: 5377184/13631488 used
[    4.367958992,5]     ibm,firmware-allocs-memory@200000000000: 20455424/68719476736 used
[    4.368012880,5]     ibm,firmware-allocs-memory@0: 17309696/67347939328 used
[    4.368080400,5] Reserved regions:
[    4.368102768,5]   0x000031c00000..000033c7ffff : ibm,firmware-stacks
[    4.368147104,5]   0x000031000000..000031bfffff : ibm,firmware-data
[    4.368196448,5]   0x000030300000..000030ffffff : ibm,firmware-heap
[    4.368279712,5]   0x000030000000..0000302fffff : ibm,firmware-code
[    4.368325888,5]   0x200000000000..200001381fff : ibm,firmware-allocs-memory@200000000000
[    4.368384640,5]   0x200ffd410000..200ffd41ffff : ibm,sbe-ffdc
[    4.368428688,5]   0x200ffd420000..200ffd42ffff : ibm,sbe-comm
[    4.368470128,5]   0x200ffd430000..200ffd43ffff : ibm,sbe-ffdc
[    4.368510704,5]   0x200ffd440000..200ffd44ffff : ibm,sbe-comm
[    4.368550304,5]   0x200ffd450000..200ffd69ffff : ibm,hbrt-code-image
[    4.368594512,5]   0x200ffd6a0000..200ffd6fffff : ibm,hbrt-target-image
[    4.368642544,5]   0x200ffd700000..200ffd7fffff : ibm,hbrt-vpd-image
[    4.368693136,5]   0x200fff800000..200fffffffff : ibm,occ-common-area
[    4.368736240,5]   0x200ffdc00000..200ffdffffff : ibm,homer-image
[    4.368784112,5]   0x200ffd800000..200ffdbfffff : ibm,homer-image
[    4.368831744,5]   0x000051c00000..000052c81fff : ibm,firmware-allocs-memory@0

HDAT parsing works (earlier as well), now info from HDAT is also
accurate for witherspoon and overall integration of HDAT based memory
reservations for HOMER area works.

--Vaidy
Vasant Hegde May 15, 2017, 2:26 p.m. UTC | #3
On 05/15/2017 12:01 PM, Oliver O'Halloran wrote:
> In the past we've ignored these since Hostboot insisted in exporting
> broken reservations and the OCC was not being used yet. This situation
> seems to have resolved itself so we should respect the reservations that
> hostboot provides.
>

Verified on latest hostboot today. It has fixed reserved memory issue.

Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

-Vasant
Stewart Smith May 16, 2017, 7:08 a.m. UTC | #4
Oliver O'Halloran <oohall@gmail.com> writes:
> In the past we've ignored these since Hostboot insisted in exporting
> broken reservations and the OCC was not being used yet. This situation
> seems to have resolved itself so we should respect the reservations that
> hostboot provides.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Thanks, merged to master as of 8af5b3c084fa51b553cb7793304c4a258a2cf420

(with this latest batch of merging all the things, we're in a position
where I should update op-build, which I'll do, and then probably swear
about random broken things for a while)
diff mbox

Patch

diff --git a/hdata/memory.c b/hdata/memory.c
index 2df1136c3627..0c6c0811f61a 100644
--- a/hdata/memory.c
+++ b/hdata/memory.c
@@ -457,12 +457,6 @@  static void get_hb_reserved_mem(struct HDIF_common_hdr *ms_vpd)
 		if (label_size > 64)
 			label_size = 64;
 
-		/* these are broken, just ignore them */
-		if (!strncmp(hb_resv_mem->label, "ibm,homer-image", label_size))
-				continue;
-		if (!strncmp(hb_resv_mem->label, "ibm,occ-common-area", label_size))
-				continue;
-
 		label = malloc(label_size+1);
 		assert(label);