Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4933739ybh; Tue, 6 Aug 2019 21:14:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCSfYfGJmIPwVvhXDmAd1SoMXse3pmf1cZjM6CS2byCDdJmiOF6GIeo1RL1h5p7I/EwrKi X-Received: by 2002:aa7:9197:: with SMTP id x23mr7206332pfa.95.1565151256290; Tue, 06 Aug 2019 21:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565151256; cv=none; d=google.com; s=arc-20160816; b=Q3nZ8tL/DJlqHKuuUlP0/V/p7B/+lZtLCmwFH+ffhjvE5s6n7/t+58mtQ5/suKgGlG NDGLsBK1evbkklZJxvdCsFhUhP52ZymZOCGWwnzcJj1NeMHZdqU6SJfGp8TyCdT4h9pt L0+W4TLXjREystY1W4ND6Ozzc+DVIyolHQbjirMVuqcUt7EMaqJZEyMIUyjIb17YKPOS xyBat97akA8iJO+5mdLQcwZGK4F0bSrFE59mfCzc4d/AHkM5ip6jOnjMxr4reYFvT5EG 9TFhyeU3FfcGbbVaDF5z6y3ZSKXTsX4CZNWTYoG+QVVAZ17UQlKampUcoaOXkzvb8pBs AYng== 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=g4Mto+u+o/GrqhpuJO5sk5R5bWRkMiGx0GZ7PDoZHhY=; b=d5uDA/4o6HqqkKWEixcrdRBdRKtTeaFNAA546W+IwBm94SJaPgAQ4qLpcWJFEb64a3 CMBZ+9Fm88xQBm1yptJDgl/6dTMv7BqjLkYz1t+4ZJIvrmeNj7ocqhrqN4wBjUJCBk6Y ljzv1xHyVZYflvOzt+s6ILXZyt8JtpZkO3n9FvqWUhps8GzZDRSL8srD5GHHrKMwhp20 bqa3KAiEt+JAgZX0VtVSTb3Eg6pd9GWo047eoqSy4036+mHsBbl974iziUQ4tMZzG9fq fafP3D5vO25PdWqUI+1njKTkVqftnqcnMxAM4YhXmWDJ5qLVZuD7le5T7PkeEH2CWHtu tRhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=hGk8PdnR; 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 l191si48294468pge.94.2019.08.06.21.13.50; Tue, 06 Aug 2019 21:14:16 -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=hGk8PdnR; 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 S1725812AbfHGEMo (ORCPT + 99 others); Wed, 7 Aug 2019 00:12:44 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55892 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbfHGEMn (ORCPT ); Wed, 7 Aug 2019 00:12:43 -0400 Received: by mail-wm1-f67.google.com with SMTP id f72so5436wmf.5 for ; Tue, 06 Aug 2019 21:12:42 -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=g4Mto+u+o/GrqhpuJO5sk5R5bWRkMiGx0GZ7PDoZHhY=; b=hGk8PdnRxQzAhPWjp8Solk8ESY/KLU+gAfVMhPUcVLaljCWzEf6pRIB+ykme9AcMV8 uAMtTV6f+Mx5YHksBZHynRnf2uhdVUemjoj0uxOcmrrY1JIbbFbS0TII60Mk2X1s8Jl/ cMMx5rySLkA8gG789t5MzOsrqa0w7yTB0pEEEBDxkaLeh3zBd+1GZU9sY+yiinrg0DAe hyS7LzVjCYue1rlQI0GA7Df+jRhMw0TfOfQbKfP7IGeSYpyIcPYtpCe5rpAeLJf0KAdC Qkxv/hMazv3lm9Tbb+XMXF7EmbBgGFSUwcCFwyhL0rLnN8CnZlKlQXh1r8Ge2wr45zvb P1zg== 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=g4Mto+u+o/GrqhpuJO5sk5R5bWRkMiGx0GZ7PDoZHhY=; b=V6azhc+0caiKa/m16vN+naIUqv25gi0qZhmCxZclm7xaJMvOUSVwoD0Bjx4D+MO3yZ ktyOa4JvAhbdBjCD6fzi/dNfc8AWcwnx7fMn7YNAUCP0/PeXX8iZmBfQRUNbY7VVNrB9 Vdkjqre4TZI0D5lV75pb9z6cgNcxYVs+8wvjVqtiWqWz+wPC85z6HDP0zhJjeEQC89p2 UjuVXyDqVyRgK26o5LotifoWYnX1c/NSjDvhueGDDoanOe0QZjAt/yoTsckz+D33PO8H pHQv2LvHsC4gd9bb/+GcMxVPxFuWJ+woYaalMlggCfUgdNWvO6E+eDDOejeHkOxnnnxC 6pBg== X-Gm-Message-State: APjAAAUD/MNZtPq6DBDteRGN/XvHQORaflMproIROk+bKypGJSD5Xqpd 4bRjc6UcFKK5mYoUWVJjGZx9qDyLMgCRkwaFIOroNw== X-Received: by 2002:a1c:9d53:: with SMTP id g80mr7920551wme.103.1565151161058; Tue, 06 Aug 2019 21:12:41 -0700 (PDT) MIME-Version: 1.0 References: <20190803042723.7163-1-atish.patra@wdc.com> <20190803042723.7163-3-atish.patra@wdc.com> In-Reply-To: From: Anup Patel Date: Wed, 7 Aug 2019 09:42:29 +0530 Message-ID: Subject: Re: [PATCH v4 2/4] RISC-V: Add riscv_isa reprensenting ISA features common across CPUs To: Paul Walmsley Cc: Atish Patra , Anup Patel , "linux-kernel@vger.kernel.org List" , Alan Kao , Albert Ou , Daniel Lezcano , devicetree@vger.kernel.org, Enrico Weigelt , Greg Kroah-Hartman , Johan Hovold , linux-riscv , Mark Rutland , Palmer Dabbelt , Rob Herring , Thomas Gleixner 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, Aug 7, 2019 at 3:24 AM Paul Walmsley wrote: > > Hi Anup, Atish, > > On Fri, 2 Aug 2019, Atish Patra wrote: > > > From: Anup Patel > > > > This patch adds riscv_isa integer to represent ISA features common > > across all CPUs. The riscv_isa is not same as elf_hwcap because > > elf_hwcap will only have ISA features relevant for user-space apps > > whereas riscv_isa will have ISA features relevant to both kernel > > and user-space apps. > > > > One of the use case is KVM hypervisor where riscv_isa will be used > > to do following operations: > > > > 1. Check whether hypervisor extension is available > > 2. Find ISA features that need to be virtualized (e.g. floating > > point support, vector extension, etc.) > > > > Signed-off-by: Anup Patel > > Signed-off-by: Atish Patra > > Do you have any opinions on how this patch might change for the Z-prefix > extensions? This bitfield approach probably won't scale, and with the > EXPORT_SYMBOL(), it might be worth trying to put together a approach that > would work over the long term? Our plan is to use bitmap instead of bitfield and all Zxyz extensions will be assigned bit positions "27 + i" where "i" will be based on order in-which they are defined in RISC-V spec. In general, "i" is just a unique relative index (starting from 0). To summarize, the existing bitfield approach can be naturally extended using bitmap. We will update this patch accordingly. Regards, Anup