On 3/14/24 20:22, lixianglai wrote:
Hi Richard:
On 3/13/24 15:33, Xianglai Li wrote:
+ if (unlikely((level == 0) || (level > 4))) {
+ return base;
+ }
...
Perhaps it would be worthwhile to add another for the level==0 or > 4 case
above?
A normal level 4 page table should not print an error log,
only if a level 4 page is large, so we should put it in
if (FIELD_EX64(base, TLBENTRY, HUGE)) {
if (unlikely(level == 4)) {
qemu_log_mask(LOG_GUEST_ERROR,
"Attempted use of level %lu huge page\n", level);
}
if (FIELD_EX64(base, TLBENTRY, LEVEL)) {
return base;
} else {
return FIELD_DP64(base, TLBENTRY, LEVEL, level);
}
}
A level 5 page table is not normal, nor is a level 0 lddir.
r~