From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by sourceware.org (Postfix) with ESMTPS id E679139518A8 for ; Tue, 8 Sep 2020 02:10:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E679139518A8 Received: by mail-io1-xd44.google.com with SMTP id u6so5560057iow.9 for ; Mon, 07 Sep 2020 19:10:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7m2pM7Xux1HWHneHGXWuxNFcmaQcQKtTZIf5kM7dzuA=; b=dE3KlD4x2rnpOkwc27UOQr26xPZWr7E0izivwfyOcW/JOV7zdlgVW2mTSwP3x5c4Wa 0k76rVArOwXX6SLSQQtkNQ5PtMe2OcbEJZ7rZ2lyQKilbV6bQUA4rYNc16ngsbeZKaSy QL8Ri9nc/mM5qmnOFuriA5G1mSFFRxGquVuvLJMATjUg97UkmFZQ1VTyEVFKY94Htp+G rtHQuXCrJRPxF+GZXKweTt/CiqnpWyhtQkCjFSyYgWOfb062U3RIYPdFZdbaE7pcEqJa wnD3b7kEPafoV05ws1A8tzo0VldeTaFR+LdKMTCypFbxm+lJJjbPAdmROJ9uRCUpr3/V IFKg== X-Gm-Message-State: AOAM532cGvAsUyyoL3zE+bhn2FNCPExUGz6HZYOUQDbOOw44bgb3xBlq HcOiDxxpUWPCNKWpvbqI1qxErLS9RNFBvxPM7FtZKe5G X-Google-Smtp-Source: ABdhPJy//9C/H9m+gRZXjCvlIdmq594C19h0SUG1nAfT5cAwLLn1MNg5w3MRZ7SPRTR+E9PVTuzW1CZsgfvP9Ld1RVg= X-Received: by 2002:a02:6607:: with SMTP id k7mr21894534jac.91.1599531027315; Mon, 07 Sep 2020 19:10:27 -0700 (PDT) MIME-Version: 1.0 References: <20200907213540.1881766-1-ibuclaw@gdcproject.org> In-Reply-To: <20200907213540.1881766-1-ibuclaw@gdcproject.org> From: "H.J. Lu" Date: Mon, 7 Sep 2020 19:09:51 -0700 Message-ID: Subject: Re: [PATCH] libphobos: libdruntime doesn't support shadow stack (PR95680) To: Iain Buclaw Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 02:10:38 -0000 On Mon, Sep 7, 2020 at 2:35 PM Iain Buclaw wrote: > > Hi, > > This patch removes whatever CET support was in the switchContext routine > for x86 D runtime, and instead uses the ucontext fallback, which propely > handles shadow stack handling. > > Rather than implementing support within D runtime itself, use libc > getcontext/setcontext functions if CET is enabled instead. > > HJ, does this look reasonable before I commit it? The detection has > been done at configure-time, rather than adding a predefined version > condition for CET within the compiler. > > Done regression testing on x86_64-linux-gnu/-m32/-mx32. > > Regards > Iain. > > --- > libphobos/ChangeLog: > > PR d/95680 > * Makefile.in: Regenerate. > * configure: Regenerate. > * configure.ac (DCFG_ENABLE_CET): Substitute. > * libdruntime/Makefile.in: Regenerate. > * libdruntime/config/x86/switchcontext.S: Remove CET support code. > * libdruntime/core/thread.d: Import gcc.config. Don't set version > AsmExternal when GNU_Enable_CET is true. > * libdruntime/gcc/config.d.in (GNU_Enable_CET): Define. > * src/Makefile.in: Regenerate. > * testsuite/Makefile.in: Regenerate. Looks good. I can try it on Tiger Lake after it has been checked in. Thanks. -- H.J.