From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id D781A4C75F for ; Fri, 8 Aug 2025 12:21:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 7B4DA68CC5E; Fri, 8 Aug 2025 15:21:53 +0300 (EEST) Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 2F11E68C3EF for ; Fri, 8 Aug 2025 15:21:47 +0300 (EEST) Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-615957f48a9so1562590a12.3 for ; Fri, 08 Aug 2025 05:21:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754655706; x=1755260506; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=h9EC6m5OUuvJPmkyNymik6gCu3CCk+S6xkrqWyrdwvs=; b=sVssi04SdEi4i2+Qgx5xChBUohD/vnlmT2Jt/lwQg+HoVwMfNDZMmz0LcGIE5Cepmy R1ZsnmR3+4w1lkyEVho7QJsTtUgKDKIINE9UimXUuFB/05h/sApFlz5a+D+9Wmye6iuR F7g0cfvsDk6zZ9wnJhH2R/MQJj0Rq/hmmsHaftxE0lL63+Wh9UV1gJk1bunToFdTzvZG Pk2KQNTQgWACW8ssrfrRO27KewkGfPHQe63Z4jyp0LECfNWsbCt9x4dcAMPc7RbvOAE/ Yz7vV2tl8mNMdFaNbXoalMkLIwtDwuu7GTEwmEVt/NthvAOlImbtpJrm2Ob30FKtzUhz 4AiA== X-Gm-Message-State: AOJu0YzJSH+796RFLLNrS7pPeEBO4xlnh8X/N+J6XIDMcUDt+Mn8tr8R LXS8FfeKxWVc/DlwHERCp6kVT4I5f/rYC8LYjU26NftDyhxe7Rj1DxiSaoqLOosOQB24op0Tnyq kQl+gW7b743ZHqrqCm43MCf/gNDvNZ2dyZ4Ny4BkattEsTVfK6IR1/CKwnKdiUxELOngGaXRepA q6RUdnnsA3F3XkjD5ei3qqq2FPeWKMx1HyXdy5PPIBCTl0XiexUK6Bsg== X-Google-Smtp-Source: AGHT+IH9nTQqZp2E9VIVbcAE1g9Gx2SPnqKyrYEi6EKBt4+2YU0HmY/sZixGKhUFDAVDH1UUcWaCtd/Q6pkxCLI= X-Received: from edad34.prod.google.com ([2002:a05:6402:4022:b0:617:ca2f:8ce2]) (user=alankelly job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:1d55:b0:615:23ce:9031 with SMTP id 4fb4d7f45d1cf-617e2c4f10amr2371375a12.16.1754655706309; Fri, 08 Aug 2025 05:21:46 -0700 (PDT) Date: Fri, 8 Aug 2025 12:20:45 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.50.1.703.g449372360f-goog Message-ID: <20250808122142.2957853-1-alankelly@google.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] swscale: Disable avx2 hscale 8to15 on IceLake and below due to Intel Gather Data Sampling mitigation performance loss X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Alan Kelly via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Alan Kelly Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Intel provided a microcode update to mitigate this security vulnerability which has a huge negative performance impact on gather instructions. This means that hscale 8to15 avx2, which uses gather extensively, is no longer faster than SSSE3 on impacted CPUs. --- libavutil/x86/cpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c index d6cd4fab9c..923c63e0c4 100644 --- a/libavutil/x86/cpu.c +++ b/libavutil/x86/cpu.c @@ -244,9 +244,11 @@ int ff_get_cpu_flags_x86(void) family == 6 && model < 23) rval |= AV_CPU_FLAG_SSSE3SLOW; - /* Haswell has slow gather */ - if ((rval & AV_CPU_FLAG_AVX2) && family == 6 && model < 70) + /* Ice Lake and below have slow gather due to Gather Data Sampling + * mitigation. */ + if ((rval & AV_CPU_FLAG_AVX2) && family == 6 && model < 143) { rval |= AV_CPU_FLAG_SLOW_GATHER; + } } #endif /* cpuid */ -- 2.50.1.703.g449372360f-goog _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".