Index: src/trusted/validator_arm/actual_classes.cc |
diff --git a/src/trusted/validator_arm/actual_classes.cc b/src/trusted/validator_arm/actual_classes.cc |
index 505a3ef94fb23f15d640083cde8993ecdd470aa7..ba3afbc255268169c8da54e601fcce2750548b51 100644 |
--- a/src/trusted/validator_arm/actual_classes.cc |
+++ b/src/trusted/validator_arm/actual_classes.cc |
@@ -528,26 +528,38 @@ RegisterList EffectiveNoOp::defs(Instruction i) const { |
return RegisterList(); |
} |
-// Roadblock |
-SafetyLevel Roadblock::safety(Instruction i) const { |
- UNREFERENCED_PARAMETER(i); |
- return MAY_BE_SAFE; |
+// PermanentlyUndefined |
+SafetyLevel PermanentlyUndefined::safety(Instruction i) const { |
+ // Restrict UDF's encoding to values we've chosen as safe. |
+ if ((i.Bits(31, 0) == kHaltFill) || |
+ (i.Bits(31, 0) == kAbortNow)) |
+ return MAY_BE_SAFE; |
+ return FORBIDDEN_OPERANDS; |
} |
-RegisterList Roadblock::defs(Instruction i) const { |
+RegisterList PermanentlyUndefined::defs(Instruction i) const { |
UNREFERENCED_PARAMETER(i); |
return RegisterList(); |
} |
// Breakpoint |
SafetyLevel Breakpoint::safety(Instruction i) const { |
- return i.GetCondition() == Instruction::AL |
- ? MAY_BE_SAFE |
- : UNPREDICTABLE; |
+ if (i.GetCondition() != Instruction::AL) |
+ return UNPREDICTABLE; |
+ // Restrict BKPT's encoding to values we've chosen as safe. |
+ if ((i.Bits(31, 0) == kLiteralPoolHead) || |
+ (i.Bits(31, 0) == kBreakpoint)) |
+ return MAY_BE_SAFE; |
+ return FORBIDDEN_OPERANDS; |
+} |
+ |
+RegisterList Breakpoint::defs(Instruction i) const { |
+ UNREFERENCED_PARAMETER(i); |
+ return RegisterList(); |
} |
bool Breakpoint::is_literal_pool_head(const Instruction i) const { |
- return i.Bits(31, 0) == kLiteralPoolHeadInstruction; |
+ return i.Bits(31, 0) == kLiteralPoolHead; |
} |
SafetyLevel PackSatRev::safety(const Instruction i) const { |