Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp951819pxu; Fri, 23 Oct 2020 18:26:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXln6ip8o1boJOUJHRXHpjU5T/mwmaOpXKnDnWEGeszARf6OOWLrge+HzVx6xI4KEjBwnC X-Received: by 2002:a17:906:3a1a:: with SMTP id z26mr4609528eje.519.1603502775602; Fri, 23 Oct 2020 18:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603502775; cv=none; d=google.com; s=arc-20160816; b=BvtUuQNUytcwQotpPuENgOLCeuArEyKzxs6KygvSxQijae3g6oyvITLya1MJlsebeP x/nVFhRPKyobrsbpr7L5mXkEpOpablfX1v6acDrcCEixabFzbI3r3thSDX2XOjPDn6lX /9Ch0RSr2pbu2kcAqZ05IOF/rycalh+008atSgZCnrfBLr6YD9T2avymiGnqAkFx0ag9 i34hK6DPO0GgfM+zflwT9rF+P28SDi6AJ7HsRUoT+WdqaDH15nsLHnB/ltRsSB3BVaSk l5crWMeQXJll6clovMknS89GqnHmBzuX/odKsLlQufIU/5WyqqRgbB2UNFF6lyL9s3if T3tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature:dkim-filter; bh=EGRt4ztnZwAX3jt6Vs1L6I71nyIhTSB2Csb5qpzwG7c=; b=dYg69N2xaVSxOqBn/M1NejFzbL4gKtnR/hzWOZlDnT3Qr5QSRr3enQrq1ltTNBEQW8 krkCP2Z4tkzbTPapVBluSHjw8MgLb29Kt6Y38GmVADoFmSjDEkGbcMTYK+wS+dgNLQ1b 0ORFXjEgk6h0c5KdK/O0IintxJi5dGKTAsyZjUUqdFllFC2/yrE62xOiqRCpVaObtVEE /+Fe7qcD06EKSxJmfI43r8qLYXptoUsNkFcbg2VeotmjBjeQJXeXEOOnjDp4ZcghzNoG q6iuDnuvkZmm6h0qFrYlGV+yXBrINthSB2z81Oyc+leuM1s7C3GZGq28DC26NGtffkLh d1cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@zytor.com header.s=2020092401 header.b=apotMjaO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk3si2632186ejb.207.2020.10.23.18.25.53; Fri, 23 Oct 2020 18:26:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@zytor.com header.s=2020092401 header.b=apotMjaO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758378AbgJWWwU (ORCPT + 99 others); Fri, 23 Oct 2020 18:52:20 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37513 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758348AbgJWWwT (ORCPT ); Fri, 23 Oct 2020 18:52:19 -0400 Received: from wld157.hos.anvin.org (c-24-6-168-49.hsd1.ca.comcast.net [24.6.168.49]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id 09NMq3vn4013373 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Fri, 23 Oct 2020 15:52:03 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 09NMq3vn4013373 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2020092401; t=1603493524; bh=EGRt4ztnZwAX3jt6Vs1L6I71nyIhTSB2Csb5qpzwG7c=; h=Date:In-Reply-To:References:Subject:To:CC:From:From; b=apotMjaOLOewyHJ6I7jiM3el3vCLm1tB5bAtUZYVoAme0w+704l59xN02nygQoy+8 mBtM/Sf8n44b9zTNAk1q3NA/8YanTUE7WrAiadFuJmkVLOzztoNfVbEsSUODb7Kj1v X/Znsp+ujjXpiFVDdjm6xfFwTNeT9shBYTVzp8AyCzgEbRFj1FmA0u+PE/07RGJ7oc tCTJ48DZgy7oOGCAOhBakYMN5mknxZq0MSr6poDFzqtOLZr5AgeCbMIiTnh287+jQn gEq6NgHBsAtuOVJFvOitwopMcBlvkfOV2R5+KOkQYtFcPCVLbYYZYcD/APrEXxhvlF EprCPOEXzOS6Q== Date: Fri, 23 Oct 2020 15:52:00 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <20201023203154.27335-1-linux@rasmusvillemoes.dk> <8820745F-E761-42E6-8A70-7B04EE70692C@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] x86/uaccess: fix code generation in put_user() To: Linus Torvalds CC: Rasmus Villemoes , Thomas Gleixner , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , Sean Christopherson , Naresh Kamboju , Linux Kernel Mailing List From: hpa@zytor.com Message-ID: <06B6997A-81AC-409D-A654-309FA8697F0C@zytor.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On October 23, 2020 2:11:19 PM PDT, Linus Torvalds wrote: >On Fri, Oct 23, 2020 at 2:00 PM wrote: >> >> There is no same reason to mess around with hacks when we are talking >about dx:ax, though=2E > >Sure there is=2E > >"A" doesn't actually mean %edx:%eax like you seem to think=2E > >It actually means %eax OR %edx, and then if given a 64-bit value, it >will use the combination (with %edx being the high bits)=2E > >So using "A" unconditionally doesn't work - it gives random behavior >for 32-bit (or smaller) types=2E > >Or you'd have to cast the value to always be 64-bit, and have the >extra code generation=2E > >IOW, an unconditional "A" is wrong=2E > >And the alternative is to just duplicate things, and go back to the >explicit size testing, but honestly, I really think that's much worse >than relying on a documented feature of "register asm()" that gcc >_documents_ is for this kind of inline asm use=2E > >So the "don't do pointless conditional duplication" is certainly a >very sane reason for the code=2E > > Linus Unconditional "A" is definitely wrong, no argument there=2E --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E