Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp255915lql; Mon, 11 Mar 2024 01:22:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+Lhg9DhzUoh9rJLS6CBnywWkWQvM7sVIEpH4szGIM7UfRgDrilIddXbG7L0qG2hNFq7m4A1+HxQboFkF5AHoRiscs1lGXRaZVLxpQEA== X-Google-Smtp-Source: AGHT+IFcVGe0yny2kE8NdG5fFai4jUdbk1+W4w9g0LMZnht6f13XwFrHJ3NL40eX3yAtQULT/P9A X-Received: by 2002:a05:6a20:1454:b0:1a0:8897:85f1 with SMTP id a20-20020a056a20145400b001a0889785f1mr6952054pzi.6.1710145358982; Mon, 11 Mar 2024 01:22:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710145358; cv=pass; d=google.com; s=arc-20160816; b=yoPZVOMyL2uzXZeRwF9npmbT4qmuN59beYR5RoSZgLyhpC6X0flPx+cHnM9GFp3GC1 8Pijvt7jJG93v1ANf449uobl3i61j4gTRAqaqfJmO0hv9Itw5wA79vuKXmrZ8IBJaGMr IGoJvJPd5gLvzrfncSw2nEqzUQYaeQgxREPKzy6jMTcxfQ7FLTJbkwZALryeQsCejkqO SHdZ7RypekKH3c14I3gDerfymtYAcsceMyRzrFFoeDohxeSA1kSyQg+XPEfr+Nle9NeZ IQ4owbFa3Q1+fAUDnEd5jScG8rKLz6JLBxea1NsXb7T0yPiPokUr+UHoyywd+x17g7Zh Qcmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=qNoNgE2K/K2kPLSrwQTYJbYYAFTH3c2G9nOR3kkuC/Q=; fh=/PwUpINlRncvVoOFP9eqdDlYcUb0Nun/Xj4MPxAw1Y4=; b=lChPtNqcZ5iEFywWXYWay3Z3dWtr3c8xKe0Mx+grc3qCW9r+TJ08W5Bip2ina0TIiJ fwMHdZu2GPpFAHYs7NxOnE9anOWd5hd272F7xIiIqiW0APQdiaHEs1BjVrlRgVSX0Hko UAunFwzA1mNw1iPxpv97nCT8X4dq8nZNqPVKjyS4DDczlGu3RLckDhvyn8PVrpmpIFLp 3L6jNjMecpUbLTKlBY9nF8HAv1w3gbqQP2WjNb/eg0t8ap/qscKBCc1WG85V3qCcKpVp kLvAKJluwlvJyUVa8a5YDqmjydXBrDUI5TjZrnXUKw3Wvn1abHSIMcNM/Q28XWNOWLyD V9Wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=c04nRhw7; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-98536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v64-20020a632f43000000b005dccf9561c0si4409917pgv.150.2024.03.11.01.22.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 01:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=c04nRhw7; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-98536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D87DCB21065 for ; Mon, 11 Mar 2024 08:22:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA9E8125B2; Mon, 11 Mar 2024 08:22:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="c04nRhw7" Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE85012B70; Mon, 11 Mar 2024 08:22:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710145341; cv=none; b=Aql8WGk3DT3Fl6l7NusKO0YNHldPx3PcLtr49Y+YXGeAhwOBjYvA914iGveNsxkCPF/rmeEhBDv6JSxklPaGyS4QUqfI5V8qQrndKayHmg5OS3af7GRTIMZEtQOMC1i9BzUlNicxUIYxQxK+fyXvwnJFhbSDa21MuTIRqBq1ZbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710145341; c=relaxed/simple; bh=aEHday/gk4ZOCk5uAe6j6ttIaEvyriVatbOjxCBx3f8=; h=From:To:Cc:Subject:Date:Message-Id; b=awT3U0utkIoKxzeuIUD797Lzfu8xM2mJsc31VZjaB34Gc0eGxQAKpeDiTQkwJ5VZKWHwtIOv7+kp2ens46knlJxAVQY403krjBMmDakhWwMZcTpXxxk61xAAd/T0b+MG02zSvMgfG8vL6hd5QjszYXxWGhcEomd4oCcPKq3uIIo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=c04nRhw7; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1710145336; h=From:To:Subject:Date:Message-Id; bh=qNoNgE2K/K2kPLSrwQTYJbYYAFTH3c2G9nOR3kkuC/Q=; b=c04nRhw778VkhEBQEBb5q8zYfbrKX5akM5l/VGKf7ZSqDwKisiJdzuV7L7QmM1GsTUNIl7HZZZwgDzkN9gQUih9YPKbWAalt/d7XOqBdk3KRTmBUzeS218R86Cp2m/tGoS3ZDc6DTB8DhY8u3ohntolFJrDAxIBB2ntWlXhU6Bc= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0W2Dc-HM_1710145272; Received: from localhost.localdomain(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0W2Dc-HM_1710145272) by smtp.aliyun-inc.com; Mon, 11 Mar 2024 16:22:16 +0800 From: Xianting Tian To: mst@redhat.com, jasowang@redhat.com Cc: kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Xianting Tian Subject: [PATCH] vhost: correct misleading printing information Date: Mon, 11 Mar 2024 16:21:09 +0800 Message-Id: <20240311082109.46773-1-xianting.tian@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Guest moved avail idx not used idx when we need to print log if '(vq->avail_idx - last_avail_idx) > vq->num', so fix it. Signed-off-by: Xianting Tian --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 045f666b4f12..1f3604c79394 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2515,7 +2515,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, vq->avail_idx = vhost16_to_cpu(vq, avail_idx); if (unlikely((u16)(vq->avail_idx - last_avail_idx) > vq->num)) { - vq_err(vq, "Guest moved used index from %u to %u", + vq_err(vq, "Guest moved avail index from %u to %u", last_avail_idx, vq->avail_idx); return -EFAULT; } -- 2.17.1