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

Side by Side Diff: src/trusted/validator/ncvalidate.h

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 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__
8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__
9 9
10 /* Defines the API exposed by the Native Client validators. */ 10 /* Defines the API exposed by the Native Client validators. */
11 11
12 #include "native_client/src/include/build_config.h" 12 #include "native_client/src/include/build_config.h"
13 #include "native_client/src/include/nacl_base.h" 13 #include "native_client/src/include/nacl_base.h"
14 #include "native_client/src/include/portability.h" 14 #include "native_client/src/include/portability.h"
15 #include "native_client/src/trusted/cpu_features/cpu_features.h" 15 #include "native_client/src/trusted/cpu_features/cpu_features.h"
16 16
17 17
18 EXTERN_C_BEGIN 18 EXTERN_C_BEGIN
19 19
20 struct NaClValidationCache; 20 struct NaClValidationCache;
21 struct NaClValidationMetadata; 21 struct NaClValidationMetadata;
22 22
23 /* Defines possible validation flags. */
24 typedef enum NaClValidationFlags {
25 DISABLE_UNSUPPORTED = 0x1
26 } NaClValidationFlags;
27
23 /* Defines possible validation status values. */ 28 /* Defines possible validation status values. */
24 typedef enum NaClValidationStatus { 29 typedef enum NaClValidationStatus {
25 /* The call to the validator succeeded. */ 30 /* The call to the validator succeeded. */
26 NaClValidationSucceeded, 31 NaClValidationSucceeded,
27 /* The call to the validator failed (Reason unspecified) */ 32 /* The call to the validator failed (Reason unspecified) */
28 NaClValidationFailed, 33 NaClValidationFailed,
29 /* The call to the validator failed, due to not enough memory. */ 34 /* The call to the validator failed, due to not enough memory. */
30 NaClValidationFailedOutOfMemory, 35 NaClValidationFailedOutOfMemory,
31 /* The call to the validator failed, due to it not being implemented yet. */ 36 /* The call to the validator failed, due to it not being implemented yet. */
32 NaClValidationFailedNotImplemented, 37 NaClValidationFailedNotImplemented,
(...skipping 23 matching lines...) Expand all
56 * in sel_ldr or command-line tool). 61 * in sel_ldr or command-line tool).
57 * readonly_text - If code should be considered read-only. 62 * readonly_text - If code should be considered read-only.
58 * cpu_features - The CPU features to support while validating. 63 * cpu_features - The CPU features to support while validating.
59 * cache - Pointer to NaCl validation cache. 64 * cache - Pointer to NaCl validation cache.
60 */ 65 */
61 typedef NaClValidationStatus (*NaClValidateFunc)( 66 typedef NaClValidationStatus (*NaClValidateFunc)(
62 uintptr_t guest_addr, 67 uintptr_t guest_addr,
63 uint8_t *data, 68 uint8_t *data,
64 size_t size, 69 size_t size,
65 int stubout_mode, 70 int stubout_mode,
71 uint32_t flags,
66 int readonly_text, 72 int readonly_text,
67 const NaClCPUFeatures *cpu_features, 73 const NaClCPUFeatures *cpu_features,
68 const struct NaClValidationMetadata *metadata, 74 const struct NaClValidationMetadata *metadata,
69 struct NaClValidationCache *cache); 75 struct NaClValidationCache *cache);
70 76
71 /* Function type to copy an instruction safely. Returns non-zero on success. 77 /* Function type to copy an instruction safely. Returns non-zero on success.
72 * Implemented by the Service Runtime. 78 * Implemented by the Service Runtime.
73 */ 79 */
74 typedef int (*NaClCopyInstructionFunc)( 80 typedef int (*NaClCopyInstructionFunc)(
75 uint8_t *dst, 81 uint8_t *dst,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 NACL_BUILD_ARCH, 208 NACL_BUILD_ARCH,
203 NACL_BUILD_SUBARCH)( 209 NACL_BUILD_SUBARCH)(
204 uintptr_t guest_addr, 210 uintptr_t guest_addr,
205 uint8_t *data, 211 uint8_t *data,
206 size_t size, 212 size_t size,
207 const NaClCPUFeatures *cpu_features); 213 const NaClCPUFeatures *cpu_features);
208 214
209 EXTERN_C_END 215 EXTERN_C_END
210 216
211 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ */ 217 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698