Constructs a logical SPE.
status = lv1_construct_logical_spe( /*IN*/ PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT, vas_id, SPE_TYPE_LOGICAL, /*OUT*/ &priv2_addr, &problem_phys, &local_store_phys, &unused, &shadow_addr, &spe_id );
| Inputs | |
|---|---|
| Register | Description |
| R3 | PAGE_SHIFT |
| R4 | PAGE_SHIFT |
| R5 | PAGE_SHIFT |
| R6 | PAGE_SHIFT |
| R7 | PAGE_SHIFT |
| R8 | vas_id - virtual address space id |
| R9 | SPE_TYPE_LOGICAL (0) |
| Outputs | |
| Register | Description |
| R3 | Status - 0 = OK, Other values are unknown, but indicate failure. |
| R4 | priv2_addr - lpar address of spe priv2 area |
| R5 | problem_phys - lpar address of spu_problem area |
| R6 | local_store_phys - lpar address of spu local storage |
| R7 | unused |
| R8 | shadow_addr - lpar address of spe register shadow area |
| R9 | spe_id - logical spe id |
Notes:
R7 out parameter was referred to in a previous codebase as “ctxt_addr”.
The Linux kernel creates the following 6 logical SPEs:
| priv2_addr | problem_phys | local_store_phys | unused | shadow_addr | spe_id |
|---|---|---|---|---|---|
| 0x4c0000660000 | 0x4c0000640000 | 0x4c0000600000 | 0×0 | 0x30000000d000 | 11 |
| 0x4c0000760000 | 0x4c0000740000 | 0x4c0000700000 | 0×0 | 0x30000000f000 | 15 |
| 0x4c0000860000 | 0x4c0000840000 | 0x4c0000800000 | 0×0 | 0×300000011000 | 19 |
| 0x4c0000960000 | 0x4c0000940000 | 0x4c0000900000 | 0×0 | 0×300000013000 | 23 |
| 0x4c0000a60000 | 0x4c0000a40000 | 0x4c0000a00000 | 0×0 | 0×300000015000 | 27 |
| 0x4c0000b60000 | 0x4c0000b40000 | 0x4c0000b00000 | 0×0 | 0×300000017000 | 31 |
For each entry, only two separate lpar are allocated by the hypervisor. Indeed, calling lv1_query_logical_partition_address_region_info on priv2_addr, problem_phys, local_store_phys and shadow_addr for the first entry returns the following info:
| lpar | start_address | size | access_right | max_page_size | flags | comment |
|---|---|---|---|---|---|---|
| 0x4c0000660000 | 0x4c0000600000 | 524288 | 0×3 (RW) | 12 | 0xa000000000000000 | SPU MMIO lpar, privilege state 2 region (128kB) |
| 0x4c0000640000 | 0x4c0000600000 | 524288 | 0×3 (RW) | 12 | 0xa000000000000000 | SPU MMIO lpar, problem state region (128kB) |
| 0x4c0000600000 | 0x4c0000600000 | 524288 | 0×3 (RW) | 12 | 0xa000000000000000 | SPU MMIO lpar, local store region (256kB) |
| 0x30000000d000 | 0x30000000d000 | 4096 | 0×1 (RO) | 12 | 0xa000000000000000 | SPU shadow registers lpar (4kB, read-only) |
From this info we see a single lpar is used for all the SPU MMIO region (see figure 5-1 CBE Memory Map of the Cell Broadband Engine Programmig Handbook) and another lpar is used for the SPE registers.