Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1130108pxu; Sat, 24 Oct 2020 01:14:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvlG6mCnbYUHiCzy9vg/UgniR3JjhI8ywcnsprF+SZAUBJSHie2MKpc+farGfIfMseUB0L X-Received: by 2002:a05:6402:206:: with SMTP id t6mr5934876edv.291.1603527268080; Sat, 24 Oct 2020 01:14:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603527268; cv=none; d=google.com; s=arc-20160816; b=LV4Epin0JFnRWGK9Y47pf7v6DKMZMlA8zv2oE6bF10g7Ab1EOp9ESRndkAI/UeIMQi JScRLyrZPmN4yys7iKIoRdK2z121NI4kYuPVsfOUWr6sJ33bGaHsXlWgFRXb0nf+VntT qk4zxRkKYHCET3tbSPuX8WmxpTa8B19Th30AKkWTiZhtYBPhQ4JBYxKmMghm8EFBJxl5 IeZwJSSPLJyEp2DFcVwUJy1JDsvUlDjZyrYJfGUQ/J1sKIrSVnXkw37Eo9a6r3B3oS/a EobhWHaaErslwC5aI2rYDvvHPQD4XmKi07wnTXidVkIP/ZRo32Am8x/eW1X2oqEZhc/9 5rKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GAaxNcyAfDpJMNO6n11/nDG/bhYOtwnmWgK2bjUdkP0=; b=ZOPgM9YM1Hnj1gsNlkauAFtwzgchXoy+opSXWA8d+GoOXnit39oxPUpok/YCaZ+5zg 2FZod/LPwJwGfSrPCdSlRaTctkjNzOeKmqWR6ihQwNBGTD+l+/Ja/7OFWNm4guPAX7bg Hw3aAfYYHGWZK4JJGgHcOO0ASv49pBHhpo6DtYVxCyE7qykjDiUn+zDOfudUx6JSvdpw XcGZdC7YIkY4FEyBfOyA1lVJV9+q62Xxvfp1UA0j3zaPwsOA0QBF7OOSLiFgK625MMdN BzFta/txBXvqAf4Rw35rvN0KzfjzM032EgMlbT4wFrLKlbXYauqG/gp0x4TXvE/M1t4f zvYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UAPMALOX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co4si2601249edb.461.2020.10.24.01.14.02; Sat, 24 Oct 2020 01:14:28 -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=pass header.i=@linux-foundation.org header.s=google header.b=UAPMALOX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755393AbgJWUzm (ORCPT + 99 others); Fri, 23 Oct 2020 16:55:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755381AbgJWUzm (ORCPT ); Fri, 23 Oct 2020 16:55:42 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F082C0613CE for ; Fri, 23 Oct 2020 13:55:42 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id c21so2981126ljj.0 for ; Fri, 23 Oct 2020 13:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GAaxNcyAfDpJMNO6n11/nDG/bhYOtwnmWgK2bjUdkP0=; b=UAPMALOXf/byWclH19PJoWgK1gdA1jAiJsVhgESW90ZBHaYiffcgByVwzyFLeCCtZh 7qBwYyud/jUnHqBh/xIBHqRLUxPrfYvVImuOhmuWIdcLnQi+cNyO9x0YZsAToskZbK6+ T8nEMLlm+nj/zScwFb8eWZ1DwWTJHGB2qzs3A= 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=GAaxNcyAfDpJMNO6n11/nDG/bhYOtwnmWgK2bjUdkP0=; b=IWxPKq93epg4wPnOU+hZbYbVsasI6rmHFTY01N8oxteUl8HpO6qi4QRumArgniBlZR deWoeNttwBNJisY9YCr4ALmsF3Sll+7IoEUNUBnzENm1mbIV4mRMmS7DpZ7L4rGPrhfH FKilRBBY57PA9SZ+RbjHrDdtHR2OzWIoMAshc9ItHJelq+pmyocdBfxFaOVtfhYUDpi7 8c0/0YnD+QbiAMF6r2/fT8HXOD4HSCpHuS5hwNFB5Eg5+fS2oWZLvrNzHHnzQYGVRudL wnrKYkHUWmdijIqJXJ/Tgdl0lQocyRTW6mMz5EcZ3CeU7MZckCoAOXwT5MQAr+1WAQGD YrOw== X-Gm-Message-State: AOAM533XJ09vF4PIUwgmLYblrR8mrFHyQ4Jh3yuo3xHxBauo1XP7qK75 LgJZesV2gWSdOj015BMztEVb5cUHSpOmaA== X-Received: by 2002:a2e:8108:: with SMTP id d8mr1631752ljg.96.1603486539983; Fri, 23 Oct 2020 13:55:39 -0700 (PDT) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id z14sm276421lji.84.2020.10.23.13.55.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Oct 2020 13:55:38 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id j30so3679525lfp.4 for ; Fri, 23 Oct 2020 13:55:38 -0700 (PDT) X-Received: by 2002:a19:c703:: with SMTP id x3mr1243212lff.105.1603486538242; Fri, 23 Oct 2020 13:55:38 -0700 (PDT) MIME-Version: 1.0 References: <20201023203154.27335-1-linux@rasmusvillemoes.dk> In-Reply-To: <20201023203154.27335-1-linux@rasmusvillemoes.dk> From: Linus Torvalds Date: Fri, 23 Oct 2020 13:55:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/uaccess: fix code generation in put_user() To: Rasmus Villemoes Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "the arch/x86 maintainers" , "H. Peter Anvin" , Sean Christopherson , Naresh Kamboju , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks, applied. On Fri, Oct 23, 2020 at 1:32 PM Rasmus Villemoes wrote: > > I'm wondering if one would also need to make __ptr_pu and __ret_pu > explicitly "%"_ASM_CX". No, the "c"/"0" thing is much better, and makes it properly atomic wrt the actual asm. As mentioned to Andy, the "register asm()" thing is not uncommon and often useful, but when you can specify the register directly in asm, that's certainly simpler and more straightforward and preferred. Linus