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=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 914B0C433E0 for ; Thu, 11 Feb 2021 15:33:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 4806864D9E for ; Thu, 11 Feb 2021 15:33:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4806864D9E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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=merlin.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=lRCQMoPQMQcTKnn3stYbzoYjTbFdual9twvI177fJMU=; b=zyuzmeVfhP7Ejv3qX3oFIKuaI rS8BXg7vFG5F+RoIgvICxG1Ek7j4bxPYZ1O2BhzvEABz39Ex/ETMxpX1WlYATP2rxoYVVyOMLkemQ W8ePjY7sr6SS6Xn2oGm632SQa3Msg+lkOfYj1/QLZnZ+cmLVHVT5AwpjCQ0fVOhRN5gd5lX8Btz/g msVvwvf23q4iVLt1rg3K+/7aFSTKlNhbZ6av+SXsTKTyQhDZnpS5fIfX7VgvcTkXNfPXhO1SzhvCV WjUrSBgzdONtokzSk9dzaZmNdqFScHunztYffvnLZS7YEPhPQZb/7yYAJbFy7sjBjTMLmc1B8WB6B DD7iw6MfA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lADxH-0001Kg-Bm; Thu, 11 Feb 2021 15:32:31 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lADxE-0001Jk-TH for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 15:32:30 +0000 Received: by mail-pj1-x1034.google.com with SMTP id q72so3586064pjq.2 for ; Thu, 11 Feb 2021 07:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QgFTmgXQGiqIKd8Yj0TUSai/AxpTkOZablyty8uKeWs=; b=fe9rmSwpPG6/cICUyh5vAqXFbE0rZ2ghlkJ1JD599XlNP1DSCFLWB94x6hp/zCsL3J sta5FsZwxZuxs9EGz6xDKMn3wnwLoqaClFVGiLnCLtQ389h4qulfwQjNVNw3Oj0telzO Pa09qtrpl7PunI9Su2hm7p1bffkTzRmn+eKMTGFm1G36JI5vrj++ds2/8S6QhRdupyJk Mur4RhLxWMQ9q9jHUMEzkXtrEF+cOdREcRQdpnxqOP/avNd+O8SZMJ13XHJW+6u14Ko/ QxcN7XvyYkhpaUPsREKxMwvD2KELNdbJOwybrJZNmFPV8qMolK6frgmDAVPStClu1J2H OdcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QgFTmgXQGiqIKd8Yj0TUSai/AxpTkOZablyty8uKeWs=; b=rwzX5ruq+qXP1rfjTFw5Awes0yorhzKPyZXJppny1lC2RfcJjbtC63HldURoFMWFFE wcV289Sn34JdbJB94L1ROp0oJkgrthvku0Kt8DftYOhSsLaeZb+YBUY6Q23O6mL13uxr 99NyxYe1PWMhjxFu5EeiVAhp26Wn5zJuUrz6J4L77cSEeXEbn/P+2sHJGnd3oG5U2ENU Ew6dwF2MW+aYMszkigj1JZYBWUK/tEYpky5zweyqS6/HIKR+fSa+44FlhLjxx0Zx0XKA 2GiSo+Adg0+CLiJ0nfgH/tZMc+TxeKbsGD+aytSMKG7ny2Qth9g1rhW+vWHTCfU/+FDw gaRg== X-Gm-Message-State: AOAM532ZFER81j6U8TaXKk/Qyaaw21XD+Wrrg0pI3oRJ6i2xyWOCkSkb p1U11zMnFlstPYQWvlaQoUb4 X-Google-Smtp-Source: ABdhPJwv7fLaLq77pnuho7qi6QrDXBBzzM3uo0EsfxioJXGCbIhZdJv8ths0icJyjaWvsWcKadCoxg== X-Received: by 2002:a17:902:b285:b029:e1:5b44:454 with SMTP id u5-20020a170902b285b02900e15b440454mr8152642plr.54.1613057544628; Thu, 11 Feb 2021 07:32:24 -0800 (PST) Received: from work ([103.66.79.29]) by smtp.gmail.com with ESMTPSA id e7sm4656075pfd.169.2021.02.11.07.32.22 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Feb 2021 07:32:24 -0800 (PST) Date: Thu, 11 Feb 2021 21:02:20 +0530 From: Manivannan Sadhasivam To: linux@armlinux.org.uk, will@kernel.org, arnd@arndb.de Subject: Re: [PATCH v2] ARM: kernel: Fix interrupted SMC calls Message-ID: <20210211153220.GB22704@work> References: <20210118181040.51238-1-manivannan.sadhasivam@linaro.org> <20210201123602.GD108653@thinkpad> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210201123602.GD108653@thinkpad> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_103229_296405_B4A6DCFA X-CRM114-Status: GOOD ( 26.75 ) 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: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bjorn.andersson@linaro.org 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 + Arnd On Mon, Feb 01, 2021 at 06:06:07PM +0530, Manivannan Sadhasivam wrote: > Hi, > > On Mon, Jan 18, 2021 at 11:40:40PM +0530, Manivannan Sadhasivam wrote: > > On Qualcomm ARM32 platforms, the SMC call can return before it has > > completed. If this occurs, the call can be restarted, but it requires > > using the returned session ID value from the interrupted SMC call. > > > > The ARM32 SMCC code already has the provision to add platform specific > > quirks for things like this. So let's make use of it and add the > > Qualcomm specific quirk (ARM_SMCCC_QUIRK_QCOM_A6) used by the QCOM_SCM > > driver. > > > > This change is similar to the below one added for ARM64 a while ago: > > commit 82bcd087029f ("firmware: qcom: scm: Fix interrupted SCM calls") > > > > Without this change, the Qualcomm ARM32 platforms like SDX55 will return > > -EINVAL for SMC calls used for modem firmware loading and validation. > > > > Signed-off-by: Manivannan Sadhasivam > > A gentle ping on this patch! > Ping again! Thanks, Mani > Thanks, > Mani > > > --- > > > > Changes in v2: > > > > * Preserved callee saved registers and used the registers r4, r5 which > > are getting pushed onto the stack. > > > > arch/arm/kernel/asm-offsets.c | 3 +++ > > arch/arm/kernel/smccc-call.S | 11 ++++++++++- > > 2 files changed, 13 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c > > index a1570c8bab25..2e2fa6fc2d4f 100644 > > --- a/arch/arm/kernel/asm-offsets.c > > +++ b/arch/arm/kernel/asm-offsets.c > > @@ -23,6 +23,7 @@ > > #include > > #include > > #include > > +#include > > #include "signal.h" > > > > /* > > @@ -147,6 +148,8 @@ int main(void) > > DEFINE(SLEEP_SAVE_SP_PHYS, offsetof(struct sleep_save_sp, save_ptr_stash_phys)); > > DEFINE(SLEEP_SAVE_SP_VIRT, offsetof(struct sleep_save_sp, save_ptr_stash)); > > #endif > > + DEFINE(ARM_SMCCC_QUIRK_ID_OFFS, offsetof(struct arm_smccc_quirk, id)); > > + DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS, offsetof(struct arm_smccc_quirk, state)); > > BLANK(); > > DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL); > > DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE); > > diff --git a/arch/arm/kernel/smccc-call.S b/arch/arm/kernel/smccc-call.S > > index 00664c78faca..931df62a7831 100644 > > --- a/arch/arm/kernel/smccc-call.S > > +++ b/arch/arm/kernel/smccc-call.S > > @@ -3,7 +3,9 @@ > > * Copyright (c) 2015, Linaro Limited > > */ > > #include > > +#include > > > > +#include > > #include > > #include > > #include > > @@ -27,7 +29,14 @@ UNWIND( .fnstart) > > UNWIND( .save {r4-r7}) > > ldm r12, {r4-r7} > > \instr > > - pop {r4-r7} > > + ldr r4, [sp, #36] > > + cmp r4, #0 > > + beq 1f // No quirk structure > > + ldr r5, [r4, #ARM_SMCCC_QUIRK_ID_OFFS] > > + cmp r5, #ARM_SMCCC_QUIRK_QCOM_A6 > > + bne 1f // No quirk present > > + str r6, [r4, #ARM_SMCCC_QUIRK_STATE_OFFS] > > +1: pop {r4-r7} > > ldr r12, [sp, #(4 * 4)] > > stm r12, {r0-r3} > > bx lr > > -- > > 2.25.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel