Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Apr 2019 23:41:36 +0000
From:      Robert Crowston <crowston@protonmail.com>
To:        Ruslan Bukin <br@bsdpad.com>
Cc:        "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: GPU passthrough: mixed success on Linux, not yet on Windows
Message-ID:  <UwyCjokFWzEqINaYmsah4k1uNRSI0Dp7vUSxukpwUztm_MBHaIrpNnmjUPseyA7IEwtCNP7-P4xdKKw4-IE4y6Irz-ileCg2CFCSUVUDFFE=@protonmail.com>
In-Reply-To: <20190328220234.GA52232@bsdpad.com>
References:  <H0Gbov17YtZC1-Ao1YkjZ-nuOqPv4LPggc_mni3cS8WWOjlSLBAfOGGPf4aZEpOBiC5PAUGg6fkgeutcLrdbmXNO5QfaxFtK_ANn-Nrklws=@protonmail.com> <20190328220234.GA52232@bsdpad.com>

next in thread | previous in thread | raw e-mail | index | archive | help
To get Windows to boot I think the only hacks I needed were in bhyve/mem.c =
(this is not production ready!)

Diff'd against 12.0-release

-- /tmp//sh-np.vFXFJd  2019-04-04 00:29:32.752990000 +0100
+++ mem.c       2019-03-02 22:27:14.500906000 +0000
@@ -101,20 +101,22 @@
 }

 static int
-mmio_rb_add(struct mmio_rb_tree *rbt, struct mmio_rb_range *new)
+mmio_rb_add(struct mmio_rb_tree *rbt, struct mmio_rb_range *new_element)
 {
        struct mmio_rb_range *overlap;

-       overlap =3D RB_INSERT(mmio_rb_tree, rbt, new);
+       overlap =3D RB_INSERT(mmio_rb_tree, rbt, new_element);

+       printf("mmio_rb_add: %lx:%lx\n", new_element->mr_base, new_element-=
>mr_end);
+
        if (overlap !=3D NULL) {
-#ifdef RB_DEBUG
-               printf("overlap detected: new %lx:%lx, tree %lx:%lx\n",
-                      new->mr_base, new->mr_end,
+//#ifdef RB_DEBUG
+               printf("overlap detected: new_element %lx:%lx, tree %lx:%lx=
\n",
+                      new_element->mr_base, new_element->mr_end,
                       overlap->mr_base, overlap->mr_end);
-#endif
+//#endif

-               return (EEXIST);
+//             return (EEXIST);
        }

        return (0);
@@ -336,6 +338,8 @@
                assert((mr->flags & MEM_F_IMMUTABLE) =3D=3D 0);
                RB_REMOVE(mmio_rb_tree, &mmio_rb_root, entry);

+               printf("unregister: %lx:%lx\n", mr->base, mr->base+mr->size=
);
+
                /* flush Per-vCPU cache */
                for (i=3D0; i < VM_MAXCPU; i++) {
                        if (mmio_hint[i] =3D=3D entry)
@@ -348,7 +352,12 @@
        if (entry)
                free(entry);

-       return (err);
+       if (err)
+               fprintf( stderr, "Unregister mem errno %d for range %lx:%lx=
.\n", err,
+                       memp->base, memp->base + memp->size );
+
+       return 0;
+       //return (err);
 }




=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me=
ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90
On Thursday, 28 March 2019 22:02, Ruslan Bukin <br@bsdpad.com> wrote:

> Hi Robert:
>
> On Sun, Mar 17, 2019 at 04:22:29PM +0000, Robert Crowston via freebsd-vir=
tualization wrote:
>
> > Is it worth me continuing to hack away at these problems---of course I'=
m happy to share anything I come up with---or is there an official solution=
 to GPU support in the pipe about to make my efforts redundant :)?
>
> Could you share your patch/hacks somewhere?
> I would like to try it with AMD graphics card and Windows.
>
> Ruslan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?UwyCjokFWzEqINaYmsah4k1uNRSI0Dp7vUSxukpwUztm_MBHaIrpNnmjUPseyA7IEwtCNP7-P4xdKKw4-IE4y6Irz-ileCg2CFCSUVUDFFE=>