[AMD Official Use Only - General] Hello Boris, >> Yes we want to map the faulting address to a RMP entry, but hugepage >> entries in RMP table are basically subpage 4K entries. So it is a 4K >> entry when the page is a 2M one and also a 4K entry when the page is a >> 1G one. >Wait, what?! >APM v2 section "15.36.11 Large Page Management" and PSMASH are then for what exactly? This is what exactly PSMASH is for, in case the 2MB RMP entry needs to be smashed if guest PVALIDATES a 4K page, the HV will need to PSMASH the 2MB RMP entry to corresponding 4K RMP entries during #VMEXIT(NPF). What I meant above is that 4K RMP table entries need to be available in case the 2MB RMP entry needs to be smashed. >> That's why the computation to get a 4K page index within a 2M/1G >> hugepage mapping is required. >What if a guest RMP-faults on a 2M page and there's a corresponding 2M RMP entry? What do you need the 4K entry then for? There is no fault here, if guest pvalidates a 2M page that is backed by a 2MB RMP entry. We need the 4K entries in case the guest pvalidates a 4K page that is mapped by a 2MB RMP entry. >Hell, __snp_lookup_rmpentry() even tries to return the proper page level... >/me looks in disbelief in your direction... Thanks, Ashish