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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 ECD0FC433C1 for ; Thu, 25 Mar 2021 09:59:08 +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 50BED6192D for ; Thu, 25 Mar 2021 09:59:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50BED6192D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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-Transfer-Encoding :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-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5bcCGFTtjGH5y2mvvx2Sy0mU3qXoUY8t25OwoqhHnDM=; b=kSb0WXlPGUbmKldV/rzHae+gW ffG0zrwZ2UEat+OQe5yA19oAd6d8H4VFbiTnTr7lz3bhXKutgycRiFymK4lL6wawjq1mMzZxtokpl dMs5BT3beTiHuU0KyNLKsYi2mg2L2Tb41ElFiHq3VkYrPKwlGw9tw2cR8lGlqvPPVXuZ4l1Jor/Mw hjoSWoUqgl0vkWxngDaDsJayDLTPQpcMYEZjSYiJyYcO82PgK0k7PHVA8LE2YFftA6vpWPZGbixiO StazvhEI1TsnHBVu5K9eVhhImpsrbtijrnjLLeWj6b/z4Dep1H6CLijk/sYyh/DEBL2j+F+ErjHO3 m5sVdIsXg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPMjd-001ADq-VD; Thu, 25 Mar 2021 09:57:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPMjI-001AAr-1i for linux-arm-kernel@lists.infradead.org; Thu, 25 Mar 2021 09:56:57 +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 826B631B; Thu, 25 Mar 2021 02:56:38 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 640983F718; Thu, 25 Mar 2021 02:56:35 -0700 (PDT) Date: Thu, 25 Mar 2021 09:56:26 +0000 From: Mark Rutland To: Michael Kelley Cc: "will@kernel.org" , "catalin.marinas@arm.com" , "lorenzo.pieralisi@arm.com" , "sudeep.holla@arm.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-efi@vger.kernel.org" , "arnd@arndb.de" , "wei.liu@kernel.org" , "ardb@kernel.org" , "daniel.lezcano@linaro.org" , KY Srinivasan Subject: Re: [PATCH v9 1/7] smccc: Add HVC call variant with result registers other than 0 thru 3 Message-ID: <20210325095626.GA36570@C02TD0UTHF1T.local> References: <1615233439-23346-1-git-send-email-mikelley@microsoft.com> <1615233439-23346-2-git-send-email-mikelley@microsoft.com> <20210324165519.GA24528@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210325_095655_455431_18920010 X-CRM114-Status: GOOD ( 23.19 ) 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 25, 2021 at 04:55:51AM +0000, Michael Kelley wrote: > From: Mark Rutland Sent: Wednesday, March 24, 2021 9:55 AM > > For the benefit of others here, SMCCCv1.2 allows: > > > > * SMC64/HVC64 to use all of x1-x17 for both parameters and return values > > * SMC32/HVC32 to use all of r1-r7 for both parameters and return values > > > > The rationale for this was to make it possible to pass a large number of > > arguments in one call without the hypervisor/firmware needing to access > > the memory of the caller. > > > > My preference would be to add arm_smccc_1_2_{hvc,smc}() assembly > > functions which read all the permitted argument registers from a struct, > > and write all the permitted result registers to a struct, leaving it to > > callers to set those up and decompose them. > > > > That way we only have to write one implementation that all callers can > > use, which'll be far easier to maintain. I suspect that in general the > > cost of temporarily bouncing the values through memory will be dominated > > by whatever the hypervisor/firmware is going to do, and if it's not we > > can optimize that away in future. > > Thanks for the feedback, and I'm working on implementing this approach. > But I've hit a snag in that gcc limits the "asm" statement to 30 arguments, > which gives us 15 registers as parameters and 15 registers as return > values, instead of the 18 each allowed by SMCCC v1.2. I will continue > with the 15 register limit for now, unless someone knows a way to exceed > that. The alternative would be to go to pure assembly language. I realise in retrospect this is not clear, but when I said "assembly functions" I had meant raw assembly functions rather than inline assembly. We already have __arm_smccc_smc and __arm_smccc_hvc assembly functions in arch/{arm,arm64}/kernel/smccc-call.S, and I'd expected we'd add the full fat SMCCCv1.2 variants there. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel