Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2643021pxj; Mon, 14 Jun 2021 03:51:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywfsIJTTmo6lEcJG3FOyMuKbSImc0ZT5tk2NLsBb6qfpyLK/r4epv1b47AleII11gnt21H X-Received: by 2002:aa7:c799:: with SMTP id n25mr15796709eds.16.1623667893990; Mon, 14 Jun 2021 03:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623667893; cv=none; d=google.com; s=arc-20160816; b=MVA7QndVcqc5xq8eS0C1tMwKIc5fjBBUjutq6PMca8Tci+4hxLLVkUUozO+9unDFB4 kbGSyaFVzy8XF+br0x7EVTp+Zp3eZM2/aajhXXAd4fxCFkZNvj3Q594dqAclfEukgH3W iE8AreN0vLmSWatAgyXSxCOqmz06Gz+DiA4FWfJq13u58nPrpGkkZ3orv287Loe6HPwG F5Te3B2a5T1+YX8bV9rljO+oLiBtHjCt70hrtBjcVpRQgoYl/UGR/gkzCxsGbRBrJbyN 08O8WT8Y1HFYnO5b4AgNuIA46H5kfNhoPnNNlaXtytfa4HxWniGn6USsN8wda8Q5hisY yhAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W5NesHhk4cH4AgD0dict8g/pZuaGLT3HD30E1PS3v6Q=; b=g6jWIWd4cH7/AB3e/a+akmgPb9PbyGUSJNkbb3/tFWm/wtohSMhY5COvb+8q9l1md7 c5G0DNM6Hqnv3ePWQNwCLZ/GmakY4DjTL76S4XErmwh0jwGge5ub1wlqzzmVsozeZTI2 NisqPs2Whua5BVnOz8IwNaCRszYry/wxvnf8NMk4XSunaXbssOVf9LLZuJSJvvaUvepF ytz69JSwAh339Y16BhzdK8hNvszLWJPFBKgCE4lO5xatEL5rYVhY0zdWbwQNomMsjQXK 3FLryz1Fe7zmQzVcNGBoLDklD7mKLOa5e6O5QFopla1D1obY6KxPDajIJb2V4ZUCso0W gZVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Uwx+Ywae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si10997070ejm.583.2021.06.14.03.51.10; Mon, 14 Jun 2021 03:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Uwx+Ywae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233959AbhFNKvs (ORCPT + 99 others); Mon, 14 Jun 2021 06:51:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:50672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234194AbhFNKoc (ORCPT ); Mon, 14 Jun 2021 06:44:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DFCCC61244; Mon, 14 Jun 2021 10:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623666980; bh=1l25weUlptaCXdQOOaYRvc5LIiHQ6ncwtcjRGSgx/tA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uwx+Ywaefi+3G78fOhUcZE2n4CLfY4YZwDSBLYfwe2df3RoYfJPOMxCOrNPc85jlm Uep9BA5iog4ghTh7doflg4J59cC8RAhCNj+8zHveSfYhqxCbVCUPkicdoZQUTSjuzb L5alsGEHLO1kHVruhTgtejN46fWG6oxeEbM/rRLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Nathan Chancellor , Kees Cook , Nick Desaulniers Subject: [PATCH 4.19 52/67] vmlinux.lds.h: Avoid orphan section with !SMP Date: Mon, 14 Jun 2021 12:27:35 +0200 Message-Id: <20210614102645.531386842@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102643.797691914@linuxfoundation.org> References: <20210614102643.797691914@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor commit d4c6399900364facd84c9e35ce1540b6046c345f upstream. With x86_64_defconfig and the following configs, there is an orphan section warning: CONFIG_SMP=n CONFIG_AMD_MEM_ENCRYPT=y CONFIG_HYPERVISOR_GUEST=y CONFIG_KVM=y CONFIG_PARAVIRT=y ld: warning: orphan section `.data..decrypted' from `arch/x86/kernel/cpu/vmware.o' being placed in section `.data..decrypted' ld: warning: orphan section `.data..decrypted' from `arch/x86/kernel/kvm.o' being placed in section `.data..decrypted' These sections are created with DEFINE_PER_CPU_DECRYPTED, which ultimately turns into __PCPU_ATTRS, which in turn has a section attribute with a value of PER_CPU_BASE_SECTION + the section name. When CONFIG_SMP is not set, the base section is .data and that is not currently handled in any linker script. Add .data..decrypted to PERCPU_DECRYPTED_SECTION, which is included in PERCPU_INPUT -> PERCPU_SECTION, which is include in the x86 linker script when either CONFIG_X86_64 or CONFIG_SMP is unset, taking care of the warning. Fixes: ac26963a1175 ("percpu: Introduce DEFINE_PER_CPU_DECRYPTED") Link: https://github.com/ClangBuiltLinux/linux/issues/1360 Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Tested-by: Nick Desaulniers # build Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210506001410.1026691-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman --- include/asm-generic/vmlinux.lds.h | 1 + 1 file changed, 1 insertion(+) --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -842,6 +842,7 @@ #ifdef CONFIG_AMD_MEM_ENCRYPT #define PERCPU_DECRYPTED_SECTION \ . = ALIGN(PAGE_SIZE); \ + *(.data..decrypted) \ *(.data..percpu..decrypted) \ . = ALIGN(PAGE_SIZE); #else