Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp611935pxb; Fri, 22 Apr 2022 07:52:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvdx791dhgrBJLT7Zwlv9vQAGrBpwx0w9AB3R/F1lgpfeZ3Sb/sdVl5TTg3mJ+3KKjBAps X-Received: by 2002:a63:f546:0:b0:3aa:878:e29f with SMTP id e6-20020a63f546000000b003aa0878e29fmr4143706pgk.439.1650639173898; Fri, 22 Apr 2022 07:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650639173; cv=none; d=google.com; s=arc-20160816; b=ztuKCYSUuN49hmFybTsbhZpv+zZ3zbCOLq5a8jUABEl/AGRCQUUDgUPo66qvc4hv2m ekbw4FEsbnDGZS+zB/fhCbYO5uLEBN8TxKch2gqHsnFYuAIipxJOZmlS3BromAl4dhL3 lg+tAQYpkPBpc50uN8fGRfaJX/rcYMwNRDjfW/SkyuXBcerX9dwU4Nr+WS/f4q3N6QN+ /DzYya6wwOeFWYJZD1tdowaVIwTJlu4a6VhZip0qdj1/Yqyza1mlr6pOM+ganzzT/20O 0G2B1TXNJxq0yjtC150llVo1Nb6cd6elefAunW3vnKTeprqf4Rh9zJN/w43ZpQDlJqEW jiGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EuRk25kCvRN6z3hBOfbf63wUVxhzveyy6WkzcVzferc=; b=ylFX8jo/kOMPSYmWRM7lfmBgdHAudKp7uax+8/AuT+ConuY311QtHsPp2pgCehNPfx eZHcBRpuBicqxvuRiE5bqr/OjItV+Tl1oEiuKhNte3UORkRc5QeruKlvu7FWNTyD25Ce e9DuZa0fgAbl79L/kcYhWtxCtPIgiouIVpqfycfhTJ5JX1xnykChD6b7dZqN3OtzlkKi IN1//e6woddxAyMIuvB+//ySMeK6jcUehd3i1VPhVj2U0J+3p4Osza9Mv91CcpOTSBTZ T6M5EpZkETQ8I0QgLiF14ocQQ7bYFlvqmsi3tPgL+Cg4nn7YC8s780tPA/pgXg3MGGfg N8fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=KdjNoW1V; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n6-20020a654cc6000000b003990deab146si8627677pgt.595.2022.04.22.07.52.37; Fri, 22 Apr 2022 07:52:53 -0700 (PDT) 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=@infradead.org header.s=desiato.20200630 header.b=KdjNoW1V; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379791AbiDTOyi (ORCPT + 99 others); Wed, 20 Apr 2022 10:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379785AbiDTOyh (ORCPT ); Wed, 20 Apr 2022 10:54:37 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE7A11ADAA for ; Wed, 20 Apr 2022 07:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=EuRk25kCvRN6z3hBOfbf63wUVxhzveyy6WkzcVzferc=; b=KdjNoW1VU33lyQIOlL7UpUlkce KQhsMGUSJG/W5+ZEgUse3mr1fbbVL2VHbUXNBgku14LpLnMhX6btqb3TJ7cuscblRhCJfyz4KVMbB ncCa+bMfhTs9XP4hFwCuRjis20N3GuUA9Xp6l0TKS38b96B83vcOcecDQ/iz/J0pgd4hifbG4B2+H fnQGzhl0tMYLLvUUazAPvwJeD2fW8RyqjZcIRYjsQsANPZ2acGcxEqZfjpoiWi6fI3nRo4KLxzB5E 7YVJA26AHgmCJK/WxpZzysRX37ljlU0q80cGC5ENxZo45RrGiVTsR1+i2obE3zymW6nBLgobiZxOM 4ourAixQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhBgB-0078x5-Nk; Wed, 20 Apr 2022 14:51:40 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 6230F9861A4; Wed, 20 Apr 2022 16:51:37 +0200 (CEST) Date: Wed, 20 Apr 2022 16:51:37 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: the arch/x86 maintainers , Josh Poimboeuf , Brian Gerst , Lai Jiangshan , Andrew Cooper , Linux Kernel Mailing List Subject: Re: [PATCH 2/2] x86,entry: Use PUSH_AND_CLEAR_REGS for compat Message-ID: <20220420145137.GG2731@worktop.programming.kicks-ass.net> References: <20220419204109.520779286@infradead.org> <20220419205241.339242797@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 Wed, Apr 20, 2022 at 07:26:54AM -0700, Andy Lutomirski wrote: > > > On Tue, Apr 19, 2022, at 1:41 PM, Peter Zijlstra wrote: > > Since the upper regs don't exist for ia32 code, preserving them > > doesn't hurt and it simplifies the code. > > They exist for compat code, though, and should be preserved for ABI > purposes. Programs that do int $0x80 in 64-bit code do exist. So this patch preserves semantics for int80, it changes things for sysenter/syscall, those currently clear the high registers, whereas after this patch they behave identical to int80. So the earlier patch: https://lkml.kernel.org/r/20220408223827.GR2731@worktop.programming.kicks-ass.net preserves semantics across the board but is slightly more complicated. And as argued elsewhere in thie thread; if preserving instead of clearing the high regs is a valid attach surface, then int80 already provides it, so I don't see how doing the same to sys* is any worse.