Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1296711rwb; Thu, 10 Nov 2022 14:09:48 -0800 (PST) X-Google-Smtp-Source: AMsMyM6u8Cncovpq56NvGNaYNCQi8qu96UgMh2jvf6KkFXB/BfaC3o+BSubxNVXepYbdpaTBPFu/ X-Received: by 2002:a05:6402:1607:b0:461:8bd2:45f with SMTP id f7-20020a056402160700b004618bd2045fmr3592490edv.232.1668118188463; Thu, 10 Nov 2022 14:09:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668118188; cv=none; d=google.com; s=arc-20160816; b=j4k/mcu4Ir6mSagLOvDPhndlXKAD1e1Z4Z0cdDbDthiNJb6hhmd5Y+BLtQsa0P/4Qt WGKXNOAl6ujgvx78pQjGWfvo2i6vg7s65BHI5hQPbHrNj+67o9m0uSYpH/DYOxVL0E0C bSLQi9VJuvmLkLAWErYOuijjwmmbuedE9R1OS7cyvUuy+pGePvWnTcVKMvPy8UleEJF5 1bDQAtEjrNeH6cTZFQLqRXX+H2Eb+dZTQp3GXbA0GQgLaR1Z57FGEa7FK3uKsRe/Ysry Rlk9bQNh1XYZHrc2dYGBKKbcktYfqesWExR8ddvYYvNcpbZsS7KRsoIQ1hy4Wa2QjeLE vqjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=94TsYS9Lhx3savK/i0rFKWoF2OB6Clo4zum9Q7WKAV8=; b=MZEFmlwmXI6zaJDT/hkxfWy//EfgLOwCmCLkyagUEbBIzGq4YtVBMUrMjEYnZ7Mu/p Gi1HKGUx3+R8EuOK9kNa5aUSwCHNB9WWHv9aOjkOwbjwwwiNsxgvphVxm78Mg9e/wg6s zhdtjTk/pZ4p/jucnOwTOIEPSX4rMw2xR5Q0/graB6u84+64z6+Ceg0bPvZBfZ8i6yXi dzCnb/S7uZP18x4TsQnx6p/qCr8R/pEpI8Sx18WScfIMWLuulac941HnjxhPM5bYbA+h VdxCu+VLcKT++bvAGwZ40utdNnZjbqnSObV+lhlO9HHrOvaqSYLOUXOmEJQA9Yl0PPC+ FKDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QkagP8AC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ka2-20020a170907990200b007ae4717bf18si347930ejc.156.2022.11.10.14.09.26; Thu, 10 Nov 2022 14:09:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QkagP8AC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231980AbiKJUqb (ORCPT + 92 others); Thu, 10 Nov 2022 15:46:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbiKJUq3 (ORCPT ); Thu, 10 Nov 2022 15:46:29 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DA9E5F90 for ; Thu, 10 Nov 2022 12:46:28 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id m6so3120477pfb.0 for ; Thu, 10 Nov 2022 12:46:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=94TsYS9Lhx3savK/i0rFKWoF2OB6Clo4zum9Q7WKAV8=; b=QkagP8ACYR8CagjP1G4Y5wJdFJ+jYesXPOL5g2+j1fUnp1hkvLCMFRVI4ER/b/Z4mD y4j1EEZ9lHH1umfNxhML7hgO8CrD6hGaW+rezADHqexqePWUNB/Xr2fjmDOWqnFkEUbv X/wPF8DR34roo3Eytdk9XCQHJT80DCQ6LagvkAiE4uI7BLF3Q1hj/TsNvym4lH0/IidO Hk3F/KyLZiM2zsutznNdhHeSDs1fdiHxGYAXVxzjG1VOPv/4hYjHDMNIlJkrO2xEsXO/ f6jcN4bd6HS1qoAJcUrknp8vuUgDY1k4ZKYNzLfqeCrrFYmyWg4m5Cqa4q/9NHVSDuWA EA9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=94TsYS9Lhx3savK/i0rFKWoF2OB6Clo4zum9Q7WKAV8=; b=KtuMPqgYKEHQ1gMo1ETtDK4cvgSZ+qNbPbAip59VfhGFM+zNRNsCLNQ7mBb7mK/Wo9 eYMfl1nPvVm9MhWC00gOXg0x7JCwy4MKZFs3Ogn8QY6UTY9ZTMpwWDTcuMZNf+kFflh/ wfpSvg3uw9C4Cg2bqf1y511H7zc124OK+SCiTB0v0MYYjMZuSLq31kqIFlofgh+xdVtj fENe0E9GPi3mZCEMa8htNnGVvSC6+4HFJayb9SPERa89W0M2IO3zW/ZqRNV4QpvPZbnA tMEB2eNj5N/U2eeLeGWqdGGV+ynO3pDiTkirlDIOHXj9TT1FITQlbEYiUq7ug20vq7IA BQuQ== X-Gm-Message-State: ACrzQf1jcJXTnxdARedKIWE5+Cg8wFZ5MEtqOXqtDUUbUdTVGc1t9Uzv 0s5lO2TFEAFha73i0yoJ24nSeX3llfDbdxTT7tvFsg== X-Received: by 2002:a05:6a00:1a4a:b0:56d:98e3:4df8 with SMTP id h10-20020a056a001a4a00b0056d98e34df8mr3400650pfv.37.1668113187475; Thu, 10 Nov 2022 12:46:27 -0800 (PST) MIME-Version: 1.0 References: <20221109000306.1407357-1-nathan@kernel.org> In-Reply-To: <20221109000306.1407357-1-nathan@kernel.org> From: Nick Desaulniers Date: Thu, 10 Nov 2022 12:46:16 -0800 Message-ID: Subject: Re: [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave To: Nathan Chancellor Cc: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Sean Christopherson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 8, 2022 at 4:04 PM Nathan Chancellor wrote: > > Recently, ld.lld moved from '--undefined-version' to > '--no-undefined-version' as the default, which breaks building the vDSO > when CONFIG_X86_SGX is not set: > > ld.lld: error: version script assignment of 'LINUX_2.6' to symbol '__vdso_sgx_enter_enclave' failed: symbol not defined > > __vdso_sgx_enter_enclave is only included in the vDSO when > CONFIG_X86_SGX is set. Only export it if it will be present in the final > object, which clears up the error. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1756 > Signed-off-by: Nathan Chancellor > --- > > It would be nice if this could be picked up for an -rc release but I > won't argue otherwise. Sounds like the lld change got reverted, so this is less urgent now, but the change still LGTM regardless. Thanks for the patch! Reviewed-by: Nick Desaulniers Fixes: 8466436952017 ("x86/vdso: Implement a vDSO for Intel SGX enclave call") > > Alternatively, we could add '--undefined-version' to the vDSO ldflags > but this does not seem unreasonable to me. > > arch/x86/entry/vdso/vdso.lds.S | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/x86/entry/vdso/vdso.lds.S b/arch/x86/entry/vdso/vdso.lds.S > index 4bf48462fca7..e8c60ae7a7c8 100644 > --- a/arch/x86/entry/vdso/vdso.lds.S > +++ b/arch/x86/entry/vdso/vdso.lds.S > @@ -27,7 +27,9 @@ VERSION { > __vdso_time; > clock_getres; > __vdso_clock_getres; > +#ifdef CONFIG_X86_SGX > __vdso_sgx_enter_enclave; > +#endif > local: *; > }; > } > > base-commit: f0c4d9fc9cc9462659728d168387191387e903cc > -- > 2.38.1 > > -- Thanks, ~Nick Desaulniers