-
Notifications
You must be signed in to change notification settings - Fork 49
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
[demo] Add clock ioctls to the KVM interface #84
Open
brendank310
wants to merge
12
commits into
Bareflank:mk-demo
Choose a base branch
from
brendank310:clock-ioctls
base: mk-demo
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Brendan Kerrigan <[email protected]>
Signed-off-by: Brendan Kerrigan <[email protected]>
Instead of using a pointer for the indices entry in kvm_msr_list, use a normal array and define the KVM_MSR_GET_INDEX_LIST ioctl using the _IOWR_LIST macro (see "shim/linux: add _IOWR_LIST macro"). Define MSR_LIST_MAX_INDICES to be 128, as this leaves some room to keep the stack frame < 1024 bytes. This may be too low of a max, but is plenty for our current QEMU and integration testing. Signed-off-by: Nick Rosbrook <[email protected]>
The KVM API states that when the number of MSRs is greater than the value set in nmsrs by the caller, the kernel will set the correct value in nmsrs and return -E2BIG. This behavior was excluded from the first implementation of KVM_GET_MSR_INDEX_LIST. Define SHIM_2BIG so that other shim functions can implement this behavior, which is a common pattern in ioctls. Signed-off-by: Nick Rosbrook <[email protected]>
Fix get msr index list for demo
The enum mv_cpuid_flag_t is incorrectly defined as mv_cpuid_flag (missing the _t suffix) in the C header file, which causes the following build errors: /home/nr/bareflank/microv/hypercall/include/mv_cdl_entry_t.h:51:9: error: User-defined types must have the same name as the header file they are defined in. Either name the Enum 'mv_cdl_entry_t', or name the header 'mv_cpuid_flag_t' [bsl-user-defined-type-names-match-header-name,-warnings-as-errors] enum mv_cpuid_flag_t flags; ^ /home/nr/bareflank/microv/hypercall/include/mv_cdl_entry_t.h:51:14: error: Enum 'mv_cpuid_flag_t' is missing documentation. Are you missing the '@brief' command? [bsl-documentation,-warnings-as-errors] enum mv_cpuid_flag_t flags; ^ /home/nr/bareflank/microv/hypercall/include/mv_cdl_entry_t.h:51:30: error: field has incomplete type 'enum mv_cpuid_flag_t' [clang-diagnostic-error] enum mv_cpuid_flag_t flags; ^ /home/nr/bareflank/microv/hypercall/include/mv_cdl_entry_t.h:51:14: note: forward declaration of 'enum mv_cpuid_flag_t' enum mv_cpuid_flag_t flags; ^ /home/nr/bareflank/microv/hypercall/include/mv_cpuid_flag_t.h:46:1: error: User-defined types must have the same name as the header file they are defined in. Either name the Enum 'mv_cpuid_flag_t', or name the header 'mv_cpuid_flag' [bsl-user-defined-type-names-match-header-name,-warnings-as-errors] enum mv_cpuid_flag ^ Fix this by adding the _t suffix in the C header file. Signed-off-by: Nick Rosbrook <[email protected]>
Implment support in the shim for the GET_SUPPORTED_CPUID ioctl. This has been tested against QEMU to confirm execution advances passed these ioctl calls. Note that the current CPUID2_MAX_ENTRIES causes stack frames to exceed 1024 bytes: /home/nr/bareflank/microv/shim/linux/src/entry.c: In function ‘dispatch_system_kvm_get_supported_cpuid’: /home/nr/bareflank/microv/shim/linux/src/entry.c:325:1: warning: the frame size of 1616 bytes is larger than 1024 bytes [-Wframe-larger-than=] 325 | } | ^ Currently the number of entries we return is 30, and reducing the max much lower could cause QEMU to fail. Signed-off-by: Nick Rosbrook <[email protected]>
Get supported cpuid demo
…on-demo-and-intel-portio Set user memory region demo and intel portio
Add KVM_GET_CLOCK vm ioctl to the shim Signed-off-by: Brendan Kerrigan <[email protected]>
Add KVM_SET_CLOCK vm ioctl to the shim Signed-off-by: Brendan Kerrigan <[email protected]>
chp-io
changed the title
Add clock ioctls to the KVM interface
[demo] Add clock ioctls to the KVM interface
Oct 27, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.