All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Dickens <jdickens@grammatech.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: Adding new custom devices to Xen via QEMU
Date: Fri, 30 Sep 2016 09:35:59 -0400	[thread overview]
Message-ID: <41099728-5681-81e8-6892-82192551deaf@grammatech.com> (raw)
In-Reply-To: <20160930113345.GC2958@citrix.com>

Hi Wei,

Thanks for the response. It make sense to me that if the device were on 
the PCI bus (or other such bus, e.g. USB) that it could be discovered, 
at least by an OS. Its something to consider. I should mention that our 
guest VM doesn't actually use an OS.

However, the device is not implemented that as PCI it is simply memory 
mapped. Technically, in QEMU is has type ISA because it was derived as a 
modification of the TPM device. Is it possible something is lacking in 
the QEMU model that Xen needs but KVM doesn't?
If the answer is that Xen should not need modification for any new 
devices then this gives me hope.  You've also inspired some things to 
try, like whether or not smaller modifications to the TPM device work. 
One change that is significant to mention is that the physical address 
range use is anomalous, by which I mean it not in the normal device range.

Any references you could give how Xen actually discovers when to use 
QEMU to service MMIO reads/writes would be useful too. My current 
understanding is that "something" would have to be used to configure the 
EPT to trigger QEMU to use on VMEXITs caused by such accesses.

Thanks,

Jason

P.S. Regarding  device_model_args=
I'm already using this and QEMU seems quite satisfied as the device is 
realized as expected it simply doesn't receive verified MMIO accesses 
for the device.


On 9/30/2016 7:33 AM, Wei Liu wrote:
> Hello
>
> On Thu, Sep 29, 2016 at 09:35:21AM -0400, Jason Dickens wrote:
>> Hello,
>>
>> My name is Jason Dickens and I'm a Research Scientist here at GrammaTech.
>> Some of our research involves securing hypervisors and we have needed to add
>> to and/or modify Xen. I have been successful in modifying the source for
>> various purposes, but my question now is about devices. We have a custom
>> device model implemented in QEMU which works great with QEMU (on Intel)
>> standalone and with KVM, however, we now want access to it in Xen using the
>> same modified QEMU build.
>> The only problem I seem to be having is getting Xen to send the MMIO R/W's
>> to QEMU. The device is being realized, but guest access to the physical
>> address range I expect to reference the device seem to go no place. I see in
>> the source calls such as "register_io_handler" that other devices use to
>> effect the EPT mapping. Is this what I need?
>> My main question is whether or not it is truly necessary to change Xen
>> itself in order to introduce new devices in Xen using QEMU, or is there just
>> a configuration setting? And what is the simplest way to have a range of
> It is most likely achievable by just configuring your PCI device (?) in
> QEMU (provided it has a reasonable BAR size or whatnot). Check out
> various device model options in xl.cfg manpage, especially
> device_model_args= option allows you to add arbitrary options to QEMU.
>
> Wei.
>
>> physical addresses access a custom QEMU device?
>>
>> Thanks,
>> Jason
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> https://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-09-30 13:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29 13:35 Adding new custom devices to Xen via QEMU Jason Dickens
2016-09-30 11:33 ` Wei Liu
2016-09-30 13:35   ` Jason Dickens [this message]
2016-09-30 13:53     ` David Vrabel
2016-09-30 14:29       ` Jason Dickens
2016-09-30 18:42         ` Konrad Rzeszutek Wilk
     [not found]           ` <b980347d-d77b-d33e-4de9-8ed2f042c136@grammatech.com>
2016-09-30 19:47             ` Konrad Rzeszutek Wilk
2016-09-30 20:06               ` Jason Dickens

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=41099728-5681-81e8-6892-82192551deaf@grammatech.com \
    --to=jdickens@grammatech.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.