@@ -73,7 +73,7 @@ const (
7373 policyDebugBit = 19
7474 policySingleSocketBit = 20
7575
76- maxPlatformInfoBit = 1
76+ maxPlatformInfoBit = 5
7777
7878 signatureOffset = 0x2A0
7979 ecdsaRSsize = 72 // From the ECDSA-P384-SHA384 format in SEV SNP API specification.
@@ -186,6 +186,16 @@ type SnpPlatformInfo struct {
186186 // TSMEEnabled represents if the platform that produced the attestation report has transparent
187187 // secure memory encryption (TSME) enabled.
188188 TSMEEnabled bool
189+ // ECCEnabled indicates that the platform is using error correcting codes for memory.
190+ // Present when EccMemReporting feature bit is set.
191+ ECCEnabled bool
192+ // RAPLDisabled indicates that the RAPL is disabled.
193+ RAPLDisabled bool
194+ // CiphertextHidingDRAMEnabled indicates cypher text hiding is enabled for DRAM.
195+ CiphertextHidingDRAMEnabled bool
196+ // AliasCheckComplete indicates that alias detection has completed since the last system reset and there are no aliasing addresses.
197+ // Mitigation for https://badram.eu/, see https://www.amd.com/en/resources/product-security/bulletin/amd-sb-3015.html#mitigation.
198+ AliasCheckComplete bool
189199}
190200
191201// SnpPolicy represents the bitmask guest policy that governs the VM's behavior from launch.
@@ -244,8 +254,12 @@ func SnpPolicyToBytes(policy SnpPolicy) uint64 {
244254// unrecognized bits.
245255func ParseSnpPlatformInfo (platformInfo uint64 ) (SnpPlatformInfo , error ) {
246256 result := SnpPlatformInfo {
247- SMTEnabled : (platformInfo & (1 << 0 )) != 0 ,
248- TSMEEnabled : (platformInfo & (1 << 1 )) != 0 ,
257+ SMTEnabled : (platformInfo & (1 << 0 )) != 0 ,
258+ TSMEEnabled : (platformInfo & (1 << 1 )) != 0 ,
259+ ECCEnabled : (platformInfo & (1 << 2 )) != 0 ,
260+ RAPLDisabled : (platformInfo & (1 << 3 )) != 0 ,
261+ CiphertextHidingDRAMEnabled : (platformInfo & (1 << 4 )) != 0 ,
262+ AliasCheckComplete : (platformInfo & (1 << 5 )) != 0 ,
249263 }
250264 reserved := platformInfo & ^ uint64 ((1 << (maxPlatformInfoBit + 1 ))- 1 )
251265 if reserved != 0 {
0 commit comments