From patchwork Fri Sep 6 13:13:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11135277 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6ED1C13BD for ; Fri, 6 Sep 2019 13:16:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A9AB206BB for ; Fri, 6 Sep 2019 13:16:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="NZs4T0sE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A9AB206BB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i6E3d-0000mo-5L; Fri, 06 Sep 2019 13:13:45 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i6E3c-0000mg-H8 for xen-devel@lists.xenproject.org; Fri, 06 Sep 2019 13:13:44 +0000 X-Inumbo-ID: 26e08b0e-d0a8-11e9-abf5-12813bfff9fa Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 26e08b0e-d0a8-11e9-abf5-12813bfff9fa; Fri, 06 Sep 2019 13:13:44 +0000 (UTC) Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BAE95206BB; Fri, 6 Sep 2019 13:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567775623; bh=04VMkFAKwpuBxhJdJIYLigr+4AaTxM1JYsTMgdArZEQ=; h=From:To:Cc:Subject:Date:From; b=NZs4T0sE2RnKQkKahhNeB4+KuDgjS8z/UykH4cTyaD0PQ1MVUOymSG9DaLaHzbaKY 6hhhzFGTqnZwNtCbZHUxgK+Lh3U8tnuxEfjT/3cQB9ZckHnj9qxw+JndI+b/pa4dIP BBsBWpVCwCnvjEqMcpu5Iq/W4HK+wvoDI7ZKxXZw= From: Masami Hiramatsu To: Ingo Molnar Date: Fri, 6 Sep 2019 22:13:37 +0900 Message-Id: <156777561745.25081.1205321122446165328.stgit@devnote2> X-Mailer: git-send-email 2.20.1 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [Xen-devel] [PATCH -tip v4 0/4] x86: kprobes: Prohibit kprobes on Xen/KVM emulate prefixes X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Peter Zijlstra , Andrew Cooper , Randy Dunlap , x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Josh Poimboeuf , xen-devel@lists.xenproject.org, Boris Ostrovsky Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi, Here is the 4th version of patches to handle Xen/KVM emulate prefix by x86 instruction decoder. These patches allow x86 instruction decoder to decode Xen and KVM emulate prefix correctly, and prohibit kprobes to probe on it. Previous version is here; https://lkml.kernel.org/r/156773433821.31441.2905951246664148487.stgit@devnote2 In this version, I added 2 patches, [1/4] fixes __ASM_FORM() to accept macros using __stringify(), [2/4] introduces new asm/emulate_prefix.h to initialize Xen and KVM emulate prefix at one place. [3/4] is updated to use new emulate_prefix.h and fix to add emulate_prefix.h to sync check list. This series can be applied on -tip master branch which has merged Josh's objtool/perf sharing common x86 insn decoder series. Thank you, --- Masami Hiramatsu (4): x86/asm: Allow to pass macros to __ASM_FORM() x86: xen: kvm: Gather the definition of emulate prefixes x86: xen: insn: Decode Xen and KVM emulate-prefix signature x86: kprobes: Prohibit probing on instruction which has emulate prefix arch/x86/include/asm/asm.h | 8 ++++-- arch/x86/include/asm/emulate_prefix.h | 14 +++++++++++ arch/x86/include/asm/insn.h | 6 +++++ arch/x86/include/asm/xen/interface.h | 11 +++------ arch/x86/kernel/kprobes/core.c | 4 +++ arch/x86/kvm/x86.c | 4 ++- arch/x86/lib/insn.c | 34 +++++++++++++++++++++++++++ tools/arch/x86/include/asm/emulate_prefix.h | 14 +++++++++++ tools/arch/x86/include/asm/insn.h | 6 +++++ tools/arch/x86/lib/insn.c | 34 +++++++++++++++++++++++++++ tools/objtool/sync-check.sh | 3 ++ tools/perf/check-headers.sh | 3 ++ 12 files changed, 128 insertions(+), 13 deletions(-) create mode 100644 arch/x86/include/asm/emulate_prefix.h create mode 100644 tools/arch/x86/include/asm/emulate_prefix.h -- Masami Hiramatsu (Linaro)