Received: by 10.192.165.148 with SMTP id m20csp556655imm; Fri, 20 Apr 2018 11:08:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx48UH+XEVpasTCvlgjLHh7Ht8UFqsWvGocBx9NF0QerbrZzjLdYvtnCuHdlZr3dh4qj42Eax X-Received: by 10.167.128.2 with SMTP id j2mr10456498pfi.126.1524247702712; Fri, 20 Apr 2018 11:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524247702; cv=none; d=google.com; s=arc-20160816; b=hdT2G3YnHP4NJVtDhY+Av3qZtCqZsBHcrCdyyN7pJ+Y7YWfh1DxrmHgnGYVW7OCuIs MMG5GSEAWpdmwFFNEY2l7czRLN+FcHuMQz9gWmrfXj95jjeaJQcPnvO5V8+uEWOkFIYc W8Tf26KuveEttYc5QSxp+rEBaBsZOx/hmyD98ANUuwutAF7Q2s/wgMNTNWHyVgED5rfH k6HscA98v4u5MUF6fxhaH5nPXYVhsj14WBQWK6K69qr5GVpUuBscgV7KErO+70X/gAvH Otnktj34BxdNHFCIsKCRroLA63NWS1K7b7oeWmbBcIeDNGUWZNxbJudCjH8fYarkC/Fp LTFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature :arc-authentication-results; bh=ChGha4aeOcaWSWam+5WgrfQTRb2Ins1pnkQymRfDPZg=; b=DpzAudnSklbDG6Py5dObVpUZSGrQD3rc5MZWzBAXO7MzSfqPS2uH73Qk2ygzZX+BB5 OenYcJjFq8JVd9BaNyJh2+W/VPjcr4bgb3VGpJojOSzqW/HlBE/wotySODQTqM+xCdud ZffkkhDSTeNvf4219SZ2vbWRCdpNSKNzDqOHHY9BRT17C+tzx7kZcILhgpG+Lnps1NVt Zjq68KrxZooROyuHn5FInGqmnlbMQ3G1pSCpocwZZQOFK6qR6GGatWM0LsP6VcdWtMEl YU/IcGzj49ToGJ1n/u1Uxnq7djg8mKX2bJ/iPnvRSNtjhmaM8pGK40apr2RAkjiSbJ8l NREA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=qmghaS45; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=cd2o6wtg; 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=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12si5378059pgf.113.2018.04.20.11.08.07; Fri, 20 Apr 2018 11:08:22 -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=@fb.com header.s=facebook header.b=qmghaS45; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=cd2o6wtg; 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=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753569AbeDTSGu (ORCPT + 99 others); Fri, 20 Apr 2018 14:06:50 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:48200 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752749AbeDTSGs (ORCPT ); Fri, 20 Apr 2018 14:06:48 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3KI0Gnv015116; Fri, 20 Apr 2018 11:06:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=ChGha4aeOcaWSWam+5WgrfQTRb2Ins1pnkQymRfDPZg=; b=qmghaS4581IiV5H6ofMT73Fn5yP3iBHnfucvv6QkiXPA7F2mLjHrQ5XXQY4GdAm/Isbj iciKsa0mKzwtEHM5IFAXwfesxJ0yLBxljKxeKEXE3ymciHX84QRBF1A1nvAwwDvtzip9 cfRCrW1jpgvEBT/zI7Wquzh/MlzOOLYwCO8= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2hfn17g12u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 20 Apr 2018 11:06:13 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.19) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 20 Apr 2018 11:06:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ChGha4aeOcaWSWam+5WgrfQTRb2Ins1pnkQymRfDPZg=; b=cd2o6wtgmRWeoBALCRIP03QrpHZ+YvMjE8rX2StbAEtd0WkoEU1aLA9Rea4Z3oAQHE/UCNiG96UiIwTL+gzrzDja0rw30+WBN8aX0f/26LBVaVjgeGdwaU6019BYhMlYQ8EbBth/rJB/dq6hKWeMX6ByKNwTdBkDOllgIr7oicY= Received: from macbook-pro-52.dhcp.thefacebook.com (2620:10d:c090:200::5:bd22) by CO2PR15MB0073.namprd15.prod.outlook.com (2a01:111:e400:5068::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Fri, 20 Apr 2018 18:06:07 +0000 Subject: Re: [PATCH v2] x86/cpufeature: guard asm_volatile_goto usage with NO_BPF_WORKAROUND To: Peter Zijlstra CC: , , , , , References: <20180415042738.1788215-1-yhs@fb.com> <20180420081936.GD4064@hirez.programming.kicks-ass.net> From: Yonghong Song Message-ID: Date: Fri, 20 Apr 2018 11:06:03 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180420081936.GD4064@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::5:bd22] X-ClientProxiedBy: CO1PR15CA0112.namprd15.prod.outlook.com (2603:10b6:101:21::32) To CO2PR15MB0073.namprd15.prod.outlook.com (2a01:111:e400:5068::23) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(2017052603328)(7153060)(7193020);SRVR:CO2PR15MB0073; X-Microsoft-Exchange-Diagnostics: 1;CO2PR15MB0073;3:O1Am9BOb2KXYvKf63xFgXOp/5OAaT+yXPEwTPLGh/2+V2zFqlnCQf44Dvs9KWFNyo2Q582HFGXo/ap4ldt965N8jwnJiv4+kfHio0mXL9wT/k08cZUBqiZPS7mZdi7pGXwegm087wAUlsPUSKRMA1U+TYB90rGGM0WiY1j7airncin4d5ES36JBhkufvomiHwzYx9kSjFsvr2xqpxpWMt5mGVApOVUci5P70dqpY9FoY9EgHlyhq6kEsRyEK5l6h;25:NHiGvhq+B+7QaeZhs5YiKm0/eeTOJ31QN7zg9ebhDd3S5O1yQteGXujrKF1AwgsLElrMCNkUqWsP8meuVD3SQXdnfi7QrhxGkv5l/pR3ePpchjPHfqXVoBA7EFYFh64PmWjs2THznrh2eITy1xCSxcc2oU0+YVLhQSgEjzumtheDxbpGX5uu7xDmZZUDv1ctJ6VWA3GDnJfWBhq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9Sd5lThtnE2PKE2ekyuab/FADyxKzH7SyeJcJ9N8mTMKCZ9lAuVhviDceQVMQTarUn5Apk9WPwTV0ze5I111L0Ivd81FtjKGT1nh0sFGBVoComjbGRCJ3PhnfFM3iHQO/pcTv7KcAiSXNXkYafXEgm5Ol+3S94hvfeSqT1xSFQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231232)(11241501184)(944501396)(52105095)(10201501046)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:CO2PR15MB0073;BCL:0;PCL:0;RULEID:;SRVR:CO2PR15MB0073; X-Forefront-PRVS: 0648FCFFA8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(376002)(346002)(366004)(39380400002)(39860400002)(396003)(446003)(6512007)(81166006)(53936002)(31696002)(25786009)(47776003)(11346002)(2616005)(6246003)(476003)(6666003)(6916009)(305945005)(5660300001)(8936002)(65826007)(4326008)(478600001)(86362001)(7736002)(8676002)(2906002)(52396003)(52146003)(23676004)(2486003)(46003)(230700001)(50466002)(67846002)(76176011)(6506007)(53546011)(52116002)(6116002)(36756003)(386003)(16526019)(6486002)(31686004)(316002)(229853002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO2PR15MB0073;H:macbook-pro-52.dhcp.thefacebook.com;FPR:;SPF:None;LANG:en;MLV:sfv; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDTzJQUjE1TUIwMDczOzIzOkR0UlRPOU1Nck5pTXZmWUhVUDBHeUZZMmJs?= =?utf-8?B?SGRtdG10elFET3ZNK3cvdGpjTTQzcGRWc3JTaUhYblBWQ05Xd2ZjekVGQ2FX?= =?utf-8?B?cGY5M0hIMitXSWo4NnJiWXloOXJ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zO1T0Cc3dINJugmv04cciVnzEgoguXSdoESmIXnmZuvSOTRzloerYZ6vvY2Mo+DUSJ1mL7RGst3oduhO98RzU+cLemRHrMIW2ukDYYxDu3oXDKEwVxZxG69MVglwixaFnjzprGz/r4l/9SCR+mqjaWlCLGrYTccF0/svn9x0yc94uDSY1l4SreUMAXDatANUx98fAt41fDOdHS0KEKzuhUV5iPborufWbitIQqc/4iK11DOtewNs2ERsgj07Yqfow==;5:0sbac0A3OB8MqGnLNHLb4vB4yqmO8NcG6GZleI6RKaism423WPikREZqTyrOv4GM340UgyztcsrAHN3ASZhWBU+v5LWzffjaNi+BoZkec4VP7iDm7L3YQqt/XvgfiZvhGvE1yoB2xGs8nkxNndyPt1gfNcM9s2ffpSO9gTOEBJ0=;24:GKuBXguffHNGyJB9nnkn5qB4ZqXC9pXl3WTMAefdMrvdhCjeOBF7qy7OQIbaE3uQ/eQPWYkLn6+0mq5nAExEIMPPqmIs4hYhd7+XOySZO8c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO2PR15MB0073;7:D1qoswwRBPd02sxMY8XsvZui+irrxu0F/qK0Mk1+Kwgf9trZvV8/eAxqxHPIqz/u0JlzymnKYUTVlsczSahYgk25dkos4c/LvfVsGkMDBH76FMoyOsGslMDvjOcmpNGwBXZKUezvygz3lS4yfllpk/RJBXQvHUpG1lBLHVzwXBYjnQt6cH0awjnjLn0JsFTj8o6dtoCht7t25bcP/dbj+UKwSwFWMy5A1iTLBPPJPk4e+LZBzRX0IhW/qZ+5AZtP;20:SqmCckRCk20S5s/Zdrz6XBBX7MQjdOMyZGDXCoOcBezrbbu+gEE9FiroObaYoUn87JJi3Tylxzhf3ZtRz8ZkBuYf3htWuf3DvIrhq6QKp65YU7Fcqcc02097KEB6UxAjXgMtFsQyMO3unqzvX/v12Q5xwJD7Z4SzhgzSZnSdkNM= X-MS-Office365-Filtering-Correlation-Id: 8cb2a86f-eb31-4176-2af1-08d5a6e963f1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2018 18:06:07.3383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8cb2a86f-eb31-4176-2af1-08d5a6e963f1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR15MB0073 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-20_08:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/20/18 1:19 AM, Peter Zijlstra wrote: > On Sat, Apr 14, 2018 at 09:27:38PM -0700, Yonghong Song wrote: > >> This patch adds a preprocessor guard NO_BPF_WORKAROUND around the >> asm_volatile_goto based static_cpu_has(). NO_BPF_WORKAROUND is set >> at toplevel Makefile when compiler supports asm-goto. That is, >> if the compiler supports asm-goto, the kernel build will use >> asm-goto version of static_cpu_has(). > > Hurm, so adding __BPF__ for BPF compiles isn't an option? It seems to me > having a CPP flag to identify BPF compile context might be useful in > general. With "clang -target bpf", we already have __BPF__ defined. For tracing, esp. ptrace.h is included, "clang -target " where "-target " can be omitted, is typically used. The reason is the native architecture header files typically include a lot of various asm related stuff where "-target bpf" cannot really handle. We relay on native clang to flush out all these asm constructs and only bpf program needed stuff survives reach to backend compiler. The backend compiler, llc, will have option "-march=bpf" to do right thing to generate bpf byte codes. So the patch is really a workaround for "clang -target x86_64" with intention of using "llc -march=bpf" later on.