Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3765044ybb; Mon, 6 Apr 2020 15:27:20 -0700 (PDT) X-Google-Smtp-Source: APiQypICejM7D78DosjbG3FmC2BB6Kypdvcetrym0PixBb6Hp5EFFnB2EqHRYhUxxgj8SrLw9gpC X-Received: by 2002:a05:6830:2428:: with SMTP id k8mr19998340ots.345.1586212040648; Mon, 06 Apr 2020 15:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586212040; cv=none; d=google.com; s=arc-20160816; b=ojh2Lr+w1TzW7C/mCmLXB0hv1T8fw2xrYLBk4nM7PK1PukHJHyg7XJMvVr4YzOOCzS bVgm6oVQNDe1fC0zVvYod7nA7jh2ZMqD4cOh0Gy0XgNtYb6ZsCC9blBOgx41tuGTbM+m XWBHjroh3eBtlt4vWws3o7p2kD38wZveBNWCIVH1+EsrJVmnyxbliJKFnXBsfmqM2QXj oNnNMftEzgl+UG151UKPFh+bTxi6lj15GOwOlFYvVGkxUIsH0yaI537k0UvgNCOAkZga sAGKocJLpMUspzi2wxX/9W4bLmyJjjuJaVaHEWnPH0HZorUgmABONO9jIab+bhGV41tT CJVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:to:from:date:dkim-signature; bh=iZFgKkz0QCkMCePst5Xuy/AmzY50YNGDctVrJzdrtEA=; b=Rt9PayNueIw7V40dGtzhyDLIb7NCqjws20zosgYEb026tp3gm5j/cko12Oe0g8ahp5 uJxcA9DfUg6QwlqIHKnZFejtOJTDEF4PcAfnky3cVZCtxffReW9xRhsPgZ88DeN/pgn5 pSn9KPjaaj8gAajFYLRiU2SK23p2yFKuZPgWOeIvT5LvMNPajSgJ+7edGLVApzCv/lh7 ahI8R4zE2sraZfRnuZ/Get1OlANXnh0qOLVeI7rzHTW4mfQCN9vYjuH45I9997UEhU/5 oK9WUjooLigZOGcdbA05rz9u/lLd7uWUp6hTKuV0UKmHglSuJOJ4432Gk0hZhFp8KQUa hpnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ABcnJlFi; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si375974oov.44.2020.04.06.15.27.07; Mon, 06 Apr 2020 15:27:20 -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=@redhat.com header.s=mimecast20190719 header.b=ABcnJlFi; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbgDFW0e (ORCPT + 99 others); Mon, 6 Apr 2020 18:26:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46050 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726130AbgDFW0e (ORCPT ); Mon, 6 Apr 2020 18:26:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586211992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=iZFgKkz0QCkMCePst5Xuy/AmzY50YNGDctVrJzdrtEA=; b=ABcnJlFi6he8TVY1RXkAyjIZL73cKdJdTBx5qcpEFjFPXRQyER9K3Wg0LkP9RuhXLICipF wtxBP+SoLDH4vmn+/iXc+51JrOxQ9kLmXFBJjOEhq7yjeYO35oV1/1ywHiHIdMbRZs0Ryg WJnsRs2x1gIJygtbTGStB1NLGQY4b5Y= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-GFrvpWp6MZSvx06IWld6eQ-1; Mon, 06 Apr 2020 18:26:30 -0400 X-MC-Unique: GFrvpWp6MZSvx06IWld6eQ-1 Received: by mail-wr1-f72.google.com with SMTP id y1so653276wrp.5 for ; Mon, 06 Apr 2020 15:26:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=iZFgKkz0QCkMCePst5Xuy/AmzY50YNGDctVrJzdrtEA=; b=QRDbxW8Ltxh9x5JIghP3Ll4Ls1z0WjeJEYoPY8meQzlZn3WFNziZAOU73C9/AU3PY2 JaeSjYl7v76mJPeBS1pOeAFdN6qpgqAbMRAk76wY7Quy63nLBENalnG4e/N0qnrgs6r3 Gzovcr3hYxvcf60FUrLO0N3bel7srnQFjhtvPQiSs3lPAibkqhAVGSwZxNoeFZN/EZWv AmxCpyc2dyOE4cKhIabGp04Lz8GLHL36iAK+fXnG3uINuKFTZr9vPIUdVRqUJUnNO1Q7 nLfdfpezSjRaeLu7SayFvAz9tqC3v70YDO8Jbc18JLjd5VzcFKWTsGHhqh343m0+Rjk4 +iQg== X-Gm-Message-State: AGi0PubqenT6I+ygild2WafHLx/QXx3R02xJIy118hHOzt4UrvDuQLfV Wz81yEZbmKupuXhMt7oiPU6uxF96MZo3BeBuwqTPpk/74+JAMLt8QVHyOG9CuRldD5CLMuH2KO1 L2fCvX1v1MO0YMxgO6mAvoSuh X-Received: by 2002:adf:bc12:: with SMTP id s18mr1617093wrg.220.1586211989687; Mon, 06 Apr 2020 15:26:29 -0700 (PDT) X-Received: by 2002:adf:bc12:: with SMTP id s18mr1617086wrg.220.1586211989511; Mon, 06 Apr 2020 15:26:29 -0700 (PDT) Received: from redhat.com (bzq-79-176-51-222.red.bezeqint.net. [79.176.51.222]) by smtp.gmail.com with ESMTPSA id j31sm21556719wre.36.2020.04.06.15.26.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 15:26:28 -0700 (PDT) Date: Mon, 6 Apr 2020 18:26:27 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Subject: [PATCH v6 00/12] virtio: alignment issues Message-ID: <20200406222507.281867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an alternative to vhost: force spec specified alignment on types which is a bit safer as it does not change UAPI. I still think it's best to change the UAPI header as well, we can do that as a follow-up cleanup. changes from v5: ack for mellanox patch fixup to remoteproc changes from v4: fixup to issues reported by kbuild changes from v3: tools/virtio fixes a bunch more cleanups that now become possible Changes from v2: don't change struct name, instead add ifndef so kernel does not see the legacy UAPI version. Jason, can you pls ack one of the approaches? Matej Genci (1): virtio: add VIRTIO_RING_NO_LEGACY Michael S. Tsirkin (11): tools/virtio: define aligned attribute tools/virtio: make asm/barrier.h self contained tools/virtio: define __KERNEL__ virtio: stop using legacy struct vring in kernel vhost: force spec specified alignment on types virtio: add legacy init/size APIs virtio_ring: switch to virtio_legacy_init/size tools/virtio: switch to virtio_legacy_init/size vop: switch to virtio_legacy_init/size remoteproc: switch to virtio_legacy_init/size mellanox: switch to virtio_legacy_init/size drivers/block/virtio_blk.c | 1 + drivers/misc/mic/vop/vop_main.c | 5 +-- drivers/misc/mic/vop/vop_vringh.c | 8 +++-- drivers/platform/mellanox/mlxbf-tmfifo.c | 6 ++-- drivers/remoteproc/remoteproc_core.c | 2 +- drivers/remoteproc/remoteproc_virtio.c | 2 +- drivers/vhost/vhost.h | 6 ++-- drivers/virtio/virtio_pci_modern.c | 1 + drivers/virtio/virtio_ring.c | 15 ++++---- include/linux/virtio.h | 1 - include/linux/virtio_ring.h | 46 ++++++++++++++++++++++++ include/linux/vringh.h | 1 + include/uapi/linux/virtio_ring.h | 30 ++++++++++------ tools/virtio/Makefile | 2 +- tools/virtio/asm/barrier.h | 1 + tools/virtio/linux/compiler.h | 1 + tools/virtio/ringtest/virtio_ring_0_9.c | 6 ++-- tools/virtio/virtio_test.c | 6 ++-- tools/virtio/vringh_test.c | 18 +++++----- 19 files changed, 112 insertions(+), 46 deletions(-) -- MST