Skip to content

Commit

Permalink
fix(ParseSnpPolicy): fix the reserved bitfield in the guest policy st…
Browse files Browse the repository at this point in the history
…ructure

Newer SEV-SNP specification steals some of the reserved bits. Update code
to keep up with the spec.

Signed-off-by: Jagannathan Raman<[email protected]>
  • Loading branch information
jraman567 committed Feb 5, 2025
1 parent e5df259 commit 5a2f196
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func ParseSnpPolicy(guestPolicy uint64) (SnpPolicy, error) {
if guestPolicy&uint64(1<<policyReserved1bit) == 0 {
return result, fmt.Errorf("policy[%d] is reserved, must be 1, got 0", policyReserved1bit)
}
if err := mbz64(guestPolicy, "policy", 63, 21); err != nil {
if err := mbz64(guestPolicy, "policy", 63, 25); err != nil {
return result, err
}
result.ABIMinor = uint8(guestPolicy & 0xff)
Expand Down

0 comments on commit 5a2f196

Please sign in to comment.