[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNmg2IEpUlArZXPK@ninjato>
Date: Mon, 28 Jun 2021 12:13:44 +0200
From: Wolfram Sang <wsa@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Jie Deng <jie.deng@...el.com>,
Linux I2C <linux-i2c@...r.kernel.org>,
virtualization@...ts.linux-foundation.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
conghui.chen@...el.com, kblaiech@...lanox.com,
jarkko.nikula@...ux.intel.com,
Sergey Semin <Sergey.Semin@...kalelectronics.ru>,
Mike Rapoport <rppt@...nel.org>, loic.poulain@...aro.org,
Tali Perry <tali.perry1@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
yu1.wang@...el.com, shuo.a.liu@...el.com,
Viresh Kumar <viresh.kumar@...aro.org>,
Stefan Hajnoczi <stefanha@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH v10] i2c: virtio: add a virtio i2c frontend driver
> Ok, that's what I thought. There is one corner case that I've struggled
> with though: Suppose the host has an SMBus-only driver, and the
> proposed driver exposes this as an I2C device to the guest, which
> makes it available to guest user space (or a guest kernel driver)
> using the emulated smbus command set. Is it always possible for
> the host user space to turn the I2C transaction back into the
> expected SMBus transaction on the host?
If an SMBus commands gets converted to I2C messages, it can be converted
back to an SMBus command. I don't see anything preventing that right
now. However, the mapping-back code does look a bit clumsy, now that I
envision it. Maybe it is better, after all, to support I2C_SMBUS
directly and pass SMBus transactions as is. It should be a tad more
effiecient, too.
Speaking of it, I recall another gory detail: SMBus has transfers named
"read block data" and "block process call". These also need special
support from I2C host controllers before they can be emulated because
the length of the read needs to be adjusted in flight. These commands
are rare and not hard to implement. However, it makes exposing what is
supported a little more difficult.
> This is certainly possible, but is independent of the implementation of
> the guest driver. It's up to the host to provision the devices that
> are actually passed down to the guest, and this could in theory
> be any combination of emulated devices with devices connected to
> any of the host's physical buses. The host may also decide to remap
> the addresses of the devices during passthrough.
That sounds good.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists