Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
s390/mem_detect: query max possible memory address via diag260 (0xc)
Let's also query the maximum possible memory address via diag260 (0xc). This will be relevant for QEMU with memory device support (e.g., virtio-mem). The value returned via SCLP will not include the reserved physical address space for memory devices, we have to query it using diag260. The doc states for diag260 (0xc): "Return the highest addressable byte of virtual storage in the host-primary address space, including named saved systems and saved segments." "Ry: Equal to the highest addressable byte of virtual storage in the host-primary address space, including named saved systems and saved segments. For example, for a guest with DEFINE STORAGE CONFIG 0.1G 8G.1G in effect, Rx would be X'000000003FFFFFFF' and Ry would be X'000000023FFFFFFF'." Usually, "virtual storage in the host" directly corresponds to guest physical memory. IIRC, there is one exception, when the SIE is called with "mso" set, so that the guest physical storage starts at an offset inside host virtual storage. Not used for KVM at least. Commit d918fe2 ("[S390] Remove diag 0x260 call from memory detection.") indicates that there were detection issues under z/VM a decade ago - maybe because of "mso". The values were not safe to detect initial memory. We cannot specialise on KVM that early during boot. Therefore, use the maximum of both values (just in case there are still weird z/VM diag260 implementations) and only query in case diag260 (0x10) succeeded. Use the same exception handling mechanism as tprot(). Signed-off-by: David Hildenbrand <david@redhat.com>
- Loading branch information