From patchwork Tue Dec 22 04:22:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1419250 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=sourceware.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=mu7RtZgu; dkim-atps=neutral Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D0NTq3wHqz9sVm for ; Tue, 22 Dec 2020 15:22:23 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 64B0C3840C14; Tue, 22 Dec 2020 04:22:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64B0C3840C14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608610928; bh=agX6HGNX179A0m4dgUsN8lPh+pMlv/dpHq3iy+AE+F8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=mu7RtZgu5gKWjFqxOuHDhQtGijfSB7O7H4QfALk731VkkLR3qjhRsm0YmRyqccRRv 8K3ba2F1yYcrSO/iEWrumfXD5zGDSJvVKNbLzS5uk+QJfZvFL922SF3t9/+FaNhmZj z+dG6/ylP3b6BWTvZHbvVuLsExBpMnqPfwe5YRQ0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 6D9E03870C0A for ; Tue, 22 Dec 2020 04:22:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6D9E03870C0A Received: by mail-pj1-x102b.google.com with SMTP id lb18so630797pjb.5 for ; Mon, 21 Dec 2020 20:22:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=agX6HGNX179A0m4dgUsN8lPh+pMlv/dpHq3iy+AE+F8=; b=si4Ek0d3FuDR7VJpsVkcpcqOeyOZ0gqvK7luXfTqB3eqNgO1UatHgMVZP9xpVRHO0T x+SOJzI1zi6SUd7PaLT2OIQ7ryPIE8htiRgVU7PGBwtQTdAae1IPfbPva7oLrKDsgi/7 /qZHBTjmtjv15qoEU9l7ukpxwHm14gTfApbMWLyhXKoLRo1qkJlIkehq8ZLvCsdD0gAD m3rtuDemLQkNRKSVp40K+yCKEidWL41yrnFJAWuQwlYyB1EgN9bMi8Rgw/+ZLS9R1eJo MEIMXMIg4ybavPPejQDes5t4Z48nTo1aowf+ME/UnP2236ygrfT0n1d0VFimdFQ/sZg+ kM/g== X-Gm-Message-State: AOAM5335lUw6ZkBwZU8cWzNvyIDgVXDdk93v9wFk4tbennbaKn6xbp1r RA69/HI+ct8cAFwyh3S+YIunBgTNUuo= X-Google-Smtp-Source: ABdhPJzJscNUmUyXkIg2X3ULF+bU1bzAQD4ef9FIjl7GZ3LSO3m7Blx0u/kDTJ6ZZFPbBZd3jYUzHA== X-Received: by 2002:a17:902:d351:b029:db:e003:3b88 with SMTP id l17-20020a170902d351b02900dbe0033b88mr19273611plk.70.1608610924181; Mon, 21 Dec 2020 20:22:04 -0800 (PST) Received: from gnu-cfl-2.localdomain (c-69-181-90-243.hsd1.ca.comcast.net. [69.181.90.243]) by smtp.gmail.com with ESMTPSA id 184sm4562397pgi.92.2020.12.21.20.22.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Dec 2020 20:22:03 -0800 (PST) Received: from gnu-cfl-2.localdomain (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 350071A00EA for ; Mon, 21 Dec 2020 20:22:02 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH] : Add Intel LAM support Date: Mon, 21 Dec 2020 20:22:00 -0800 Message-Id: <20201222042200.2808179-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=-3040.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Add Intel Linear Address Masking (LAM) support to . --- manual/platform.texi | 3 +++ sysdeps/x86/sys/platform/x86.h | 3 +++ sysdeps/x86/tst-get-cpu-features.c | 1 + 3 files changed, 7 insertions(+) diff --git a/manual/platform.texi b/manual/platform.texi index 8fec2933d6..b67683aeb3 100644 --- a/manual/platform.texi +++ b/manual/platform.texi @@ -377,6 +377,9 @@ the indirect branch predictor barrier (IBPB). @item @code{KL} -- AES Key Locker instructions. +@item +@code{LAM} -- Linear Address Masking. + @item @code{L1D_FLUSH} -- IA32_FLUSH_CMD MSR. diff --git a/sysdeps/x86/sys/platform/x86.h b/sysdeps/x86/sys/platform/x86.h index 3ef92b04e8..99d8c9b0ab 100644 --- a/sysdeps/x86/sys/platform/x86.h +++ b/sysdeps/x86/sys/platform/x86.h @@ -317,6 +317,7 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int) #define bit_cpu_FSRS (1u << 11) #define bit_cpu_FSRCS (1u << 12) #define bit_cpu_HRESET (1u << 22) +#define bit_cpu_LAM (1u << 26) /* COMMON_CPUID_INDEX_19. */ @@ -541,6 +542,7 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int) #define index_cpu_FSRS COMMON_CPUID_INDEX_7_ECX_1 #define index_cpu_FSRCS COMMON_CPUID_INDEX_7_ECX_1 #define index_cpu_HRESET COMMON_CPUID_INDEX_7_ECX_1 +#define index_cpu_LAM COMMON_CPUID_INDEX_7_ECX_1 /* COMMON_CPUID_INDEX_19. */ @@ -765,6 +767,7 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int) #define reg_FSRS eax #define reg_FSRCS eax #define reg_HRESET eax +#define reg_LAM eax /* COMMON_CPUID_INDEX_19. */ diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c index 667aa27117..6f1e925a6a 100644 --- a/sysdeps/x86/tst-get-cpu-features.c +++ b/sysdeps/x86/tst-get-cpu-features.c @@ -227,6 +227,7 @@ do_test (void) CHECK_CPU_FEATURE (FSRS); CHECK_CPU_FEATURE (FSRCS); CHECK_CPU_FEATURE (HRESET); + CHECK_CPU_FEATURE (LAM); CHECK_CPU_FEATURE (AESKLE); CHECK_CPU_FEATURE (WIDE_KL);