Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp727901pxb; Thu, 12 Nov 2020 15:06:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaIfBtLoWdcbNcCvKs6KcAGVNBJp9Sikt7D6nhsW81K00RVTdg89mPCIHUSI5wPAz1BYgm X-Received: by 2002:a17:906:b202:: with SMTP id p2mr1563545ejz.483.1605222368092; Thu, 12 Nov 2020 15:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605222368; cv=none; d=google.com; s=arc-20160816; b=ujEspHZJWDx0sI9vOb57dzq0hk63t4AhgOl6Wd9rQSiX9CMWv4uHEUZ+iTiQFdzQMb 75olruX7cCjKQHQs8jEkj/WR28eD+X7bw6EW7IkThmG+PvVnyliRTNBT7BC41x/ccSsH hTIVwPu3pBa8AE+ePN44kL9ranCd4d58KbIVdMUobddqWEwL3GuR4Mr7IwaYbL5qv9Ww l+w1+nOuL/7USFs52UQVAqFYuSV6GWIeHVQTGKuJnKrRU8k6ONWajz2aJM2BTK01S4v5 DtS2aucdpg6sLpePk5AaSsCmYg7TlXmBppfQPS4LD7td2ov81oE4Bc3H5wpT/h+hkcZs wKKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fnHRhadYMNBieRjFdpkgcexF0C54pntt644UCAtopA0=; b=PFw6ti6gfq7tlzGJWKMT8ZMoVLi2n/wd94QYNZIiL9yRMcOLB1GjEykVdI+aOKVvnc L3hqBa461wBDCnRglZ7iABeU9EfzB0SSUsD6lNe8eFVef9IH8aKMp6sCthq25o99HHi5 pXrSLcGkiTBPfll41Q8BqeCyVpLJ5ZPcmup9guLP5s6bJWyaGyxYfV84UGCPuk5YGUYc +0pK7fWNOmE6W5W3/vf5GYoBftCmhEbc8w5X792erC0wkaYr84QjC9aW0cXrnMdj1o1J sR078N/KAhBo64WLybOhe0m4wKH7jEXwo6ZQDRZFx+ynlBOS72hfheDfCo67/Cog4cs6 49HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gKSw9Sv0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ar8si4758491ejc.496.2020.11.12.15.05.44; Thu, 12 Nov 2020 15:06:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gKSw9Sv0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726610AbgKLXD6 (ORCPT + 99 others); Thu, 12 Nov 2020 18:03:58 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52814 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725929AbgKLXD4 (ORCPT ); Thu, 12 Nov 2020 18:03:56 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0ACN1mvR148597; Thu, 12 Nov 2020 18:03:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=fnHRhadYMNBieRjFdpkgcexF0C54pntt644UCAtopA0=; b=gKSw9Sv0cphiUFkzlUncdYaCUMI577OPwVxN4ze5RJ4BGCLcBrWiBeGVEq4npR6laHdg LwfN7eRpb2QGTEbOnu5pU59+yF6qMqZYJikcgWR0BK8zN1E2F1KD/5w9XnTtSr+abnqq t1xrYdJhdkFPeeW1m2LVmH7lqSBofsVrM1t0CtLeRV9OMTjj5LxXt8zpSszij3/07ssT xxfVgNx5vDs8lEY+wf2kq5zEM9S8LGfRlZ6YeNFzTCzFYON8B+Q2WGCGwUdi6I9aRP6g /IphmOWOkxy9t6mVzys9IAYtSOSEffrIea50m33rR8jM04fBSLMj0yyXCWH865+aCWdi KQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 34s9vkyj8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Nov 2020 18:03:26 -0500 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0ACN2TGX151606; Thu, 12 Nov 2020 18:03:26 -0500 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 34s9vkyj7k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Nov 2020 18:03:26 -0500 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0ACMqU4h031544; Thu, 12 Nov 2020 23:03:24 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 34nk78p4tc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Nov 2020 23:03:24 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0ACN3M6d65798432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Nov 2020 23:03:22 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 315B74C04A; Thu, 12 Nov 2020 23:03:22 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9659B4C044; Thu, 12 Nov 2020 23:03:21 +0000 (GMT) Received: from localhost (unknown [9.171.90.1]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 12 Nov 2020 23:03:21 +0000 (GMT) Date: Fri, 13 Nov 2020 00:03:20 +0100 From: Vasily Gorbik To: Josh Poimboeuf , Masami Hiramatsu , Peter Zijlstra Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Miroslav Benes , Alexandre Chartre , Julien Thierry , linux-kernel@vger.kernel.org Subject: [PATCH v5 1/5] x86/tools: Use tools headers for instruction decoder selftests Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Patchwork-Bot: notify X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-12_14:2020-11-12,2020-11-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=1 mlxscore=0 adultscore=0 impostorscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011120127 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently x86 instruction decoder is used from: - the kernel itself, - from tools like objtool and perf, - within x86 tools, i.e. instruction decoder selftests. The first two cases are similar, because tools headers try to mimic kernel headers. Instruction decoder selftests include some of the kernel headers directly, including uapi headers. This works until headers dependencies are kept to minimum and tools are not cross-compiled. Since the goal of the x86 instruction decoder selftests is not to verify uapi headers move it to using tools headers, like this is already done for vdso2c tool, mkpiggy and other tools in arch/x86/boot/. Signed-off-by: Vasily Gorbik --- arch/x86/tools/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile index 55b1ab378974..bddfc9a46645 100644 --- a/arch/x86/tools/Makefile +++ b/arch/x86/tools/Makefile @@ -29,14 +29,14 @@ posttest: $(obj)/insn_decoder_test vmlinux $(obj)/insn_sanity hostprogs += insn_decoder_test insn_sanity # -I needed for generated C source and C source which in the kernel tree. -HOSTCFLAGS_insn_decoder_test.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/uapi/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/uapi/ +HOSTCFLAGS_insn_decoder_test.o := -Wall -I$(srctree)/tools/arch/x86/lib/ -I$(srctree)/tools/arch/x86/include/ -I$(objtree)/arch/x86/lib/ -HOSTCFLAGS_insn_sanity.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/ +HOSTCFLAGS_insn_sanity.o := -Wall -I$(srctree)/tools/arch/x86/lib/ -I$(srctree)/tools/arch/x86/include/ -I$(objtree)/arch/x86/lib/ # Dependencies are also needed. -$(obj)/insn_decoder_test.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c +$(obj)/insn_decoder_test.o: $(srctree)/tools/arch/x86/lib/insn.c $(srctree)/tools/arch/x86/lib/inat.c $(srctree)/tools/arch/x86/include/asm/inat_types.h $(srctree)/tools/arch/x86/include/asm/inat.h $(srctree)/tools/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c -$(obj)/insn_sanity.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c +$(obj)/insn_sanity.o: $(srctree)/tools/arch/x86/lib/insn.c $(srctree)/tools/arch/x86/lib/inat.c $(srctree)/tools/arch/x86/include/asm/inat_types.h $(srctree)/tools/arch/x86/include/asm/inat.h $(srctree)/tools/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c HOST_EXTRACFLAGS += -I$(srctree)/tools/include hostprogs += relocs -- 2.25.4