From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E642C33CB1 for ; Thu, 16 Jan 2020 11:41:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8FB320748 for ; Thu, 16 Jan 2020 11:41:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="P3Vjpg65" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8FB320748 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VZ4rX8L/6KaCDbQBIXQgfdt6PSXRxEh7r/HuLtOp0JQ=; b=P3Vjpg65VeBYvv dDYB1keBjEIFOybGaLbKvYGJYX+64OANw2CePcSJYQaDmioR0iFskr5a4cNYzb7+6zd9ayNZvZP92 bpLQsrz2Qxymhywu3y9kQYW+7LmVnuaxBR7mkAxO/P7thKbaBUkd9R6vX0ICJO27bjWkCH+s84VdZ YdcJOl+HlnsPkB+RydzhxxQFHa5BeKl4RU7+UvXnOzeISfL/XnHHdu/Wt9k9XM/8UPSuuF97zfhhV 5br7rWqYY9rNvyRgVB/fMZVDtVcF9FdkZHO717WQI7H38tGayQMGEAoV0EZLVNrtlSMDNmMBzb1oR AB/8kUHR5qy5dN2Q3Eug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1is3WH-0003bv-Rc; Thu, 16 Jan 2020 11:41:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1is3WA-0003bR-M9 for linux-arm-kernel@lists.infradead.org; Thu, 16 Jan 2020 11:40:59 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E1B5D31B; Thu, 16 Jan 2020 03:40:52 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 08AA33F534; Thu, 16 Jan 2020 03:40:51 -0800 (PST) Date: Thu, 16 Jan 2020 11:40:49 +0000 From: Catalin Marinas To: Ard Biesheuvel Subject: Re: [PATCH v10 1/3] arm64: Implement archrandom.h for ARMv8.5-RNG Message-ID: <20200116114049.GD10277@arrakis.emea.arm.com> References: <20200110122341.8445-2-broonie@kernel.org> <20200114174432.GG2579@willie-the-truck> <20200115091651.GB21692@willie-the-truck> <20200115110720.GG3897@sirena.org.uk> <20200115142611.GC3429@arrakis.emea.arm.com> <20200116110245.GB10277@arrakis.emea.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200116_034054_769338_675F3457 X-CRM114-Status: GOOD ( 17.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Will Deacon , Mark Brown , Richard Henderson , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 16, 2020 at 12:10:28PM +0100, Ard Biesheuvel wrote: > On Thu, 16 Jan 2020 at 12:02, Catalin Marinas wrote: > > On Wed, Jan 15, 2020 at 02:23:39PM -1000, Richard Henderson wrote: > > > On 1/15/20 4:26 AM, Catalin Marinas wrote: > > > > Until the ifunc resolver can work with CPUID, I think we should keep > > > > adding HWCAPn bits. We can revisit this with the toolchain people before > > > > introducing HWCAP3. > > > > > > Why would the ifunc resolver not be able to use HWCAP_CPUID? > > > > It can indeed check the HWCAP_CPUID but I haven't seen any plans to > > implement the next part, actual use of an MRS instruction to read the > > corresponding ID_AA64* regs. This MRS emulation was requested by (some > > of) the toolchain people, even the architecture gained a feature to > > simplify the emulation, but followed by complete silence from the > > toolchain folk. > > But what infrastructure would the toolchain folks need to provide > here? An ifunc resolver would simply do > > void generic_func(...); > void foo_func(...); > > void *resolve_foo(long hwcap) > { > if (hwcap & HWCAP_CPUID) { > long l; > asm ("mrs %1, ID_AA64_...") : "=r"(l)); > if (l has 'foo') > return foo_func; > } > return generic_func; > } > > so all that is needed for using ID registers to do ifunc resolution is > already there. If you write the resolver yourself, it should work. I was thinking of function multiversioning (which I thought using ifunc behind the scenes) but I'm not sure what the aarch64 support level is (in gcc or clang). Anyway, I'm not aware of anyone using the MRS emulation (maybe they do and I haven't heard). I guess it doesn't help that we keep adding HWCAP bits ;). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel