Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1421976ybt; Sat, 20 Jun 2020 09:53:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoDrsmmQtr7x69IQet/nVVg31+VhQ62ap/ocwIf/u0HeDojR0xoRfibF/+qyX7YDoE4imt X-Received: by 2002:aa7:c81a:: with SMTP id a26mr9241835edt.353.1592672029571; Sat, 20 Jun 2020 09:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592672029; cv=none; d=google.com; s=arc-20160816; b=fF7YArSWQkyDmI11GMNCaRZJIs61HtqhYNsfF6n2XLAOfIk88E7j+52E6e2+ezfD/O LrnajDBYMK/JLn1LaGNUK3XJsKkJWtzMTXyOX8MbPis6Ldv7L1BAQ5W3pjWRqWYfRvlJ VMwsAhi0/jwUlVX+c1h+CtpN+KCjRKJqOFxY1HHzVjUBmI+jZLu9PtOsPHuW1aGbT3ut zwCTh8hxrUCTBDz5/YlryfptuM66QaIaSWuwhPJV3MFq5aYddYG4DeSc0H8wp2aDDNw1 GMBPoMsKS8OT9wMO4B3x8Xx0NM4j6aqQyxCLRTg4CunLnU0BIORBacx42U8C1IfrTfVD tJcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7gXamD6tdco3sX1rsWjyx/DNsG9Dx7HvJbp4Sgjo81s=; b=UFPxG5SdBk+/5L8ScHvzbJuiVmvhbcVpUyWYwmESoanDIOeQCIaYh7wyEEmBSlQPar BTDgybpud4VETUF+zaPCX9z+iqtBPm3zyHgb2CeWQieR/MgHbgHOUr59K8SYtDEHv7ma 9ci7yMRHFn4k6y3Ym0pA6gPrYbjYsjPJebeIKkbuoC9OCHe6jUxdjXRsIiWt4xsVnJKe qb1SMV+JrCreHcD9KLGm35xUB6+N6Qcg10mkFnd4SKj26/C4sY4YLK0+cPNnLYGYzvuP Q8v6G07ze1MAE/ZhW4dLw/BLXeNY0A/YD2ZdM1UtodR6xibkdBkcPGesjmM2y7rzbgUQ +YWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=JB70eXW6; 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 s1si5515334edw.362.2020.06.20.09.53.27; Sat, 20 Jun 2020 09:53:49 -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=JB70eXW6; 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 S1727990AbgFTQvH (ORCPT + 99 others); Sat, 20 Jun 2020 12:51:07 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34950 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725290AbgFTQvH (ORCPT ); Sat, 20 Jun 2020 12:51:07 -0400 Received: by mail-lj1-f193.google.com with SMTP id q19so14910725lji.2 for ; Sat, 20 Jun 2020 09:51:05 -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=7gXamD6tdco3sX1rsWjyx/DNsG9Dx7HvJbp4Sgjo81s=; b=JB70eXW6129XbjPHpJQunGUIMM53GNDzabriZYPRfLkmsKWzMVZsseChD9TekSyUpA EVQwpFR3L7FM2Y9I+rLVZY00YWZJHYTfxve8+q//i3CHatLmxT3cCeBSGHuvknRjI6Pb rL8GLj3b9jPvOO46NbZTvdDo/PPx58jx7G+YY= 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=7gXamD6tdco3sX1rsWjyx/DNsG9Dx7HvJbp4Sgjo81s=; b=cfYc/cO3dMgKeWH6nnm9LU4ptFUsj2BvOJYqBuxwVs+MJOtAiVcKXlt3oGgb2S4Mse LSkoKnI1UkuxCbzMmF4bV0oM5xifkcr8g0RGan1aX90AQJfEBbl8953+BYM5QhnbR4VC cBRcHHfx6eFkj467hcfxVCeNMNjY/tuTlvdjnJFV7fTGgcvWlnT7wxvLXhRUaLFo3pMj 4zX8urnSB4n7AOnXu+mUhnR3Z3MgTD4Z6DUlrtuWMATzZcu/XeKRBg5GlJNwBhyzvLF2 OYH3s2sL0lYyZAC2kgtkqfUZ9AB1dVkaygdwBmC4DsUPqPLiR8bBrxkrfpmhXdCn/R8l InCg== X-Gm-Message-State: AOAM532pk1Pvc005O/VOsjJsSlc+EBfeOGP1Nelhyql7cFoLvnAduvX6 e+9beBJuMh/lleyxJXlC4ZRN7/gfPTo= X-Received: by 2002:a2e:7006:: with SMTP id l6mr4857516ljc.453.1592671804614; Sat, 20 Jun 2020 09:50:04 -0700 (PDT) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id c6sm2174731lff.77.2020.06.20.09.50.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Jun 2020 09:50:03 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id a9so14869009ljn.6 for ; Sat, 20 Jun 2020 09:50:03 -0700 (PDT) X-Received: by 2002:a2e:9cd4:: with SMTP id g20mr4470977ljj.371.1592671803344; Sat, 20 Jun 2020 09:50:03 -0700 (PDT) MIME-Version: 1.0 References: <20200619065007.GA3041@lst.de> <20200619074233.GA3723@lst.de> In-Reply-To: From: Linus Torvalds Date: Sat, 20 Jun 2020 09:49:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Commit 25f12ae45fc1 ("maccess: rename probe_kernel_address to get_kernel_nofault") causing several OOPSes To: "Kenneth R. Crudup" Cc: Christoph Hellwig , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 20, 2020 at 6:46 AM Kenneth R. Crudup wrote: > > So, be totally surprised :) I've just booted with "maccess: rename > probe_kernel_address to get_kernel_nofault" intact and your probe_roms.c > patch with no issues. > > (Perhaps there's some sort of compiler optimization going on?) Hmm. Very strange. I was a tiny bit worried about that part of the patch, because I also changed the types (from "unsigned char *" to "void *"), but pointer arithmetic in "unsigned char *" and "void *" is the same, and Christoph's partial revert patch doesn't even revert that part. But I really don't see what Christoph's revert would really even change It switches the order of the arguments back.. It does re-introduce a bug in that macro that I fixed. This macro is buggy garbage: +#define probe_kernel_address(addr, retval) \ + copy_from_kernel_nofault(&retval, addr, sizeof(retval)) in case 'retval' is a complex expression, becasue of possibly changing the C order of operations. So it needs to be "&(retval)" in the macro body. But that is never the case for 'retval'. For 'addr', yes, but 'addr' is only used simply (and copy_from_kernel_nofault() isn't a macro). I'm staring at that opatch and not seeing how it could _possibly_ make any difference in code generation. Which is the obvious next step: would you mind compiling that file with and without the patch and sending me the two object files? Linus