From patchwork Tue Jun 11 20:11:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuxuan Luo X-Patchwork-Id: 1946542 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 4VzKb03wsTz20Wl for ; Wed, 12 Jun 2024 06:12:11 +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 1sH7qV-0004U1-Sh; Tue, 11 Jun 2024 20:11:55 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sH7qU-0004Td-1U for kernel-team@lists.ubuntu.com; Tue, 11 Jun 2024 20:11:54 +0000 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (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-0.canonical.com (Postfix) with ESMTPS id A039E3F197 for ; Tue, 11 Jun 2024 20:11:53 +0000 (UTC) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-795505d8e46so155366685a.1 for ; Tue, 11 Jun 2024 13:11:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136712; x=1718741512; 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=Nw70ro1zYW9XlCeA52HJlxkU8dMTyRMds6VNRw9Z4Ko=; b=QMpm2CogekY+JZzFEZGdJfohc46zB7zYlhFHKj0GO6vWNGWABYU2Wl3dJLJJ1dMP3R J02B+Im/d4WeN6N+CvlthalqqMI4NS+sw448ZXTuc5R6HHukVd1gg8l1Y4/y+g8ZbeWL r7Yu8T07yfMkvRdIm0qrFKEGH9MjU7iOe/hzVM7AQuUT2J1B3TJH7dnH7lJXT5sojN8J J3NlvYYOoMk8cxtVvcFJMV/JQqrhJjYZ6FjioZ6wNnerc7uNqmNGFvdTZHoY7nbMoeJN qN5jvu0CTqJSH3x6WlQCBS5uOrqufJ7HoGyqAkDaN+PnZljkuC8B4m9vjkSaN86qJZiN Rajw== X-Gm-Message-State: AOJu0YxbxXrT8A+dKfrwWJ0m2pdhl3HEPXvUVaOA77nNBXvpdNqnND2f vYx0lIPIewg6u8fJe7IPRRLuzDbSJjWr2tlpB6hoZFBPzyxqtHGVmXJnu0ai1fTg/jzRD5+g9MV gr32+BkWmwe+vYbnX8bYsJV1D2sTkpg+v+qroyP4rQ9jP5sx8f1Hr9Vb5lwc7jEPAupZQRinRkB aLN6ghoi4t2Q== X-Received: by 2002:a05:620a:25d3:b0:794:99f3:d407 with SMTP id af79cd13be357-7953c43b786mr1480013885a.19.1718136712067; Tue, 11 Jun 2024 13:11:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaO3e8yYKZTjuSfwIrHVrbdUn+wP8aDlr328zqmvUd4HOxNlXmWjYWw3NVGUwexlb/NpqUCQ== X-Received: by 2002:a05:620a:25d3:b0:794:99f3:d407 with SMTP id af79cd13be357-7953c43b786mr1480012685a.19.1718136711739; Tue, 11 Jun 2024 13:11:51 -0700 (PDT) Received: from localhost.localdomain ([2001:67c:1562:8007::aac:4795]) by smtp.gmail.com with ESMTPSA id af79cd13be357-795331c493asm545340885a.104.2024.06.11.13.11.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:11:51 -0700 (PDT) From: Yuxuan Luo To: kernel-team@lists.ubuntu.com Subject: [Focal][PATCH 1/3] x86/sev: Rename mem_encrypt.c to mem_encrypt_amd.c Date: Tue, 11 Jun 2024 16:11:37 -0400 Message-Id: <20240611201145.183510-2-yuxuan.luo@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611201145.183510-1-yuxuan.luo@canonical.com> References: <20240611201145.183510-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 84373dc9b341e..0eb2ee47a4af9 100644 --- a/arch/x86/mm/Makefile +++ b/arch/x86/mm/Makefile @@ -1,14 +1,14 @@ # 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 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 @@ -50,6 +50,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