From patchwork Mon Aug 26 15:01:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuxuan Luo X-Patchwork-Id: 1976875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wsv5x3nb1z1yfF for ; Tue, 27 Aug 2024 01:01:57 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sibE5-00029o-I5; Mon, 26 Aug 2024 15:01:49 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sibE3-00028O-M0 for kernel-team@lists.ubuntu.com; Mon, 26 Aug 2024 15:01:47 +0000 Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 6E8B43F62B for ; Mon, 26 Aug 2024 15:01:47 +0000 (UTC) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2025df5742aso40123165ad.1 for ; Mon, 26 Aug 2024 08:01:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724684505; x=1725289305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HdfmysK79gWCdWjEyBD/294pXSh3Bcwah9zZqlLzla4=; b=luOzn5dsr4xSdoqH5C6I2aCv9+eqs0GjaSI7Kyq/hY2RhXBHt0xIIafD+3Ze+DqNkc bu7k/NP7/yLNdS1p4OcDGXqJfzdeCNopSx+Zv8Ha+Def399UoYT41LyJ5HDZtV8U1JF2 LGAD9mVIWdSMAzf/jUAbjtGh3zEdd0p1RYD3F1cf3+jmgOclofUw5rN4WF1cGfdfzOOF ugjij1Zi+9dmM+3OcCl/mNrL5msRaOkrT8UXKegGCUfgsXM0DRH8XIZYZTeodGFB+S+8 29aG/UTqnc3ICe8Tj46ouawvvnYCqytZTDufVzJky4TGCYqtyamvm/CN1BskxBhB48TV KieQ== X-Gm-Message-State: AOJu0Yw+X8sHf0zh4pSswqSXpXX4Pq6ii2iD6M+hga8D5y79NKCXi6+x ZiIxXMUkwcoBqbY/QVeRnxEH/fgWdU10EVSg88gJw9qZ7bOXFUcusjgxqCH/dit11T1mR9N97YH mvlxfu6yZP3GFM7WHd5650V6L+GxBzkqKwA8pUY/3RIDIeIBgOX2GbyP/5vRm8vGaqCKA6pTrbj 3OpyZ8uKp1SIYw X-Received: by 2002:a17:902:e5c4:b0:202:4317:79c1 with SMTP id d9443c01a7336-2039e4cc9afmr93891825ad.37.1724684505297; Mon, 26 Aug 2024 08:01:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiuxtb0J/+TNB+k1dwws9DGC3pnQT1bcxxGB4n8tHRy7TtNjCHvMXZHLQorhx87J7e+y/hbQ== X-Received: by 2002:a17:902:e5c4:b0:202:4317:79c1 with SMTP id d9443c01a7336-2039e4cc9afmr93891445ad.37.1724684504796; Mon, 26 Aug 2024 08:01:44 -0700 (PDT) Received: from cache-ubuntu.hsd1.nj.comcast.net ([2001:67c:1562:8007::aac:4795]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2038556667bsm68731295ad.7.2024.08.26.08.01.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 08:01:43 -0700 (PDT) From: Yuxuan Luo To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/8] x86/sev: Rename mem_encrypt.c to mem_encrypt_amd.c Date: Mon, 26 Aug 2024 11:01:20 -0400 Message-Id: <20240826150125.1347359-4-yuxuan.luo@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826150125.1347359-1-yuxuan.luo@canonical.com> References: <20240826150125.1347359-1-yuxuan.luo@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kuppuswamy Sathyanarayanan Both Intel TDX and AMD SEV implement memory encryption features. But the bulk of the code in mem_encrypt.c is AMD-specific. Rename the file to mem_encrypt_amd.c. A subsequent patch will extract the parts that can be shared by both TDX and AMD SEV/SME into a generic file. No functional changes. Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Reviewed-by: Tom Lendacky Tested-by: Tom Lendacky Link: https://lore.kernel.org/r/20211206135505.75045-3-kirill.shutemov@linux.intel.com (cherry picked from commit dbca5e1a04f8b30aea4e2c91e5045ee6e7c3ef43) CVE-2024-25744 Signed-off-by: Yuxuan Luo --- arch/x86/mm/Makefile | 8 ++++---- arch/x86/mm/{mem_encrypt.c => mem_encrypt_amd.c} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename arch/x86/mm/{mem_encrypt.c => mem_encrypt_amd.c} (100%) diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile index 5864219221ca8..c9c4806411536 100644 --- a/arch/x86/mm/Makefile +++ b/arch/x86/mm/Makefile @@ -1,10 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 # Kernel does not boot with instrumentation of tlb.c and mem_encrypt*.c KCOV_INSTRUMENT_tlb.o := n -KCOV_INSTRUMENT_mem_encrypt.o := n +KCOV_INSTRUMENT_mem_encrypt_amd.o := n KCOV_INSTRUMENT_mem_encrypt_identity.o := n -KASAN_SANITIZE_mem_encrypt.o := n +KASAN_SANITIZE_mem_encrypt_amd.o := n KASAN_SANITIZE_mem_encrypt_identity.o := n # Disable KCSAN entirely, because otherwise we get warnings that some functions @@ -12,7 +12,7 @@ KASAN_SANITIZE_mem_encrypt_identity.o := n KCSAN_SANITIZE := n ifdef CONFIG_FUNCTION_TRACER -CFLAGS_REMOVE_mem_encrypt.o = -pg +CFLAGS_REMOVE_mem_encrypt_amd.o = -pg CFLAGS_REMOVE_mem_encrypt_identity.o = -pg endif @@ -52,6 +52,6 @@ obj-$(CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS) += pkeys.o obj-$(CONFIG_RANDOMIZE_MEMORY) += kaslr.o obj-$(CONFIG_PAGE_TABLE_ISOLATION) += pti.o -obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt.o +obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt_amd.o obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt_identity.o obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt_boot.o diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt_amd.c similarity index 100% rename from arch/x86/mm/mem_encrypt.c rename to arch/x86/mm/mem_encrypt_amd.c