You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/02 09:46:12 UTC

[GitHub] [incubator-nuttx] btashton opened a new pull request #944: x86_64: Set kernel entry to 1M to avoid EPT Violation

btashton opened a new pull request #944:
URL: https://github.com/apache/incubator-nuttx/pull/944


   ## Summary
   When running inside of qemu via KVM ostest configuration fails to run triggering a reboot right after leaving grub.  Using trace-cmd and kernelshark it was determined that a Tripple Fault was being triggered because of too many EPT_VIOLATIONS. 
   
   Using bochs this behaviour is not seen if some of the fault triggers are disabled.
   
   QEMU is started via this command with a delay triggered by grub.
   ```
   qemu-system-x86_64  -cpu host,+pcid,+x2apic,+tsc-deadline,+xsave,+rdrand --enable-kvm -smp 1 -m 2G -cdrom boot.iso -serial mon:stdio -d in_asm -D qemu.log -s -no-reboot
   ```
   
   In another window kvm tracing is started.  The kernel is selected in GRUB in QEMU.  When QEMU terminates the trace is also sent a TERM signal.
   ```
   ❯ sudo trace-cmd record -b 20000 -e kvm
   [sudo] password for bashton: 
   Hit Ctrl^C to stop recording
   ^CCPU0 data recorded at offset=0x73b000
       1863680 bytes in size
   CPU1 data recorded at offset=0x902000
       97107968 bytes in size
   CPU2 data recorded at offset=0x659e000
       5685248 bytes in size
   CPU3 data recorded at offset=0x6b0a000
       1699840 bytes in size
   ```
   Looking at the end of the trace we can see the fault prior to QEMU terminating
   ![ept_violation](https://user-images.githubusercontent.com/173245/80860768-e4937d00-8c1e-11ea-90bb-d456d498cb0e.png)
   
   Once the entry point was changed from 4M to the standard 1M the ostest passed.
   
   ## Impact
   x86_64 configurations do not run correctly on QEMU with kvm enabled which is required to fully function.
   
   ## Testing
   The ostest configuration was run in qemu (with kvm) and bochs
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on pull request #944: x86_64: Set kernel entry to 1M to avoid EPT Violation

Posted by GitBox <gi...@apache.org>.
patacongo commented on pull request #944:
URL: https://github.com/apache/incubator-nuttx/pull/944#issuecomment-623113478


   Should I will wait for approval from Yang ChungFan (SonicYang).  I have no technical expertise with x86_64 to evaluate the change.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on pull request #944: x86_64: Set kernel entry to 1M to avoid EPT Violation

Posted by GitBox <gi...@apache.org>.
patacongo commented on pull request #944:
URL: https://github.com/apache/incubator-nuttx/pull/944#issuecomment-623155242


   I don't know anything about the x86_64 so cannot provide any technical review.  But basic on the work that you have done and upon your stong arguments, I will continue with the merge.  If Sonic Yang does have additional changes we can accomodate those later as well.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] sonicyang commented on pull request #944: x86_64: Set kernel entry to 1M to avoid EPT Violation

Posted by GitBox <gi...@apache.org>.
sonicyang commented on pull request #944:
URL: https://github.com/apache/incubator-nuttx/pull/944#issuecomment-623898272


   This looks fine to me.
   No clue why 4M is not working but 1M is.
   Maybe the grub version influence this? because I am getting reliable boot.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] btashton commented on pull request #944: x86_64: Set kernel entry to 1M to avoid EPT Violation

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #944:
URL: https://github.com/apache/incubator-nuttx/pull/944#issuecomment-622927525


   @sonicyang Can you please take a look at this.  


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] btashton commented on pull request #944: x86_64: Set kernel entry to 1M to avoid EPT Violation

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #944:
URL: https://github.com/apache/incubator-nuttx/pull/944#issuecomment-623154634


   I have tested it on both simulators and it works for me.  Prior to this change getting QEMU to work was very unreliable. The Linux kernel also decompresses to the 1M mark. Technically it can be a higher address long as the bootloader is aware.
   
   The EPT violation might have been a red hearing since I see it in the logs anyway.
   
   I would be fine merging it in.  All the other testing and work I have been doing is with this applied.  Same goes for the issues in #904 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] sonicyang commented on pull request #944: x86_64: Set kernel entry to 1M to avoid EPT Violation

Posted by GitBox <gi...@apache.org>.
sonicyang commented on pull request #944:
URL: https://github.com/apache/incubator-nuttx/pull/944#issuecomment-623897113


   I was a bit off. I am sorry.
   I will take a look at this now.
   
   I might be hitting similar problems lately.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org