Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp924339rwb; Fri, 7 Oct 2022 06:04:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nULkT8F2oy7CoK9MF8hjEoItgoZkvVLdk+zd7j3NTcYZU0Ht2aoZQHRIffTCQk/gxkiVd X-Received: by 2002:a17:907:9727:b0:78a:e09c:f2f9 with SMTP id jg39-20020a170907972700b0078ae09cf2f9mr3919345ejc.455.1665147898058; Fri, 07 Oct 2022 06:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665147898; cv=none; d=google.com; s=arc-20160816; b=GyZD+vEGyRN4HQoR88Bo9/9Zs8PpdGg3vv4gPk7AUc0yMqgo7hdvO+2o+UEi18CnQ4 SwNDKs8HD3YQwsoFHGwxJUAjYzNtYnhLIprFI2sospZCQkI1AzT0L4TTobaCcdhNnMzA FWoDkdp0WwIsl13o8cpa1VpNgfqDHyt6jmG0L4ZZlcEDbTFXFs1CRAKfnzHRsdEuiJwk jwu9K7oqDEYhivXWgDG/bUvympWV7TSisuBOvI49UElzWStIHc+tD80JRE9LPSzEqzWA 6KPVOGRrztX8Ix669i/nmAtzmM8jidmfsllhpD8fGWBNs0nZw4yL2GC1V6tgPQT57msd BVoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/Wu7zkDvh9Y7YMMhVMehTcCNW6maACM0iCCQHnBi68g=; b=jRbrpJiAeysp+P0C3pSc81GhqifDM2/PzR89z8LEMYrlYQo18uSTS6X8QGKIW+xIRk sSEt692zrhKeCi/AknZixUyh6h09j+A1ZuxEKfNzYbxjfGxtWGLNrUO3/j8F+RrNR7EV oY95hBFhmRBtwoZML6Id3AI7MaqcBjdWAFKl+Pf/4ttNOnZ40hZI1ywrxxE14XbCT0OJ mu5jJ9KRa8Tt4BASYabH76NWtTttI7me1P2n70gmV0dlm25UxLqQAy4xw14d66jpfwrL ZGbGuVICqP6dMkHSe+/ekJqRaw9hHH1fLmR4plb4UfYdDPyf2JQlRcITGkKmxAil6upW Xa4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SGq47a75; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk30-20020a1709077f9e00b0077a0f6cbfa0si2639596ejc.114.2022.10.07.06.04.15; Fri, 07 Oct 2022 06:04:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SGq47a75; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-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 S229892AbiJGNDo (ORCPT + 99 others); Fri, 7 Oct 2022 09:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiJGNDW (ORCPT ); Fri, 7 Oct 2022 09:03:22 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD193748D6 for ; Fri, 7 Oct 2022 06:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665147791; 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=/Wu7zkDvh9Y7YMMhVMehTcCNW6maACM0iCCQHnBi68g=; b=SGq47a75Zlw/jWHNEoptaPYL1iY9zRewXe/Z8UwPtU0JytoxfSzlxARDksQ1LLQieg9eh9 5Dr/51iAHzN455vPna9eBOKoMrKLlDnOS5BRgzPb0DsR3D17qnGpCroaldQd/m3guTawST lruWtjOsVvCbvSgNRY31mQ/rGnpiwDg= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-48-UwWC6JIGO2eQOMmmG_pBPA-1; Fri, 07 Oct 2022 09:03:09 -0400 X-MC-Unique: UwWC6JIGO2eQOMmmG_pBPA-1 Received: by mail-wr1-f72.google.com with SMTP id n8-20020adf8b08000000b0022e4d3dc8d2so1396185wra.7 for ; Fri, 07 Oct 2022 06:03:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/Wu7zkDvh9Y7YMMhVMehTcCNW6maACM0iCCQHnBi68g=; b=ve2+5rue4c83QCD7fuQ3OTrKy4P0VdhV8l7JesvhiqzPZjjUSaVs34qKyIlXsYF2QT nSm+Vu3A+OzwrWsXuNu88DdsKv3ihnrbgmXGM9m9gfh9dWgBii3t8nmzoyoNNec0Efly cBe7GeSV5ihlQyYGFhHOsHvCM+gefzmmGTDo91cE3AQcZ47Pz/0tJYpM7DBRegzJfDsS hGzsM3rtjnpU+fZjOI0tW+SmevlfmDFNMZ4CRg+nh1d6rnI170RhUnFFuL3zQraNPVJR gnMVf3bxDoacHGMIMGQaIIETSwSvAJWeuLbSdJoL0KZwwiesSk6Jl3ue39JMQvAj5dbb bgyA== X-Gm-Message-State: ACrzQf2FLbPo9uiYdSgYk2s9SGYudLJ8lH/ausrCJSDbq4Wqd0m0AUTo gqsGOwKeDmGub66/dd0+6cKkNIc/Agl/0agwnvQXVir8MyuzTIUAKArTKau7HfgeJ7ySQB8uPBj XyxSrRWxeNu43IZJiPQ7r4VEpzN/I X-Received: by 2002:a5d:6f17:0:b0:22e:33e7:6f6c with SMTP id ay23-20020a5d6f17000000b0022e33e76f6cmr3084360wrb.201.1665147788492; Fri, 07 Oct 2022 06:03:08 -0700 (PDT) X-Received: by 2002:a5d:6f17:0:b0:22e:33e7:6f6c with SMTP id ay23-20020a5d6f17000000b0022e33e76f6cmr3084320wrb.201.1665147788101; Fri, 07 Oct 2022 06:03:08 -0700 (PDT) Received: from redhat.com ([2.55.183.131]) by smtp.gmail.com with ESMTPSA id f10-20020a7bcd0a000000b003a5c999cd1asm2822460wmj.14.2022.10.07.06.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 06:03:07 -0700 (PDT) Date: Fri, 7 Oct 2022 09:03:02 -0400 From: "Michael S. Tsirkin" To: Igor Skalkin Cc: Jason Wang , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, mgo@opensynergy.com Subject: Re: [PATCH] virtio_bt: Fix alignment in configuration struct Message-ID: <20221007090223-mutt-send-email-mst@kernel.org> References: <20220807221152.38948-1-Igor.Skalkin@opensynergy.com> <20220807185846-mutt-send-email-mst@kernel.org> <02222fcb-eaba-617a-c51c-f939678e3d74@opensynergy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02222fcb-eaba-617a-c51c-f939678e3d74@opensynergy.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Mon, Aug 08, 2022 at 02:04:43PM +0200, Igor Skalkin wrote: > On 8/8/22 01:00, Michael S. Tsirkin wrote: > > On Mon, Aug 08, 2022 at 12:11:52AM +0200, Igor Skalkin wrote: > > According to specification [1], "For the device-specific configuration > space, the driver MUST use 8 bit wide accesses for 8 bit wide fields, > 16 bit wide and aligned accesses for 16 bit wide fields and 32 bit wide > and aligned accesses for 32 and 64 bit wide fields.". > > Current version of the configuration structure: > > struct virtio_bt_config { > __u8 type; > __u16 vendor; > __u16 msft_opcode; > } __attribute__((packed)); > > has both 16bit fields non-aligned. > > This commit fixes it. > > [1] https://ddec1-0-en-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fdocs.oasis%2dopen.org%2fvirtio%2fvirtio%2fv1.1%2fvirtio%2dv1.1.pdf&umid=d1786ace-e8ea-40e8-9665-96c0949174e5&auth=53c7c7de28b92dfd96e93d9dd61a23e634d2fbec-39b15885ceebe9fda9357320aec1ccbac416a470 > > Signed-off-by: Igor Skalkin > > This is all true enough, but the problem is > 1. changing uapi like this can't be done, will break userspace > 2. the driver has more issues and no one seems to want to > maintain it. > I posted a patch "Bluetooth: virtio_bt: mark broken" and intend > to merge it for this release. > > This is very sad. We already use this driver in our projects. Ping. If we still have no maintainer I'm marking it broken, users should at least be warned. > Our virtio bluetooth device has two backends - HCI_USER socket backend for one > platform and uart backend for the other, and works well (after applying your > "[PATCH] Bluetooth: virtio_bt: fix device remove") patch, so this "device > removal" problem can probably be considered solved . > We could help with the rest of the problems you listed that can be solved > (specification, QEMU support). > And the only problem that is difficult to solve (because of the need to change > UAPI header files) is just this one with unaligned configuration fields. > At the moment, it does not reproduce, because without VIRTIO_BT_F_VND_HCI > (Indicates vendor command support) feature negotiated, the driver does not > read the non-aligned configuration fields. > > So, what would you advise us to do? Continuing to use the "marked broken" > driver, start writing a specification for a new from scratch, better one? > Or is there any way to bring this one back to life? > > > > --- > include/uapi/linux/virtio_bt.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/uapi/linux/virtio_bt.h b/include/uapi/linux/virtio_bt.h > index a7bd48daa9a9..adc03709cc4f 100644 > --- a/include/uapi/linux/virtio_bt.h > +++ b/include/uapi/linux/virtio_bt.h > @@ -23,9 +23,9 @@ enum virtio_bt_config_vendor { > }; > > struct virtio_bt_config { > - __u8 type; > __u16 vendor; > __u16 msft_opcode; > + __u8 type; > } __attribute__((packed)); > > #endif /* _UAPI_LINUX_VIRTIO_BT_H */ > -- > 2.34.1 > > -- > > Best regards, > > Igor Skalkin > Software Engineer > > OpenSynergy GmbH > Rotherstr. 20, 10245 Berlin > > igor.skalkin@opensynergy.com > www.opensynergy.com > > registered: Amtsgericht Charlottenburg, HRB 108616B > General Management: Rolf Morich, Stefaan Sonck Thiebaut > > > Please mind our privacy notice pursuant to Art. 13 GDPR. // Unsere Hinweise zum > Datenschutz gem. Art. 13 DSGVO finden Sie hier.