Skip to content
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

Adds timestamped polling #174

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Adds timestamped polling #174

wants to merge 14 commits into from

Conversation

rountree
Copy link
Collaborator

Fixes #173.

Adds polling.

README.md
Added desription of new msr_batch_op struct.
Removed example code that no longer compiles in v2.0.

examples/example.c
Modified to be working example of polling via batch.

msr-smp.c
Replaced previous read/write code with read/write/poll + timestamp

msr_batch.c
Small patch to keep allowlist functional.

msr_safe.h
New op struct.

Tested on serif.

The example code needs work and the README.md needs a cleanup pass.

rountree-alt and others added 12 commits September 12, 2024 09:54
The type of (((struct class *)0)->devnode) has changed at least
twice in the mainline kernel.  Coding based on mainline kernel
versions has repeatedly run into the problem of distros backporting
features to older kernels.

Solved here using _Generic and multiple function definitions.
Compiling under Linux 6.9.9 and gcc 10.3.1.
msr_version.h
	#defines for major, minor, and patch versions of msr-safe
	as well as helper macros to generate _u32 and string
	representation.

Makefile
	Removes CURRENT_VERSION and -DVERSION from build.
	msrsave now gets the version string from msr_version.h

msrsave_main.c
msr_entry.c
	Now #includes msr_version.h and uses MSR_SAFE_VERSION_STR

msr_safe.h
	Repurposes a bit of struct padding to hold a _u32-format
	msr-safe version number.

README.md
	Updates documentation of struct msr_batch_array to note
	the new version field.  Explains how this will remain
	unused in the 1.x.y series.  Version 2.x.y will begin
	checking this version field to make sure what the user
	compiled against is the same version as the loaded
	kernel module.  This is necessary due to anticipated
	batch API changes in version 2.0.0.

Tested on serif (Ubuntu 24.04.1 LTS, Linux 6.8.0, gcc 13.2.0)
README.md
Describes new error (ENOPROTOOP) that results from a mismatch
between the loaded kernel module and what's in the batch request.

examples/example.c
Updated to use versioning.

msr_batch.c
Checks for correct version as part of batch request parsing.

msr_version.h
Bumped version to 2.0.0.

Tested on serif.
README.md
Added desription of new msr_batch_op struct.
Removed example code that no longer compiles in v2.0.

examples/example.c
Modified to be working example of polling via batch.

msr-smp.c
Replaced previous read/write code with read/write/poll + timestamp

msr_batch.c
Small patch to keep allowlist functional.

msr_safe.h
New op struct.
@rountree rountree added this to the v2.0.0 milestone Sep 14, 2024
@rountree rountree mentioned this pull request Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v2.0.0] Add timestamped polling
2 participants