Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5890026pxb; Thu, 20 Jan 2022 06:40:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGZXzSVHUg5HVlNki8C6AheXVv3csLR69PjoEx+Yyj188iw8rQ6YStRGcJh9DbDMeW97H7 X-Received: by 2002:aa7:8642:0:b0:4be:9b5a:d4db with SMTP id a2-20020aa78642000000b004be9b5ad4dbmr36167149pfo.64.1642689624523; Thu, 20 Jan 2022 06:40:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642689624; cv=none; d=google.com; s=arc-20160816; b=vwS5e0Y95TcD1TM+dz6a843d27Cvj0xMDxvf+xsmrz8Xm0QsSGZBD4syFMAHW/Fl1v UcXilA59/dqLGRAZGfAjIg0j420I3oePin/T3s/T4ZejLmuOVBjJLf3jmPxlFQJnC0to 0yW7o5RZvDVRzWxLomJ5LYsHVQNSbKOrPj8s8o454piEilCHQqkYATCezyc1Q/l7ZH9Q 35plkyg89AVic4wrAzxl7M4toPRlCpCzjhX/Jb2wrXfs70IpqhncB3aGWW19BrMSMCdX HAR/oBQMaUgjBT/c4mAR8PN2XcvxN7M94bgs3C1TKyFbBVP86GENu/Hj/bsWuw/SzWjN irWw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=d0YPpE+94B6yWE7TJv4rcwracfeu9W68cFUmQp0rBtk=; b=Cisk1tJskl+VCrEOfG6Gosnx8tTFThD3FQOWabfYt6AI4xUwWQDwxmlYhbtz1Agzjo eYvOxDdY00r6jc0veA2cCCBGsyP0j7LeuXLX4CtbwJ8Gu6Wm4NXP0IznhovmZFZmTqpu mqOdzAIyF+U3fmVtFfDTxkZfIRzIt1C8ijfDv6MqglDkdS5E8SYJdFs4Bv5j3j9iCnDO GRpgP66qGA+OA/9R2GuDypePV3Bvf0KKlBivLchcO9Ml7XCiqC04iKqTKMxKOUSRqm73 dt+nL7hHd65uBiKccTJeL16WIf1WkUYbtkV2cG9LDVjPwmSwFZ+eWJ1eYO+3CRktYONg 0+1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g7uiJfW7; 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 k6si3609614pff.137.2022.01.20.06.40.12; Thu, 20 Jan 2022 06:40:24 -0800 (PST) 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=g7uiJfW7; 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 S1345973AbiARPn4 (ORCPT + 99 others); Tue, 18 Jan 2022 10:43:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40000 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345950AbiARPnz (ORCPT ); Tue, 18 Jan 2022 10:43:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642520630; 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=d0YPpE+94B6yWE7TJv4rcwracfeu9W68cFUmQp0rBtk=; b=g7uiJfW7u1/M60YSZoTIYJWbR4jjWmq7YCbuKiwvvF0w1LvF/ngcpB56eGw5D7LKWuH11f R37CAntgny7GhXYYVZUcY/2SoWm13m5Y90AN1K1v+zqmFP3qsN3EBm+LtQRT4QjCYUSfuE 045qwLd4UR+sHeMnSppnGeNJr1hwAV0= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-219-12RjRnhkPeaDBYcCLStdmg-1; Tue, 18 Jan 2022 10:43:47 -0500 X-MC-Unique: 12RjRnhkPeaDBYcCLStdmg-1 Received: by mail-ed1-f70.google.com with SMTP id l14-20020aa7cace000000b003f7f8e1cbbdso17331386edt.20 for ; Tue, 18 Jan 2022 07:43:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=d0YPpE+94B6yWE7TJv4rcwracfeu9W68cFUmQp0rBtk=; b=a7dIGQMLtQz8GY7TtVTduOT7LjxG5jLZ7xErHwp1VT3gTdU+z/7g/dxDKfGmghvr51 bBbELx07h7DWcGUj9l+crbzUGBuovREgtKnLrCjL0PIpN76AgyY8VMlHgpSW62Mc2WwF fq5m0cDuB3UxKh7NKnDYQxsDTO210VwtWe+NOyWIBBvHR1/VRG58X7VFgM81UZKXhBNN PIZuFq/rBAkckUHGmmV+3/wURm+gFXPnacU1U6ZEax4xba0B6JB4SNVS7y3hYGL7lQdc yutlr9j9QY5qo4LbEoA9ICw0zYNzam0/thwctmgJE3wkGO/eFWHm/nKL3d8HFRT360rE 1uxQ== X-Gm-Message-State: AOAM533r8lJFrqp43HotbfZWjv85d8f2GyBj/zRrY1n6ufaNB4g/OD0i 0mjql+HSvQLHN/W06RAvzsPiMUhc0I1HGb60q07YaHe5W5JoIzaFHqQZuti/0c5Mag9j8oigqaY g4KDffzUtBLAB9zQDuFXTJa+0 X-Received: by 2002:a05:6402:291b:: with SMTP id ee27mr18848547edb.363.1642520623263; Tue, 18 Jan 2022 07:43:43 -0800 (PST) X-Received: by 2002:a05:6402:291b:: with SMTP id ee27mr18848524edb.363.1642520623022; Tue, 18 Jan 2022 07:43:43 -0800 (PST) Received: from redhat.com ([2.55.154.241]) by smtp.gmail.com with ESMTPSA id hs32sm5459700ejc.180.2022.01.18.07.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 07:43:42 -0800 (PST) Date: Tue, 18 Jan 2022 10:43:38 -0500 From: "Michael S. Tsirkin" To: Cornelia Huck Cc: Jason Wang , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Halil Pasic , virtualization@lists.linux-foundation.org Subject: Re: [PATCH] virtio: acknowledge all features before access Message-ID: <20220118104318-mutt-send-email-mst@kernel.org> References: <20220114200744.150325-1-mst@redhat.com> <20220117032429-mutt-send-email-mst@kernel.org> <87mtjuv8od.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87mtjuv8od.fsf@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 17, 2022 at 01:38:42PM +0100, Cornelia Huck wrote: > On Mon, Jan 17 2022, "Michael S. Tsirkin" wrote: > > > On Mon, Jan 17, 2022 at 02:31:49PM +0800, Jason Wang wrote: > >> > >> 在 2022/1/15 上午4:09, Michael S. Tsirkin 写道: > >> > @@ -495,6 +494,10 @@ int virtio_device_restore(struct virtio_device *dev) > >> > /* We have a driver! */ > >> > virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER); > >> > + ret = dev->config->finalize_features(dev); > >> > + if (ret) > >> > + goto err; > >> > >> > >> Is this part of code related? > >> > >> Thanks > >> > > > > Yes. virtio_finalize_features no longer calls dev->config->finalize_features. > > > > I think the dev->config->finalize_features callback is actually > > a misnomer now, it just sends the features to device, > > finalize is FEATURES_OK. Renaming that is a bigger > > patch though, and I'd like this one to be cherry-pickable > > to stable. > > Do we want to add a comment before the calls to ->finalize_features() > (/* write features to device */) and adapt the comment in virtio_ring.h? > Should still be stable-friendly, and giving the callback a better name > can be a follow-up patch. Sorry which comment in virtio_ring.h? Could not find anything. > > > >> > + > >> > ret = virtio_finalize_features(dev); > >> > if (ret) > >> > goto err;