lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNmK0MP5ffQpiipt@ninjato>
Date:   Mon, 28 Jun 2021 10:39:44 +0200
From:   Wolfram Sang <wsa@...nel.org>
To:     Jie Deng <jie.deng@...el.com>
Cc:     linux-i2c@...r.kernel.org,
        virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, mst@...hat.com, jasowang@...hat.com,
        andriy.shevchenko@...ux.intel.com, conghui.chen@...el.com,
        arnd@...db.de, kblaiech@...lanox.com,
        jarkko.nikula@...ux.intel.com, Sergey.Semin@...kalelectronics.ru,
        rppt@...nel.org, loic.poulain@...aro.org, tali.perry1@...il.com,
        u.kleine-koenig@...gutronix.de, bjorn.andersson@...aro.org,
        yu1.wang@...el.com, shuo.a.liu@...el.com, viresh.kumar@...aro.org,
        stefanha@...hat.com, pbonzini@...hat.com
Subject: Re: [PATCH v10] i2c: virtio: add a virtio i2c frontend driver

Hi,

sorry for the long delay. I am not familiar with VFIO, so I had to dive
into the topic a little first. I am still not seeing through it
completely, so I have very high-level questions first.

> The device specification can be found on
> https://lists.oasis-open.org/archives/virtio-comment/202101/msg00008.html.

I think we need to start here:

===

If ``length of \field{read_buf}''=0 and ``length of \field{write_buf}''>0,
the request is called write request.

If ``length of \field{read_buf}''>0 and ``length of \field{write_buf}''=0,
the request is called read request.

If ``length of \field{read_buf}''>0 and ``length of \field{write_buf}''>0,
the request is called write-read request. It means an I2C write segment followed
by a read segment. Usually, the write segment provides the number of an I2C
controlled device register to be read.

===

I2C transactions can have an arbitrary number of messages which can
arbitrarily be read or write. As I understand the above, only one read,
write or read-write transaction is supported. If that is the case, it
would be not very much I2C but more SMBus. If my assumptions are true,
we first need to decide if you want to go the I2C way or SMBus subset.

But maybe I need to undestand the following paragraph first:

===

A driver may send one request or multiple requests to the device at a time.
The requests in the virtqueue are both queued and processed in order.

===

What happens if those multiple requests are sent out to the I2C bus
master driver on the host? Is there one transaction with N messages or
are there N transfers with 1 message each. This is a difference in I2C
world (REP_START vs. STOP/START) and some devices really need this
properly handled or they won't work.

===

The case when ``length of \field{write_buf}''=0, and at the same time,
``length of \field{read_buf}''=0 doesn't make any sense.

===

Oh, it does. That's a legal transfer, both in SMBus and I2C. It is used
to e.g. discover devices. I think it should be supported, even though
not all bus master drivers on the host can support it. Is it possible?

Also, as I read it, a whole bus is para-virtualized to the guest, or?
Wouldn't it be better to allow just specific devices on a bus? Again, I
am kinda new to this, so I may have overlooked things.

Thanks and happy hacking,

   Wolfram


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ