Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp680633lqb; Wed, 17 Apr 2024 07:58:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8q4CyXVSAeQ6Tq0npGJa7EHIA7/dCVhkFCkoubLbU5qUPwY7756MFWfeX7rCNyNY2UrPqrBR6bh909a9Y/02ORj7Y9ck3PHillEbqvA== X-Google-Smtp-Source: AGHT+IFmt4JNxPMgOjAr0tSkfANzazAXH2H/3lwR1sKsDZ4sF8x9w/yHOCx8ZqLkOIBhUJ1OC1pv X-Received: by 2002:a05:6a20:3cab:b0:1a9:5b3f:f212 with SMTP id b43-20020a056a203cab00b001a95b3ff212mr24489667pzj.4.1713365900223; Wed, 17 Apr 2024 07:58:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713365900; cv=pass; d=google.com; s=arc-20160816; b=oqXEMJgUZTkCc/PX1ecKG1pNIRIS2E8mlkmwZNbfmnn7HH39ov48GiCpL+rzBlLBoR sDob4O/MtbRlQNsCgaxU9+PVyWvX/nDob0wDBWQVvL3x0FFan5l7iFh1pho9Y88SUUF5 /qlz/8dPQB7Rn9gPX0H7vMZREOZCtmo+HY+EyQx6//cn49FSMmWzyQqFhoUXJmQQK9eA uRE9jbggLw/hXWhz9m2j0fTK1jSouhw40vk/6kkjkV6A++vGQgAqtzGToNWYNlIF+BuY hdAoE7HJ+XMS4CUUy4/X1bFM+7sw8BSMX+huHK27KIxcPUFtt1pyO/hJRjR1yadRSluy Gusg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=o9TxhyKKQoiYNhUTURUSf28pnSXNpqLVIzMjhDUbYMU=; fh=ml0HEN4D5QgUMXZ8YmD06rzk77O/RHZuAyx0ejTTH1Q=; b=DY9x5woI7+X5x8KnOWTFL2WS8tWT5A5vThZIhj4Jgj1QeiKqYjVgN2a6ndqunx+hP3 7KfI+glYpAXZeHIQJEdNvOFQtnCladcNv+Ish1lfHPgeF0iaclTvAPg5vm+Cv7keWooJ NMnAQrYag6noOtqtPIF19tUFXszA2QARvZtR4Ap1R8BpQCbkGgsvPXP9aWvdQl2bm3kz 2ep9Y+0A2BWA2c4PylXKJm11zsHP7kNGNVnme7M+t40QM4WUzklXud822ZQVNAfxsmah BX6jP6foG8b9SjL3M57AYyTPR8p7osHi1ViOhQaMcEY8n89tX6Df98tZJNdKMM0HL3b2 rEug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-148741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 9-20020a631849000000b005cfd3333850si11311989pgy.106.2024.04.17.07.58.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 07:58:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-148741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 83275283631 for ; Wed, 17 Apr 2024 14:58:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8047F146A73; Wed, 17 Apr 2024 14:58:12 +0000 (UTC) Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B178140E3D for ; Wed, 17 Apr 2024 14:58:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713365892; cv=none; b=aymR3+ItFnLYuhNmaBvJIzjheapJc+42qXfsKJC8e8HgqiFU6piftmw8QNVkNppCYXv4yGXIi4IFBr5uvO20uZGh/7OEcQM1Lt8oH+q6V5wEASeHZcMHZ7BxbJ6A8eTrps748bZ0nzsrqDBCCE5HqzDr4tHBtWr9jVgyfRQf9PE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713365892; c=relaxed/simple; bh=2xyj0NTxTG4WCIsfGF2Dj9gu+EMZjKYzqcfchrNiejM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Tz5o/BN+OgTRBL1UI7KPTmr9Cvmjgd80gxKdDwKIX+TZHg2RldRe+IuqKK+FpiuKTfXrkyKLjekWtsODT1AvR1kvGCmlgOmeDKdFVyFIWlaJgvl2MkbRz2amJnvia3bcwflCEjEkPdf/bZR3Mb+mofLzlL93IuwOYrMNHx/HvzA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id C152A40E0187; Wed, 17 Apr 2024 14:58:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4DOFZVzoP8VO; Wed, 17 Apr 2024 14:58:03 +0000 (UTC) Received: from zn.tnic (pd953020b.dip0.t-ipconnect.de [217.83.2.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D3E9440E0028; Wed, 17 Apr 2024 14:57:43 +0000 (UTC) Date: Wed, 17 Apr 2024 16:57:38 +0200 From: Borislav Petkov To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Sean Christopherson , Andrew Cooper , Dave Hansen , Nikolay Borisov , KP Singh , Waiman Long , Ingo Molnar Subject: Re: [PATCH v3] x86/bugs: Only harden syscalls when needed Message-ID: <20240417145738.GDZh_jYguUrkT9QlXp@fat_crate.local> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Tue, Apr 16, 2024 at 04:02:21PM -0700, Josh Poimboeuf wrote: > Syscall hardening (i.e., converting the syscall indirect branch to a > series of direct branches) may cause performance regressions in certain > scenarios. Only use the syscall hardening when indirect branches are > considered unsafe. > > Fixes: 1e3ad78334a6 ("x86/syscall: Don't force use of indirect calls for system calls") > Reviewed-by: Pawan Gupta > Signed-off-by: Josh Poimboeuf > --- > v3: > - fix X86_FEATURE_INDIRECT_SAFE value > > arch/x86/entry/common.c | 15 ++++++++++++--- > arch/x86/entry/syscall_32.c | 11 +---------- > arch/x86/entry/syscall_64.c | 6 ------ > arch/x86/entry/syscall_x32.c | 7 ++++++- > arch/x86/include/asm/cpufeatures.h | 1 + > arch/x86/include/asm/syscall.h | 8 +++++++- > arch/x86/kernel/cpu/bugs.c | 31 +++++++++++++++++++++++++++++- > 7 files changed, 57 insertions(+), 22 deletions(-) I poked at this a bit and can't find anything that I can complain about so Acked-by: Borislav Petkov (AMD) I'll pick it up into urgent if no one complains soon. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette