hv: mmu: add pre-assumption for hpa2gpa

They're: (a) only SOS would use hpa2gpa and (b) the GPA and HPA
in SOS is identical mapping.
Rename hpa2gpa to vm0_hpa2gpa then.

Tracked-On: #1124
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2018-10-17 19:59:36 +08:00
committed by wenlingz
parent 49b476bb56
commit 70ddca3a87
5 changed files with 16 additions and 20 deletions

View File

@@ -45,7 +45,7 @@ static inline void *gpa2hva(struct vm *vm, uint64_t x)
static inline uint64_t hva2gpa(struct vm *vm, void *x)
{
return hpa2gpa(vm, hva2hpa(x));
return (is_vm0(vm)) ? vm0_hpa2gpa(hva2hpa(x)) : INVALID_GPA;
}
#endif /* !ASSEMBLER */