openpower-cores / a2i

Other
243 stars 40 forks source link

What's the function of field LPID? #19

Closed luffygood closed 3 years ago

luffygood commented 3 years ago

In the A2_BGQ, the Logical Partition ID's function is described as below:

The LPID is part of the virtual address and is used during address translation comparing LPID to the TLPID field in the TLB entry to determine a matching TLB entry.

In the TLB entry, the TLPID's function is described as below: Specifies the value that is written to the TLB entry TLPID field by the execution of tlbwe. This field is loaded from the TLB entry TLPID by the execution of tlbre and by the execution of tlbsx that finds a matching entry. The TLB entry TLPID identifies the logical partition associated with the TLB entry.

What does the logical partition really mean? And what does this field do for matching a TLB entry?

openpowerwtf commented 3 years ago

For matching, it's shown in Figure 6-1. Virtual Address to TLB Entry Match Process (nonguest or partition match), and for VA creation, it's shown in Figure 6-2. Effective-to-Real Address Translation Flow.

LPIDs would typically be used in a system with hypervisor and guest OS.

1.3.1 Embedded Hypervisor The A2 core implements the Embedded Hypervisor Architecture to provide secure compute domains and operating system virtualization. The Embedded Hypervisor Architecture introduces the concept of partitions by two main architectural changes. The first is by extending the virtual address with a logical partition identifier (LPID). The identifier serves an analogous purpose to the process ID (PID) and is used to distinguish partitions.

Book III-E, Chapter 2 Logical Partitioning

The Embedded.Hypervisor category permits threads and portions of real storage to be assigned to logical collections called partitions, such that a program executing in one partition cannot interfere with any program executing in a different partition. This isolation can be provided for both problem state and privileged state programs, by using a layer of trusted software, called a hypervisor program (or simply a “hypervisor”), and the resources provided by this facility to manage system resources.