public/xen.h: Update mmu_update comment
cover public/xen.h: Update mmu_update comment
Frediano Ziglio (2):
public/xen.h: Update page table layout comments public/xen.h: Update comment for mmu_update hypercall
xen/include/public/xen.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/2 public/xen.h: Update page table layout comments
From: Frediano Ziglio <[email protected]>
Bit 12 was always used for the MFN.
Extend range for MFN.
--- xen/include/public/xen.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
xen/include/public/xen.h +1 -2
@@ -283,8 +283,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);* if this is a X86_64 machine and four page table layout is used, the layout * of val is: * - 63 if set means No execute (NX) -* - 46-13 the machine frame number -* - 12 available for guest +* - 51-12 the machine frame number * - 11 available for guest * - 10 available for guest * - 9 available for guest
Signature · 1 line
2.43.0
PATCH 2/2 public/xen.h: Update comment for mmu_update hypercall
In reply to Frediano ZiglioFrom: Frediano Ziglio <[email protected]>
The command is filtered from the address using this code
cmd = req.ptr & (sizeof(l1_pgentry_t)-1);
l1_pgentry_t is always 64 bit so the 3 lower bits are used as a command, not only 2 bits.
--- xen/include/public/xen.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
xen/include/public/xen.h +7 -7
@@ -218,16 +218,16 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);* x == 0 => PFD == DOMID_SELF * x != 0 => PFD == x - 1 * -* Sub-commands: ptr[1:0] specifies the appropriate MMU_* command. +* Sub-commands: ptr[2:0] specifies the appropriate MMU_* command. * ------------- -* ptr[1:0] == MMU_NORMAL_PT_UPDATE: +* ptr[2:0] == MMU_NORMAL_PT_UPDATE: * Updates an entry in a page table belonging to PFD. If updating an L1 table, * and the new table entry is valid/present, the mapped frame must belong to * FD. If attempting to map an I/O page then the caller assumes the privilege * of the FD. * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller. * FD == DOMID_XEN: Map restricted areas of Xen's heap space. -* ptr[:2] -- Machine address of the page-table entry to modify. +* ptr[:3] -- Machine address of the page-table entry to modify. * val -- Value to write. * * There also certain implicit requirements when using this hypercall. The
@@ -264,17 +264,17 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);* mentioned above. The argument is MMUEXT_UNPIN_TABLE for all levels and the * pagetable MUST not be in use (meaning that the cr3 is not set to it). * -* ptr[1:0] == MMU_MACHPHYS_UPDATE: +* ptr[2:0] == MMU_MACHPHYS_UPDATE: * Updates an entry in the machine->pseudo-physical mapping table. -* ptr[:2] -- Machine address within the frame whose mapping to modify. +* ptr[:3] -- Machine address within the frame whose mapping to modify. * The frame must belong to the FD, if one is specified. * val -- Value to write into the mapping entry. * -* ptr[1:0] == MMU_PT_UPDATE_PRESERVE_AD: +* ptr[2:0] == MMU_PT_UPDATE_PRESERVE_AD: * As MMU_NORMAL_PT_UPDATE above, but A/D bits currently in the PTE are ORed * with those in @val. * -* ptr[1:0] == MMU_PT_UPDATE_NO_TRANSLATE: +* ptr[2:0] == MMU_PT_UPDATE_NO_TRANSLATE: * As MMU_NORMAL_PT_UPDATE above, but @val is not translated though FD * page tables. *
Signature · 1 line
2.43.0
Quoted 6 lines · Frediano Ziglio
Frediano Ziglio (2):
public/xen.h: Update page table layout commentspublic/xen.h: Update comment formmu_updatehypercallxen/include/public/xen.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
Considering these are (doc) bugs, I think I'm going to shovel the patches in without asking for a release ack.
Jan
Quoted 11 lines · Jan Beulich
Quoted 6 lines · Frediano Ziglio
Frediano Ziglio (2):
public/xen.h: Update page table layout commentspublic/xen.h: Update comment formmu_updatehypercallxen/include/public/xen.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)Reviewed-by Jan Beulich <[email protected]>Considering these are (doc) bugs, I think I'm going to shovel the patches in without asking for a release ack.
Patch 1 is fine, although I think it ought to go further and not try to not-invented-here explain what an x86 pagetable entry is.
Patch 2 is an ABI change, which is why I didn't include this in the docs changes I put in prior to tagging rc1.
At a minimum it needs to explain that this is dependent on the pagetable format, and is safe enough following the removal of the 32bit build of Xen.
~Andrew
Quoted 8 lines · Andrew Cooper
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Frediano Ziglio
Frediano Ziglio (2):
public/xen.h: Update page table layout commentspublic/xen.h: Update comment formmu_updatehypercallxen/include/public/xen.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
Quoted 7 lines
Quoted 4 lines
Reviewed-by Jan Beulich <[email protected]>Considering these are (doc) bugs, I think I'm going to shovel the patches in without asking for a release ack.
Patch 1 is fine, although I think it ought to go further and not try to not-invented-here explain what an x86 pagetable entry is.
Shrinking what's said there could as well be done separately. Correcting obviously wrong numbers imo wants taking right away. Objections?
Quoted 2 lines
Patch 2 is an ABI change, which is why I didn't include this in the docs changes I put in prior to tagging rc1.
What is the "ABI" here? What's written in the header, or what has been in use since before 6aec3334b3e (no real title)? From there being only L1 and L2 table handling that is being moved there, that must pre-date 64-bit support. I.e. 64-bit Xen has used the low 3 bits forever.
Quoted 2 lines
At a minimum it needs to explain that this is dependent on the pagetable format, and is safe enough following the removal of the 32bit build of Xen.
Frediano, please extend accordingly.
Jan