From owner-soc-status@freebsd.org Mon Jul 9 11:40:27 2018 Return-Path: Delivered-To: soc-status@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 9D1811042011 for ; Mon, 9 Jul 2018 11:40:27 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27A2992D63; Mon, 9 Jul 2018 11:40:27 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: by mail-ed1-f54.google.com with SMTP id u11-v6so13669518eds.10; Mon, 09 Jul 2018 04:40:27 -0700 (PDT) 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:cc; bh=ohFGlZmPxFUlAHTidBB0Ay+Efy3WmjvgmsOhHgAi0uc=; b=l0yM61HzBVfOYSDvKY/p8KehDB6tk+SaqsCRkOSDbxsVIGtzNYt3LdxdDJeqhuTo7t P3fsuxr1uVVqtUbOTA+3klhlq7JQDOrUkDCeuYozEik/cap07CodXpB/MMbY1tx5X1lW XM5m6nE694hQmNtu+mMwsav57O/+DdtslbcIXFqHl5nRvlLyq9ohydGTR6rRyW5FTcsD /MhuxMJK0kQ8BhQUdJp0iP9edlTesAx/4ouXpG9jYa42RmDDUCNxvj+qIjLMi5yHT6C6 oAftZvK/FCCR1+B5SqgGWW0bz0ulJ5Llnp0E7dby9A927hX05kSjCp9NLTY/vH0YQ2Y1 lm0g== X-Gm-Message-State: APt69E0njTNqKAkwidj5OIiFx7O3f6d0/e9wwLGsjniflwu4QhltRMK/ 0dRAqXFEl7kSn/6KmYwPN3oAYELf X-Google-Smtp-Source: AAOMgpdSt9bH97Y3XOWpol4haUmEVQYGxAWjLz66B81v3bHuVvNlWCis/68qi09Lb6b9fxSHnN+gRw== X-Received: by 2002:a50:cb0d:: with SMTP id g13-v6mr21505417edi.81.1531136419778; Mon, 09 Jul 2018 04:40:19 -0700 (PDT) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com. [209.85.208.44]) by smtp.gmail.com with ESMTPSA id y26-v6sm6704628edr.51.2018.07.09.04.40.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 04:40:19 -0700 (PDT) Received: by mail-ed1-f44.google.com with SMTP id i20-v6so661014eds.12; Mon, 09 Jul 2018 04:40:19 -0700 (PDT) X-Received: by 2002:a50:a9e2:: with SMTP id n89-v6mr7544999edc.158.1531136419601; Mon, 09 Jul 2018 04:40:19 -0700 (PDT) MIME-Version: 1.0 From: Pratyush Yadav Date: Mon, 9 Jul 2018 17:09:43 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: [Week 8] Import the Xen grant-table bus_dma(9) handlers from OpenBSD To: soc-status@freebsd.org Cc: Akshay Jaggi , Edward Napierala Content-Type: text/plain; charset="UTF-8" X-BeenThere: soc-status@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Summer of Code Status Reports and Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2018 11:40:27 -0000 Hi, Last week I went through the Xen blkfront driver code to understand how it works, and how it uses the grant references. It took me quite some time because the driver is huge and I was often chasing functions all over the place. After that, I started to convert the blkfront driver to use the new busdma implementation. There are two places where foreign access is granted: - xbd_connect() (blkfront.c:1341). Here, access is granted to the xbd's indirect pages. - xbd_mksegarray() (blkfront.c:162). This is called from the dma load callback to the loads in xbd_queue_request() (blkfront.c:301). xbd_connect() seems simpler so I started with it. I have managed to update xbd_connect() to use the new busdma implementation, and now I will start to update xbd_mksegarray(). I also made further improvements to the busdma implementation, like the ability to pass flags to the grant table allocation methods, and improved error checking. Also, I fixed an infinite recursion bug. You can check the code here [0]. I maintain a blog on Blogger where I publish my progress every few days. Check it out if you want more details on what I'm doing [1]. [0] https://github.com/prati0100/freebsd/tree/busdma_xen_clean [1] https://pratyushgsoc.blogspot.com/ -- Regards, Pratyush Yadav