Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2366131ioo; Sat, 28 May 2022 11:25:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2hY4cHlmglrqTYd/TG8LZ79miMf41Rrth4fZn2mHcTXGwq2r06DsBvG/2HP+ShUsCEMPS X-Received: by 2002:a17:90b:4f91:b0:1cd:3a73:3a5d with SMTP id qe17-20020a17090b4f9100b001cd3a733a5dmr14542762pjb.98.1653762349038; Sat, 28 May 2022 11:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653762349; cv=none; d=google.com; s=arc-20160816; b=VqKQ4fyCJw7+21tBP824wq9KfvuDm4UbEKlJkx/uPbH+OQYrrDdleOp5/kApnf3HWq HzMLSvthTBYCY9OYCMFQi9xMSj7IeDzTxwxzrLl+LaE70s9Gj6r1EVb6S9XATFJYdHQE ixsB4tmCkXKqWi714rHtBHWiB7h/sS7c25LgHoD1spnuckm/2s2/m4o0iKYWxD4kZkT7 MiclFjBT6yGOeCnQXEiKXNmDzZQrvDaQoEBcv6yTFWzYAFj49JOI+Q2j3I2qB6z1TKiy +7vy7oqXfHarmwr2VHjWqvxanhQBUVpRDka9OwOhULdSWkqnyLldWxya0qNekoj4Lhrr wEow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:cc:to:from:date:subject :message-id; bh=OUdKB8+QDOPUz2m7XpAd8beFvdW864BSYLtpVxwhbBQ=; b=qeavvXsmVlAAMVJ2m6jqgpM/ttrfca/km7cM2z2IyHEn9AsSPiDpWUUoyy+60zYaJf iC4GjQOacuMqaw4zHX777oa9l+CgFQa0ow+0RMGZOLcCW2q1BEHCqPlMpOXW7hwqGbob 73gIZw6p8q2CcGvsZSj0szX5R+W+36btIlGi9rYMJSOhiJkbW5S81GDSo0gOkKtrxF5G PCj4X8t6oYtmwbu7qQvXK5PvTdDmpXytMfsPNenR+zfdgelCgKSO7Ak9lOF2kYPgUR2Q u9OFgVoSzLZ9mDRk9ex5/Dn0xqM8Nzx+UisNfGEOgdpVm/AFbyD+ukwQjKFCgVCnoc7w iuJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x8-20020a637c08000000b003fa34f037f9si10534673pgc.436.2022.05.28.11.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 11:25:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8B4A118361; Sat, 28 May 2022 11:25:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229510AbiE0Htx (ORCPT + 99 others); Fri, 27 May 2022 03:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348130AbiE0Htu (ORCPT ); Fri, 27 May 2022 03:49:50 -0400 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F083FC4E1; Fri, 27 May 2022 00:49:47 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R541e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=xuanzhuo@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0VEW9IBM_1653637784; Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0VEW9IBM_1653637784) by smtp.aliyun-inc.com(127.0.0.1); Fri, 27 May 2022 15:49:44 +0800 Message-ID: <1653637777.3783245-8-xuanzhuo@linux.alibaba.com> Subject: Re: [PATCH V6 9/9] virtio: use WARN_ON() to warning illegal status value Date: Fri, 27 May 2022 15:49:37 +0800 From: Xuan Zhuo To: Jason Wang Cc: tglx@linutronix.de, peterz@infradead.org, paulmck@kernel.org, maz@kernel.org, pasic@linux.ibm.com, cohuck@redhat.com, eperezma@redhat.com, lulu@redhat.com, sgarzare@redhat.com, Vineeth Vijayan , Peter Oberparleiter , linux-s390@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20220527060120.20964-1-jasowang@redhat.com> <20220527060120.20964-10-jasowang@redhat.com> In-Reply-To: <20220527060120.20964-10-jasowang@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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-kernel@vger.kernel.org On Fri, 27 May 2022 14:01:20 +0800, Jason Wang wrote: > We used to use BUG_ON() in virtio_device_ready() to detect illegal > status value, this seems sub-optimal since the value is under the > control of the device. Switch to use WARN_ON() instead. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Cc: Vineeth Vijayan > Cc: Peter Oberparleiter > Cc: linux-s390@vger.kernel.org > Signed-off-by: Jason Wang Reviewed-by: Xuan Zhuo > --- > include/linux/virtio_config.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h > index d4edfd7d91bb..9a36051ceb76 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -255,7 +255,7 @@ void virtio_device_ready(struct virtio_device *dev) > { > unsigned status = dev->config->get_status(dev); > > - BUG_ON(status & VIRTIO_CONFIG_S_DRIVER_OK); > + WARN_ON(status & VIRTIO_CONFIG_S_DRIVER_OK); > > /* > * The virtio_synchronize_cbs() makes sure vring_interrupt() > -- > 2.25.1 >