From patchwork Tue Mar 6 20:52:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Pisa X-Patchwork-Id: 10262995 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F23FC602BD for ; Tue, 6 Mar 2018 21:21:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEBF12916A for ; Tue, 6 Mar 2018 21:21:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE82D291AC; Tue, 6 Mar 2018 21:21:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A45352916A for ; Tue, 6 Mar 2018 21:21:08 +0000 (UTC) Received: from localhost ([::1]:58288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etK1D-0003mw-DD for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Mar 2018 16:21:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etJZL-0003JN-NH for qemu-devel@nongnu.org; Tue, 06 Mar 2018 15:52:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etJZH-0007fa-Qw for qemu-devel@nongnu.org; Tue, 06 Mar 2018 15:52:19 -0500 Received: from smtp8.web4u.cz ([81.91.87.88]:39904 helo=mx-8.mail.web4u.cz) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1etJZH-0007bp-HY for qemu-devel@nongnu.org; Tue, 06 Mar 2018 15:52:15 -0500 Received: from mx-8.mail.web4u.cz (localhost [127.0.0.1]) by mx-8.mail.web4u.cz (Postfix) with ESMTP id F13231FF4F0; Tue, 6 Mar 2018 21:52:08 +0100 (CET) Received: from baree.pikron.com (unknown [89.102.4.32]) (Authenticated sender: ppisa@pikron.com) by mx-8.mail.web4u.cz (Postfix) with ESMTPA id C3DD2200B2B; Tue, 6 Mar 2018 21:52:08 +0100 (CET) From: Pavel Pisa To: Thomas Huth , Deniz Eren , Paolo Bonzini Date: Tue, 6 Mar 2018 21:52:08 +0100 User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748) References: <48c4af3c240286a89fc5fdbcaa254ea386c979b9.1515960078.git.pisa@cmp.felk.cvut.cz> In-Reply-To: X-KMail-QuotePrefix: > MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201803062152.08551.pisa@cmp.felk.cvut.cz> X-W4U-Auth: c9608d683888129f9724858317ae86edf758fb7f X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 81.91.87.88 Subject: Re: [Qemu-devel] [PATCH V4 4/7] CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Oliver Hartkopp , qemu-devel@nongnu.org, Oleksij Rempel , Konrad Frederic , Jan Kiszka , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hello Thomas, thanks for report but I at this time I am and can be some time in condition which does not allow me to access e-mail and normal work On Tuesday 06 of March 2018 16:29:19 Thomas Huth wrote: > On 14.01.2018 21:14, pisa@cmp.felk.cvut.cz wrote: > > From: Pavel Pisa > > > > Signed-off-by: Pavel Pisa > > --- > > default-configs/pci.mak | 1 + > > hw/can/Makefile.objs | 1 + > > hw/can/can_kvaser_pci.c | 375 > > ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 377 > > insertions(+) > > create mode 100644 hw/can/can_kvaser_pci.c > > Hi, > > the kvaser_pci device introduced a new way to crash QEMU, e.g.: > > mips64el-softmmu/qemu-system-mips64el -M malta,accel=qtest \ > -device kvaser_pci > > Program received signal SIGSEGV, Segmentation fault. > 0x0000555555a6e2ec in can_bus_insert_client (bus=0x0, > client=client@entry=0x5555570c4018) at > /home/thuth/devel/qemu/net/can/can_core.c:50 > 50 QTAILQ_INSERT_TAIL(&bus->clients, client, next); The reason is that parameters canbus0 and canbus1 are required. -object can-bus,id=canbus0 \ -device kvaser_pci,canbus0=canbus0 This could be be fast fix but plead somebody else to send regular patch. My personal opinion is to create bus on Best wishes, Pavel Pisa --- a/net/can/can_host.c +++ b/net/can/can_host.c @@ -57,6 +57,10 @@ static void can_host_connect(CanHostState *ch, Error **errp) return; } + if (ch->bus_client == NULL) { + error_setg(errp, "bus is not specified for given device."); + return; + } can_bus_insert_client(ch->bus, &ch->bus_client); }