Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5041523pxb; Wed, 26 Jan 2022 03:37:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmSgQFKUe88TbiIPHJIiU6qekzvpvXheLlvtnRszycCtuj2LLDFybXCoUFeeUHFNLmXHao X-Received: by 2002:a17:907:3fa3:: with SMTP id hr35mr14715890ejc.677.1643197025461; Wed, 26 Jan 2022 03:37:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643197025; cv=none; d=google.com; s=arc-20160816; b=cL040pqvhVjwGor4q4JFAWASCviR89Cf8/fH6d9YJinB3TBxwemIxHoKTuAi+pPO3z WdEWAaqkENpwe5F1EPHJDBa2LzY0wR5teumDU+/SBuslCTbdjMfZ2i0rRZtttBNPnVRJ hrK0mdFDcXRRdEshH3iVBJdFvDf0X5Abuv6dOuEzfvb3TrGt+owqHYSe7M7aYNoIiVSp UnJix/IJZs7dDuyxRlzwor4kKtpz3byrf+yVVFiuk9xeyGC97w4ry7sYK9CuJp8CDBpj cpJia40NkKtW2XkO+jJlqsFRvU/CQgZWRrc2mztZDhgGivx0QAE0uts+CBusi0a4IqZN gplw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=qypysjHth1jRiNBt/8JGIGWIt3KpK06bNS5rg4fV+Go=; b=SjTfe8FaaFaGshgsrVrt8kv48//qZf4YyEoUPpBvGlofS8sKdu7fXqdo4jDOfxC0QZ TtwT6w5DSXF19TybWOhNRyZOkvKgU7Mk1IpxXXLo4ngM+C26ANxLBjfdepi1xlC1lPEE 3NRHTP80aN7aLTUV91XQ0Fm/q7VNOWtx8fFRTmZW4UN83UnY4Ca0PhlyTyfNIs3jm0Th URPNSTebtytMFBkAP8dtBQv1w0j1uNKaTux0EgNr5naGDuuP/kJrt/K38C93uPfdfDXE GgbOMctp62fq5R9Zhr8dVUGGK2dlnFPvN4U35PkkKKLnSSjYoAljU2a8I8Jfg5PE6Fv4 g8zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si11563405edj.376.2022.01.26.03.36.39; Wed, 26 Jan 2022 03:37:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233839AbiAYW3b convert rfc822-to-8bit (ORCPT + 99 others); Tue, 25 Jan 2022 17:29:31 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:54456 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233824AbiAYW3a (ORCPT ); Tue, 25 Jan 2022 17:29:30 -0500 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-312-9uUIQKOKPQeq0Z4xvNcZPA-1; Tue, 25 Jan 2022 22:29:28 +0000 X-MC-Unique: 9uUIQKOKPQeq0Z4xvNcZPA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Tue, 25 Jan 2022 22:29:26 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.028; Tue, 25 Jan 2022 22:29:26 +0000 From: David Laight To: 'Jessica Clarke' , Atish Patra CC: Linux Kernel Mailing List , Anup Patel , Albert Ou , Atish Patra , Damien Le Moal , devicetree , Jisheng Zhang , "Krzysztof Kozlowski" , linux-riscv , Palmer Dabbelt , "Paul Walmsley" , Rob Herring Subject: RE: [PATCH v3 6/6] RISC-V: Do not use cpumask data structure for hartid bitmap Thread-Topic: [PATCH v3 6/6] RISC-V: Do not use cpumask data structure for hartid bitmap Thread-Index: AQHYEjqOgNf2MUyCekGjzXIezYRolax0US8A Date: Tue, 25 Jan 2022 22:29:26 +0000 Message-ID: <63b1a64fc25d44dabab777bf1f247863@AcuMS.aculab.com> References: <20220120090918.2646626-1-atishp@rivosinc.com> <20220120090918.2646626-7-atishp@rivosinc.com> <1AA3005C-E9C8-4E4B-900D-DD48B37CEA41@jrtc27.com> In-Reply-To: <1AA3005C-E9C8-4E4B-900D-DD48B37CEA41@jrtc27.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 20 Jan 2022, at 09:09, Atish Patra wrote: > > > > Currently, SBI APIs accept a hartmask that is generated from struct > > cpumask. Cpumask data structure can hold upto NR_CPUs value. Thus, it > > is not the correct data structure for hartids as it can be higher > > than NR_CPUs for platforms with sparse or discontguous hartids. > > > > Remove all association between hartid mask and struct cpumask. .... > > -static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask, > > +static int __sbi_rfence_v01(int fid, const struct cpumask *cpu_mask, > > unsigned long start, unsigned long size, > > unsigned long arg4, unsigned long arg5) > > { > > int result = 0; > > + unsigned long hart_mask; > > + > > + if (!cpu_mask) > > + cpu_mask = cpu_online_mask; > > + hart_mask = __sbi_v01_cpumask_to_hartmask(cpu_mask); > > > > /* v0.2 function IDs are equivalent to v0.1 extension IDs */ > > switch (fid) { > > case SBI_EXT_RFENCE_REMOTE_FENCE_I: > > sbi_ecall(SBI_EXT_0_1_REMOTE_FENCE_I, 0, > > - (unsigned long)hart_mask, 0, 0, 0, 0, 0); > > + (unsigned long)&hart_mask, 0, 0, 0, 0, 0); You don't need the cast. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)