Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5477491rwb; Wed, 9 Aug 2023 05:02:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFmNhtNlhHJFmaha3HPHpuqhF0Ahbw2bOWkxf40gd+gXVcH5wFUg53M5X3vGNCOTOsIKE8j X-Received: by 2002:a05:6a21:3291:b0:135:8a65:a772 with SMTP id yt17-20020a056a21329100b001358a65a772mr2658817pzb.50.1691582541229; Wed, 09 Aug 2023 05:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691582541; cv=none; d=google.com; s=arc-20160816; b=G5KjfSyLrW6HlU+D4uSzC2Ax3/teCJE8+0N26zUAu5UFb7yBlFa6v9kOB6Bn+JLZ8k /5a23MJBQ2MqYPqIjIlvq5Fg4JwPynhNCM7758n6iL8pzzGfNHP/JxDlJHNmHx+dY3nt NAJVX6TRty/zrRWQboovnfTtBxkD6wG+qyXg1b7wpJu+05ajhtqOjbDnfedkLwSJ4w7V yNdrYr3iDQ7zkXmfmZ7mPrFv+mLg1B49Kay1ur7F4ZXriqnix46JPL5zAcFPE5ENPggJ elq+ty4wofmdC4r5uzvMGoB4Lza3Kp0Oay6KDsMVoEfg8slzUitw4BBQsim+2ey+dT20 wbbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=Ip99IWzh9iqFef9e6nIgPBmnr/F9q3MmjgOd+8GvIIg=; fh=BbFsgyB1VYnDvwu4HCjvn81YW3VqqSpBIMFTXI+s7rM=; b=sKOqPWPlREINlFPrMRf1YL4malbVIGKRfHMiEEvZW39uNNI2iXH8C+qdPH7PAEBTTv qYl8nMvhneAytL70x67VCz0NiwJo1nnu3/OSfphNicUM0/lQLEjjMhMBta6EFQojRkI9 gHbw+E9PclUsnfb4YQvzhhvMqpQwdOqMRZLZK019jh5wWwKpnV1UhNY5gMezdOrgFjfW evO6l+XWXA8XX6L7cXRqn9+tmuBVOSnuvPrjzEvEsnkazK/TFIdfnqH8UjHbx2DxKaCq 7K5zKyz6wNEMimdHZoHSqLxpyrg3rhfOkMBFbuRnPcsXQlEPFbQ3BjR7xg7MevTxeQOu WDTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a056a00130200b006862e207c34si9311862pfu.66.2023.08.09.05.02.07; Wed, 09 Aug 2023 05:02:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230312AbjHIKZJ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 9 Aug 2023 06:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbjHIKZI (ORCPT ); Wed, 9 Aug 2023 06:25:08 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2D0B1BFB; Wed, 9 Aug 2023 03:25:06 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 1CD4D8016; Wed, 9 Aug 2023 18:24:58 +0800 (CST) Received: from EXMBX064.cuchost.com (172.16.6.64) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 9 Aug 2023 18:24:58 +0800 Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX064.cuchost.com (172.16.6.64) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 9 Aug 2023 18:24:57 +0800 Received: from EXMBX066.cuchost.com ([fe80::5947:9245:907e:339f]) by EXMBX066.cuchost.com ([fe80::5947:9245:907e:339f%17]) with mapi id 15.00.1497.044; Wed, 9 Aug 2023 18:24:57 +0800 From: JeeHeng Sia To: Conor Dooley CC: Conor Dooley , "palmer@dabbelt.com" , Paul Walmsley , Atish Patra , Anup Patel , Alexandre Ghiti , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Song Shuai , Petr Tesarik , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: RE: [RFT 1/2] RISC-V: handle missing "no-map" properties for OpenSBI's PMP protected regions Thread-Topic: [RFT 1/2] RISC-V: handle missing "no-map" properties for OpenSBI's PMP protected regions Thread-Index: AQHZxTKPVELaCqW/WUK93+UXGxBdOK/eAqwggAHhD4CAAed1gA== Date: Wed, 9 Aug 2023 10:24:57 +0000 Message-ID: <3931cc7932e644bd88f9baf2beddd00d@EXMBX066.cuchost.com> References: <20230802-purse-hydrant-6f44f77364b0@wendy> <20230802-detention-second-82ab2b53e07a@wendy> <3e066032031e4552b4b7903755deb669@EXMBX066.cuchost.com> <20230808-humility-rut-e1e46cf75708@spud> In-Reply-To: <20230808-humility-rut-e1e46cf75708@spud> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [210.186.215.22] x-yovoleruleagent: yovoleflag Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Conor Dooley > Sent: Tuesday, August 8, 2023 9:13 PM > To: JeeHeng Sia > Cc: Conor Dooley ; palmer@dabbelt.com; Paul Walmsley ; Atish Patra > ; Anup Patel ; Alexandre Ghiti ; Bj?rn T?pel > ; Song Shuai ; Petr Tesarik ; linux- > riscv@lists.infradead.org; linux-kernel@vger.kernel.org; stable@vger.kernel.org > Subject: Re: [RFT 1/2] RISC-V: handle missing "no-map" properties for OpenSBI's PMP protected regions > > On Mon, Aug 07, 2023 at 12:44:07AM +0000, JeeHeng Sia wrote: > > > > +/* SBI implementation IDs */ > > > +#define SBI_IMP_OPENSBI 1 > > I would suggest to create an enum struct for the SBI Imp ID in > > the sbi.h file. What do you think? > > I'm not really sure what the advantage of doing so is. The macro SBI_IMP_OPENSBI seems weird (I would read it as "SBI Implementation OpenSBI"). However, if we implement an enum struct for SBI_IMP_ID (There are numerous IDs available), the macro can be abbreviated to OpenSBI. By doing this, the conditional checking of the implementation ID would be more readable, as shown below: if (sbi_firmware_id != OPENSBI)