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=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 3257DC43461 for ; Tue, 18 May 2021 11:57:28 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 B425660FE9 for ; Tue, 18 May 2021 11:57:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B425660FE9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=desiato.20200630; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zMpnrq0f7kWY/dbDLDiTj8M5+YOil5qDWqoRDGfJ+gU=; b=mlMl5AegJalRJf1+I7NRsq2/h xJyO4ggZzsCKUa1rRA8xdP3Wbt8WdEbD3IAtx9jr0uttPA4SC1akTd/BUAtV13G/PuT2EaPk7W7hU M8Jc1YXe+eB9FEvDlE9urWfY6FExCMxTnjScwxNT80zphJZeGy+CMV6Ds1qbu3ljC3Ufozs8k3sc6 NZH9HqxUqtXLyTAYD0iqO6QadSUcRF5m8sHki6xVRpP7vA7q2ye5bbnBdL2MpJI/RbqHaBMSAkPss K5tbD38A/6VVUHiPOpULg2P/uUw0mpArNoQtfnKcZRiFbi/z1KUD+65Qg7w9jOdP6zhSHGDouZjqV KHCE4lPUQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liyJc-000fxO-OP; Tue, 18 May 2021 11:55:13 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liyJ1-000fou-0v for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 11:54:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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; bh=2NKczrVoGJY7PlVj04dy4kkzuoUSeXLXlvSmrztk5/E=; b=OJFu3k8VSElG3qlw1N8xZmHhZR ZFTjjHcV0bgB71L5sw3VeOaf9uJ+K+KZPBfrY5/ESqP2C3zZQuXCym/S0W6EsvhcrP6R4kvRlXkit 60eivQPRxRqnMFHkfZGB2CYgUFedvpeIhKNM6123iwtveOh546GiP+f5ycf7/Za7sSQS7iinfJayZ xfQnJCa8blZ/zekK+PyBFxlbPaJt3NrW8RxgmjeIrMsY8wrFGODwNl//UACTMjr3Q7KAa+iY+YzIr +edPBw6WmODGTX/LqVInKbaMT8/YR1oVHn9Ss154eDwOrlJ9uEWNuuM5l3wKRLp1zlDMi6eJ2q7Os AiB+12vQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liyIy-00EcgR-HI for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 11:54:33 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id B066A610A2; Tue, 18 May 2021 11:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621338872; bh=MC3S5T9ebSKNql4ZYtKnrtLfalN84NmkQj4qNk6ecmU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K0COvdQJAbH+2KYupM59IrWfYnu5Vedf86uMCoB+tMKsloATLtwNQH1SoX5zhci9d jlsQ8Ll6xbBfNFStS2GGIoG5EwBc8RCHmbUF9YqMGvptYMW57T3pZtGAorL4CR+JRF Zx/0/0Pwn1PEdrb8tgMUAhtSOgkjbnqMQmoV6fkq7QbY2Tl2vgnnrZGXMUO10zSoKp pnWkWdks4aaiNmoeKG9RZlqBJOrNPvPxXwhRnwRwc9gYroWSzbFLkuuTYXkXhyn0Wm gm4+iIvyZUb0mNTVAqsgfyTT2XA878aR4EKMd4x6ZHblObcf7LcxazkeKbaJPhkSG0 D9tC39l3aUwmw== Date: Tue, 18 May 2021 12:53:48 +0100 From: Mark Brown To: Marc Zyngier Cc: Catalin Marinas , Will Deacon , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 2/2] arm64: smccc: Support SMCCC v1.3 SVE register saving hint Message-ID: <20210518115348.GA4358@sirena.org.uk> References: <20210518100919.6674-1-broonie@kernel.org> <20210518100919.6674-3-broonie@kernel.org> <87pmxotirl.wl-maz@kernel.org> MIME-Version: 1.0 In-Reply-To: <87pmxotirl.wl-maz@kernel.org> X-Cookie: Radioactive cats have 18 half-lives. 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-20210518_045432_637911_133D3754 X-CRM114-Status: GOOD ( 16.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7071563969915947193==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7071563969915947193== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="r5Pyd7+fXNt84Ff3" Content-Disposition: inline --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 18, 2021 at 11:53:50AM +0100, Marc Zyngier wrote: > Mark Brown wrote: > > +alternative_if ARM64_SVE > > + > > + adrp x15, smccc_has_sve_hint > The adrp instruction will give you a 4kB aligned address, which > results in 1 chance out of 512 to point to the right location. The > adr_l macro is probably what you want. Ouch, yes. This was working surprisingly well in my testing. > > register unsigned long r2 asm("r2"); \ > > register unsigned long r3 asm("r3"); \ > > __declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \ > > - asm volatile(inst "\n" : \ > > + asm volatile(SMCCC_SVE_CHECK \ > What happens when this is called from a context where > __smccc_sve_check isn't mapped, nor does "current" mean anything? See > arch/arm64/kvm/hyp/nvhe/psci-relay.c for an example. Ah, oh dear. I have to admit I haven't entirely been able to follow the contexts the various bits of KVM run in yet, nor how much of the normal kernel environment is being maintained :/ . I do see some ifdefery with __KVM_NVHE_HYPERVISOR__ elsewhere which could be used to take care of that particular case either by providing a __hyp mapping or just not trying to set the flag there (the latter seems safer) but I'm guessing there's others. Do we have a reliable way of identifying such contexts? --r5Pyd7+fXNt84Ff3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmCjqssACgkQJNaLcl1U h9ApmQf9GyfpU0XGiwxMR7bUtJoWHJDrJdF3QDvp1CbFF6Nzml6qoq3blmJeBWvU /1lxjBUO4Z9LaAb7kt+VekE90Ww5K4VJ6cQlnulechZTZgvg50Mb+iasqtgDAJ63 7AeReRHeqR5GL6Chu8dYa870OaWNwYYVdHMorLIyeIAg12j39oZOL7P29+0cAGnW i2Spi752z0Cmo8df4IR8F9G0G6nn1A1OAzO/ot8AGGK2rQdeSH8mrM8Z0i1IrTcM IJ9GTPCV4NcJkeC197AbeohzLdwjV4ngmpNVvRRDRW9ovdCxL7ox0/79sAG6CoTb 9yf4joF1hJmCO+EqUe24RPGQR5sJ1Q== =I/3L -----END PGP SIGNATURE----- --r5Pyd7+fXNt84Ff3-- --===============7071563969915947193== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7071563969915947193==--