From owner-freebsd-current@freebsd.org Sun Aug 5 09:35:37 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A319E1070D16 for ; Sun, 5 Aug 2018 09:35:37 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1482B89022 for ; Sun, 5 Aug 2018 09:35:37 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wr1-x42a.google.com with SMTP id g1-v6so5983312wru.2 for ; Sun, 05 Aug 2018 02:35:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=dOxYYLZGsnGiIYbBqUJbQDT1bV+6dLna9WtTnhA2AyA=; b=eBJbRDcaJ7oPFdnH0eSjrh0+58UisxbWWwsPeTWUg407hNrHR6p2Qt80Pm0GdgzCSw mWeSfAUYoRvYabGQ2RBxTs57mKI94TeBnrTGOfquTsDxK5Vb3j3Mr5iEqq05PS31Wofw /cQkCBw7k30dJXLLBiPEyyoV5AgsKxcsbHIeVas3+SPevc42gnEVon0U08tXzrKt6W6E zdS6da948+2VgCvcgl7KE1gJC4G7BiLQ8RqOA2eE8BgIev4gRYMGzHaJoYysSL/SqEW3 4WPgHlK6U2FI1SftDY7mK4L+RlkTcPt6RzDtazGANCAsAHCkZ5450XVGb5lffIe+nXlh 7W5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=dOxYYLZGsnGiIYbBqUJbQDT1bV+6dLna9WtTnhA2AyA=; b=OIe8/0YAYrfl4MenngEoSZZjOHgY69GBMAAikYivHTDtyNgmNvkiKn5KPXIvHGvoRp 2MJMJnmx835eeauOSamhJ0He4IysIB0PLsuMNSJhrBE6gKmICp5Mtb4fwkG7EEp7XtCf f1QzP2t7M/Z0kpHBsgsFM9ZQUyCOzacbEk4yMqasdu0IeSHFYpEfEnJWsmdOkrN59m5U znG5jHRny6/PGkbX9jjtPhZf1je/i5PaqvvfbdP6o3wVnxT1LLoEcY/1VN0iiq8IKf0+ lI2Z955AMjaoy21WuPDxcZTGsshVrddPIR7bgelduKrA5KCIUo0S2CAnVUFfTx15aNU2 UAIA== X-Gm-Message-State: AOUpUlEu8YUboWfvozwEEU24911EAfLB7HtbUziN+EfMyd0I2vLfW6OK 7By1z91AXg3e0aEeLzL67bUCDy22rUKnixtH8z9WrYU8 X-Google-Smtp-Source: AAOMgpeyIARSCUWezlIKnxcJVek92NjgownoVXiUsbyQqX/B4HjZQy/+fs9KYaM5tp3YJQvAdFaXVJpHDkEdKU8ZFqE= X-Received: by 2002:adf:93a3:: with SMTP id 32-v6mr6513682wrp.140.1533461735197; Sun, 05 Aug 2018 02:35:35 -0700 (PDT) MIME-Version: 1.0 From: Johannes Lundberg Date: Sun, 5 Aug 2018 10:34:56 +0100 Message-ID: Subject: IOMMU for GPUs To: freebsd-current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 09:35:37 -0000 Hi First I have to say I don't know much when it comes to virtual GPUs and IOMMU. I'm trying to figure out what we have and what is missing in regards to sharing the GPU to virtual guests on Intel and AMD and things like the amdkfd driver (for Radeon open compute). Looking at the state of IOMMU in FreeBSD there seem to be (what I guess is) a general driver for Intel at /usr/src/sys/x86/iommu/. Then there's the support for AMD's IOMMU in bhyve at /usr/src/sys/amd64/vmm/io/iommu.c. Without looking too much into the details my guess is we have an iommu driver for Intel that Intel's i915/gvt can use but for AMD there's only the specific implementation for bhyve and no general driver that other clients can use... Or? If anyone wants to work on this, it's up for grabs :) We'll probably have to add some glue in linuxkpi as well. Cheers