diff options
author | Bernhard Urban <bernhard.urban@xamarin.com> | 2018-11-06 23:55:48 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2018-11-06 23:55:48 +0300 |
commit | 22143c7916d8f0b2095aeed4d1c4bf0c8cbfedc6 (patch) | |
tree | 13470f3f5ef31af82222d91caed6922ad117b8a8 | |
parent | 5d5d8fc7ea64648a6ad5e3a90a055f77ac2f0660 (diff) |
[icalls] remove DISABLE_POLICY_EVIDENCE (#11565)
[icalls] remove DISABLE_POLICY_EVIDENCE
Originally it was introduced with https://github.com/mono/mono/commit/db3591bb93dfe913c39ff73b95194effb88c880a . It seems like only the icall definitions were disabled for device runtimes (which aren't shipped there anyway), however the icalls themselves are _included_ in the device runtime. Note that the definitions are available to the AOT compiler.
Not sure what the rationale was behind this. Since the original change is very old, I think it just happened to be like that today. When running with the interpreter we need the icalls definitions at run-time available too (via the optional icall table that is linked in, so no additional cost for the fullAOT runtime due to this change).
Also remove `HANDLES_MAYBE` since it isn't needed anymore.
I think eventually we want to have `--enable-minimal=policy_evidence` that _also_ excludes the actual icalls, but this will need changes on the BCL side as well.
-rw-r--r-- | mono/metadata/icall-decl.h | 2 | ||||
-rw-r--r-- | mono/metadata/icall-def.h | 22 | ||||
-rw-r--r-- | mono/metadata/icall-table.c | 4 | ||||
-rw-r--r-- | mono/metadata/icall-table.h | 7 | ||||
-rw-r--r-- | mono/metadata/icall.c | 15 | ||||
-rw-r--r-- | sdks/builds/ios.mk | 2 |
6 files changed, 14 insertions, 38 deletions
diff --git a/mono/metadata/icall-decl.h b/mono/metadata/icall-decl.h index 65b924f4042..646d4b05db7 100644 --- a/mono/metadata/icall-decl.h +++ b/mono/metadata/icall-decl.h @@ -52,7 +52,6 @@ typedef enum { #include "icall-table.h" #define NOHANDLES(inner) inner -#define HANDLES_MAYBE(cond, id, name, func, ret, nargs, argtypes) HANDLES (id, name, func, ret, nargs, argtypes) #define HANDLES_REUSE_WRAPPER(...) /* nothing */ // Generate prototypes for coop icall wrappers. @@ -65,7 +64,6 @@ typedef enum { #undef ICALL_TYPE #undef ICALL #undef HANDLES -#undef HANDLES_MAYBE #undef HANDLES_REUSE_WRAPPER #undef NOHANDLES diff --git a/mono/metadata/icall-def.h b/mono/metadata/icall-def.h index 452c4777ac7..20902356624 100644 --- a/mono/metadata/icall-def.h +++ b/mono/metadata/icall-def.h @@ -909,30 +909,28 @@ HANDLES(RNG_2, "RngGetBytes", ves_icall_System_Security_Cryptography_RNGCryptoSe HANDLES(RNG_3, "RngInitialize", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize, gpointer, 2, (const_guchar_ptr, gssize)) HANDLES(RNG_4, "RngOpen", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngOpen, MonoBoolean, 0, ()) -#ifndef DISABLE_POLICY_EVIDENCE ICALL_TYPE(EVID, "System.Security.Policy.Evidence", EVID_1) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, EVID_1, "IsAuthenticodePresent", ves_icall_System_Security_Policy_Evidence_IsAuthenticodePresent, MonoBoolean, 1, (MonoReflectionAssembly)) +HANDLES(EVID_1, "IsAuthenticodePresent", ves_icall_System_Security_Policy_Evidence_IsAuthenticodePresent, MonoBoolean, 1, (MonoReflectionAssembly)) ICALL_TYPE(WINID, "System.Security.Principal.WindowsIdentity", WINID_1) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINID_1, "GetCurrentToken", ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken, gpointer, 0, ()) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINID_2, "GetTokenName", ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName, MonoString, 1, (gpointer)) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINID_3, "GetUserToken", ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken, gpointer, 1, (MonoString)) +HANDLES(WINID_1, "GetCurrentToken", ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken, gpointer, 0, ()) +HANDLES(WINID_2, "GetTokenName", ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName, MonoString, 1, (gpointer)) +HANDLES(WINID_3, "GetUserToken", ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken, gpointer, 1, (MonoString)) ICALL(WINID_4, "_GetRoles", ves_icall_System_Security_Principal_WindowsIdentity_GetRoles) ICALL_TYPE(WINIMP, "System.Security.Principal.WindowsImpersonationContext", WINIMP_1) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINIMP_1, "CloseToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken, MonoBoolean, 1, (gpointer)) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINIMP_2, "DuplicateToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken, gpointer, 1, (gpointer)) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINIMP_3, "RevertToSelf", ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf, MonoBoolean, 0, ()) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINIMP_4, "SetCurrentToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken, MonoBoolean, 1, (gpointer)) +HANDLES(WINIMP_1, "CloseToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken, MonoBoolean, 1, (gpointer)) +HANDLES(WINIMP_2, "DuplicateToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken, gpointer, 1, (gpointer)) +HANDLES(WINIMP_3, "RevertToSelf", ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf, MonoBoolean, 0, ()) +HANDLES(WINIMP_4, "SetCurrentToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken, MonoBoolean, 1, (gpointer)) ICALL_TYPE(WINPRIN, "System.Security.Principal.WindowsPrincipal", WINPRIN_1) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINPRIN_1, "IsMemberOfGroupId", ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId, MonoBoolean, 2, (gpointer, gpointer)) -HANDLES_MAYBE(ENABLE_POLICY_EVIDENCE, WINPRIN_2, "IsMemberOfGroupName", ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName, MonoBoolean, 2, (gpointer, const_char_ptr)) +HANDLES(WINPRIN_1, "IsMemberOfGroupId", ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId, MonoBoolean, 2, (gpointer, gpointer)) +HANDLES(WINPRIN_2, "IsMemberOfGroupName", ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName, MonoBoolean, 2, (gpointer, const_char_ptr)) ICALL_TYPE(SECSTRING, "System.Security.SecureString", SECSTRING_1) ICALL(SECSTRING_1, "DecryptInternal", ves_icall_System_Security_SecureString_DecryptInternal) ICALL(SECSTRING_2, "EncryptInternal", ves_icall_System_Security_SecureString_EncryptInternal) -#endif /* !DISABLE_POLICY_EVIDENCE */ ICALL_TYPE(SECMAN, "System.Security.SecurityManager", SECMAN_1) NOHANDLES(ICALL(SECMAN_1, "get_RequiresElevatedPermissions", mono_security_core_clr_require_elevated_permissions)) diff --git a/mono/metadata/icall-table.c b/mono/metadata/icall-table.c index 1fc4f9adacf..2b9eea8f58c 100644 --- a/mono/metadata/icall-table.c +++ b/mono/metadata/icall-table.c @@ -40,7 +40,6 @@ // These definitions are used for multiple includes of icall-def.h and eventually undefined. #define NOHANDLES(inner) inner -#define HANDLES_MAYBE(cond, id, name, func, ret, nargs, argtypes) HANDLES (id, name, func, ret, nargs, argtypes) #define HANDLES(id, name, func, ...) ICALL (id, name, func ## _raw) #define HANDLES_REUSE_WRAPPER HANDLES @@ -155,14 +154,12 @@ static const gconstpointer icall_symbols [] = { #endif // ENABLE_ICALL_SYMBOL_MAP #undef HANDLES -#undef HANDLES_MAYBE #undef NOHANDLES static const guchar icall_uses_handles [] = { #define ICALL_TYPE(id,name,first) /* nothing */ #define ICALL(id,name,func) 0, #define HANDLES(...) 1, -#define HANDLES_MAYBE(...) 1, #define NOHANDLES(inner) 0, #include "metadata/icall-def.h" #undef ICALL_TYPE @@ -170,7 +167,6 @@ static const guchar icall_uses_handles [] = { }; #undef HANDLES -#undef HANDLES_MAYBE #undef HANDLES_REUSE_WRAPPER #undef NOHANDLES diff --git a/mono/metadata/icall-table.h b/mono/metadata/icall-table.h index 5c1e29b8dfd..b956007bc01 100644 --- a/mono/metadata/icall-table.h +++ b/mono/metadata/icall-table.h @@ -347,12 +347,10 @@ func ## _raw ( MONO_HANDLE_FOREACH_ARG_RAW_ ## n argtypes MONO_HANDLE_COMMA_ ## // Implement ves_icall_foo_raw over ves_icall_foo. // Raw handles are converted to/from typed handles and the rest is passed through. -#define MONO_HANDLE_IMPLEMENT_MAYBE(cond, id, name, func, rettype, n, argtypes) \ +#define MONO_HANDLE_IMPLEMENT(id, name, func, rettype, n, argtypes) \ \ MONO_HANDLE_DECLARE_RAW (id, name, func, rettype, n, argtypes) \ { \ - g_assert (cond); \ - \ HANDLE_FUNCTION_ENTER (); \ \ /* FIXME Should be ERROR_DECL but for fragile test. */ \ @@ -367,7 +365,4 @@ MONO_HANDLE_DECLARE_RAW (id, name, func, rettype, n, argtypes) \ MONO_HANDLE_RETURN_END (rettype) \ } \ -#define MONO_HANDLE_IMPLEMENT(id, name, func, rettype, n, argtypes) \ - MONO_HANDLE_IMPLEMENT_MAYBE (TRUE, id, name, func, rettype, n, argtypes) - #endif diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c index 715229ba843..4cf792555e4 100644 --- a/mono/metadata/icall.c +++ b/mono/metadata/icall.c @@ -8777,13 +8777,6 @@ ves_icall_System_Environment_get_ProcessorCount (void) // Generate wrappers. -#ifdef DISABLE_POLICY_EVIDENCE -#define ENABLE_POLICY_EVIDENCE 0 -#else -#define ENABLE_POLICY_EVIDENCE 1 -#endif -#undef DISABLE_POLICY_EVIDENCE // Not redefined so keep at end of file. - #define ICALL_TYPE(id,name,first) /* nothing */ #define ICALL(id,name,func) /* nothing */ #define NOHANDLES(inner) /* nothing */ @@ -8795,17 +8788,13 @@ ves_icall_System_Environment_get_ProcessorCount (void) // i.e. the wrapper would also have a different name. #define HANDLES_REUSE_WRAPPER(...) /* nothing */ -#define HANDLES_MAYBE(cond, id, name, func, ret, nargs, argtypes) \ - MONO_HANDLE_DECLARE (id, name, func, ret, nargs, argtypes); \ - MONO_HANDLE_IMPLEMENT_MAYBE (cond, id, name, func, ret, nargs, argtypes) - #define HANDLES(id, name, func, ret, nargs, argtypes) \ - HANDLES_MAYBE (TRUE, id, name, func, ret, nargs, argtypes) + MONO_HANDLE_DECLARE (id, name, func, ret, nargs, argtypes); \ + MONO_HANDLE_IMPLEMENT (id, name, func, ret, nargs, argtypes) #include "metadata/icall-def.h" #undef HANDLES -#undef HANDLES_MAYBE #undef HANDLES_REUSE_WRAPPER #undef ICALL_TYPE #undef ICALL diff --git a/sdks/builds/ios.mk b/sdks/builds/ios.mk index cfe5d7a8981..0c5b6176403 100644 --- a/sdks/builds/ios.mk +++ b/sdks/builds/ios.mk @@ -70,7 +70,7 @@ _ios-$(1)_CPPFLAGS= \ -DMONOTOUCH=1 \ $$(ios-$(1)_SYSROOT) \ -arch $(3) \ - -DSMALL_CONFIG -DDISABLE_POLICY_EVIDENCE=1 -D_XOPEN_SOURCE -DHOST_IOS -DHAVE_LARGE_FILE_SUPPORT=1 \ + -DSMALL_CONFIG -D_XOPEN_SOURCE -DHOST_IOS -DHAVE_LARGE_FILE_SUPPORT=1 \ _ios-$(1)_LDFLAGS= \ -Wl,-no_weak_imports \ |