Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp9004ybe; Sun, 1 Sep 2019 19:11:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIMqgh0ew/WsATehi0k1n+VVOxG5JmBXkGEcJh3h8H7QzVuCJNazYvvNAoA8AMJsl6lxsL X-Received: by 2002:a17:902:8d8d:: with SMTP id v13mr27425850plo.137.1567390283602; Sun, 01 Sep 2019 19:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567390283; cv=none; d=google.com; s=arc-20160816; b=xYJ2lznnhXTVVJCTcB2O0GXKojWz51l5FZOB+6U46wNc+lvjd25qZU9ltjOPPaE+Wk Idy1ffGYTd9DfIXgP5rPMDD5OkCScklRjbQksK4og7uc3h8pyapQF22pczdYE6lOfmV1 78jgJHdYMsU7BAVa/1rLlWUBXb/Ib8/JCDRRT0Vw5zAtLVErpnA1dNBri8q4DLDAeA75 Zl0upY9bL/F8VkUmyr4acQYtvpqC955v2XUNSKYOIS+r/2BBDDdDt2B61XnYwpbKB82/ bq9WkuQHJNok3Tf7wdJJpETSgVh8F2KXGRLP+V320etfUiPTjqDFGAqIVFkGXb5fmBdt 5VOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=IKEtilq2bCFU0ExW/kQEechgE7sEyiAZtsK6K3A0aYY=; b=K5fUve4rLw26u1ouYqnGVIGDxgza8aD4VT/rdg7IOc0TJxDMB4fz3c9cMSKlGibHHa hQij46bu0RCvuLfNKMTu8TSoaGvrgUPkO242AbidIWn48o5/fY+fGLws80Omvg/MRtGc kWgtXtggUT8/ZZGuZvEsYnPllYDHjE6t2OzplL6zoQF2tMwLQ19hvzXxmP4z7yCHD1wU ufnbtz5l1JJQNIp3nBVn2YaWEWN1u3nVKGOudbmG38bPSlbVy7YZVCMNXRZpnLszNeO1 PqMN/I0w2SNRQmOLPtznyUaHgMYX2hwONfwYA1SRXYNevvb2wBky+/tEtbx/kaAPmTd3 aNfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Xy4Qg4nu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si10263182pgr.277.2019.09.01.19.11.08; Sun, 01 Sep 2019 19:11:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Xy4Qg4nu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729100AbfIBCKQ (ORCPT + 99 others); Sun, 1 Sep 2019 22:10:16 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57924 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727517AbfIBCKQ (ORCPT ); Sun, 1 Sep 2019 22:10:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IKEtilq2bCFU0ExW/kQEechgE7sEyiAZtsK6K3A0aYY=; b=Xy4Qg4nuoZ6/KSJhUspUj71XI mbaz/IVdXenNWL1LKL9plQv9geiHY86SuQO0ixHozKNmJxtbEacXej57pmenRH8w0KlEjJwwZMTFq eGVMwvFN9MQ2qoVAiPe8fphyLamELduVy9sYqA8LSs0XVsstbxBSa0nHStSazf9nUf3B8PRAQ4TQD Pn4WqFDZr+TXsdeYRAAK3WE8EUfZKDJJTluu9VCWOw4u4dOCWlifTtB7H5J+7GnyPcuRJDNt9YVjv +Br/XLSlTpP1NxVGiG2UobCe2rKSmmwrBvJx5gjnRGuuF/DHrerFZ8fIm7WDF48tWWVSsxRkJHU2V qRh0Sd+NA==; Received: from [2601:1c0:6200:6e8::4f71] by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i4bnI-0006CI-LK; Mon, 02 Sep 2019 02:10:12 +0000 Subject: Re: [PATCH v3] arch/microblaze: add support for get_user() of size 8 bytes To: Linus Torvalds Cc: LKML , Al Viro , "Steven J. Magnani" , Michal Simek , Jason Gunthorpe , Leon Romanovsky , Doug Ledford , Andrew Morton References: <5a3e440f-4ec5-65d7-b2a4-c57fec0df973@infradead.org> <6184ffdd-30bf-668a-cdee-88cc8eb2ead7@infradead.org> From: Randy Dunlap Message-ID: <98c83922-6ab1-98ca-7682-7796ae1facf4@infradead.org> Date: Sun, 1 Sep 2019 19:10:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <6184ffdd-30bf-668a-cdee-88cc8eb2ead7@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/1/19 12:10 PM, Randy Dunlap wrote: > On 9/1/19 10:31 AM, Linus Torvalds wrote: >> On Sun, Sep 1, 2019 at 10:07 AM Linus Torvalds >> wrote: >>> >>> I guess I'll apply it. I'm not sure why you _care_ about microblaze, but ... > > It was just a response to the 0day build bot reporting build errors. > > >> Ugh. As I was going to apply it, my code cleanliness conscience struck. >> >> I can't deal with that unnecessary duplication of code. Does something >> like the attached patch work instead? >> >> Totally untested, but looks much cleaner. > > Hm, I'm getting one (confusing) build error, in block/scsi_ioctl.c: > > CC block/scsi_ioctl.o > In file included from ../include/linux/uaccess.h:11, > from ../include/linux/highmem.h:9, > from ../include/linux/pagemap.h:11, > from ../include/linux/blkdev.h:16, > from ../block/scsi_ioctl.c:9: > ../block/scsi_ioctl.c: In function 'sg_scsi_ioctl': > ../arch/microblaze/include/asm/uaccess.h:167:25: error: invalid initializer > typeof(ptr) __gu_ptr = (ptr); \ > ^ > ../block/scsi_ioctl.c:426:6: note: in expansion of macro 'get_user' > if (get_user(opcode, sic->data)) > ^~~~~~~~ if (get_user(opcode, sic->data)) return -EFAULT; where sic->data is unsigned char data[0] here: typedef struct scsi_ioctl_command { unsigned int inlen; unsigned int outlen; unsigned char data[0]; } Scsi_Ioctl_Command; On x86_64 this builds as a call to get_user_1(). (cannot do objdump on arch/microblaze/, unknown arch/machine) I guess we need a way to coerce that to call get_user_1(), such as a typecast. This _seems_ to work (i.e., call get_user_1()): if (get_user(opcode, (unsigned char *)(sic->data))) return -EFAULT; ?? -- ~Randy