<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"> Makes sense, likely uint32_t is used
      somewhere in size computations, and we silently overflow.<br>
      We never tested so huge PCI regions, I think. Assert is likely
      bogus, and just manifest we compute<br>
      addresses wrong somewhere, and things go wrong later on. <br>
       <br>
       If you could figure out where it happens - guess VBox devs would
      accept your change.<br>
      Generally ICH9 code shall be easier to understand and modify,
      although problem could be in generic PDM code.<br>
      <br>
        Nikolay<br>
      <br>
      On 04/24/2013 05:47 PM, José Massada wrote:<br>
    </div>
    <blockquote
cite="mid:CAFtq+bBd4BwM=HmkkwF37w0=FPw+urBzQd_GD2X7Nf_dGQ=oYw@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">I managed to get it to call my callbacks.
        <div>Calling PDMDevHlpMMIORegister with the phys address and the
          full size does not work. By calling PDMDevHlpMMIORegister with
          smaller sizes (and the correct phys address) it works.</div>
        <div><br>
        </div>
        <div>Calling PDMDevHlpMMIORegister with phys addr 0x40000000 and
          size 0x20000000 fails.<br>
        </div>
        <div>Calling PDMDevHlpMMIORegister 4 times with phys addr
          0x40000000, 0x48000000, 0x50000000 and 0x58000000, and
          size 0x8000000 works.</div>
        <div><br>
        </div>
        <div>Jose</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Wed, Apr 24, 2013 at 10:30 AM, José
          Massada <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:jose.massada@gmail.com" target="_blank">jose.massada@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote">
            <div dir="ltr">
              <div>Not sure if relevant but I got the following errors
                on the log (the machine still loads) when using the ICH9
                chipset:</div>
              <div><br>
              </div>
              <div>00:00:11.500658 VMSetError:
                /home/vbox/vbox-4.2.10/src/VBox/VMM/VMMR3/PGMPhys.cpp(4502)
                int pgmPhysFreePage(VM*, GMMFREEPAGESREQ*, uint32_t*,
                PGMPAGE*, RTGCPHYS); rc=VERR_PGM_PHYS_NOT_RAM</div>
              <div>00:00:11.500676 VMSetError: GCPhys=0000000020001000
                type=6</div>
              <div>00:00:11.500723 AssertLogRel
                /home/vbox/vbox-4.2.10/src/VBox/VMM/VMMR3/PGMPhys.cpp(911)
                int pgmR3PhysFreePageRange(VM*, PGMRAMRANGE*, RTGCPHYS,
                RTGCPHYS, uint8_t): RT_SUCCESS_NP(rc)</div>
              <div>00:00:11.501156 VERR_PGM_PHYS_NOT_RAM (-1639) -
                Trying to free a page that isn't RAM.</div>
              <div>00:00:11.581464 AssertLogRel
                /home/vbox/vbox-4.2.10/src/VBox/VMM/VMMR3/PGMPhys.cpp(2248)
                int PGMR3PhysMMIORegister(VM*, RTGCPHYS, RTGCPHYS, int
                (*)(VM*, RTGCPHYS, void*, void*, size_t, PGMACCESSTYPE,
                void*), void*, RTHCUINTPTR, RTR0PTR, RTRCPTR, RTRCPTR,
                const char*): RT_SUCCESS_NP(rc)</div>
              <div>00:00:11.581495 cbRamRange=2097280</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>And when using PIIX3, I only get this next one:</div>
              <div><br>
              </div>
              <div>
                <div>00:00:11.926143 AssertLogRel
                  /home/vbox/vbox-4.2.10/src/VBox/VMM/VMMR3/PGMPhys.cpp(2248)
                  int PGMR3PhysMMIORegister(VM*, RTGCPHYS, RTGCPHYS, int
                  (*)(VM*, RTGCPHYS, void*, void*, size_t,
                  PGMACCESSTYPE, void*), void*, RTHCUINTPTR, RTR0PTR,
                  RTRCPTR, RTRCPTR, const char*): RT_SUCCESS_NP(rc)</div>
                <div>00:00:11.926178 cbRamRange=2097280</div>
                <div><br>
                </div>
                <div>Jose</div>
              </div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <br>
                  <div class="gmail_quote">On Wed, Apr 24, 2013 at 8:18
                    AM, José Massada <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:jose.massada@gmail.com"
                        target="_blank">jose.massada@gmail.com</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote">
                      <div dir="auto">
                        <div>I tried both but lately I've been testing
                          with ICH9. Same behaviour.</div>
                        <div><br>
                        </div>
                        <div>
                          Jose</div>
                        <div>
                          <div>
                            <div><br>
                              On 24/04/2013, at 08:08, Nikolay Igotti
                              <<a moz-do-not-send="true"
                                href="mailto:igotti@gmail.com"
                                target="_blank">igotti@gmail.com</a>>
                              wrote:<br>
                              <br>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div> Which chipset you are using? ICH9
                                  generally shall be better suited for
                                  your needs, due to recent <br>
                                  PCI features support.<br>
                                  <br>
                                    Nikolay<br>
                                  <br>
                                  23.04.2013 18:25, José Massada пишет:<br>
                                </div>
                                <blockquote type="cite">
                                  <div dir="ltr">Hi all,
                                    <div><br>
                                    </div>
                                    <div>
                                      <div>I'm working on a PDM virtual
                                        PCI device module and I need to
                                        have a bar size of 512MB.</div>
                                      <div>This particular PCI device
                                        uses bar 0 and 1 for register
                                        blocks (64KB each) and bar 2 for
                                        memory (this one I need to be
                                        512MB or even bigger).</div>
                                      <div><br>
                                      </div>
                                      <div>Registering the memory bar
                                        using the MMIO2 functions fails
                                        when the size is bigger than
                                        256MB (hard coded limit in the
                                        allocation function) so I tried
                                        registering using MMIO. It seems
                                        to work but my read and write
                                        callbacks never get called (bar
                                        0 and 1 also use MMIO and their
                                        callbacks always get called). I
                                        tried decreasing the bar 2 size
                                        and the callbacks got called.</div>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div>Is this even possible without
                                      modifying VBox source code? What
                                      am I missing?</div>
                                    <div><br>
                                    </div>
                                    <div>Thanks,</div>
                                    <div>Jose</div>
                                  </div>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                  <pre>_______________________________________________
vbox-dev mailing list
<a moz-do-not-send="true" href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a>
<a moz-do-not-send="true" href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" target="_blank">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a>
</pre>
                                </blockquote>
                                <br>
                              </div>
                            </blockquote>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>