From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4C5791F463 for ; Tue, 10 Dec 2019 20:47:36 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=UfRh43eNVSGk9sh4 Hnd5cssg9Y+MOfOyTOAGheCpXDwlgaDy2nLVsZ1tH7ghyhdJrdkBqAdF+9z0zYGq 6dNhifkJI0Or68rBjpj4A5T3uFVQ7KHSgN0rQOOAsmLkH+BOBI6i/hBjUePfauD4 Di9ajOZkk/yH5Q0LJBNLa91VbZs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=HEAzyN/T9QOPYgzpsdSDHd oI6YM=; b=NZYII1dRrg92PJlnPIE78kY1Ny+38FAWesOWqEy/9zWZgmNSX3nZ2C t8YIkPi+WL4x9DFvJo6H60mvT429riBy4lvU3G+A7a3t1CANDXusiVGBViqJeh7S JniV6Dw5hORmjlT0uioYAbed/H7lUIaYGV5LcOMYw+KdPy2CRbvsQ= Received: (qmail 122976 invoked by alias); 10 Dec 2019 20:47:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 122891 invoked by uid 89); 10 Dec 2019 20:47:17 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-pj1-f65.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=g8TxQxq1k9A+dKJYw6Piw1z0XYl9eh/smB+EyA2IIIc=; b=HKTcoJEI79DHdlshxNDVJw9bkObZ8kb/fQDcuALRll/LocKURfVAFi/rTGZbTqQhvU kdHoQqn/Ct+D9CSL8gl5G7V2UHBAhMf4zQFfzIW7DvtLKFygTpKzr/0juZPphTrTdh7H JNwCbjTIyqrnt8miuE5uD8Vmwfg3YNywb4kUqzV/oPMo1Wfk+SILqttAW4CZtmoPZ2DF u6kjqtH4i+8/yzTqs1tc9loHoA117/MNBHxoxBwcnQhjNbbqNS5FUiYCWOQ7nObzJ29I OqpBgWSQhGCRaRjwwyAneCx5fpaEFRDNUN3d3SaM3G8kZ8dI8qP5f9zaDBb1gm/BZoBL 9hpA== From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH 0/4] i386: Finish CET support Date: Tue, 10 Dec 2019 12:47:06 -0800 Message-Id: <20191210204710.4832-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch set finishes CET support on i386: 1. getcontext, setcontext and swapcontext are updated not to preserve EAX, ECX and EDX. Since they are caller-saved, caller will reload them after getcontext, setcontext and swapcontext calls if needed. The extra scratch registers are used to enable CET. 2. Add missing _CET_ENDBR to i386 assembly files. 3. Enable CET support in i386 ucontext functions. Tested on i386 CET/non-CET machines. H.J. Lu (4): i386: Don't unnecessarily save and restore EAX, ECX and EDX [BZ# 25262] i386/sub_n.S: Add a missing _CET_ENDBR to indirect jump target i386: Add _CET_ENDBR to assembly files without ENTRY i386: Enable CET support in ucontext functions sysdeps/i386/i386-mcount.S | 2 + sysdeps/i386/nptl/pthread_spin_lock.S | 2 + sysdeps/i386/nptl/pthread_spin_unlock.S | 3 + sysdeps/i386/pthread_spin_trylock.S | 2 + sysdeps/i386/sub_n.S | 1 + sysdeps/unix/sysv/linux/i386/_exit.S | 1 + sysdeps/unix/sysv/linux/i386/getcontext.S | 64 +++++++- sysdeps/unix/sysv/linux/i386/makecontext.S | 123 +++++++++++++++ sysdeps/unix/sysv/linux/i386/setcontext.S | 112 ++++++++++++-- sysdeps/unix/sysv/linux/i386/swapcontext.S | 156 ++++++++++++++++++-- sysdeps/unix/sysv/linux/i386/sysdep.h | 5 + sysdeps/unix/sysv/linux/i386/ucontext_i.sym | 1 + 12 files changed, 443 insertions(+), 29 deletions(-) -- 2.21.0