On 08.06.21 11:20, Dongjiu Geng wrote:
> Hi,
>      From the jailhouse design, the Private Per-CPU data should be not
> accessed by other CPUs except the current CPU.  But from the code[1]
> and my test, it is not. For example, the CPU1 can access the CPU0's
> private data, because hv_paging_structs already map it, and the
> per-cpu page table will link the hv_paging_structs.  is this a bug? I
> think the Private Per-CPU data should be not accessed by other CPUs
> except the self CPU.
> 
> [1]:       err = paging_create(&hv_paging_structs,
>                             paging_hvirt2phys(&hypervisor_header),
>                             system_config->hypervisor_memory.size,
>                             (unsigned long)&hypervisor_header,
>                             PAGE_DEFAULT_FLAGS,
>                             PAGING_NON_COHERENT | PAGING_HUGE);
> 

You are referring to
https://github.com/siemens/jailhouse/blob/6d9c51d0bd819689c00f6a3c38d3099f6eb9c657/hypervisor/paging.c#L678:
Right, the initial mapping means everything is visible for all CPUs. But
then comes
https://github.com/siemens/jailhouse/blob/6d9c51d0bd819689c00f6a3c38d3099f6eb9c657/hypervisor/setup.c#L100
which setups up an alternative mapping (installed by arch_cpu_init()).
That does not contain the private data structs of the other CPUs. You
should be able to confirm that AFTER initialization, e.g. on a first VM
exit after setup.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/f220116c-a666-5b73-9fe3-e5e4acd1583d%40siemens.com.

Reply via email to