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

Side by Side Diff: src/trusted/validator_arm/ncvalidate.cc

Issue 1234393005: A mechanism to identify/forbid/"rewrite" non-temporal instructions (and other) (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Use 0 to represent normal validation in NaClValidationFlags Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include <climits> 7 #include <climits>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 *is_position_independent = validator.is_position_independent(); 136 *is_position_independent = validator.is_position_independent();
137 if (!success) return 2; // for compatibility with old validator 137 if (!success) return 2; // for compatibility with old validator
138 return 0; 138 return 0;
139 } 139 }
140 140
141 static NaClValidationStatus ApplyValidatorArm( 141 static NaClValidationStatus ApplyValidatorArm(
142 uintptr_t guest_addr, 142 uintptr_t guest_addr,
143 uint8_t *data, 143 uint8_t *data,
144 size_t size, 144 size_t size,
145 int stubout_mode, 145 int stubout_mode,
146 uint32_t flags,
146 int readonly_text, 147 int readonly_text,
147 const NaClCPUFeatures *cpu_features, 148 const NaClCPUFeatures *cpu_features,
148 const struct NaClValidationMetadata *metadata, 149 const struct NaClValidationMetadata *metadata,
149 struct NaClValidationCache *cache) { 150 struct NaClValidationCache *cache) {
150 // The ARM validator never modifies the text, so this flag can be ignored. 151 // The ARM validator never modifies the text, so this flag can be ignored.
151 UNREFERENCED_PARAMETER(readonly_text); 152 UNREFERENCED_PARAMETER(readonly_text);
153 UNREFERENCED_PARAMETER(flags);
JF 2015/07/29 00:08:02 I'd rather CHECK(flags == 0);
ruiq 2015/07/29 00:14:17 Done.
Mark Seaborn 2015/07/29 00:31:39 Won't that fail when running PNaCl apps inside Chr
152 CheckAddressAlignAndOverflow((uint8_t *) guest_addr, size); 154 CheckAddressAlignAndOverflow((uint8_t *) guest_addr, size);
153 CheckAddressOverflow(data, size); 155 CheckAddressOverflow(data, size);
154 CheckAddressOverflow(data, size); 156 CheckAddressOverflow(data, size);
155 157
156 if (stubout_mode) 158 if (stubout_mode)
157 return NaClValidationFailedNotImplemented; 159 return NaClValidationFailedNotImplemented;
158 160
159 CHECK(guest_addr <= std::numeric_limits<uint32_t>::max()); 161 CHECK(guest_addr <= std::numeric_limits<uint32_t>::max());
160 162
161 // These checks are redundant with ones done inside the validator. It is done 163 // These checks are redundant with ones done inside the validator. It is done
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // so is their mix (single instruction update is atomic). 263 // so is their mix (single instruction update is atomic).
262 // We just have to make sure that unintended fallthrough doesn't 264 // We just have to make sure that unintended fallthrough doesn't
263 // happen, and we don't change position of guard instructions. 265 // happen, and we don't change position of guard instructions.
264 // Problem is that code is mapped for execution at different address 266 // Problem is that code is mapped for execution at different address
265 // that one we use here, and ARM usually use virtually indexed caches, 267 // that one we use here, and ARM usually use virtually indexed caches,
266 // so we couldn't invalidate correctly anyway. 268 // so we couldn't invalidate correctly anyway.
267 return 0; 269 return 0;
268 } 270 }
269 271
270 EXTERN_C_END 272 EXTERN_C_END
OLDNEW
« no previous file with comments | « src/trusted/validator/validation_disable_unsupported_test.cc ('k') | src/trusted/validator_mips/ncvalidate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698