From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0FCD221729; Wed, 30 Apr 2025 22:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746050764; cv=none; b=RkNYwKwbFsVg2zEfS+eQ3L61EPJ4FxKe02lgnfFCZOkcqqUvlpzuJznn3FpFyAyAYOJEKNjvIM2dxIBgR2Th2VoIz+QA1+ymQr2k1CuawwduRlJnDqDpjXZ9eLopjZkxw7uuPaNG+quQxmkJwTlG9EjX7NozeMDZj3nfX0YkRX0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746050764; c=relaxed/simple; bh=5fuitnncfD5tDUPddDF+UDVEs5aeUDwBqWLUYZxf27Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=I5QqKK5H1dBAj3wAUhdQJLw3d7yu/4wB980ENk1GyjBvlEddWRNYSs7b0BEYWqVGfGbAbNIo06/N4VqyxZiv5cXe5Wr+SeD3weOL3Sgfqarf4tKAoATB6j1rFTFzd8QbB9QCxfFXAtbVEOs5BfdFgj+DRNN8/oTfdvb25E6tTKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxonhyperv.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linuxonhyperv.com header.i=@linuxonhyperv.com header.b=iImSj47e; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxonhyperv.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxonhyperv.com header.i=@linuxonhyperv.com header.b="iImSj47e" Received: by linux.microsoft.com (Postfix, from userid 1202) id 86A98204E7FE; Wed, 30 Apr 2025 15:06:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 86A98204E7FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1746050762; bh=cEirtZm/SmFjzm0Vy14RfmaUhYtp12qkUzkZo1lRLGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iImSj47e07xsBznoeQZejw+4P9PkzBztTIYHqH5HzOisxe8kF32Im5Zu5RPLNfmAe N3xgl/l7sXhWbrUKmJxwd4csshn+X7AMecSc+A8liwJXMf2Ye83MdsnEUwPFfU529I 7fJr1M+maMSvsMIPJx9QQdclIWboWJXu0CHDwZkk= From: longli@linuxonhyperv.com To: "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Greg Kroah-Hartman , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Long Li , stable@vger.kernel.org Subject: [Patch v2 3/4] uio_hv_generic: Adjust ring size according to system page alignment Date: Wed, 30 Apr 2025 15:05:57 -0700 Message-Id: <1746050758-6829-4-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1746050758-6829-1-git-send-email-longli@linuxonhyperv.com> References: <1746050758-6829-1-git-send-email-longli@linuxonhyperv.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Long Li Following the ring header, the ring data should align to system page boundary. Adjust the size if necessary. Cc: stable@vger.kernel.org Fixes: 95096f2fbd10 ("uio-hv-generic: new userspace i/o driver for VMBus") Signed-off-by: Long Li --- drivers/uio/uio_hv_generic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c index 08385b04c4ab..dfc5f0e1a254 100644 --- a/drivers/uio/uio_hv_generic.c +++ b/drivers/uio/uio_hv_generic.c @@ -256,6 +256,12 @@ hv_uio_probe(struct hv_device *dev, if (!ring_size) ring_size = SZ_2M; + /* + * Adjust ring size if necessary to have the ring data region page + * aligned + */ + ring_size = VMBUS_RING_SIZE(ring_size); + pdata = devm_kzalloc(&dev->device, sizeof(*pdata), GFP_KERNEL); if (!pdata) return -ENOMEM; -- 2.34.1