Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5599844ybl; Tue, 27 Aug 2019 07:07:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwll4F54A73hJIv1KjW+hQ+CiV1rNZALdeCGlSygyC7sMX4JFcTv6vQ1JmS2se+75hPioM X-Received: by 2002:a62:2aca:: with SMTP id q193mr26736925pfq.209.1566914843940; Tue, 27 Aug 2019 07:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566914843; cv=none; d=google.com; s=arc-20160816; b=Tob/O4Od5yyYzTkaOlqX4CkGcfEFQA3WNiI7S7C+GVn28ukKXyZ4RDbofxbRq/be81 qpRxEicub1cUEKiAVGmsss6sVnxb3msSg7hvF02VnNIsI75wD1GqA7rH/0kWKfkKWXIc BF8xmYFua7zg6dWT6hgsLR1U5UvfVFs1+pj8vqfzaDRQjNTPe1pRErX5sfXwtKpg/GOe a/o7TUivSEr0woxfAV5PI/YgSgKphm+RwQdTSn4RTuVxyAo9XTI7bDqx/GVrjT5aPWEo Gc9orfvrYvvqWavFU3U29WXf5BBBRWc57eaFn8h7YuibLxAytTkL7nWh+IiUZTn7gIZR +8Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=661U0lSjozJky25e5/EuVz5qAI0zmTf9XyJtMCPs0n0=; b=afZCsBSmS+IC7jgbxmn95i8S3ssHBDJ8HrAX4Ltt6IxUoxPxpb91Fyj1mI+2okDWDL LCHAkCRXW/QnVrtCfqSdJlMQag2xAMtryo6qnUZPaw/qEBTchYbHpNpnuBdjR6CWXcWi jgpRyJ1IyokdY7IXezYK72RC4jGWt30ay1sUVvd5Jytg5Ig3N6yyx+qh2iJc49piNcWa S+NE9JtuUjJgkmRXUS2Mb79h/MIlAq+aZnrmYKpRIyQ6KB+qSEEK8o5g7Pjmb9rbLMKS L68N1AF7RQ/XD0jVeLIZf8bA1uIvNQH+DVaIoTngmFVdKBmPAXJGgDoCYDh9xp0p9YCl ctCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=MHYvhQTl; 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 i8si2808311pjx.0.2019.08.27.07.07.07; Tue, 27 Aug 2019 07:07:23 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=MHYvhQTl; 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 S1728702AbfH0OEp (ORCPT + 99 others); Tue, 27 Aug 2019 10:04:45 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42996 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726170AbfH0OEp (ORCPT ); Tue, 27 Aug 2019 10:04:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=661U0lSjozJky25e5/EuVz5qAI0zmTf9XyJtMCPs0n0=; b=MHYvhQTl7K//OKrXEbamD4ni1 UvrLZ3Lz0teQfWmr6PngU7IqrWfwUicXW+jUHr8dLMN1JozqkCrSN4KDkJbeZ8nOtl7mds9mUT4hF 36GNcEtt2d360CH1CNyEuNrQJJ5N+eHgsdmmsx7Vdr1I81RSN86Yrh+dq8FetfkBVh50QXXrNGrRv +YdJcDZV07q5nK/ZG034qdRWyjUuF64/S+tU1oqF2QYUWEbPhLw77Sir1pvnmBoXcWfvHzj4Axs+u P6Mid9tbKsY+3lIM/mGNe/EN5/xnq7ZjP4nRaoebAqq+t8BSjVxR29XT0w1lq+v3qdJM15/WS15oN w/Qc13A5w==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1i2c5S-0004DE-5P; Tue, 27 Aug 2019 14:04:42 +0000 Date: Tue, 27 Aug 2019 07:04:42 -0700 From: Christoph Hellwig To: Atish Patra Cc: Albert Ou , Alan Kao , Greg Kroah-Hartman , Anup Patel , Palmer Dabbelt , linux-kernel@vger.kernel.org, Mike Rapoport , Alexios Zavras , Gary Guo , Paul Walmsley , linux-riscv@lists.infradead.org, Thomas Gleixner Subject: Re: [RFC PATCH 1/2] RISC-V: Mark existing SBI as legacy SBI. Message-ID: <20190827140442.GB21855@infradead.org> References: <20190826233256.32383-1-atish.patra@wdc.com> <20190826233256.32383-2-atish.patra@wdc.com> <20190827140304.GA21855@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190827140304.GA21855@infradead.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 07:03:04AM -0700, Christoph Hellwig wrote: > > +#define SBI_EXT_LEGACY_SET_TIMER 0x0 > > +#define SBI_EXT_LEGACY_CONSOLE_PUTCHAR 0x1 > > +#define SBI_EXT_LEGACY_CONSOLE_GETCHAR 0x2 > > +#define SBI_EXT_LEGACY_CLEAR_IPI 0x3 > > +#define SBI_EXT_LEGACY_SEND_IPI 0x4 > > +#define SBI_EXT_LEGACY_REMOTE_FENCE_I 0x5 > > +#define SBI_EXT_LEGACY_REMOTE_SFENCE_VMA 0x6 > > +#define SBI_EXT_LEGACY_REMOTE_SFENCE_VMA_ASID 0x7 > > +#define SBI_EXT_LEGACY_SHUTDOWN 0x8 > > As Mike said legacy is a bit of a weird name. I think this should > be SBI01_* or so. And pleae align the numeric values and maybe use > an enum. > > > + > > +#define SBI_CALL_LEGACY(which, arg0, arg1, arg2, arg3) ({ \ > > register uintptr_t a0 asm ("a0") = (uintptr_t)(arg0); \ > > register uintptr_t a1 asm ("a1") = (uintptr_t)(arg1); \ > > register uintptr_t a2 asm ("a2") = (uintptr_t)(arg2); \ > > Instead of the weird inline assembly with forced register allocation, > why not move this to pure assembly? AFAICs this is the whole assembly > code we'd need: > > ENTRY(sbi01_call) > ecall > END(sbi01_call) Actually we'll need a mv to a7 for the function id, but the point still stands.