Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp706965ybh; Tue, 10 Mar 2020 06:51:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtqjBT0S5666k9vdT4zHtYBpQ1Q+3d4hjk5m+B7vMoNzvcXzecGalUDn44FBzXW+aAD70is X-Received: by 2002:aca:4e08:: with SMTP id c8mr1234421oib.143.1583848266757; Tue, 10 Mar 2020 06:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583848266; cv=none; d=google.com; s=arc-20160816; b=SOACB0mdg3oS5pRCR3DHzictXWinn+BGMtGW+LeOJijgng1w5lV7Z3hynti1J3IXgH BoAl+3Ckuh4j/NYhCcoWA1/CKzF7ChoQlv8h3+C5rJ/mSXZei68P+4h/YoMYdDYyfgdD /M0X3hW5gpJhoRsEmsuxRkNcxZy8VovJTTVL83/sz2GrZJgV98ALFkqNz6ui8u1FkEJk 0hzY9B6MMCB1RdTNrnH2DbnO91/eP65UTelgwhzN6C0byzd98lF/sN/g/L16TwelTEKy bPsg2H9yZp0bJDHQewYtDCckx7kkhyJ3+EHd09zxwpExJX7bWk01pn7dG6pClE114zp8 UnHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=nhgz/w5Eb5VDZMZsWlI17qnMWK+YUGYFeu4ia0BfkhY=; b=BAWxz6MPDDFju78nGaJoNdTjNUTZeawpIG4FQXZZicsJ9koD75GHa+Az55l+V837xN jTLVpqVkITYB9sO/74wyxhhx1c7Plcilwud0zTWNsFvg5KfHzrt4t9gLbu2CeSIQZ2zE 04YEkcDPL1Idmx++lA1/R7iJYFKoLWPnwEpqFp6Si7sVJkyma4FnspF3Dr0KVmMzpFIa ZueD+FW8P7iT4At3sSP2rp0CUaBH8PbPaN1BovA9JSjOy7WURKNC3sArLfUHbAXYKojB K//rvJuOZU8jZ4M94D9MECkS8yFyYlRj08PXUbpiL6vryWS2coju+mpPgQqoBHuaN6ia qcfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=BpLElkmd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si8244709otq.81.2020.03.10.06.50.53; Tue, 10 Mar 2020 06:51:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=BpLElkmd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727249AbgCJNtO (ORCPT + 99 others); Tue, 10 Mar 2020 09:49:14 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:33612 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbgCJNtN (ORCPT ); Tue, 10 Mar 2020 09:49:13 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02ADgSm1171180; Tue, 10 Mar 2020 13:48:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=nhgz/w5Eb5VDZMZsWlI17qnMWK+YUGYFeu4ia0BfkhY=; b=BpLElkmdo0xPUf2HP1thsvg9AgngLdlVJd9D2GykXlinSUiQ390bHEjwnaOReuQj6/Bv Z1AtAdgqwGQi3irEA/UyjZV3HFXbvSXBXEP89dvj8ubVQn3XGsmA+8w1gGTf4JnvDP5u jKTubLBHekzRKCmayVFJQgMuVNK9GcvaNnqMWIAYUF4PUxslcpYfDUas9d+BX2rzLU1n 68lK2zFIZECCB19jG/MLFRNDCZg3wFKO3dAHBgJzt1zvospUkAy7B34OzojzT+HGO3oD +PVMhE52PzmqZzYbG+g+5G0dJd8ey8ISbPV6xL6suEDVEjNMGinwdtABhse+oxDiTxXb gw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2yp9v60qau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Mar 2020 13:48:35 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02ADhUdg171181; Tue, 10 Mar 2020 13:48:34 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2yp8rj07gr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Mar 2020 13:48:34 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 02ADmXok023293; Tue, 10 Mar 2020 13:48:33 GMT Received: from [192.168.8.5] (/213.41.92.70) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 10 Mar 2020 06:48:32 -0700 Subject: Re: [patch part-II V2 11/13] x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline To: Thomas Gleixner , LKML Cc: x86@kernel.org, Steven Rostedt , Brian Gerst , Juergen Gross , Frederic Weisbecker References: <20200308222359.370649591@linutronix.de> <20200308222610.040107039@linutronix.de> From: Alexandre Chartre Organization: Oracle Corporation Message-ID: Date: Tue, 10 Mar 2020 14:48:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20200308222610.040107039@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9555 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 mlxscore=0 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003100092 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9555 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 adultscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003100092 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/8/20 11:24 PM, Thomas Gleixner wrote: > Prevent the compiler from uninlining and creating traceable/probable > functions as this is invoked _after_ context tracking switched to > CONTEXT_USER and rcu idle. > > Signed-off-by: Thomas Gleixner > --- > arch/x86/include/asm/nospec-branch.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- a/arch/x86/include/asm/nospec-branch.h > +++ b/arch/x86/include/asm/nospec-branch.h > @@ -319,7 +319,7 @@ DECLARE_STATIC_KEY_FALSE(mds_idle_clear) > * combination with microcode which triggers a CPU buffer flush when the > * instruction is executed. > */ > -static inline void mds_clear_cpu_buffers(void) > +static __always_inline void mds_clear_cpu_buffers(void) > { > static const u16 ds = __KERNEL_DS; > > @@ -340,7 +340,7 @@ static inline void mds_clear_cpu_buffers > * > * Clear CPU buffers if the corresponding static key is enabled > */ > -static inline void mds_user_clear_cpu_buffers(void) > +static __always_inline void mds_user_clear_cpu_buffers(void) > { > if (static_branch_likely(&mds_user_clear)) > mds_clear_cpu_buffers(); > Reviewed-by: Alexandre Chartre I am just wondering if it would be worth defining a new function attribute to identify functions which shouldn't be trace/probe more clearly. For example: #define no_trace_and_probe __always_inline static no_trace_and_probe void mds_user_clear_cpu_buffers(void) { ... } I am just concerned that overtime we might forgot that a function is defined __always_inline just because it shouldn't be traced/probed. alex.