Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1188263ybx; Thu, 31 Oct 2019 07:00:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2BhK7lJZWz6JoQwyY3w1tzDSvfNKLiJKYeSGMgxnWMzU62JkEZIl/LktUNWW+ozua5hot X-Received: by 2002:a17:906:eda2:: with SMTP id sa2mr4079450ejb.14.1572530434627; Thu, 31 Oct 2019 07:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572530434; cv=none; d=google.com; s=arc-20160816; b=LXLQnNwA4sEEAEjgzaXgW6CsBCsSnc4/TuJn5iLp78INHdo76zZa4A+TpylrC3R4oy EEJwX7VnpMMZ4PtAcIHR71oFFp3tBtncKp/A6BG2KJHnjK0GFfItBMx2uh+uaWXEZKCa dYhP9XJQK2Z0kZMqZG/tmmVV+bbOxJpeObENQXE7qZXAO3LAsJIATEgyZPRYKjLFdxjs 1ca2+3auldDv7twK/TxKaCYvBK9KasYxKaxu9erPNQTffNTgaTqwSxs43o/yltO3luBc vXP0WizmJLeSwl1WUQlq3ZhPD9UyFmdojUMacBka4PFdRCzfFWWyZRKFpv1nhNOAZw7j mizw== 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=6lc72BgRwD53g5GkhGUqFFG2nhb0dXxx1JADtBs5rJw=; b=Y5Xs1xxmHjcj9AL0GLGebGwfMAvou6uRnkddT6w7GF3fXp9Y4tmaYX5wGCu35fjwDQ ZNGqmGotL74y8F0ALRe9prSQT1viRGpW09rTwM/X678mU8YshBZERrMKUsdxseHWt3JH zxtonbyx/hV+H5EU9sMbkSaddSbj24B7SlF8w2dLxnzJyTPR0/pT/NGNe+4lWB6PPryZ CZWB1idi9v09tG1ZsFVx1UVRUh3pJ+iv4YCTocINruSWY1OGo2BX7dvlH+uLSX9RXigq T3/OeuPL5eY9FPhuSbWOsGoLdnZQ2FHQhoeqdzUHSd+RevYRLngT2nCOyLtWkj3qAkD+ mjNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nd7hRbEA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si4779642edc.97.2019.10.31.07.00.11; Thu, 31 Oct 2019 07:00:34 -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=pass header.i=@gmail.com header.s=20161025 header.b=nd7hRbEA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727752AbfJaN7W (ORCPT + 99 others); Thu, 31 Oct 2019 09:59:22 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:35559 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727567AbfJaN7W (ORCPT ); Thu, 31 Oct 2019 09:59:22 -0400 Received: by mail-yw1-f66.google.com with SMTP id r134so2154630ywg.2 for ; Thu, 31 Oct 2019 06:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6lc72BgRwD53g5GkhGUqFFG2nhb0dXxx1JADtBs5rJw=; b=nd7hRbEAfWE8bai204exlUd4eQxE+PqtFpB4gNcChz18ASnUWtYBaJ7hq9VvRDL2Mt 9J1qcpniYjzrbZZF76uQKP4yZ7l0m26a3Oi696396zqnYybZSMV4jbZWNYIc0TuOavVG coo19mZKcAn8G4QoLCo9pNivxwz3JdkdMXDLrDWI2KB4khoTwd0/B3TWA9ttzwc3vuUz JIejUDdHxuSCBhI7MZG2MFRCFX+OMIsoY7gepXTB/RhrmJeo31B4ELQ07NhPc5XmGo5E KW0So4p5uEzR946cLNcCBFQ2cLahz4wu4ihWFl7cq2CRQgiVgVSLPZcrcgjxBK/HL0QQ fJrA== 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=6lc72BgRwD53g5GkhGUqFFG2nhb0dXxx1JADtBs5rJw=; b=XeTbKfpsPVdKwysxgyu2yRE+qy5JOqGEECWYCnF4NK0W2KZ5nLvks2wb8/SPbZGHNR xKvq0isvCycRymoIqEfplYPVDSW18h/Rs5NG5RnMRSuLo75w1LhIxoklRKBYkTi1Pgk8 YQ5xUgnoA307lc5HZmxXlEMHF2DSocZDTEi+nysy+KMkj9YSJ/AKKc1uWurmLmnphxi8 5amhIfJ7FUbGWGxXNjxDwIpEnBbR4GGY6T4tmGaGYaEeHzQFSj8kOJ3BP79yCm6sddnR gGZImV6owyCaufeWifCXIk3EthRw4pViPWgftMtUq+TDZhNmPLBfeTbyThWxiEVe9ReY 7nIw== X-Gm-Message-State: APjAAAWHgRE0Z3hxAMwzkw1d3wWjvWG+F7CWSkb6s6i1Ip/Dqrca8phl vggXuYxdlM3u0hXsGsoTS2afzsFOlwbpNE2oCtw= X-Received: by 2002:a81:61c3:: with SMTP id v186mr4332558ywb.151.1572530361617; Thu, 31 Oct 2019 06:59:21 -0700 (PDT) MIME-Version: 1.0 References: <20191031050338.12700-1-csm10495@gmail.com> <20191031133921.GA4763@lst.de> In-Reply-To: <20191031133921.GA4763@lst.de> From: Charles Machalow Date: Thu, 31 Oct 2019 06:59:10 -0700 Message-ID: Subject: Re: [PATCH] nvme: change nvme_passthru_cmd64's result field. To: Christoph Hellwig Cc: linux-nvme@lists.infradead.org, marta.rybczynska@kalray.eu, Keith Busch , Jens Axboe , Sagi Grimberg , linux-kernel@vger.kernel.org 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 Thu, Oct 31, 2019, 6:39 AM Christoph Hellwig wrote > All that casting is a pretty bad idea. please just add an explicit > reserved field before the result, and check that it always is zero > in the ioctl handler. Not quite sure what you mean by check for zero in the ioctl handler. I like the idea of being able to use the same struct for either the original or 64 ioctls from userspace. I don't believe adding the explicit rsvd field allows that - Charlie Scott Machalow On Thu, Oct 31, 2019 at 6:39 AM Christoph Hellwig wrote: > > On Wed, Oct 30, 2019 at 10:03:38PM -0700, Charles Machalow wrote: > > Changing nvme_passthru_cmd64's result field to be backwards compatible > > with the nvme_passthru_cmd/nvme_admin_cmd struct in terms of the result > > field. With this change the first 32 bits of result in either case > > point to CQE DW0. This allows userspace tools to use the new structure > > when using the old ADMIN/IO_CMD ioctls or new ADMIN/IO_CMD64 ioctls. > > All that casting is a pretty bad idea. please just add an explicit > reserved field before the result, and check that it always is zero > in the ioctl handler.