|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 20/39] xen/riscv: resolve the faulting guest physical address
> Recover the guest physical address from htval and stval. On a guest-page > fault to hypervisor, htval holds the guest physical address shifted > right by 2, so that an address wider than HSXLEN fits, and stval holds > the faulting guest virtual address. The shift is done on paddr_t rather > than on the raw register: a guest physical address is 34 bits wide on > RV32 with Sv32x4, so shifting an XLEN-wide value would drop its top two > bits. Nit: "The shift" reads as the right shift just described, while what is meant is shifting htval back left by 2 to recover the address. Could you say so explicitly? Something like: ```` Shift htval back left by 2 and take the two low bits from stval. htval is first converted to paddr_t, then shifted: a guest physical address is 34 bits wide on RV32 with Sv32x4, so shifting the XLEN-wide register itself would drop the top two bits. ``` Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx> -- Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |