On 26 March 2018 at 21:41, Arnabjyoti Kalita <akal...@cs.stonybrook.edu> wrote: > After a while, I seem to get page-faults in the kernel code itself. > > I see that the page-fault handler executes the below function > > https://github.com/qemu/qemu/blob/67b9c5d4f37ea373ebf9aad251883886e34bf2e1/target/i386/seg_helper.c#L847 > > This directs to the async_page_fault handler in the kernel and eventually > stops because page faults in the kernel are not expected. > > I wanted to disable the page faults so that the execution does not get > stuck and eventually finish. Are there any mechanisms to disable the page > faults without affecting the "modified" execution ?
If the guest CPU needs to take a page fault there is no way to proceed further without doing that -- the memory it tried to access is simply not there. If the guest should not be taking page faults in the kernel then you need to find out what has gone wrong that it is trying to do that. The problem will be somewhere in the flow of execution leading up to that point. (The obvious guess is that your modifications to the control flow are causing the problem -- if you swap the direction of branches for things like "is this pointer NULL" checks then you're going to take faults that you shouldn't, for instance.) thanks -- PMM