Why does the page fault handler only support traps caused by accessing the PLIC? #188
Replies: 2 comments 7 replies
-
That is indeed strange. When you say "tried to let the VM access the PCI-ECAM region", you mean you added this MMIO region to the VM's configuration dev list? If so, this is because the hypervisor is indeed passing through that region to the guest and the value from the MMIO registers you read is indeed zero. If not, the behavior you are observing shouldn't happen. First, the hardware should trap the access. Second, either there is an emulation handler registered within the hypervisor (and here you are correct, the only emulation handler at the moment for RISC-V is for the PLIC), or the hypervisor should simply stop the guest. Maybe if you give me you VM configuration and tell me which MMIO addresses you are accessing I could look into it. |
Beta Was this translation helpful? Give feedback.
-
I added a PCIe node to the VM's device tree, but I didn’t map the address regionfor The problem is that I found that for each access to the configuration space corresponding to a specific BDF, the access instruction with offset 0x3d is always missing. From the hypervisor side, this access instruction does not appear, and from the Linux side, the access result is always 0. I can see the VM's access to other offsets in the hypervisor, and the hypervisor returns the correct results, but certain access instructions for specific offsets are consistently missing, which is quite confusing. The result is that when I run the command Below is the PCIe node I added to the VM's device tree, which I dumped from qemu-system-riscv64 in qemu-9.0.1:
|
Beta Was this translation helpful? Give feedback.
-
Hello, when I was reviewing the RISC-V part, I noticed that in the
guest_page_fault_handler
function, it seems that only traps related to the PLIC region are handled. Is this because it hasn't been fully implemented yet, or is it due to hardware limitations that don't support other data aborts?I'm asking this question because I tried to let the VM access the PCI-ECAM region, which caused a trap into the hypervisor, but through QEMU's trace, I found that some access instructions didn't seem to be caught by the hypervisor and were directly returned as 0 to the VM.
Beta Was this translation helpful? Give feedback.
All reactions