From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E61CA270ED4 for ; Wed, 30 Jul 2025 09:29:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753867800; cv=none; b=qHGuhQrtbSLWvtVYpB3NUxeHW5WDlxA0N6kuNQPNya6hjT3z3YlPBAb6VJ2f+Rc7vCr3/jPV3MWSawF0ZmDtzBouh+1V8Mz0ccqZ4/KW9LEmrjWOIHgdkAqi+GD59wUSxSTvm9ZXKBZuRdDvi4l35475l9udqci8sMfIywggrSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753867800; c=relaxed/simple; bh=fnvRP+SViXyCbSMzmsrKWpJn9OYHrE70YQgzPaCywJA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=WaH/6n6C1LHPxICACmJyrSKKnMy/ORbfczVfOGKpXTLjb38/q1OHx0oVo7Bz3i0Kr8rWxSqPaXBSpYPvIsmKQgBQWw5FX5gMAcirGkAQQ2DJwKLaiODJahovFBf2f6+oyBwZQz6lXosFXKklhr+zg7ItrG3mgqXLMQxHOEZMxo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=m8JqsNdp; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="m8JqsNdp" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-b31d489a76dso6672240a12.1 for ; Wed, 30 Jul 2025 02:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1753867797; x=1754472597; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=L0POlGKbEX0EvHYDWI2NptB2rFaQwWq9w/pBl23x/4k=; b=m8JqsNdpmNjEiQDZlPQYPmq10IeFALBuw6Cqqxxd5JCEVEc5XxrGhS5RiJm5CNuot7 SJgEzx0BGd8lrtdO2/I75RCNyk5Su7htVs99clauIY5z7tg/+Mbp0Ml5WfHSqX+Dz7sM aa6gd8ty80jHXsZ4it3QMuMzSdmRbcAogtBCpC+TtE8Wp4EPl4i43AwVO64N17XLFIGb mpq/eRUjpHLefY/8DCiM/zkNzf5Mq5GfiQ1C4PTw71XwmJp953UGhTJeRTKhiYPaMwfT 4qfRAbH9ag0X7immokP4AtKtFlUZfKUJtkNaw5AHan1uMGbg/J6XxJgEHdMue6WCe80l E1IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753867797; x=1754472597; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L0POlGKbEX0EvHYDWI2NptB2rFaQwWq9w/pBl23x/4k=; b=aqn6RWk0hWKcjFsIakiY2yM4v4GGRRtdpXogmU5rcls1CcnTMfXamrLRpiWZzjpG9n qMVNLL8Imxbr09YsQ7IOsU1TCPzgiYjPehoJYsOMFrlLYP8Ka87odpDTdxxnEJmQbBPm h12aToxLx7pbB2/CTDZCix7BxJSKSsTiO5xX4YMkewSDnZbuT7EAmm5K5WQkyC8vY4ex aZHEzvhCuWgV8nS6E6n5QBMh1BCUuHSoVW/oNNNnkgqxu/x0MYupLFr6gqwSSvwWI87S LxUXHeUpVan0HuhPy6AYiRn/ekJFschUJVpJl/TJH7OfDwgseIptAnloxVnTIq+A+FUM B57Q== X-Forwarded-Encrypted: i=1; AJvYcCW5r2IzCSYm+4O34CZDzEmTHN9GjVHdTLSfy/u50BYMmB/dfEV60baFi2feQAUIQEJhoT8JZtG+Adgi@vger.kernel.org X-Gm-Message-State: AOJu0Yy/6Afk1j/XifmzND5xvfnssMyvMvwtcj+cQnYfpzHRd9kHVqzD E9h6ALftkGwX1Yn4DmxaRJ4KFnUUBRSTPbTvBTijwPBAg9yUeHDAUOP5gnvEW/s/6yw= X-Gm-Gg: ASbGncvFczafk/MAk/rus0jknUQsteedVNv5w2o3dFoffhAwVSKtc6l/iWwPH7TYB5A W/XlCI/HRlKkZ7F7pkFC59Z3ySnuyxP2Kt+8NkwYgXGKkQMeCMG5lW3Ux4FFt8lT2NSRHB00tmL FNU4gv5lq8g9qZ6UaaDLMNo97nl+AwETbZHWENdFgMR30+EsEQYpbt0PKzodzDg9v3nSgcwD5xw VfCac+Z14atUTiLb6PtXsGLrmXlhWYe5rRGM9YgagRUtWOLkLmsfFsTWaC8NRWAoRqNEfPa41A/ lyJtdu53lgLXpiO5bWL9HOLxGCEA0TG605JwBUZNkBHVW/HrQ+fZo/FEvamNSmfTQEs0NLL82a7 +1Ux0ZaP9L25TZlcAvWfa4CQ= X-Google-Smtp-Source: AGHT+IF4uc5aZmco6mwIQFVn7igbRT3lJPHP6Dmmwr2upZelWkrrgq0JOAt0HEgC+nPLPHXlqWICLw== X-Received: by 2002:a17:90b:5103:b0:313:f6fa:5bb5 with SMTP id 98e67ed59e1d1-31f5de54a99mr4185193a91.18.1753867797096; Wed, 30 Jul 2025 02:29:57 -0700 (PDT) Received: from localhost ([122.172.85.40]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-31f63ee4f42sm1477362a91.23.2025.07.30.02.29.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jul 2025 02:29:56 -0700 (PDT) From: Viresh Kumar To: linux-kernel@vger.kernel.org, =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Jason Wang , "Michael S. Tsirkin" , Rob Herring , Saravana Kannan , Viresh Kumar , Xuan Zhuo Cc: Arnd Bergmann , Vincent Guittot , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Bill Mills , devicetree@vger.kernel.org, virtualization@lists.linux.dev, Sudeep Holla , Bertrand Marquis , "Edgar E . Iglesias" , Arnaud Pouliquen , Krzysztof Kozlowski , Conor Dooley Subject: [RFC PATCH 0/6] virtio: Add support for Virtio message transport Date: Wed, 30 Jul 2025 14:59:29 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello, This RFC series introduces support for a new Virtio transport type: "virtio-msg", as proposed in [1]. Unlike existing transport types like virtio-mmio or virtio-pci, which rely on memory-mapped registers, virtio-msg implements transport operations via structured messages. Those messages can be transported through different mechanisms such as mailboxes, shared memory based FIFO or specific protocols such as FF-A on Arm. This series includes: - Core virtio-msg transport support. - Two message transport bus implementations: - virtio-msg-ffa: based on ARM's Firmware Framework for Arm (FF-A). - virtio-msg-loopback: a loopback device for testing and validation. The code is available here for reference: [2] and virtio-msg loopback and FF-A test setups are explained here: [3] and [4]. This series is based on v6.16 and depends on commit [5]. ### Memory Mapping and Reserved Memory Usage The first two patches enhance the reserved-memory subsystem to support attaching struct device`s that do not originate from DT nodes — essential for virtual or dynamically discovered devices like the FF-A or loopback buses. This reserved-memory region enables: - Restricting all DMA-coherent and streaming DMA memory to a controlled range. - Allowing the remote endpoint to pre-map this memory, reducing runtime overhead. - Preventing unintentional data leaks, since memory is typically shared at page granularity. - For the loopback bus, it restricts the portion of kernel memory that can be mapped into userspace, improving safety. Device association with reserved-memory regions is based on DT node naming conventions, such as vmsglb@ or vmsgffa@, similar to the remoteproc framework’s approach. Feedback on the design, API, and approach is welcome. -- Viresh [1] https://lore.kernel.org/all/20250620224426.3923880-2-bill.mills@linaro.org/ [2] git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/linux.git virtio/msg-rfc-v1 [3] https://linaro.atlassian.net/wiki/spaces/HVAC/pages/30104092673 [4] https://linaro.atlassian.net/wiki/spaces/HVAC/pages/29657792513 [5] From linux-next: 5be53630b4f0 virtio-mmio: Remove virtqueue list from mmio device Viresh Kumar (6): of: reserved-memory: Add reserved_mem_device_init() of: reserved-memory: Add of_reserved_mem_lookup_by_name virtio: Add support for virtio-msg transport virtio-msg: Add optional userspace interface for message I/O virtio-msg: Add support for FF-A (Firmware Framework for Arm) bus virtio-msg: Add support for loopback bus MAINTAINERS | 7 + drivers/of/of_reserved_mem.c | 91 +++- drivers/virtio/Kconfig | 34 ++ drivers/virtio/Makefile | 5 + drivers/virtio/virtio_msg.c | 655 +++++++++++++++++++++++++++ drivers/virtio/virtio_msg_ffa.c | 505 +++++++++++++++++++++ drivers/virtio/virtio_msg_internal.h | 88 ++++ drivers/virtio/virtio_msg_loopback.c | 323 +++++++++++++ drivers/virtio/virtio_msg_user.c | 140 ++++++ include/linux/of_reserved_mem.h | 13 + include/uapi/linux/virtio_msg.h | 213 +++++++++ include/uapi/linux/virtio_msg_ffa.h | 94 ++++ include/uapi/linux/virtio_msg_lb.h | 22 + 13 files changed, 2166 insertions(+), 24 deletions(-) create mode 100644 drivers/virtio/virtio_msg.c create mode 100644 drivers/virtio/virtio_msg_ffa.c create mode 100644 drivers/virtio/virtio_msg_internal.h create mode 100644 drivers/virtio/virtio_msg_loopback.c create mode 100644 drivers/virtio/virtio_msg_user.c create mode 100644 include/uapi/linux/virtio_msg.h create mode 100644 include/uapi/linux/virtio_msg_ffa.h create mode 100644 include/uapi/linux/virtio_msg_lb.h -- 2.31.1.272.g89b43f80a514