Skip to content

Conversation

@zulinx86
Copy link
Contributor

@zulinx86 zulinx86 commented Jul 4, 2023

Changes

  • Drops unimplemented MSRs from MSR baseline files for test_cpu_rdmsr
  • Introduces MSR baselines per host CPU model

Reason

Previously all the static CPU templates had not passed through MSRs from the host, so we did not need to have MSR baseline files for each host CPU model. With PR #3907, the T2CL template passes through IA32_ARCH_CAPABILITIES.{RSBA/RRSBA} which results in difference of the MSR value between different CPU models.

As discussed in #3926 (comment), a large portion of MSR baseline files are occupied by unimplemented MSRs.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • [ ] If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • [ ] Any required documentation changes (code and docs) are included in this PR.
  • [ ] API changes follow the Runbook for Firecracker API changes.
  • [ ] User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested. <= I tested this on a private pipeline.
  • [ ] New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@zulinx86 zulinx86 self-assigned this Jul 4, 2023
@zulinx86 zulinx86 requested review from kalyazin and pb8o July 4, 2023 11:54
@zulinx86 zulinx86 force-pushed the msr_baseline branch 3 times, most recently from 055b952 to 5ef4fbf Compare July 4, 2023 15:17
@zulinx86 zulinx86 changed the title test: Gathers per-CPU MSR baselines test: Per-CPU model MSR baselines Jul 4, 2023
@zulinx86 zulinx86 changed the title test: Per-CPU model MSR baselines test: improve/refactor/regather MSR baselines Jul 4, 2023
@zulinx86 zulinx86 changed the title test: improve/refactor/regather MSR baselines test: improve/extend/regather MSR baselines Jul 4, 2023
@zulinx86 zulinx86 requested a review from pb8o July 4, 2023 15:34
pb8o
pb8o previously approved these changes Jul 4, 2023
zulinx86 added 5 commits July 4, 2023 15:50
Comments on test_cpu_rdmsr explains what env those MSR baselines were
gathered but does not show how to gather them. This commit adds a line
that we can use to regather baseline by uncommenting it.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
Previously all the static CPU templates had not passed through MSRs from
the host, so we did not need to have MSR baseline files for each CPU
model. With PR firecracker-microvm#3907, the T2CL template passes through
IA32_ARCH_CAPABILITIES.{RSBA/RRSBA} which results in difference of the
MSR value between different CPU models. This commit enables MSR
baselines for all the combinations of (host CPU, host kernel, guest
kernel). Actual baseline regathering will be done in a successive
commit.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
msr_reader.sh queries some ranges of MSR indices regardless of whether
they are implemented or not, and it has saved them with the STATUS field
("implemented" or "unimplemented") so far. However, a large portion of
them are unimplemented, resulting in large numbers of lines of baseline
files.

This commit drops unimplemented MSRs from msr_reader.sh. This should be
fine since not having some MSR indices implies that they are
unimplemented.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
The last few commits dropped STATUS column from baseline files and
introduced per-CPU model baselines. To make test_cpu_rdmsr pass, this
commit regathers MSR baseline files.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
Changes `Path(snapshot_artifacts_dir)` to `snapshot_artifacts_dir`,
since `snapshot_artifacts_dir` is already a `Path` object.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
@zulinx86 zulinx86 added the Type: Fix Indicates a fix to existing code label Jul 4, 2023
@zulinx86 zulinx86 requested a review from pb8o July 4, 2023 16:02
@zulinx86 zulinx86 added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Jul 5, 2023
@zulinx86 zulinx86 merged commit e896359 into firecracker-microvm:main Jul 5, 2023
@zulinx86 zulinx86 deleted the msr_baseline branch July 5, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Fix Indicates a fix to existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants