-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting ranges of valid guest physical memory address #23
Comments
@kylerky You are correct and I think the current behaviour is the result of a bug. The API documentation indicates that the connection is closed on communication errors, however the calls themselves should be allowed to fail and some do indeed (the memory mapping ones come to mind). |
I can't reproduce it unless the gpa/size pair is not valid. We use the following function to validate:
Should we return an error code (as a command reply) instead for this case too? There is also a bug when you try to read a whole page, because |
I think so.
That is what I was doing. I was reading the memory in 4KB chunks when the socket was closed. This does not happen with all the 4KB reads though, just some of them. |
#25 should fix the issue related to |
So, returning |
Good. It is helpful that we can distinguish between the two kinds of errors. |
I'll queue this change for the next version, because I don't think you need it right now. You still have to use arguments that pass the validation tests in order to see if the page is mapped or not. Right? #25 will allow you to read a whole page. |
Is there any way to know which guest physical memory addresses are valid for KVMI_READ_PHYSICAL and KVMI_WRITE_PHYSICAL?
As far as I can see, KVMI_GET_MAX_GFN gives the largest physical memory address , say
max_addr
(max_gfn << 12
), used by the guest. But I found that I could get an error code -22 from KVM when I am reading from some addresses smaller thanmax_addr
. I suspect that this is because those addresses are not mapped by the KVM.Currently, KVMI_READ_PHYSICAL returns error code -22 when reading from invalid addresses and the socket will be closed by KVM, which is not convenient when I try to scan the whole memory of the guest.
Given that there is no way to get ranges of valid guest memory address, I think a better way is not to close the socket when reading from invalid addresses.
The text was updated successfully, but these errors were encountered: