Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp73657ybd; Fri, 28 Jun 2019 14:50:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3Zlz1MA+vX8HWVsIYgsenpZusYvw/XKd+TTy6N/CEySq2k4XA2o2DAWVFVhSqk6ZKA1SM X-Received: by 2002:a17:90a:2506:: with SMTP id j6mr16260568pje.129.1561758655135; Fri, 28 Jun 2019 14:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561758655; cv=none; d=google.com; s=arc-20160816; b=pWb2CK4i2OjzjQF+VhKa6a53LLFy99dPFX5WOjtcEz6ta9SioeCCnEq2jHCt7eOPg9 KYRZQn4X5/qVv2wcD4m7tWQvfbociNepA/tBIKtJ7RFi/DtPx/IavbK2hAnbeTJ5R6Cs YmnN7EdBnik8XvdAiB3xdF9LhElTu0KoccoeZnqCJ62+QBUZlEMqQvdblmsIpA+9oEO5 rVFmE22aev5veELWo7bVtbPa2zitjrLYn2QhISlvpj5dCFXq6+zctrkQLojHFhDuSnSg v1SzQG6+RsBZf67yl5G6YTm8Yn726DyEEXzrMljVlWHeTzSazcuguEqZvyaJRUG3Nvv2 /G1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=qdZrjeoDNSQsqkyJp6BkgnYTQ7c4BAmADlCHRSbPn3o=; b=oU1IKIiUgXrQjITKE6K11Bj+xcO+9V37vDtRJoz/zo3s7mKG/0SU9JbpoVeOInJerm Zc2pnpIOgYQE8Kni5R9XRinqwJ1ZFWmuYR2ehv8h0qIp9kIV30x3Y+iYXAaFAHBIC17T GzHNj1vCIsMb4b/CQiclXgTUHsXNSqReJ0StV8J159uv8Oa6TMU9S35xITE0Tg7DSodn n2ByEoj+HYEzyRcS+eFdVFdbi7fy/lNb9AY2ZWIKVoT2eaJnhdAlOOeFgcMlkQMUPFYZ VXOwZVmtpCH6nDWwEMqcquKys2Nxnb1Xg7DncbOx7tC8ApHFrd38rh+rP0ZLoTqys37d 1uwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=Jbtf3SMd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m68si3766222pfm.150.2019.06.28.14.50.38; Fri, 28 Jun 2019 14:50:55 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=Jbtf3SMd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726711AbfF1Vtg (ORCPT + 99 others); Fri, 28 Jun 2019 17:49:36 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44938 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726565AbfF1Vtf (ORCPT ); Fri, 28 Jun 2019 17:49:35 -0400 Received: by mail-pf1-f193.google.com with SMTP id t16so3620219pfe.11 for ; Fri, 28 Jun 2019 14:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qdZrjeoDNSQsqkyJp6BkgnYTQ7c4BAmADlCHRSbPn3o=; b=Jbtf3SMdEjxfXc+d5F8QO1cas1KV2BV1hoJs1qRKJoPwT1GlFe/aVrIguqs8TeA5WL XFjSvXz5JL1mUxkp/yO9dDhKS2J+SdrJ0lxayg7atN068yg4GTjfLZEsHH6mtervlgTu dfdYK9wPBB2jWUqrgrGm8vXuRpOQ+u1Yc96OVeVo3XhBxIwOapG0VhV1rN1dM/PdL3/X bn1SdNRys1EYpFylxcnIXF3WzYpVDimXTzieLOZngZ+kqn3ePeZflspOP3g1t7V/TKhT bcyf3c/YjSwa+06KGllNZms+B+F87dwMlPa8OT/AmVRI2aAmsjsl+ygOc4phTxqIL3Hv VbiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qdZrjeoDNSQsqkyJp6BkgnYTQ7c4BAmADlCHRSbPn3o=; b=bIaQTPMEb4ADGGc4h+3+CPqklU88NlfZKc9hf1nY+LZmHN5FfO2KCdapinClRHu43E uB84DtRMANTqjktUYRDTFX7RVteQIkzQ3pWRY5CM/KC2nxyORAfnANfPVikSi0Miz8fA dfs7YW5ywCGfySRKlIOUjNe1SDnN5tOmraxfZGq2RVPDGxg4U2HFM0LsydlkgViEkdxW 05jy52pLqrdpLJ5q5pwmgt3BK+TFrdEgtsYSDYYIiiOXqh9vz6XBlg/YMICFXtxeM6gx y44qYKQz/2VhL/uc6wMYF2ds7QLpgwL1JGe6Tzov/I2Bk2yZLe4YAoiFBSJ3hI8dfeLF 9maQ== X-Gm-Message-State: APjAAAWRJKkF96ih3pH5WIpDerdJj0AiUptpctBWet03TCv0BgeFB5Ur BED9bGkijwZ2ct8Y73pelduHiw== X-Received: by 2002:a17:90a:c504:: with SMTP id k4mr15615755pjt.104.1561758574932; Fri, 28 Jun 2019 14:49:34 -0700 (PDT) Received: from ?IPv6:2600:1010:b00c:70fb:70e6:7ca0:457a:d080? ([2600:1010:b00c:70fb:70e6:7ca0:457a:d080]) by smtp.gmail.com with ESMTPSA id d123sm3359464pfc.144.2019.06.28.14.49.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2019 14:49:33 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [RFC PATCH 1/3] mm: Introduce VM_IBT for CET legacy code bitmap From: Andy Lutomirski X-Mailer: iPhone Mail (16F203) In-Reply-To: <20190628194158.2431-1-yu-cheng.yu@intel.com> Date: Fri, 28 Jun 2019 14:49:32 -0700 Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190628194158.2431-1-yu-cheng.yu@intel.com> To: Yu-cheng Yu Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 28, 2019, at 12:41 PM, Yu-cheng Yu wrote: >=20 > The previous discussion of the IBT legacy code bitmap is here: >=20 > https://lkml.org/lkml/2019/6/6/1032 >=20 > When CET Indirect Branch Tracking (IBT) is enabled, the processor expects > every branch target is an ENDBR instruction, or the target's address is > marked as legacy in the legacy code bitmap. The bitmap covers the whole > user-mode address space (TASK_SIZE_MAX for 64-bit, TASK_SIZE for IA32), > and each bit represents one page of linear address range. >=20 > This patch introduces VM_IBT for the bitmap. There=E2=80=99s no need to allocate a bit for this and to clutter up the fau= lt code with special cases. Use _install_special_mapping(), please. If you n= eed to make it more flexible to cover your use case, please do so.