# VMX root-mode vs VMX non-root mode

By vmx-root code execution in HyperDbg, we mean that the code is executed after a vm-exit and before VMRESUME instruction.

By vmx non-root, it means that the code will be executed in regular kernel-mode codes.

You should be cautious if you want to cause vm-exit in vmx non-root. For example, you should not execute CPUID in vmx-root as it makes your logging mechanism slower. In other words, there is no limitation, but you have to know what you want to do.

Please make sure to avoid ["unsafe" behavior](https://docs.hyperdbg.org/tips-and-tricks/considerations/the-unsafe-behavior) in vmx-root mode.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hyperdbg.org/tips-and-tricks/considerations/vmx-root-mode-vs-vmx-non-root-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
