I2C Multi-master and Controller Slave Mode in QEMU - Klaus Jensen, Samsung Electronics
Channel: The Linux Foundation
Date: 2022-10-08

I2C Multi-master and Controller Slave Mode in QEMU - Klaus Jensen, Samsung Electronics

Several emulated BMC boards are missing an implementation of a MCTP controller because the protocol relies on slaves being able to master the bus (aka. multi-master). Additionally, being able to communicate with MCTP/I2C devices from the host requires slave-mode support in the I2C controller. In this talk we show how this functionality can be implemented in QEMU and discuss the techniques used to introduce asynchronous behavior on top of an existing synchronous API as unintrusively as possible - techniques which are applicable for similar purposes in other areas of QEMU. We then show how multi-master support may be used to allow the emulation of a device implementing the NVMe Management Interface over the MCTP/I2C transport, and how controller slave mode allows a host to communicate directly with said NVMe-MI device using the recently added Linux kernel AF_MCTP socket support. Finally, we discuss how MCTP may be implemented generally such that several boards may take advantaged of it.