<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'><br>    Hi Ananth,<br><br> Sorry for taking so long. Unfortunately I was not able to merge the patch because you created it against an outdated version of the source code. The MsiCommon.cpp module was effectively unchanged for years, but in October 2015 a few significant changes were made. Some of those changes are related to MSI per-vector masking and directly conflict with your changes. <br><br> Could you please try the current code and check if it does everything you need? If not, I'm sure we can tweak it. I think it should work as is, but then again I wouldn't bet my own money on it.<br><br>      Regards,<br>          Michal<br><br>----- Original Message -----<br>From: apallapothu@gmail.com<br>To: michal.necasek@oracle.com<br>Cc: vbox-dev@virtualbox.org<br>Sent: Tuesday, January 5, 2016 8:08:09 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna<br>Subject: Re: [vbox-dev] ICH9 MSI handling<br><br><div dir="ltr">Attached Patch log file along with the source code, requesting to submit under MIT License. Let me know if I missed anything.<div><br></div><div>Ananth</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 30, 2015 at 2:52 PM, Michal Necasek <span dir="ltr"><<a href="mailto:michal.necasek@oracle.com" target="_blank">michal.necasek@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Times New Roman;font-size:12pt;color:#000000"><br> Please take a look at this: <a href="https://www.virtualbox.org/wiki/Contributor_information" target="_blank">https://www.virtualbox.org/wiki/Contributor_information</a><br><br> For a small patch, I highly recommend submitting it under the MIT license. Basically you post the patch on this list and state that it's provided under the MIT license. We'll take a look at it, possibly modify it, and apply (if we're happy with it).<br><br> A patch has higher chance of being accepted when it follows the VirtualBox coding standards and is reasonably well designed. For example requiring the user to directly modify the PCI config registers sounds like something that should be avoided for MSIs. But let's see the patch first.<br><br>      Regards,<span class=""><br>         Michal<br><br>----- Original Message -----<br>From: <a href="mailto:apallapothu@gmail.com" target="_blank">apallapothu@gmail.com</a><br></span><div><div class="h5">To: <a href="mailto:michal.necasek@oracle.com" target="_blank">michal.necasek@oracle.com</a><br>Cc: <a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a><br>Sent: Wednesday, December 30, 2015 12:30:02 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna<br>Subject: Re: [vbox-dev] ICH9 MSI handling<br><br><div dir="ltr"><div>2 things that I do 1) Directly write to control config register for 64 bit using *setbyte or *setword function calls 2) I set "<span style="font-size:12.8px">pMsiReg->fMsi64bit" during MSI registration.</span></div><div><br></div><div><span style="font-size:12.8px">I presume changes might help other users, so would be glad to submit changes. N</span><span style="font-size:12.8px">ever submitted patches before, what is the process to do so ?</span></div><div><br></div><div>Ananth</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 29, 2015 at 5:36 AM, Michal Necasek <span dir="ltr"><<a href="mailto:michal.necasek@oracle.com" target="_blank">michal.necasek@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
 I can't say much without seeing exactly what you changed. But just two questions:<br>
<br>
 - Do you call pciDevSetMsi64Capable() anywhere? Perhaps MsiInit() should be doing that.<br>
 - Did you set pMsiReg->fMsi64bit before registering the MSI capability?<br>
<br>
 It is entirely possible that the 64-bit MSI support is not as good as it could be since VirtualBox does not ship with any devices which use that.<br>
<br>
 Are you going to submit patches for VirtualBox or are you happy with maintaining local changes?<span><font color="#888888"><br>
<br>
<br>
     - Michal</font></span><span><br>
<br>
On 12/29/2015 5:44 AM, Ananth Pallapothu wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
Hi Michal,<br>
<br>
    I was able to get my device working for MSI Interrupts Non-masking.<br>
<br>
    Problem was 3 folded.<br>
    1) A) Added new msiMaskEnabled function to do appropriate checkings<br>
        B) Existing check conditions inside MsiNotify are specifically<br>
isolated incase of Non-Masking.<br>
    2) I invoke exclusive register write access to MSI control at the<br>
very end of my constructor (after MSI registration call)<br>
    3) msiIs64Bit never returned functionally appropriate/true value. So<br>
I modified this function to return appropriate value by reading control<br>
config & 0x80<br>
<br>
Thanks.<br>
<br>
<br>
<br>
<br>
On Mon, Dec 28, 2015 at 4:50 AM, Michal Necasek<br></span><span>
<<a href="mailto:michal.necasek@oracle.com" target="_blank">michal.necasek@oracle.com</a> <mailto:<a href="mailto:michal.necasek@oracle.com" target="_blank">michal.necasek@oracle.com</a>>> wrote:<br>
<br>
<br>
      Hmm, that doesn't make sense to me. The mask bits do not overlap<br>
    anything else. I'm looking at figure 6-9 on page 233 of the PCI 3.0<br>
    specification.<br>
<br>
      The code in MsiCommon.cpp is clear enough. Are you failing to set<br>
    the fMsi64bit flag when registering the MSI capability?<br>
<br>
      You probably also noticed that MsiInit() always sets the<br>
    BOX_PCI_MSI_FLAGS_MASKBIT and there is currently no way to register<br>
    an emulated device without MSI per-vector masking. That should not<br>
    cause trouble since guest software does not have to use masking.<br>
<br>
          - Michal<br>
<br>
<br>
    ----- Original Message -----<br></span><span>
    From: <a href="mailto:apallapothu@gmail.com" target="_blank">apallapothu@gmail.com</a> <mailto:<a href="mailto:apallapothu@gmail.com" target="_blank">apallapothu@gmail.com</a>><br>
    To: <a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a> <mailto:<a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a>><br>
    Sent: Monday, December 21, 2015 5:16:15 AM GMT +01:00 Amsterdam /<br>
    Berlin / Bern / Rome / Stockholm / Vienna<br>
    Subject: [vbox-dev] ICH9 MSI handling<br>
<br>
    Hello Developers,<br>
<br>
           I am experimenting on ICH9 with a pluggable device. Reason<br>
    for using ICH9 is MSI support.<br>
    Following through AHCI, HPET device I see that code is aligned for<br>
    specific mode of MSI configuration, "Per-Vector Masking Capable".<br>
<br>
           MsiNotify function reads Mask Bits, Pending Bits without<br>
    conditionally checking whether device is Per-Vector Masking Capable.<br>
    So, by default code thinks offset 0xC reg as mask data where infact<br>
    it is MSI data with Interrupt Vector ID incase of masking disabled.<br>
    iVector value seems to be confusing too.<br>
<br>
          My particular device needs to be configured for 64 bit MSI<br>
    address capable and Mask disabled, so, MSI_MSG_CNTL @ MSI capability<br>
    offset 0x02 = 0x0081<br>
<br>
         Can someone please suggest, recommend changes to handle this<br>
    mode of MSI operation ?<br>
<br>
    Thanks.<br>
<br>
<br>
</span></blockquote>
<br>
</blockquote></div><br></div>
</div></div></div></div></blockquote></div><br></div>
</div></body></html>