qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex David <alex.daerf@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Andreas Färber" <afaerber@suse.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Trying to write a new device / virtio-i2c ?
Date: Mon, 17 Feb 2014 09:35:18 +0100	[thread overview]
Message-ID: <CAA17Vo98LAygDVEFozQtrsi5o5zysNCG6Joe6PjJyHTd0Hmk0A@mail.gmail.com> (raw)
In-Reply-To: <52FE4820.8050009@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]

Thanks for all your answers.

I understand that what I want to achieve seemed pretty confused. I will try
to clarify :

On real hardware, I have an I2C device used to get temperatures, pressure
etc... and it works on x86 and there were no QEMU virtualized hardware
corresponding.

I don't really need to simulate the I2C hardware in QEMU. Indeed, there are
few of them just sending regular i2c data. For some tests, I want to be
able to send/receive these ones from my daemon on the host. After some
researches, what I was thinking about was :

1) Use virtio-serial and write an I2C driver (guest kernel) that would
give/take data to/from i2c-1 and read/write to vportp0... Seemed a bit
ugly, so I wanted to try something else.

2) Write virtio-i2c (using i2c-driver and virtio kernel basics) that would
register, for example, i2c-1 and get/send data from my guest app, and use
virtio to send these data to host.

What I have done for now : I used virtio-serial / virtio-console in linux
kernel and inspired from virtio-pci to try to registers these "vport0pX" as
i2c-1, i2c-2 etc... and as i2c devices. I also wrote a virtio-i2c QEMU-side
to register as this hardware using virtio-i2c drivers. I think my
understanding of the architecture is probably not complete, as it seems
that this QEMU device doesn't automatically registers as a "virtio-i2c"
hardware that would launch my guest kernel driver.
My printk's in the "probe" are not printed. My driver is then never used.

My questions were then :
- My solution might be a bit complicated assuming I don't have that much
knowledge in the architecture (however I'm interested into learning...)
- Are there solutions that seems more adapted to my case ? Like using
USB-I2C bridge ?


2014-02-14 17:45 GMT+01:00 Paolo Bonzini <pbonzini@redhat.com>:

> Il 14/02/2014 17:31, Andreas Färber ha scritto:
>
>  While that is certainly possible in case host passthrough was desired,
>> maybe virtio was mixed up with VFIO?
>>
>
> I don't think so, VFIO is mostly about IOMMUs and protecting from DMA.
>
> Paolo
>

[-- Attachment #2: Type: text/html, Size: 2773 bytes --]

  reply	other threads:[~2014-02-17  8:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 13:26 [Qemu-devel] Trying to write a new device / virtio-i2c ? Alex David
2014-02-14 15:26 ` Stefan Hajnoczi
2014-02-14 15:58 ` Paolo Bonzini
2014-02-14 16:31   ` Andreas Färber
2014-02-14 16:45     ` Paolo Bonzini
2014-02-17  8:35       ` Alex David [this message]
2014-02-17  9:19         ` Paolo Bonzini
     [not found]           ` <CAA17Vo9E9D-jPa3gwhsui3i=APz1FM-41jbK+zpOm2tWf7swdw@mail.gmail.com>
2014-02-17  9:38             ` [Qemu-devel] Fwd: " Alex David
2014-02-17  9:55               ` Paolo Bonzini
     [not found]                 ` <CAA17Vo_cBCbKkqDu2zQ0DW2FoAyVqxVXGtNGArJ1tnk6N9AUqA@mail.gmail.com>
2014-02-17 10:38                   ` Paolo Bonzini
2014-02-17 12:23                     ` Alex David
2014-02-17 13:11                       ` Alex David
2014-02-17 13:19                         ` Paolo Bonzini
2014-02-17 13:32                           ` Alex David
2014-02-17 14:30                             ` Paolo Bonzini
2014-02-17 15:33                               ` Alex David
2014-02-17 16:11                                 ` Paolo Bonzini
2014-02-18 12:48                                   ` Alex David
2014-02-18 13:05                                     ` Paolo Bonzini
2014-02-18 13:44                                       ` Alex David
2014-02-18 13:47                                         ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAA17Vo98LAygDVEFozQtrsi5o5zysNCG6Joe6PjJyHTd0Hmk0A@mail.gmail.com \
    --to=alex.daerf@gmail.com \
    --cc=afaerber@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).