Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3110034pxb; Mon, 1 Nov 2021 08:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+JEDs+CUiDa0mTDNXZCWEVplopWO5M/X1LRnHTYMhrzYC6GgbGwAkrBPrAvF6D8VdIRJ5 X-Received: by 2002:a6b:e903:: with SMTP id u3mr20751851iof.36.1635779021001; Mon, 01 Nov 2021 08:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635779020; cv=none; d=google.com; s=arc-20160816; b=SFI/OIkHdscm9VA4ilEa4WAD0wgF3Nvl1a8+OxKfz9sS9Ti1a31AmRpmVF98KVGVLy hCtJPPIM7xfYLx3XPn9q5bvxyOBBrOBHLt1s7SfAg5c0359Oa21JlFJKtxeNFw4KEbOi g3NL2yaApJHmbv1T2eyW/aQ8gS7JviJx2liwRaGE/OXrs53TvYDC2X2pKEmaUaDo0BMv rqq8Q5Zyk+8axehCCSyMW66bDv6lruPYEuPVTYUFmWEC/rBvkV90mfkpHbq5nZzEumRb yZu3HKblIKqgj8868Lm624XbWsbeJP6VtiwrT7WrZcH3zqklH4JyfUJ5a/8uTuqe4/ou /jow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aV4ZtZ43VwnKsLkvPobGjH+Nu8TCZDHl/55S1ia5M+k=; b=iI9gWh2RVVCuvefK8Ofc0AIHS1Zo6XeCLinoEc+pebhVLZNd7IuF39BfBVwfYQyK/S Xhyk8qoEPR6OFU2aoNg5aPcQQdtYOSGVFS5GMxddYSEzUPfNXBt6Rxr7V6GJh1t1Gs7b 9ozzJMU44NV9bFW6Dg4Ix4UjmR6gpGHARs+EQRVzDt7/pvzWexf9Ug+ym/wImdWZD7PJ OrYtOyTxwNk4dEozgipLyl8GVmtp0Dix8xjd4sTMgq+z7+fey8rS0kWc+9XSjf6kxcSz OddAWrR507v/0GLuzGFpcojVnpg4eoXbLkBszwrKV2YsMjEHCcCCp67Ju0YMSugdcDUD 7ntQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TZcU7SXQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si22482858jaj.127.2021.11.01.08.03.23; Mon, 01 Nov 2021 08:03:40 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=TZcU7SXQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232289AbhKAPES (ORCPT + 99 others); Mon, 1 Nov 2021 11:04:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbhKAPER (ORCPT ); Mon, 1 Nov 2021 11:04:17 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D57C061714; Mon, 1 Nov 2021 08:01:44 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id k29so11362529qve.6; Mon, 01 Nov 2021 08:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aV4ZtZ43VwnKsLkvPobGjH+Nu8TCZDHl/55S1ia5M+k=; b=TZcU7SXQ8ZWXRZdvOEo4mPKuugCOTEgtIHx2GhsmzTE/f4FXu3nAr2gM4RtudQsEni G5K/U1+GHH8zQNoYMxSluGXrJM0O6hiORlhUnkOjHY3XRSVCSDtW3U3c7Y7FqM9FhUB1 ngBzAZS58Xn+OvMQLht6fQhvdJd1YJca8Z80I8+gqrXTCkTKX2gn0IPTr3FqMyARV8bd xKbJMh9IaNk9UqFPdfll9oxcZ7CMKN5PmO2IgVJJqSuErbMVmvT8+aDvmYRC/ndz5Tra tKLbGXb3lh4Kw+j0BYC6nef3jnQmm8hUXUiZ25CHdXWOHtfdRihwioMl2pz+iECECt55 0ugw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aV4ZtZ43VwnKsLkvPobGjH+Nu8TCZDHl/55S1ia5M+k=; b=0QSj3at7wxaCv8Tn1Phl+rGo+/2jth4+7sXHKEK5hodcQuOoMmBi8gcSZ9fg5/UMY3 kaNxcxKK4/O82qo+a1cydyk0ZeyRiZv8hctLTasW+qBFiDc+YOoKWqPRgHoZtRw/An0A x6mlAD1EJO5k3qQek0BRfCGDBIoQc1uJz+MdrPwBl8HJg0LeGuf4xF6OY7+7aJfRiVf5 8kPpBZsIw9J/l4PFV0ZoJtu6pPE49+fuc4gP0QzRdH9GTwab6ZNxAxw1uNjtPwhHBmMl LRxlzxxSA8YMju/tJbUG4uekBpz2n7SMKT65Xyi//sKxHnuL+UjFiz0YeUiJpShMuCuQ 96sg== X-Gm-Message-State: AOAM532Hp7Sx3dPdSulmsdq+vBckAoNbPc9GTw+ryaaiVq4cj7Knqks0 ckGaqI4dWnNK9L+6zOl5A0l0ibLYIJ8VEA== X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29317718qvc.58.1635778892866; Mon, 01 Nov 2021 08:01:32 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id d19sm9183141qty.26.2021.11.01.08.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 08:01:31 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id A8BCB27C005A; Mon, 1 Nov 2021 11:01:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 01 Nov 2021 11:01:30 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdehvddgieelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeeuohhquhhnucfh vghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrfgrthhtvg hrnhepieejhfelvddtgeduhfffueegteevleeugfekvefhueduuedugfevvefhtedvuedv necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsghoqh hunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedtieegqddu jeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfhhigihmvg drnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 Nov 2021 11:01:28 -0400 (EDT) From: Boqun Feng To: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Boqun Feng , stable@vger.kernel.org, Baihua Lu Subject: [PATCH] Drivers: hv: balloon: Use VMBUS_RING_SIZE() wrapper for dm_ring_size Date: Mon, 1 Nov 2021 23:00:26 +0800 Message-Id: <20211101150026.736124-1-boqun.feng@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Baihua reported an error when boot an ARM64 guest with PAGE_SIZE=64k and BALLOON is enabled: hv_vmbus: registering driver hv_balloon hv_vmbus: probe failed for device 1eccfd72-4b41-45ef-b73a-4a6e44c12924 (-22) The cause of this is that the ringbuffer size for hv_balloon is not adjusted with VMBUS_RING_SIZE(), which makes the size not large enough for ringbuffers on guest with PAGE_SIZE=64k. Therefore use VMBUS_RING_SIZE() to calculate the ringbuffer size. Note that the old size (20 * 1024) counts a 4k header in the total size, while VMBUS_RING_SIZE() expects the parameter as the payload size, so use 16 * 1024. Cc: # 5.15.x Reported-by: Baihua Lu Signed-off-by: Boqun Feng --- drivers/hv/hv_balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 7f11ea07d698..ca873a3b98db 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -480,7 +480,7 @@ module_param(pressure_report_delay, uint, (S_IRUGO | S_IWUSR)); MODULE_PARM_DESC(pressure_report_delay, "Delay in secs in reporting pressure"); static atomic_t trans_id = ATOMIC_INIT(0); -static int dm_ring_size = 20 * 1024; +static int dm_ring_size = VMBUS_RING_SIZE(16 * 1024); /* * Driver specific state. -- 2.33.0