Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: src/trusted/validator_arm/actual_classes.cc

Issue 10879090: ARM validator: continue with extra_load_store_instructions. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: "Update test_sp_updates.S and related .nexe and .err files: they were relying on UNDEFINED behavior… Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/validator_arm/actual_classes.h ('k') | src/trusted/validator_arm/armv7.table » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2edcdf119b40d25c60dfea0c50c72bfc07c268e6..d660bdee122729239c0e33486861ce6c8034926e 100644
--- a/src/trusted/validator_arm/actual_classes.cc
+++ b/src/trusted/validator_arm/actual_classes.cc
@@ -341,6 +341,10 @@ SafetyLevel LoadBasedOffsetMemoryDouble::safety(const Instruction i) const {
return UNPREDICTABLE;
}
+ if (m.reg(i).Equals(t.reg(i)) || m.reg(i).Equals(t2.reg(i))) {
+ return UNPREDICTABLE;
+ }
+
// Now apply non-double width restrictions for this instruction.
return LoadBasedOffsetMemory::safety(i);
}
@@ -394,6 +398,7 @@ SafetyLevel StoreBasedMemoryWithWriteBack::safety(const Instruction i) const {
// may not check for this. For the moment, we are changing
// the code to ignore this case for stores.
// TODO(karl): Should we not allow this?
+ // TODO(jfb) Fix this.
return UNPREDICTABLE;
}
@@ -428,9 +433,12 @@ SafetyLevel StoreBasedOffsetMemory::safety(const Instruction i) const {
// may not check for this. For the moment, we are changing
// the code to ignore this case for stores.
// TODO(karl): Should we not allow this?
+ // TODO(jfb) Fix this.
return UNPREDICTABLE;
}
+ // TODO(jfb) if ArchVersion() < 6 && wback && m == n then UNPREDICTABLE;
+
return StoreBasedMemoryWithWriteBack::safety(i);
}
@@ -513,6 +521,12 @@ RegisterList Roadblock::defs(Instruction i) const {
}
// Breakpoint
+SafetyLevel Breakpoint::safety(Instruction i) const {
+ return i.GetCondition() == Instruction::AL
+ ? MAY_BE_SAFE
+ : UNPREDICTABLE;
+}
+
bool Breakpoint::is_literal_pool_head(const Instruction i) const {
return i.GetCondition() == Instruction::AL
&& i.Bits(19, 8) == 0x777
@@ -707,6 +721,13 @@ RegisterList MoveDoubleFromCoprocessor::defs(Instruction i) const {
// Control flow
SafetyLevel BxBlx::safety(Instruction i) const {
+ // Extra NaCl constraint: can't branch to PC. This would branch to 8 bytes
+ // after the current instruction. This instruction should be in an instruction
+ // pair, the mask should therefore be to PC and fail checking, but there's
+ // little harm in checking.
+ if (m.reg(i).Equals(kRegisterPc)) return FORBIDDEN_OPERANDS;
+
+ // Redundant with the above, but this is actually UNPREDICTABLE. Expect DCE.
if (link_register.IsUpdated(i) && m.reg(i).Equals(kRegisterPc)) {
return UNPREDICTABLE;
}
« no previous file with comments | « src/trusted/validator_arm/actual_classes.h ('k') | src/trusted/validator_arm/armv7.table » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698