Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1310898ybg; Fri, 18 Oct 2019 15:41:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWX4q+Zx2yUiX4mugmJjOKA/P1QqP2K6mYc1GwXTaQDLtJUzz7w8/LZL+IKULPk+f4b5VM X-Received: by 2002:aa7:cfc2:: with SMTP id r2mr12142600edy.229.1571438473924; Fri, 18 Oct 2019 15:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571438473; cv=none; d=google.com; s=arc-20160816; b=HVOBqXAG0Yjnsed77tIgAL+cKaN+UaLIC/JTqAWExq+UaZqhG2FQKHZ01MEgBG6Bv5 SYMUFghzQVSBKpZeQH8B8DjXDzjAhDg4dgp4QP5p5Wl59RphzVXZcwxRcRoN77yDR1XG cAknpXHe4P4Deo2rlaksi79G1hccn5xSHzKlFJ0UO+9O5CWFxrNHMOfhY5biLiE33AL1 BfEm/pWvFV8xfuvsHdCQOQd+G9s5aLJMjCVyKJasf0FjAETbwEcndU5sjkZ2Zs8qDtS1 Z1GGpj+PQcHvaiCktyKp587BVv5WC/IrZmOU9aZs/flkp91Toj29ShKCoIXdWsyZTSB3 +T1w== 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=I5uiLwmoQ+UosJLYhlwMFvtZSM4kU7jPQZOvk7J0zfE=; b=0Lte3EdLRRX2peA0tHGeAO5mZOWBl65dxUHH9I0yVRE5FGOTrxW4KjDpLQkjz+5T21 RQT0BehFi7765D3S4Eh3ZVVVo+X7Yb0dRhKY0iQNsS3TaCwh3GYIG8UqU4uwUqSllDQr aM0POQO8q7TnbPS9Voif/oQ96rvuPdfd0ilRb3/5cSoSbh/EdeVuFnaaJrVZKyq93OrG ML/JOsqoBnydW85V9PC7LmgezxMk/HDJYrb2uOYK6wzVFhkvJFtqadvYBxkv7X9XOXVd ktg8lmrbX/7aoae/Tg1NIBclJsCJV408Uy9hkuWgI4pocZ0+OGNN3m+Sj4kZW0JkN2N6 0RXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=XOKhHh0n; 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 v31si4766435edm.402.2019.10.18.15.40.50; Fri, 18 Oct 2019 15:41:13 -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=XOKhHh0n; 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 S2390502AbfJRF1f (ORCPT + 99 others); Fri, 18 Oct 2019 01:27:35 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35202 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbfJRF1e (ORCPT ); Fri, 18 Oct 2019 01:27:34 -0400 Received: by mail-wm1-f67.google.com with SMTP id n124so1047857wmf.0 for ; Thu, 17 Oct 2019 22:27:32 -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=I5uiLwmoQ+UosJLYhlwMFvtZSM4kU7jPQZOvk7J0zfE=; b=XOKhHh0naS5QNQVOxy3d8B/YfNidBHYJz3f1c7FjVlmosH5Qz36FN+IV9Ca20+vpCk Zkq22eYC6P2UKvSostC7Y69bl9ecqj9HwulutQKBKivrHtMd4ZiWIPxTs39U/rNghF+p cFdAI2F43Bl0FH9rkUx14qGaH0MAK05tdg2lPLn6M3DhWVk+V1QD23LVJoJpwuOyBbYZ VgAfmi08rDRpjl9Wz48HrY7fVRXd4LK3/8qbFc5kHWRu0vusRAoLBreiVNvBOQfUHdkC 7JrRzXfe7Qz1CiONoX7vuUMOGtPSKvWW4/QQNEujMAnhDy68QKy2RtBCpm7av87tRvy8 sVDQ== 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=I5uiLwmoQ+UosJLYhlwMFvtZSM4kU7jPQZOvk7J0zfE=; b=ZrrU4kRNbQxBQlMZJ+t5NYxLrqNME/ScaEyLEYhmqYzLrOVFBC7DUgrusslCaWKxXa lqJbEaPkrz/FmzEH8x4stF2Vq7fzaWI2Mn4m702Scow9621SOxxBnyK/bozK7legyb0K +tCewwsmocnxTlfDoN6mpbzQkKfRnl//Yu6cTvx681g64r4EByXI/6hTCfATle602m8f 6/IPTMTgloAj3DG7+7zIDrBM1zEmEos6FwGlR8yGtX7WcB51fPJXWPyNUmgbeemgoONF LN50J2UcFCRsHJ1/+J7tCPvEqqR7nwpBgNKdZDIgPdLyrvRWUqgEQ9g5nWhVcVIX1yb2 kFfQ== X-Gm-Message-State: APjAAAUd5SVWNJR2VkR3SkYRLJZ5bVkDkIMj2MlMyauPQ7pI6DGh0pOG 4iiCOWvlHL26oYPjnqYVPp8HB7ZQ7xvyfkWlSQ24l2ba4ms= X-Received: by 2002:a05:600c:214f:: with SMTP id v15mr5241260wml.177.1571367162336; Thu, 17 Oct 2019 19:52:42 -0700 (PDT) MIME-Version: 1.0 References: <20191017173743.5430-1-hch@lst.de> <20191017173743.5430-5-hch@lst.de> In-Reply-To: <20191017173743.5430-5-hch@lst.de> From: Anup Patel Date: Fri, 18 Oct 2019 08:22:31 +0530 Message-ID: Subject: Re: [PATCH 04/15] riscv: don't allow selecting SBI based drivers for M-mode To: Christoph Hellwig Cc: Palmer Dabbelt , Paul Walmsley , Damien Le Moal , linux-riscv , "linux-kernel@vger.kernel.org List" 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 Thu, Oct 17, 2019 at 11:07 PM Christoph Hellwig wrote: > > From: Damien Le Moal > > When running in M-mode we can't use SBI based drivers. Add a new > CONFIG_RISCV_SBI that drivers that do SBI calls can depend on > instead. > > Signed-off-by: Damien Le Moal > Signed-off-by: Christoph Hellwig > --- > arch/riscv/Kconfig | 6 ++++++ > drivers/tty/hvc/Kconfig | 2 +- > drivers/tty/serial/Kconfig | 2 +- > 3 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 86b7e8b0471c..b85492c42ccb 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -76,6 +76,12 @@ config ARCH_MMAP_RND_BITS_MAX > config RISCV_M_MODE > bool > > +# set if we are running in S-mode and can use SBI calls > +config RISCV_SBI > + bool > + depends on !RISCV_M_MODE > + default y > + > config MMU > def_bool y > > diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig > index 4d22b911111f..4487a6b9acc8 100644 > --- a/drivers/tty/hvc/Kconfig > +++ b/drivers/tty/hvc/Kconfig > @@ -89,7 +89,7 @@ config HVC_DCC > > config HVC_RISCV_SBI > bool "RISC-V SBI console support" > - depends on RISCV > + depends on RISCV_SBI > select HVC_DRIVER > help > This enables support for console output via RISC-V SBI calls, which > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > index 67a9eb3f94ce..540142c5b7b3 100644 > --- a/drivers/tty/serial/Kconfig > +++ b/drivers/tty/serial/Kconfig > @@ -88,7 +88,7 @@ config SERIAL_EARLYCON_ARM_SEMIHOST > > config SERIAL_EARLYCON_RISCV_SBI > bool "Early console using RISC-V SBI" > - depends on RISCV > + depends on RISCV_SBI > select SERIAL_CORE > select SERIAL_CORE_CONSOLE > select SERIAL_EARLYCON > -- > 2.20.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv LGTM. Reviewed-by: Anup Patel Regards, Anup