From patchwork Fri Jun 14 09:31:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongji Xie X-Patchwork-Id: 10994839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68EAB14BB for ; Fri, 14 Jun 2019 09:52:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B44128355 for ; Fri, 14 Jun 2019 09:52:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 500CB283EE; Fri, 14 Jun 2019 09:52:07 +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=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F03A5282E8 for ; Fri, 14 Jun 2019 09:52:06 +0000 (UTC) Received: from localhost ([::1]:49698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbisP-0000oW-7u for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Jun 2019 05:52:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40698) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbieL-0004hV-GP for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:37:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbiZ7-0000nP-2R for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:32:09 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:44739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbiZ6-0000mw-TF for qemu-devel@nongnu.org; Fri, 14 Jun 2019 05:32:09 -0400 Received: by mail-pf1-x444.google.com with SMTP id t16so1084997pfe.11 for ; Fri, 14 Jun 2019 02:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uXimO1fIrN/suCveCkDvGhUQ6cXgmIUR+zvZ/sjAqMA=; b=JPZ2VhFsJRluFjtUxMi88kSfvo4YX+asIgRqnRZfntfVdBfPUonLJGXY8+2C6zaTj/ pu3EzrAoCZp1y/j2RkUMdpY9GYagH8UgRdLG0Nw6W/o0qELz8rTn+giJBxD4dmROZDVb maHECFWkeYHC/BzpaTD2cic/DuWnKufJlv3SGTRKJD7+Q9DDDmQG8SBo0b8wM09kK+xh FXIXUMU7FXV/tFcHCFKbqkKoPpsmLtLHUvFVAYVyHfGXrH21vdtvh9LLp93UDwLAQL+6 DkYnl6rxkbjfNCZ48SamO9i42zGAyfXoEuxvbvMb9ew58bK2WevIsmBsl2K0nfwySx1m rnAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uXimO1fIrN/suCveCkDvGhUQ6cXgmIUR+zvZ/sjAqMA=; b=JAdqxnx2EP8Wt8Hbq/7DSOQv/H7BuDdRkYzXo8MeSOJzlbaHkzSiEeKyYUXLYQxgMP I6ARETIEhXoMo1H8UwDoCBHkJzljAl2Tpx1p8QDpaPyiHfTUnOAnSs0boRLjYWvtcspG 3dAeEMIURVWfTcwbYqO4Ugy1bzt6M6xIqb9xBcqUoq+zNxgsZPi4Ea3j02N5dl8n/vmo I3yrcF4OAeK/0l0fNKYvWlzrwTz7WVOW2FOS5JXYhoXsD/cvqjS/pBLVckDLVA6T25dL PofYyyI+XFSEqbPb+RdiGnFjir4GFoCY4gGNRUwB61sh4ZLIhY0cOTtQ8JyE3kbS9z8P SWIg== X-Gm-Message-State: APjAAAW/du5q1Az/KpXEj6/P3m2A4S5pcTnSTi9eJXgokHNJD7oOPNYb 9Ntg/rMDK3s/1z+JX9tcJhY= X-Google-Smtp-Source: APXvYqw+VlBZU72y/mvqwSUeSEPehB3IAora8db+7KXnXe3oL8o2zJtQ5UsrWviP9ycV2/GXenJbtw== X-Received: by 2002:a65:510c:: with SMTP id f12mr33622507pgq.92.1560504727855; Fri, 14 Jun 2019 02:32:07 -0700 (PDT) Received: from localhost ([116.247.112.152]) by smtp.gmail.com with ESMTPSA id j8sm2134156pfi.148.2019.06.14.02.32.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 02:32:07 -0700 (PDT) From: elohimes@gmail.com X-Google-Original-From: xieyongji@baidu.com To: mst@redhat.com, groug@kaod.org Date: Fri, 14 Jun 2019 17:31:18 +0800 Message-Id: <20190614093121.5580-3-xieyongji@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190614093121.5580-1-xieyongji@baidu.com> References: <20190614093121.5580-1-xieyongji@baidu.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 Subject: [Qemu-devel] [PATCH v3 2/5] virtio: Set "start_on_kick" for legacy devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Xie Yongji , dgilbert@redhat.com, ehabkost@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Xie Yongji Besides virtio 1.0 transitional devices, we should also set "start_on_kick" flag for legacy devices (virtio 0.9). Signed-off-by: Xie Yongji Reviewed-by: Greg Kurz --- hw/virtio/virtio.c | 6 ++---- include/hw/virtio/virtio.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 19062fbb96..473881e9ec 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1212,8 +1212,7 @@ void virtio_reset(void *opaque) k->reset(vdev); } - vdev->start_on_kick = (virtio_host_has_feature(vdev, VIRTIO_F_VERSION_1) && - !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)); + vdev->start_on_kick = !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1); vdev->started = false; vdev->broken = false; vdev->guest_features = 0; @@ -2325,8 +2324,7 @@ void virtio_init(VirtIODevice *vdev, const char *name, g_malloc0(sizeof(*vdev->vector_queues) * nvectors); } - vdev->start_on_kick = (virtio_host_has_feature(vdev, VIRTIO_F_VERSION_1) && - !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)); + vdev->start_on_kick = !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1); vdev->started = false; vdev->device_id = device_id; vdev->status = 0; diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 15d5366939..b189788cb2 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -107,7 +107,7 @@ struct VirtIODevice bool broken; /* device in invalid state, needs reset */ bool use_started; bool started; - bool start_on_kick; /* virtio 1.0 transitional devices support that */ + bool start_on_kick; /* when virtio 1.0 feature has not been negotiated */ VMChangeStateEntry *vmstate; char *bus_name; uint8_t device_endian;