From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by sourceware.org (Postfix) with ESMTPS id 534F2385781A for ; Thu, 24 Jun 2021 12:07:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 534F2385781A Received: by mail-qv1-xf2c.google.com with SMTP id fq1so2629192qvb.1 for ; Thu, 24 Jun 2021 05:07:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tZ6KGd72O/KjeB7T1ZzDtym4GRN6beOJR2i5Pnf6zyk=; b=QFYMIX5su5XHBQcoUlQQa67LB6Ko6zJiARDCKf2LAJSE9Fc12/vaUnp+3n+LLZnI9A P7SDv2nFAdyy1iFMmgObQ++x/bZoAkF0gNc5Do/oBgP63KEx0+9Ex0rFFrn2Hpo1vC00 wxytxmVlg0TTu9G6Y7E7Tq1a3qn3PgwB3aPor4U11gG0p139Qsp/Q+na69cJlVp8ipxj ycHJI0l990AkUr0MvGDB1724Qc951P2xnPdynne2R1zvw64pBVHfqGYQFVy6tAQnmWsJ 3QiPXoUja7XRWB+0aNRM+AHE0tbBOoLARdQnWPm4J7DY+KtKkNNM77/9mQcwgKwQUEjy +KuQ== X-Gm-Message-State: AOAM531PjiMzSl686U8zq++dDwFaIk4ERt3dN7gQRHm/Rqdy17aYXoUg MMNJkCB5KHy1FD4V9EDZQx8aqg== X-Google-Smtp-Source: ABdhPJyWLyAGPpPZi2N0pqQEDBbb420CxSN1NfRUD2rAi6n6mFp5ecWLG9ueq6sZbCtj+i3QexwTsw== X-Received: by 2002:a0c:e481:: with SMTP id n1mr5048275qvl.49.1624536457776; Thu, 24 Jun 2021 05:07:37 -0700 (PDT) Received: from [192.168.1.108] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id x25sm2175120qkx.109.2021.06.24.05.07.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 05:07:37 -0700 (PDT) Subject: Re: [PATCH] x86: Copy IBT and SHSTK usable only if CET is enabled To: Florian Weimer , Adhemerval Zanella via Libc-alpha References: <20210623145419.3025540-1-adhemerval.zanella@linaro.org> <7b2557a7-9b86-7121-a366-5fee330f8364@linaro.org> <89312fbc-0fb1-8523-2c1c-c99025bb787e@linaro.org> <87fsx7n1ag.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: Date: Thu, 24 Jun 2021 09:07:34 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87fsx7n1ag.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 12:07:39 -0000 On 24/06/2021 04:56, Florian Weimer wrote: > * Adhemerval Zanella via Libc-alpha: > >> + x86_cpu_AMD_IBPB = x86_cpu_index_80000008_ebx + 12, >> + x86_cpu_AMD_IBRS = x86_cpu_index_80000008_ebx + 14, >> + x86_cpu_AMD_STIBP = x86_cpu_index_80000008_ebx + 15, >> + x86_cpu_AMD_SSBD = x86_cpu_index_80000008_ebx + 24, > > Do these show up as USABLE automatically? The test suggests to me that > they do. No, these are set not usable by CPU_FEATURE_USABLE. The test only checks if kernel advertise through /proc/cpuinfo matches HAS_CPU_FEATURE. > > This points to a deeper problem elsewhere: new bits should not become > available automatically, they must be copied over explicitly because > ld.so does not know the semantics for a new bit in USABLE. I think the cpu-features.c already does it for the usable fields. I tend to agree that we should not enable unknown flags, we might now know prior hand that a future flag might or not require glibc support.