Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1765621ybn; Wed, 2 Oct 2019 23:18:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9le7G7sjKL+HVjYTlksfDVUWlPu5ROHcsu8EXuIHXdFiyUgBSGg2db/fcdTKmF3VJcqzC X-Received: by 2002:a05:6402:17a2:: with SMTP id j2mr7833208edy.121.1570083513174; Wed, 02 Oct 2019 23:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570083513; cv=none; d=google.com; s=arc-20160816; b=AxOcnfEN09DtU6pYosrhv4zreUfEiD3x+uJS3T+YChIZLzez8zZ+4DvkEVn/9IqwZf GTSkKYJqP+cOe5J9TKgdbNW/3Cj+7mlhBGR4SsVQ/HkvFHCxjodiCpPecCZxKuNSBZ1O qAxc9di+hYW16rPOA2DBqLJAKKGrZhdsTuyLL8/U4+1ZEmNEK5jwa0oRdTS7rSNQBjmo ocHCfz6qu4Ofu/UDIpkmkerC+NYkiEC4C34VpwR+jssX1LJbGwjv3f+sJwY7aJmsVFk9 Dhcj7WogSIHv4eldFDD5/9VRIIej7GLB+JrAi2zODmr0vz3Ip3KOGhSOPGlWr8EgrFP9 glSA== 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=NKOOmFJoWYoEPN+uqtmhf6aauubkx5IFocgXqh0aQII=; b=q07fhN04GGJbiyGxBAKKM53GKwiUrwb7ilx+GQ0cKLc1QcG5Gm+Ama4PJBPATY/95O SC+gLLZ3iP0vpB2YEaiHk6x6h7BECkexTwOwl9t8VvHyv3P2WyLjmNZdAKnH4Vh8j3ID ucYEEs/tAmtUZEVk+Xoeh/ErHFfxxm0Qq3mGDIxa6XA4BkPyv8W2dwbgkFnGM+CFHfA1 CHILKI6C2CDS5hc9PqUnXkRJqYyv4gRXHAK/+XpRe5jd7l0pee/LfHUWTzq7Yf1/9WjX p5DF4UoC7NL98AhxZfplVF5PJG4sBZt9511Ci+4ysER6N7CJTAKm61xDU0jZkZ8qWf3Q 1X+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=DXp0N9M7; 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 b8si898536edc.231.2019.10.02.23.18.09; Wed, 02 Oct 2019 23:18:33 -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=DXp0N9M7; 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 S1727447AbfJCFaV (ORCPT + 99 others); Thu, 3 Oct 2019 01:30:21 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33112 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725290AbfJCFaU (ORCPT ); Thu, 3 Oct 2019 01:30:20 -0400 Received: by mail-wr1-f68.google.com with SMTP id b9so1451282wrs.0 for ; Wed, 02 Oct 2019 22:30:17 -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=NKOOmFJoWYoEPN+uqtmhf6aauubkx5IFocgXqh0aQII=; b=DXp0N9M7YUJCq9IoMUwGmDeleNVsb98z4MSfodW+tVsnEydckKyJ1XMHTsB0rbtdNU sP/qSwdvfNgwx9qtCNSaU2CNk6CQgNuJ+a0xYGD9F+ZgzkBZgVULfUCN6nlKnHyMEqiq LlChvZ+diAcyvscPqIMfNJX/mYJfiVB56j1kUHWiXk0L34LWrOdxqjuz3zfewRRnLt9Z Ci7Fl2OHWikQrTFBx2qnwebIA+UoRSwoKdS1AVRSmDfG8cp/nYoHHiMMiQ5Y0+rooK7N 4/Fnj/zul2VDdZfUblpZ+zGa19KM1dmWsZVZnMA/YTORlIuq0SQvAamA92VPAkIBHTv/ HXjw== 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=NKOOmFJoWYoEPN+uqtmhf6aauubkx5IFocgXqh0aQII=; b=CUPn5lq/rxQi0Fzx0HKBRHjcqJ45O+gjwP5oI9OCxEMNYkwClFO1X/dtdq8tdslBM+ AcMw+T65zWDdCX9C59rMS7n6SCijy+mCvC6m/GBa+rWhbHQdzXY0RxcxnFTrue+TVmvw VaE6IwyY3b4hOmSVZ3RELERJk58YwtbKymrrG2Gdp3pq9vQu3WK9crUor/9JViTt+p8t 2dALN3/iGCf3JBG2W4rzjW2PBxbKHMU+ZPLaTGbWKbT6wMFn8Y7n7TK0sqfo0pBY+qL6 gDSyHybQ7YOl3JF3a7yoDI2ItA9ZV2Gr0Sv6o0JwBvcVfeUyizv3dv7mqkx51NfgPj2N VkTQ== X-Gm-Message-State: APjAAAVfdpt59MCa0XVjRCWruXtFopnkMpqmiPYuune8RQo2b0T50lvd W09ZFTcUqoX4KP4DFox5U/xZBSw82tQGXcmV7xCGfw== X-Received: by 2002:adf:ef12:: with SMTP id e18mr1611901wro.65.1570080616914; Wed, 02 Oct 2019 22:30:16 -0700 (PDT) MIME-Version: 1.0 References: <20190927000915.31781-1-atish.patra@wdc.com> <20190927000915.31781-4-atish.patra@wdc.com> <20190927222107.GC4700@infradead.org> In-Reply-To: <20190927222107.GC4700@infradead.org> From: Anup Patel Date: Thu, 3 Oct 2019 11:00:05 +0530 Message-ID: Subject: Re: [PATCH v2 3/3] RISC-V: Move SBI related macros under uapi. To: Christoph Hellwig Cc: Atish Patra , "linux-kernel@vger.kernel.org List" , Albert Ou , Alan Kao , Palmer Dabbelt , Mike Rapoport , Paul Walmsley , Gary Guo , Greg Kroah-Hartman , linux-riscv , Thomas Gleixner , Allison Randal 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 Sat, Sep 28, 2019 at 3:51 AM Christoph Hellwig wrote: > > On Thu, Sep 26, 2019 at 05:09:15PM -0700, Atish Patra wrote: > > All SBI related macros can be reused by KVM RISC-V and userspace tools > > such as kvmtool, qemu-kvm. SBI calls can also be emulated by userspace > > if required. Any future vendor extensions can leverage this to emulate > > the specific extension in userspace instead of kernel. > > Just because userspace can use them that doesn't mean they are a > userspace API. Please don't do this as this limits how we can ever > remove previously existing symbols. Just copy over the current > version of the file into the other project of your choice instead > of creating and API we need to maintain. These defines are indeed part of KVM userspace API because we will be forwarding SBI calls not handled by KVM RISC-V kernel module to KVM userspace (QEMU/KVMTOOL). The forwarded SBI call details are passed to userspace via "struct kvm_run" of KVM_RUN ioctl. Please refer PATCH17 and PATCH18 of KVM RISC-V v8 series. Currently, we implement SBI v0.1 for KVM Guest hence we end-up forwarding CONSOLE_GETCHAR and CONSOLE_PUTCHART to KVM userspace. In future we will implement SBI v0.2 for KVM Guest where we will be forwarding the SBI v0.2 experimental and vendor extension calls to KVM userspace. Eventually, we will stop emulating SBI v0.1 for Guest once we have all required calls in SBI v0.2. At that time, all SBI v0.1 calls will be always forwarded to KVM userspace. Regards, Anup