Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5226356img; Wed, 27 Mar 2019 04:43:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2EAUNpGGmK7bC3OUOZSU/giC8iF1tJtKXD44zhE/+3JrZHLv/K6nMs26d7N2DqaeEJzJH X-Received: by 2002:a62:3047:: with SMTP id w68mr34630006pfw.17.1553687002144; Wed, 27 Mar 2019 04:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553687002; cv=none; d=google.com; s=arc-20160816; b=zeh/ZmS+rw1CZn6x1k0+XZqKS68nCoGYdMdE4hkzNsf2syX00DXSzRHiyrxGAOLTku aBBBhzsjwJ+UmEFm7EaqkbUNZCrvoCEAu5GJ6KOE9k4loU95EhsGXjVhbqDxQAmfISkG UJzdCa+6Jq0nH5hrSMQJNW1bBhIkUkIdSTzVzPNphsyrqvVYEbn+0JrfWAKwqhKwV7yL R43j8K0CF2OW5J1gmb8iHvJQXTeG26J+bimutNF2+xSIfvHoKgqwFP91E0eRFec1cpVf GX/9KH029fixWxZZRiPO6TdOEQf85QMROhXP6nUBeRsTDMvin4QYKds+QD9er6Xckd6M jx9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YNNdbSS+C3KJAabfM9Oo1cBSnZKSRht7rzVdKUeZ6F0=; b=ZNdIjAbPAql6o6S4aEeIXoqxZs60xYUqXOGHcPJCR2h25KHmYXmyuH3oeDRodb74yL xdjbYZK78VHSRylOtaNxP5gawc9gxEi4mFmAe3Qaj1CfWKEYcQdwjdkGJxfxpr6Kq2zm bdmufgrDfn2796js0/RGvVystArr2vUtyR0+rO7bD3yKIUytII2K3QeNbBLqKHcWBkOK Q4vY3iH9tCzq9ItKM8aRaeOr3SCMjfLN9c7QWaTUD+tm1+M1iH21x9uJ/8TB8QCbRij0 9jNpRDccvZ/4itHl178vq6aVl+jfFIf7cPpIpxuihRTgNlOkqlaBsHh+GOK6Xr7hev5H ejog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=leBDzQpK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si13243045pfe.90.2019.03.27.04.43.06; Wed, 27 Mar 2019 04:43:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=leBDzQpK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728543AbfC0Lm1 (ORCPT + 99 others); Wed, 27 Mar 2019 07:42:27 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53434 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbfC0Lm0 (ORCPT ); Wed, 27 Mar 2019 07:42:26 -0400 Received: by mail-wm1-f66.google.com with SMTP id q16so15805539wmj.3 for ; Wed, 27 Mar 2019 04:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YNNdbSS+C3KJAabfM9Oo1cBSnZKSRht7rzVdKUeZ6F0=; b=leBDzQpK8dYKG+NM4xP5w+oTyJYG5WWEhS5kvnN0UcM+D2SuFxRxv46g5EZ9QtRIfk GgEHV3D98wAbU87hp1GW8xVKm0QvMQ1rtGLfZ3lXPC2JTvGhoT7fVyPWLwHbKrPaLk3g uq+v84/6VbwUv/jTwx64qtPTGdAyvhCpIhRE3p+pfODBkxD1IWz3nmP7S4oaY5DseX0h iQaViAAUzSro5l9MQwuDBnrs9RqcmdhJW59Vneo82bq8QltnbAYEqBoEKs2tLMx3ElDs CZaTkCg6Egobrk3UkSbPLD3bqjfdcqiEv82RZAwacQLNBWeodPOpVr2bQ/AkkOaiyysY bceA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YNNdbSS+C3KJAabfM9Oo1cBSnZKSRht7rzVdKUeZ6F0=; b=DH6O1ywVekg1bX817ej63w6hmkjLm6/grlBar1CSlmM5J+yMTUekCM15imHzOFz957 r71ltPDfoa15/QNIW67JIuRWPRSWkfFCKe3hbSJcjzREpS++H975kb2eJsXgVNMVjR/X xKEa6MvesVWLDs3s8vL9fwNASDiLkcnvd7Zfc7LB2EIPQYHMKYBuRv+o3cFyB36Fy1QQ KbDRfhOn9Ad5oACq7RuhexAU5bvRjfayeFu+Hq4a3UJYMCMadlVkS1F+eZI7rBNWVny6 /vfSEt7gtsNl4+yLTy4E8umrcoUzaVu4sT4FAawlB5j3fk+qhcMTZLZTdwQDDRcWLUWu UJJQ== X-Gm-Message-State: APjAAAWNWer3kmO0Z9i0Q9Ye4TumxVbo1rogvIRrQcRMudMEsINQcPF5 Imho4kCgIwURXJZw7JXcfW5JMK7FXcJDk3V29Nagrw== X-Received: by 2002:a7b:cf18:: with SMTP id l24mr9709637wmg.132.1553686944711; Wed, 27 Mar 2019 04:42:24 -0700 (PDT) MIME-Version: 1.0 References: <20190327100201.32220-1-anup.patel@wdc.com> <7edf91f1-1df5-5513-d372-d84edd12edf3@garyguo.net> In-Reply-To: <7edf91f1-1df5-5513-d372-d84edd12edf3@garyguo.net> From: Anup Patel Date: Wed, 27 Mar 2019 17:12:13 +0530 Message-ID: Subject: Re: [PATCH] RISC-V: Implement ASID allocator To: Gary Guo Cc: Anup Patel , Palmer Dabbelt , Albert Ou , Atish Patra , Christoph Hellwig , Paul Walmsley , Mike Rapoport , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 27, 2019 at 4:57 PM Gary Guo wrote: > > Hi Anup, > > This won't work in an actual hardware with ASID support. There're more Can you elaborate why? This implementation is based on Linux ARM64 ASID allocator which is tested for large number of CPUs on real HW. > interactions with TLB flushes that need to be considered. You won't see Yap, already considered. Please point me to unhandled case. > this on both QEMU and SiFive board, as QEMU does not have ASID, so it > pretends that ASID is supported by just flushing its TLB everytime you Nope, it does not. It detects whether ASID is supported or not. If supported it will also figure-out number of ASID bits supported by HW. SiFive board does not have ASID bits so this implementation successfully detects that number of ASID bits are 0 and fallbacks to original way of local TLB flushes. > change sptbr. I suspect the performance gain you see is just due to > saved TLB flush as TLB flush is super expensive in QEMU (all translation > block jumps need to be cleared). Yes, performance gain is due to saved TLB flushes. On HW which supports ASID bits, we will see more performance improvements. > > I have my version here https://github.com/nbdd0121/linux/tree/asid. I > haven't done code cleanups yet, but this version has correctness of its > ASID code tested on our TLB simulator tool (which unfortunately I can't > share right now as it involves with unpublished works). Except few minor differences. You version of ASID allocator is same as mine. In fact there are lot of similar code framgements in your version compared to Linux ARM64 as well. I am sure this patch will work for you. > > In fact my submit my previous patch series exactly as the basis of this > patch. This patch is based your patch series so I suggest you take this patch and try it on your simulator. Suggestions and improvements to this patch are welcomed. I would be happy if you can assist me to try on your HW. Regards, Anup