commit 5c30f34: [Feature] Allow hyperscan for ppc64, as vectorscan now suports it.

Duncan Bellamy dunk at denkimushi.com
Tue Jan 25 21:21:04 UTC 2022


Author: Duncan Bellamy
Date: 2022-01-22 11:41:53 +0000
URL: https://github.com/rspamd/rspamd/commit/5c30f34906494a50f284bdd3a60168eb68aefac3 (refs/pull/4047/head)

[Feature] Allow hyperscan for ppc64, as vectorscan now suports it.

---
 src/hs_helper.c                  | 2 +-
 src/libserver/cfg_utils.c        | 2 +-
 src/libserver/maps/map_helpers.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/hs_helper.c b/src/hs_helper.c
index e3c464786..d1bc36b81 100644
--- a/src/hs_helper.c
+++ b/src/hs_helper.c
@@ -303,7 +303,7 @@ static gboolean
 rspamd_rs_compile (struct hs_helper_ctx *ctx, struct rspamd_worker *worker,
 		gboolean forced)
 {
-#ifndef __aarch64__
+#if !defined(__aarch64__) && !defined(__powerpc64__)
 	if (!(ctx->cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) {
 		msg_warn ("CPU doesn't have SSSE3 instructions set "
 				"required for hyperscan, disable hyperscan compilation");
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 44cdbc84f..46ec5d5c6 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -817,7 +817,7 @@ rspamd_config_post_load (struct rspamd_config *cfg,
 	rspamd_regexp_library_init (cfg);
 	rspamd_multipattern_library_init (cfg->hs_cache_dir);
 
-#if defined(WITH_HYPERSCAN) && !defined(__aarch64__)
+#if defined(WITH_HYPERSCAN) && !defined(__aarch64__) && !defined(__powerpc64__)
 	if (!cfg->disable_hyperscan) {
 		if (!(cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) {
 			msg_warn_config ("CPU doesn't have SSSE3 instructions set "
diff --git a/src/libserver/maps/map_helpers.c b/src/libserver/maps/map_helpers.c
index 4eb6b2fee..c7b3ce00c 100644
--- a/src/libserver/maps/map_helpers.c
+++ b/src/libserver/maps/map_helpers.c
@@ -1306,7 +1306,7 @@ rspamd_re_map_finalize (struct rspamd_regexp_map_helper *re_map)
 
 	map = re_map->map;
 
-#ifndef __aarch64__
+#if !defined(__aarch64__) && !defined(__powerpc64__)
 	if (!(map->cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) {
 		msg_info_map ("disable hyperscan for map %s, ssse3 instructons are not supported by CPU",
 				map->name);


More information about the Commits mailing list