Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2649468pxj; Mon, 14 Jun 2021 04:02:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwttgz0zxvZdFmUIfC+B+ZIC8Miw0selpyjK3+KTAtIdgM/HOORSO1FIcZ73IFyvhihOyf5 X-Received: by 2002:a17:907:984a:: with SMTP id jj10mr10804636ejc.436.1623668540889; Mon, 14 Jun 2021 04:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623668540; cv=none; d=google.com; s=arc-20160816; b=OBxXcCobLwlLE+oow/FCPN8b9ySCXBvDAaR2O9Rl0VJwXj38OZfiq+bJ22zi7j2HCz seSOpOyvkt9FrfC1Nts0MmxjDoCWayaqbiz8k0R3rXwWWsFTql4mx2oFiW/OIK9iA5AV wLoJPlYDW7CTg1ZWXb43PjJARB+RZr0k4MiIPV3gnGz9CIAH0RuiBfPuJYqAvvV3xLho qU3VmePj7ozP1ZRJgo3JspwybbWxIx4uk7GDzwgQBlYmUzQ5jy5BZZligKig9xB2RbFJ iDqqD7NyCbLhK/2zn+uUPgGSutigWwddsxLZNWb9Big52a+wkcrO7P4t2Uf2YjNkIGZc LhhA== 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=r+qJ8PVhcyFpAlXEWQTDoKPAUnW0wO/Vx1JGAzkEn9w=; b=YbywmZ1EXGKVo7HbzpvaFeZ/Jw7OLMV5iTeCgFXddPBKhu2yO3hN/8Kt/8ljQbGiCN 7p9pGkoDndDwgo823g046akb5HdJu2Qnr9A9vPwFBYAFDvK1EHt/qFuJiNkSWd2RJ88i nHi4t+8DdtK016AzRZzgdkFrZajroItUYb5OafFucqL3LRQcW4C4azGYRz837OFoORuL d30TTicV42mmOp/qotjddl9pZadkNN806KEORh7IR8+ywSiTMNVFgkfocmIv/ingzwCo wOseqHJMOgXR0gAvcYniMCdNUSuE0WLJGnq0iFD+OatlwlbThkJYlfhpvNTmzcjR+ckp 2NWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H1EAumuF; 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 d4si11187279ejo.252.2021.06.14.04.01.58; Mon, 14 Jun 2021 04:02:20 -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=H1EAumuF; 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 S234644AbhFNLCw (ORCPT + 99 others); Mon, 14 Jun 2021 07:02:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:59300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234067AbhFNKxz (ORCPT ); Mon, 14 Jun 2021 06:53:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 71CF8613F2; Mon, 14 Jun 2021 10:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667204; bh=PMabqoCTJXAPEJkhGnF1mvJJovdeQXxrCAXhI7Vg2fE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H1EAumuFM2GLFUBwAAOn6j8QDKuybqSo5UHnQ3+4xu8Pkkl5eoeGN8Ibm2JWT8zY8 pTl3fvhA/3/IGFYuJ6HLWfUzG1z5cxVt4zyiw2pLKG20XoDU+HANXdgjpZryxRr4dR 3P0UgELDLfP3HsNVRchqrnph+ql0pOBSqyKfcovs= 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 5.4 67/84] vmlinux.lds.h: Avoid orphan section with !SMP Date: Mon, 14 Jun 2021 12:27:45 +0200 Message-Id: <20210614102648.645950211@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102646.341387537@linuxfoundation.org> References: <20210614102646.341387537@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 @@ -882,6 +882,7 @@ #ifdef CONFIG_AMD_MEM_ENCRYPT #define PERCPU_DECRYPTED_SECTION \ . = ALIGN(PAGE_SIZE); \ + *(.data..decrypted) \ *(.data..percpu..decrypted) \ . = ALIGN(PAGE_SIZE); #else