Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2347168pxa; Mon, 3 Aug 2020 13:59:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcsMrd8nTjeSSN+PVHnvLYmgwaMxMzobSmJU3YO/8PZ+uAbQ9jhPyUJ5gR+FBtMUdozJYY X-Received: by 2002:a17:906:17d1:: with SMTP id u17mr18070153eje.113.1596488398258; Mon, 03 Aug 2020 13:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596488398; cv=none; d=google.com; s=arc-20160816; b=fdWvEznszxv1MPHND3i1M4SqLW2+GUziKsugtkB4X9ZoqHu4E/ggQPkulMmlY1E22n xEMrQ2KblvRjRFAa2SB2912j37glWJC7LEbX7NHTtpY1yaacY5fHbJ6BqYELu4fAsFuG 0QnseJwqS/XI6DQBg4DD9aCbrjkMeXOx3YX4qE0PwU/spLcnAS+9OTHGzQktDPDpWWXp aWApkOZuytRDMyDmvFN0Cf76fOfUiMpZ49j3o9kzeo9HpaDZ1vAA7a/zTFq2U8jHbsGM Skre7rqjSf8yvggfumIZXErq+2oYc3/SlIiCSPHgUihK8gTY0paI0WaRvMk7GB4KJ4YM SWTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Ksnf9HBHraqrjZuwYMeAj9n5YSqFyP9eX0KH8vvwtbE=; b=C+5fQTu5U+okR/AZiR+xfoVY08fjVWGEn1I7fPVXd9LsRzIyDrLOEhU43CccB4YJjn A9nVG/F3FPo+Mdqzcrq2s4aLD1W6ojD3ZNuPeVGBNsRIkoT+he3fom+6r5/SA8MUSxR8 9oXJKsyBiNXj8UrZAF6lyLQdVgQarhR2EVlihwgOqLno1rM09R/NNNnTIcQJZO9X5kbc AxdFfk+xTz+kr8ruu+8Mn4Y/ko7M339yPtIchbyHMP8wL6Aj/NYiv0Ptw55dAQE2nqY5 aPBN2AtLwQXk7oNRgYh3bIrqhScmPt7Ze1gt1xDuMX/RqBIRmjx6KdJ7w5ZG2kO+0itQ /guw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LUFb27gn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si11527289ejd.418.2020.08.03.13.59.36; Mon, 03 Aug 2020 13:59:58 -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=@redhat.com header.s=mimecast20190719 header.b=LUFb27gn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729054AbgHCU7J (ORCPT + 99 others); Mon, 3 Aug 2020 16:59:09 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:53429 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728605AbgHCU7J (ORCPT ); Mon, 3 Aug 2020 16:59:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596488347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ksnf9HBHraqrjZuwYMeAj9n5YSqFyP9eX0KH8vvwtbE=; b=LUFb27gnW7hye5vuw1DPf26hA/mi8EyXgxBsWmZOabdSnMCVoKAXkX5RGY/zHzMeu7Bp4M IK1Gx3ba9WL1CWFWkREm6xzctwZQrVS6rTejfJUa8YKuK/M8IakWczgL7ss/Y06R5w5TNk +8TCCCUkjzQArj/vUVd7/4ouPwh4k7I= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-EIuZ82bIM0a-IraJbIcr8Q-1; Mon, 03 Aug 2020 16:59:05 -0400 X-MC-Unique: EIuZ82bIM0a-IraJbIcr8Q-1 Received: by mail-qt1-f200.google.com with SMTP id w30so12257740qte.14 for ; Mon, 03 Aug 2020 13:59:04 -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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ksnf9HBHraqrjZuwYMeAj9n5YSqFyP9eX0KH8vvwtbE=; b=bngHqFar43AfpWs/C+kbZIhE3P28AeqZ0q3QW82qcE4Y3dqHUDIKU2Ox7xiTm9haUG gxS5Xrcsr4aJBAILtfukFKLZlIXuLFTxnNqVk82evUtWcq6c2lQu1CQiKeXlC9mucEp0 8yLRg98baalcVI+NvWVBzCU6Wh0Egl/k6hHeSAIniv6UUqcMsyAovSd1U3xuGfL2ZtEj YOGRPfigQEhXSZNRE5OyhRpXedAdaYqsNn5mVM7i+gEp9OtmS9LMuyL/S8laIGq19UUt zMeWBcHW6QX7wGvlGNSngB/Ki2Sc1bItPurrmYlDky7qPNq7f6AvZ8yPOVk0JvqzGslY vCHw== X-Gm-Message-State: AOAM532RSLtuWlqG8YARX+rgG1pK80IE8yVeKlvb6/umNGKfduMTOauc unhPdZa0ffrM91xQeG1nMlwQg0ly0WFenkbtgQ2HqiGYsagbB+q42USAOVWcqdOBXZr2TmIkdzI wsxikPLcsnWqaOSDhMgo9cQDG X-Received: by 2002:a37:6442:: with SMTP id y63mr18063649qkb.104.1596488344327; Mon, 03 Aug 2020 13:59:04 -0700 (PDT) X-Received: by 2002:a37:6442:: with SMTP id y63mr18063622qkb.104.1596488343966; Mon, 03 Aug 2020 13:59:03 -0700 (PDT) Received: from redhat.com (bzq-79-177-102-128.red.bezeqint.net. [79.177.102.128]) by smtp.gmail.com with ESMTPSA id w20sm4939699qki.108.2020.08.03.13.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 13:59:03 -0700 (PDT) Date: Mon, 3 Aug 2020 16:58:59 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, Jason Wang , Paolo Bonzini , Stefan Hajnoczi Subject: [PATCH v2 06/24] virtio_blk: correct tags for config space fields Message-ID: <20200803205814.540410-7-mst@redhat.com> References: <20200803205814.540410-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200803205814.540410-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tag config space fields as having virtio endian-ness. Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_blk.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h index 0f99d7b49ede..d888f013d9ff 100644 --- a/include/uapi/linux/virtio_blk.h +++ b/include/uapi/linux/virtio_blk.h @@ -57,20 +57,20 @@ struct virtio_blk_config { /* The capacity (in 512-byte sectors). */ - __u64 capacity; + __virtio64 capacity; /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ - __u32 size_max; + __virtio32 size_max; /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */ - __u32 seg_max; + __virtio32 seg_max; /* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */ struct virtio_blk_geometry { - __u16 cylinders; + __virtio16 cylinders; __u8 heads; __u8 sectors; } geometry; /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ - __u32 blk_size; + __virtio32 blk_size; /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */ /* exponent for physical block per logical block. */ @@ -78,42 +78,42 @@ struct virtio_blk_config { /* alignment offset in logical blocks. */ __u8 alignment_offset; /* minimum I/O size without performance penalty in logical blocks. */ - __u16 min_io_size; + __virtio16 min_io_size; /* optimal sustained I/O size in logical blocks. */ - __u32 opt_io_size; + __virtio32 opt_io_size; /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */ __u8 wce; __u8 unused; /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */ - __u16 num_queues; + __virtio16 num_queues; /* the next 3 entries are guarded by VIRTIO_BLK_F_DISCARD */ /* * The maximum discard sectors (in 512-byte sectors) for * one segment. */ - __u32 max_discard_sectors; + __virtio32 max_discard_sectors; /* * The maximum number of discard segments in a * discard command. */ - __u32 max_discard_seg; + __virtio32 max_discard_seg; /* Discard commands must be aligned to this number of sectors. */ - __u32 discard_sector_alignment; + __virtio32 discard_sector_alignment; /* the next 3 entries are guarded by VIRTIO_BLK_F_WRITE_ZEROES */ /* * The maximum number of write zeroes sectors (in 512-byte sectors) in * one segment. */ - __u32 max_write_zeroes_sectors; + __virtio32 max_write_zeroes_sectors; /* * The maximum number of segments in a write zeroes * command. */ - __u32 max_write_zeroes_seg; + __virtio32 max_write_zeroes_seg; /* * Set if a VIRTIO_BLK_T_WRITE_ZEROES request may result in the * deallocation of one or more of the sectors. -- MST