Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4580376ybc; Tue, 26 Nov 2019 11:09:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwNtrF3i3WD46Ut+1RkU9CKWwBJhRl8hYtCWAm2j+Tx3/IFD/aAQT6nVZDr7UaHsTHWfQg1 X-Received: by 2002:aa7:ca4a:: with SMTP id j10mr27292439edt.54.1574795343902; Tue, 26 Nov 2019 11:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574795343; cv=none; d=google.com; s=arc-20160816; b=YneVyzS4CF1RhiNzn7MhPxdjFoU14snX1DYaarIW21dv2/pnhPlyzsJ3VUOxKYexxA MFLhlagVv0TSKluqwzTYKNU0ENtR6UeOvtU9j4Zop3R79V6yQeQ/reIFlOzADRDhKqy7 QUoMr/IqH9nNEyP8JQ8ycVdXORyWVzJNkWjJXucxXs6neBrB877pkaH0J6kBU9lyiTvE zcwCTNXZbXgKYw/o+77cUSrgqzv1U0lEtZXp2zotCEgLMjSgKyYjFPV4ehkgIGCy1g0c 87q4t4zLpgHy95tYLJ3nBhyf5aazIk8ielTCCXJrSfZ2+C9rqCg669k/kgR3FK0K/UZf BaqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:wdcironportexception :ironport-sdr:ironport-sdr:ironport-sdr:dkim-signature; bh=a3Cq15pCtqO2bg7nAD4VbqWwG+a62wbtl/ovCMA+1JM=; b=LW9amwPEIYv2CtITVOkDhXZ/dGfOVq4H88lbS31tYM0gj/ZMpBxli/RI7z60ZhOllC 8LTG3Z1Yu/AygjPrhjis3TIgWE6WGZbDjUciVfIBzs0xbJaj8zWQG8gSoQHbxp5cJ2h2 rC/TSITl4bF7SliRWPCDCnS/ozY4WhP88qk9/a/9zccuZTNst+LmA3UY7l3jhQxFmzzL jfzLtbCLA+XtfvFvgmbVJewCt0+kuLRRtPzN3Jb2zICemjUGw0pvPTcEUZoKllq4IIOY 4ImN7Xxhl1njSjGURCaGMqkbcdfhxwlPUAezX/i+HAzESi5k6Yhgc6LvvhqBjp+vGpVI 1suQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=PB1TrApq; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a30si8703154eda.259.2019.11.26.11.08.38; Tue, 26 Nov 2019 11:09:03 -0800 (PST) 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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=PB1TrApq; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727105AbfKZTF3 (ORCPT + 99 others); Tue, 26 Nov 2019 14:05:29 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:62441 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726052AbfKZTF2 (ORCPT ); Tue, 26 Nov 2019 14:05:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1574795129; x=1606331129; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2tYGSMNcs0UW5Lvpl6YDf0Tvze90VFHUzSCbHuotN/Y=; b=PB1TrApqXL5cuyt9fDw8haeQVSPFwU+HhI+p5JarF2526gLUoJfE/OAR c01bPPQ2jWZ6tfMQ+fneaYCZZRpMRy/gx6bfzNw/HjYEufH0KFH2o9mpQ bjyCKEbZooxxgXN1sd5dJwqsdoURvagGtETkFb6eI7b3OE53pxTiWrykZ RTxXlKUDOuk7RWx84ZEA+XccXLEzeYaEMqHWTCAng4nNKnbRidNAZfVnI huLdMwsTgMEcG3gXDWj0iE76Sg5k66AAfTLebJSI2Rri58BEW40VXlka8 cIVu47WKhe/zY4CNf+4deXXH3xemTMp2afLl9wa/pnwrKB7i+tVA/5fEF Q==; IronPort-SDR: RSHekiM2ktTP1Fy2hRLyJS7EDFBn69Ti6V1vT00Li8I7tnDJKX7qfp+XUFINtuEmjAeeCUjmDJ jinr8DTwJFuXdG8pCNr9ROcNYulvFJcaAycHsMr1wu5MO9PJu7W6aiIMv4wRqSQ7GTBo31M/ex Z2aCmAueJfqQAYEsoDS1w0PMVmJeUAN3DMybvHXeKlApBY94MOTH5XxfS3GvhoUbEP8lyiBnMu eZfuSmK70JHdp+J6lRaacB8RrfxdZg1BTsPkGGhzTnTedUb/TXBRotqIBLGtRnE2ki4mqP/IJr qT8= X-IronPort-AV: E=Sophos;i="5.69,246,1571673600"; d="scan'208";a="128481924" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 27 Nov 2019 03:05:29 +0800 IronPort-SDR: NxX2HEtXc3w80hllkIiLNPL070rWoCcG2mzbi4235JPMIqghBmncA9794qRg8szFUnWEFb6yKV KKYWo9oevq1GuHyVINFkZUtavVsxWLCj2zJPFVVw43sbpyv46pShPwqoL1OcCS0VyNiogmmi1k S8gtYqPlWpf0a2TQ6eM31RqvvK6ZZM/i/7lic4wOece6xfT+wZV58BSmtr3gToa96Eea0fwY6/ Npa4+VGKny69jwACx1EToLM9WJRRF2cMQLg13RepVLh97pXcetjVLbstKODllZil7Z3m2F28S3 dGDp5AXMMAZ1vIgUk6kefNfm Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2019 11:00:06 -0800 IronPort-SDR: nxYeJpflgf54V2H2m4tS5AoYPhejdMtOxwXGMEpLk0poTU5aapkCjQSswOYP3wGvbOLWQ0nyl5 aJT1M7YX96RukqYxDqEvdZBsDgOneOpmX73Sg2wfzaZeZp2lWUDWiSDnZe1tOfrC73dmdkdMId 3FJWqp+VkDFmthixKtXkAVdh+m2Rr+LnSxtc2Eciu/pVUaDXI4voO4M2ZTvr118Dq3qcFMMmNA 6QYOx/VcZNJM4e6ZZzyGnQ5ph4Qb5dF53L8Wd4IhJ/8U7MTxHcRkUrG248nourw/3wnmgxK3Xe 4N4= WDCIronportException: Internal Received: from usa003951.ad.shared (HELO yoda.hgst.com) ([10.86.50.226]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Nov 2019 11:05:28 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , Alexios Zavras , Anup Patel , linux-riscv@lists.infradead.org, Mao Han , Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner Subject: [PATCH v5 0/4] Add support for SBI v0.2 Date: Tue, 26 Nov 2019 11:04:59 -0800 Message-Id: <20191126190503.19303-1-atish.patra@wdc.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Supervisor Binary Interface(SBI) specification[1] now defines a base extension that provides extendability to add future extensions while maintaining backward compatibility with previous versions. The new version is defined as 0.2 and older version is marked as 0.1. This series adds support v0.2 and a unified calling convention implementation between 0.1 and 0.2. It also add other SBI v0.2 functionality defined in [2]. The base support for SBI v0.2 is already available in OpenSBI v0.5. This series needs additional patches[3] in OpenSBI. Tested on both BBL, OpenSBI with/without the above patch series. [1] https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc [2] https://github.com/riscv/riscv-sbi-doc/pull/27 [3] http://lists.infradead.org/pipermail/opensbi/2019-November/000738.html Changes from v4->v5 1. Fixed few minor comments related to static & inline. 2. Make sure that every patch is boot tested individually. Changes from v3->v4. 1. Rebased on top of for-next. 2. Fixed issuses with checkpatch --strict. 3. Unfied all IPI/fence related functions. 4. Added Hfence related SBI calls. 5. Moved to function pointer based boot time switch between v01 and v02 calls. Changes from v2->v3. 1. Moved v0.1 extensions to a new config. 2. Added support for relacement extensions of v0.1 extensions. Changes from v1->v2 1. Removed the legacy calling convention. 2. Moved all SBI related calls to sbi.c. 3. Moved all SBI related macros to uapi. Atish Patra (4): RISC-V: Mark existing SBI as 0.1 SBI. RISC-V: Add basic support for SBI v0.2 RISC-V: Introduce a new config for SBI v0.1 RISC-V: Implement new SBI v0.2 extensions arch/riscv/Kconfig | 6 + arch/riscv/include/asm/sbi.h | 177 +++++++----- arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/sbi.c | 547 ++++++++++++++++++++++++++++++++++- arch/riscv/kernel/setup.c | 2 + 5 files changed, 660 insertions(+), 73 deletions(-) -- 2.23.0