Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp382758pxa; Tue, 4 Aug 2020 07:53:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX+6RUvAAufnr+OQZOs+RkVlKEQlc/5UOsP+UE6u8aujdiBanPVU3nbAAkL9dB4woGqci1 X-Received: by 2002:aa7:c513:: with SMTP id o19mr20911813edq.327.1596552808134; Tue, 04 Aug 2020 07:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596552808; cv=none; d=google.com; s=arc-20160816; b=cE699xsZtIKK1hJ1SaGJQL/hRe7KrhjdY7VNsBBI3GRaM61KHFVhiAy5pL2/DEacI9 0SyISp7zBC4BLWpJS8eWqBffCrtcteh5goKU0WjK10aJ0CDktz97q7oFGNFMeG770Snp 4eevBfXexdTMXBuLQULaWp4QENah671SUFb7oII6OdyXEFIp99KCuIPPWnHO0kn/6XPt 6itUs+fs4GSDIg+95VwhdadLMVf2Oe70B9SR/cWs8R54PEHdCrpidxM61RqwE0VPRwHU Qg6UUt47COaJ5+LGscL5LWF+ezgHBi/r1dDNySpzvFazApoem6R6qHX/gfyqUWc57aH2 s/Hg== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=6YxLRfbCPvEp7fds9gJqZErapKvRhVFigGRNQsWtgis=; b=jMM3a3YZRdL74FdUF1TiI7VO5sNNrJLOl0Wd5FV8gVwTv0PtRv42G0av1B+xY5Hjn6 5qVwLQpq+rm2vxP8fdu7w4yPmeJ7u4+MyAp3lUj1SgH/cvg9begkcoCGBB+3eyOXYWCp zyBBDc261JzEyDwHtm8uCATxYEl47Qc+dpdGc8rDwlZroN2KzoCnTY+kvzyNRHwRklQg OUXO2Q4T5OUV+wuuqsf0cXD78s74QDt6avZN/X1iwOQq7OWVB5hBntflO594D0AJABb7 GadmxsOyZMnwps7frTVqc5IrcTvNu3/YHEEjTH+4YvV0gKmBnpLxzHUmXB/prgKVVOWe 6FJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xx6uBbNh; 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 f16si9523912edv.411.2020.08.04.07.53.05; Tue, 04 Aug 2020 07:53:28 -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=Xx6uBbNh; 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 S1728408AbgHDOu5 (ORCPT + 99 others); Tue, 4 Aug 2020 10:50:57 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:49736 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725904AbgHDOuw (ORCPT ); Tue, 4 Aug 2020 10:50:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596552651; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6YxLRfbCPvEp7fds9gJqZErapKvRhVFigGRNQsWtgis=; b=Xx6uBbNh0iJDgOpH48suyP+DkGDzF5B2iPqMLg2jNJe9xc2ix0T1zQi0R4IQMlUysxhYf+ WOsmwQfcRrw9ei7yFq1Iz/ZokP889w2luZ/TJgutQyFpKAs32qmg+rDG3aRh8LbLsD4kl0 MSEfoWI8IbbmUGUx41GnNOk6LwMumT4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-456-OMCkbzNkO12miiPFRDkg0A-1; Tue, 04 Aug 2020 10:50:48 -0400 X-MC-Unique: OMCkbzNkO12miiPFRDkg0A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E08580BCB2; Tue, 4 Aug 2020 14:50:46 +0000 (UTC) Received: from gondolin (ovpn-112-169.ams2.redhat.com [10.36.112.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id A960069317; Tue, 4 Aug 2020 14:50:41 +0000 (UTC) Date: Tue, 4 Aug 2020 16:50:39 +0200 From: Cornelia Huck To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v2 17/24] virtio_config: disallow native type fields Message-ID: <20200804165039.58dcb29e.cohuck@redhat.com> In-Reply-To: <20200803205814.540410-18-mst@redhat.com> References: <20200803205814.540410-1-mst@redhat.com> <20200803205814.540410-18-mst@redhat.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Aug 2020 16:59:57 -0400 "Michael S. Tsirkin" wrote: > Transitional devices should all use __virtioXX types. I think they should use __leXX for those fields that are not present with legacy devices? > Modern ones should use __leXX. > _uXX type would be a bug. > Let's prevent that. That sounds right, though. > > 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 >