qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: geoff@hostfission.com
To: Ladi Prosek <lprosek@redhat.com>
Cc: Yan Vugenfirer <yvugenfi@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] ivshmem Windows Driver
Date: Thu, 19 Oct 2017 20:41:47 +1100	[thread overview]
Message-ID: <cb980fa56e032de56dc48193f6989ed7@hostfission.com> (raw)
In-Reply-To: <59a147491e11c4c692e9f762bcd9fb21@hostfission.com>

On 2017-10-19 20:07, geoff@hostfission.com wrote:
> On 2017-10-19 20:01, Ladi Prosek wrote:
>> On Thu, Oct 19, 2017 at 10:44 AM,  <geoff@hostfission.com> wrote:
>>> On 2017-10-19 19:35, Ladi Prosek wrote:
>>>> 
>>>> On Wed, Oct 18, 2017 at 5:04 PM,  <geoff@hostfission.com> wrote:
>>>>> 
>>>>> Hi Ladi & Yan,
>>>>> 
>>>>> I am pleased to present the completed driver for review, please 
>>>>> see:
>>>>> 
>>>>> https://github.com/gnif/kvm-guest-drivers-windows
>>>> 
>>>> 
>>>> Awesome!
>>>> 
>>>> Feel free to open pull request, it should be easier to comment on.
>>> 
>>> 
>>> Great, I will do so after I have addressed the below. Thanks again.
>>> 

I have created a PR, see:

https://github.com/virtio-win/kvm-guest-drivers-windows/pull/174

>>>> 
>>>> * WoW considerations: It would be nice if the driver could detect 
>>>> that
>>>> the map request is coming from a 32-bit process and expect a 
>>>> different
>>>> layout of struct IVSHMEM_MMAP.
>>> 
>>> 
>>> I did think of this but I am unsure as to how to detect this.
>> 
>> I don't think I ever used it but IoIs32bitProcess() looks promising.
>> 


Obviously PVOID will be 32bit which will mess with the struct size and
offset of vectors but I am not aware of a solution to this. If you have
any suggestions on how to rectify this it would be very much 
appreciated.

>>>> 
>>>> * It would be cleaner to use READ_REGISTER_* and WRITE_REGISTER_*
>>>> from/to IVSHMEMDeviceRegisters instead of plain memory accesses. Or 
>>>> at
>>>> the very least the accesses should be marked volatile.
>>> 
>>> 
>>> I thought that mapping the IO space was enough for this since it is
>>> mapped as non-cacheable. I can see the point of marking it volatile 
>>> but
>>> see no need to use the read/write register semantics. If this is what 
>>> it
>>> takes however I am happy to do so.
>> 
>> Code like this raises eyebrows:
>> 
>>   deviceContext->devRegisters->doorbell |= (UINT32)in->vector |
>> (in->peerID << 16);
>> 
>> Many readers will probably be wondering what exactly the compiler is
>> allowed to do with this statement. May it end up ORing the lower and
>> upper word separately, for example?
>> 
>>   OR [word ptr addr], in->vector
>>   OR [word ptr addr + 2], in->peerID
>> 
>> And, by the way, is OR really what we want here?
>> 
> 
> After double checking this you are dead right, the register is 
> documented
> as write only. I will fix this.

Done.

> 
>>>> 
>>>> * In ivshmem.inf: ManufacturerName="Red Hat, Inc." instead of 
>>>> "RedHat"
>>>> 
>>> 
>>> No worries.
>>> 
>>>> * Is any of the API used by the driver Win10-only? Just curious, 
>>>> it's
>>>> fine to build the driver only for Win10 for now even if it isn't.
>>> 
>>> 
>>> I have not tried to build it on anything older then win 10 build 
>>> 10586
>>> as I have nothing older, but AFAIK it should build on windows 8.1 or
>>> later just fine. This is more due to my lack of familiarity with 
>>> Visual
>>> Studio, give me gcc and vim any day :).
>> 
>> Gotcha, no worries, other versions can be tested later.

  reply	other threads:[~2017-10-19  9:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-15  9:32 [Qemu-devel] ivshmem Windows Driver geoff
2017-10-15 11:14 ` Yan Vugenfirer
2017-10-15 12:21   ` geoff
2017-10-15 12:24     ` Yan Vugenfirer
2017-10-15 12:29       ` geoff
2017-10-16 18:31         ` geoff
2017-10-18  5:31           ` Ladi Prosek
2017-10-18  5:50             ` geoff
2017-10-18  6:50               ` Ladi Prosek
2017-10-18  6:56                 ` geoff
2017-10-18 12:34                   ` Ladi Prosek
2017-10-18 15:04                     ` geoff
2017-10-19  8:35                       ` Ladi Prosek
2017-10-19  8:44                         ` geoff
2017-10-19  9:01                           ` Ladi Prosek
2017-10-19  9:07                             ` geoff
2017-10-19  9:41                               ` geoff [this message]
2017-10-19  9:51                                 ` Ladi Prosek
2017-10-19 10:42                                   ` geoff
2017-10-16 15:20 ` Eric Blake
2017-10-16 16:05   ` geoff

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=cb980fa56e032de56dc48193f6989ed7@hostfission.com \
    --to=geoff@hostfission.com \
    --cc=lprosek@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yvugenfi@redhat.com \
    /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).