From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 1C3C33793DE for ; Wed, 29 Apr 2026 09:52:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777456378; cv=none; b=BvCDFQj4W/Msk6RZCC4OHiFr7bQ7sTQd04W+k8fO+PlTjH4KM9r45KvjVCDhNqUeJQCXYFS9ReTYaz5Tvb4nwfQWrEdXwQQTY061/nhulaT4pvjCKFdrPxauu77VQT5OL2fV460oEQ3sYA8ErhgCta93D5SxvFIgLQCjyGxdsmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777456378; c=relaxed/simple; bh=iYiw0CmhW1uNO52r6h06DT39V6K9yOrh40nBJUPbNT4=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=YauMR1rwf++avK9mDzfPoA49C6WI/mJO9DS/ss2tdE0PYuravktLmwBLRffatdzRU5paH7QjxxGkast/y98FUvGF3r+kbQB6/gKSyhVzSp/tGBy7pV/G4jW6jYSYF4XymhSLMe6udKAMTc9F+rpwu7pEoAKHK5QAU8dsyPbKu+E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=MjILmRL+; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MjILmRL+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777456375; 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; bh=tEgMhSGkxaVa76ywFFeR7i2nWi7ewgciMk8C9+6QmjI=; b=MjILmRL+nm79B1kxU4NIIdPmh9JFtjxrLEFN8SCrnMjM4zqXuqDoJggiz2NE5khxE+P+Zb UdxUaZGbWWDVicWm+yL4/FOF7eGpQpY9vE7ss/DgQlonUFePKOpoHPgO6duOYk+rxRMBIK 5/7uFcFaQAqBiLQnCIjGhF54TJlpebQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-19-zBYbRCtwO1m14iD81uuuJA-1; Wed, 29 Apr 2026 05:52:51 -0400 X-MC-Unique: zBYbRCtwO1m14iD81uuuJA-1 X-Mimecast-MFC-AGG-ID: zBYbRCtwO1m14iD81uuuJA_1777456369 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5742D19560AE; Wed, 29 Apr 2026 09:52:48 +0000 (UTC) Received: from f43vm.redhat.corp (headnet01.pony-001.prod.iad2.dc.redhat.com [10.2.32.101]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A80FF1800345; Wed, 29 Apr 2026 09:52:43 +0000 (UTC) From: Sergio Lopez To: Chia-I Wu , Jason Wang , "Michael S. Tsirkin" , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Xuan Zhuo , linux-kernel@vger.kernel.org, Simona Vetter , Dmitry Osipenko , Thomas Zimmermann , David Airlie , Gurchetan Singh , Gerd Hoffmann , virtualization@lists.linux.dev, dri-devel@lists.freedesktop.org, Maxime Ripard , Maarten Lankhorst Cc: Sergio Lopez Subject: [PATCH v2 0/3] drm/virtio: introduce F_BLOB_ALIGNMENT support Date: Tue, 28 Apr 2026 21:44:47 +0200 Message-ID: <20260428194450.518296-1-slp@redhat.com> Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 There's an increasing number of machines supporting multiple page sizes and on these machines the host and a guest can be running, each one, with a different page size. For what pertains to virtio-gpu, this is not a problem if the page size of the guest happens to be bigger or equal than the host, but will potentially lead to failures in memory allocations and/or mappings otherwise. To deal with this, the virtio-spec was extended to introduce with the VIRTIO_GPU_F_BLOB_ALIGNMENT feature [1]. If this feature is negotiated, we must use the "blob_alignment" field in the config to ensure every CREATE_BLOB and MAP_BLOB is properly aligned before sending it to the device. We also introduce the VIRTGPU_PARAM_BLOB_ALIGNMENT parameter to allow userspace to query the alignment restrictions for blobs. This supersedes "drm/virtio: introduce the HOST_PAGE_SIZE feature" [2]. [1] https://github.com/oasis-tcs/virtio-spec/commit/f9abfd55cb663837dda1153b826216dcf4d25b84 [2] https://lkml.org/lkml/2024/7/23/438 Changes in v2: - Rebased. - Moved blob size alignment validation to verify_blob(), rejecting misaligned sizes early in the ioctl path instead of checking in virtio_gpu_cmd_resource_create_blob() and virtio_gpu_cmd_map() (Dmitry Osipenko). Sergio Lopez (3): drm/virtio: support VIRTIO_GPU_F_BLOB_ALIGNMENT drm/virtio: honor blob_alignment requirements drm/virtio: add VIRTGPU_PARAM_BLOB_ALIGNMENT to params drivers/gpu/drm/virtio/virtgpu_drv.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.h | 2 ++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 10 ++++++++++ drivers/gpu/drm/virtio/virtgpu_kms.c | 14 +++++++++++--- include/uapi/drm/virtgpu_drm.h | 1 + include/uapi/linux/virtio_gpu.h | 9 +++++++++ 6 files changed, 34 insertions(+), 3 deletions(-) -- 2.53.0