Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2349891pxa; Mon, 3 Aug 2020 14:03:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ2PiV6T+cw4umNKSF0ENKZmFgX211RSARGRqhi1wU5bRF2gsRvMy64i2+y7x+7uwCwdY7 X-Received: by 2002:a50:bece:: with SMTP id e14mr17180444edk.190.1596488595201; Mon, 03 Aug 2020 14:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596488595; cv=none; d=google.com; s=arc-20160816; b=dzGmoHwoBWhdna1WHmxygfLuej9u9v1BS9eqPmjBTitmFZpWYBGpGWiUn4jnjuAz1Z fuaSuZAZZSuGfcNVSWYP7TDtZp4t//f42s2e48L9h8FXsp8xY4FwiWoZXJdMnww2y2YL yls2f/XRRFU03c5ol2FIVJIMEN5WQKy+waXjCWa5dKS3259Ye7LWMmpvLaqg8ezQIziW q25SUgVbMtYKaxyii04FRmPSJkLQtMLKw+FAwM/uBDRGkaFSpcatRZdQEmtiOPO/phIW WEJhdPw8YisLEcWyfsiA/Y5h4NEPMXC+gUVX9SOhNIsg5kBpvLr4EQ4pWV6ZSWgRg75C iwMA== 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=THaB8S+209mrmnxdJZIOkJCpQ5DDeAQcpm4IqDkBrvY=; b=tH/9nMvzCd8WAvkCrsMIVc2fEFnrDvgKtEOTYcwDdpUznD34VkcIqV8MPgvPX4TWeb mxufpgodljPxz7msfOjrVuI6F3dEShfllH+2CZxkpzC9nw9VmSTYKzbEGUGPCuTGq85F VrmrEr8KMgHBLpAzxvBiEMUWePnwNUC/cscVAF6/GVAlDQNsVidySCtcKj8KeE6SxKu7 mRPMKjvKYLQodM50fJ5Sp1yOuDfPVRUGR/K9XbsDiKO1jaqwACYXcuWbqGllrw3/YegI 0c9cKsFu0UeX7RiEeSU5AV5GjqSrqifwzvn6/5GfkhzE15ak16S1EzyDsKAAHwjYNX7Y 62uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VaNCLoo1; 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 d10si11193504ejt.153.2020.08.03.14.02.52; Mon, 03 Aug 2020 14:03:15 -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=VaNCLoo1; 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 S1729177AbgHCVAG (ORCPT + 99 others); Mon, 3 Aug 2020 17:00:06 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20588 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729171AbgHCVAF (ORCPT ); Mon, 3 Aug 2020 17:00:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596488404; 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=THaB8S+209mrmnxdJZIOkJCpQ5DDeAQcpm4IqDkBrvY=; b=VaNCLoo1Btp6/Go5q3/Ez7pu5F/Z+A7bo42howe+0XLEiRzIq9s1JZoVnZNYakcqfR8Vs9 so79hdh29LpXDPel+b0cfqDHvL15Ex6guKiDU+jXGbAtaTpdajRCpYDSBqrl5p72HaDSr8 O+ER5/39Rv2f92Gz6R8krPDMjw839oE= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-296-FkES2kB0OriNAiFlGLX31Q-1; Mon, 03 Aug 2020 17:00:02 -0400 X-MC-Unique: FkES2kB0OriNAiFlGLX31Q-1 Received: by mail-qt1-f197.google.com with SMTP id r9so27755739qtp.7 for ; Mon, 03 Aug 2020 14:00:02 -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=THaB8S+209mrmnxdJZIOkJCpQ5DDeAQcpm4IqDkBrvY=; b=X9BD82ozwIzBZZvwOMRuxnN5TrdvHXksVeCDYNg/wYLpoLNIyHdggaO6nVSI0fqzl1 W2r36ML239oIzWvrOwU+s8M4MsIOxjgoVWG/GlpJhFnaQaFLApYQmkJjMiBvGonNxzV2 CK2MFwYbAsCs0iy1W5ByoixjoBqigL5nLaYMLaE7mAhWayv69uI/YhWsB8x/TYqY1CVC PUxDKbHlUFwEFF9wfPf6ANQK/HynFqhBOZnlGu5EO8PRyhl25tg4356gYjtE6AMkLglv EZwY9qeog92IY0xBEYXU/H3eYt6cqnr1hjO5R0wjeUVOU/DaNxlAxM1fjhPZ5r5pS6jg 9Kcg== X-Gm-Message-State: AOAM531fUAliWP6n3rmFd3AVEOZpIPSAzlGLWT+9LLOTGUzURG5H4sCx N4lHqTyXN0/w9ahwHxRR1XTx6DhxBSR8at9YAPmsXj9+/jqrka6Q3PRnJ1WXZShAwijBNWRU6Ur iy/Rcuqs7LdIMuPQ4NHNpQqzl X-Received: by 2002:ac8:520f:: with SMTP id r15mr19359541qtn.116.1596488401509; Mon, 03 Aug 2020 14:00:01 -0700 (PDT) X-Received: by 2002:ac8:520f:: with SMTP id r15mr19359526qtn.116.1596488401300; Mon, 03 Aug 2020 14:00:01 -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 w44sm23888660qtj.86.2020.08.03.13.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 14:00:00 -0700 (PDT) Date: Mon, 3 Aug 2020 16:59:57 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, Jason Wang Subject: [PATCH v2 17/24] virtio_config: disallow native type fields Message-ID: <20200803205814.540410-18-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 Transitional devices should all use __virtioXX types. Modern ones should use __leXX. _uXX type would be a bug. Let's prevent that. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 64da491936f7..c68f58f3bf34 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -319,9 +319,8 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) __virtio_pick_type(x, __u8, __u8, \ __virtio_pick_endian(x, __virtio16, __virtio32, __virtio64, \ __virtio_pick_endian(x, __le16, __le32, __le64, \ - __virtio_pick_endian(x, __u16, __u32, __u64, \ - /* No other type allowed */ \ - (void)0))))) + /* No other type allowed */ \ + (void)0)))) #endif -- MST