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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C9331C636D3 for ; Tue, 31 Jan 2023 16:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c849n3EFnOgQi3pTlOUIEWPkzF90U4koPpS3SULVxoo=; b=w4tbdNTvsbRW2s IvXKSQJvGzHmSawRU6wzdxqDAnJBWvkZ9xEHLOTEnYKnkOU8PcM297ZpF85H+VQsCxlwfvJxUO7at duw2OJ3DnKvM0xwv235kuZJzFRB9FLn0rcePfPxPjGAW40yYVWOap7oTnoXGXX9pUamcjaph2zwMf RcWJ6ddkFiu2uXx7gQI1IxL73ldA4Afl1XmB97yQk2XScF8axULi3G81FpEgjHhkc/gONGfeZoMMd 5k2XWLgId8w/1XVViFNKa2KmEfugmib9EXMGJ5muuoxNObI/lgTuL55as7fjVJunPbu528EgmeBRQ JyiVbD7iArr1eU1+dKeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMtJT-008eiv-Hu; Tue, 31 Jan 2023 16:16:52 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMtJK-008egW-R7 for linux-arm-kernel@lists.infradead.org; Tue, 31 Jan 2023 16:16:44 +0000 Received: by mail-wr1-x42e.google.com with SMTP id m14so14245752wrg.13 for ; Tue, 31 Jan 2023 08:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=sC+Di4TlxPVQsXJqfIn37g9Ynl7ooeDJgBJ8CzuZpDw=; b=Uf78pptncObWY5xdYUfe2j7UvjXYtPw+VQcbxe0alttk6JFQDrg6tA8iJX9Ohj8VzT YN8cYyfZ3DHpsnjtlWbzm0bM23MsAAn1Gum53E1PuLNlld7t3g6HuFYoLvWmrCNr1vWx y7rVfl0sn40yXsIZxuBmSgcsFpfTfmWn3OHOs6SpCyZAgcS6Q7ogT4ewMNKf41HMnmvc u3HuWpTh0gjdWAqWRl/sQ5mN2kvUKGOq9wy1H8ibGKOphJctkWcKCbiE7zWqduPsYosk R4y8TZQ76fQfEQ20NlM04AsnMKT+ODQOnRWu99lrENzhXJ4+w7Jeid5rqDIe1s2eTJLT MmBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sC+Di4TlxPVQsXJqfIn37g9Ynl7ooeDJgBJ8CzuZpDw=; b=n+mnHeCh4EMM2jx577H2mid1i7NynS55ECcYcFPBW0NTa10VP7U1x4lHZyHjI4jg9B Ev4Y6kxMbuySjSUWIgLKYTz/qTTBODohKJCj6QuHkYQSAUJUY9yLr9kofSCRXbx1h3W7 6S9YGbh4/v078azvzXp6nKaJ3Om2blyG6OYrL1uYJ1SUNfG9FeL3O6TUDU87Qr14v8qG bjSLSayZ9jYK+MfEvAYVlaUfDKoCJJZDVLUh8hXL9VEZ6uqB3jGAo/Z3E+5wVHP/KmzW K9Kz1NgTpxGqOOZ2xZcAiEwrb7YK4iqvUNPdpiVslal5gWnRs98dDegz2B/qmBu5ZAfO GvSw== X-Gm-Message-State: AO0yUKWxCQKteMvmVQG7yb6en+lzgBQgLKk+keT9A3TvTDA0AFzfz51B PSgmnFrl5f9VKv0cmfhbc3vlxw== X-Google-Smtp-Source: AK7set+z2vha8SMTRFw07oToyZO54cqTLBQQuhLnB/koaRsR37m5k+ULuqFbD5HHG6hr1qZjtljxKQ== X-Received: by 2002:adf:dd12:0:b0:2bf:afdf:13db with SMTP id a18-20020adfdd12000000b002bfafdf13dbmr24003759wrm.47.1675181797823; Tue, 31 Jan 2023 08:16:37 -0800 (PST) Received: from [192.168.1.195] ([5.133.47.210]) by smtp.googlemail.com with ESMTPSA id m14-20020a5d6a0e000000b002bfd09f2ca6sm13188926wru.3.2023.01.31.08.16.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Jan 2023 08:16:36 -0800 (PST) Message-ID: <8e21109b-37d9-982b-1cdb-aeaafaa986ea@linaro.org> Date: Tue, 31 Jan 2023 16:16:34 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v9 07/27] virt: gunyah: msgq: Add hypercalls to send and receive messages Content-Language: en-US To: Elliot Berman , Bjorn Andersson , Alex Elder , Murali Nalajala , Catalin Marinas , Will Deacon Cc: Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Dmitry Baryshkov , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Bagas Sanjaya , Marc Zyngier , Jassi Brar , Sudeep Holla , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230120224627.4053418-1-quic_eberman@quicinc.com> <20230120224627.4053418-8-quic_eberman@quicinc.com> From: Srinivas Kandagatla In-Reply-To: <20230120224627.4053418-8-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230131_081642_974674_BDD05B19 X-CRM114-Status: GOOD ( 21.06 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 20/01/2023 22:46, Elliot Berman wrote: > Add hypercalls to send and receive messages on a Gunyah message queue. > > Signed-off-by: Elliot Berman > --- > arch/arm64/gunyah/gunyah_hypercall.c | 33 ++++++++++++++++++++++++++++ > include/linux/gunyah.h | 5 +++++ > 2 files changed, 38 insertions(+) > > diff --git a/arch/arm64/gunyah/gunyah_hypercall.c b/arch/arm64/gunyah/gunyah_hypercall.c > index ffed4b71641f..d93ad2c08479 100644 > --- a/arch/arm64/gunyah/gunyah_hypercall.c > +++ b/arch/arm64/gunyah/gunyah_hypercall.c > @@ -13,6 +13,8 @@ static const uint32_t gunyah_known_uuids[][4] = { > }; > > #define GH_HYPERCALL_HYP_IDENTIFY GH_HYPERCALL(0x0000) > +#define GH_HYPERCALL_MSGQ_SEND GH_HYPERCALL(0x001B) > +#define GH_HYPERCALL_MSGQ_RECV GH_HYPERCALL(0x001C) > > /** > * gh_hypercall_get_uid() - Returns a UID when running under a Gunyah hypervisor > @@ -71,5 +73,36 @@ void gh_hypercall_hyp_identify(struct gh_hypercall_hyp_identify_resp *hyp_identi > } > EXPORT_SYMBOL_GPL(gh_hypercall_hyp_identify); > > +int gh_hypercall_msgq_send(u64 capid, size_t size, uintptr_t buff, int tx_flags, bool *ready) > +{ > + struct arm_smccc_res res; > + > + arm_smccc_1_1_hvc(GH_HYPERCALL_MSGQ_SEND, capid, size, buff, tx_flags, 0, &res); > + <-- > + if (res.a0) > + return res.a0; > + > + *ready = res.a1; > + > + return res.a0; --> this can be made more readable with code something like: if (res.a0 == SMCCC_RET_SUCCESS) *ready = res.a1; return res.a0; > +} > +EXPORT_SYMBOL_GPL(gh_hypercall_msgq_send); > + > +int gh_hypercall_msgq_recv(u64 capid, uintptr_t buff, size_t size, size_t *recv_size, bool *ready) > +{ > + struct arm_smccc_res res; > + > + arm_smccc_1_1_hvc(GH_HYPERCALL_MSGQ_RECV, capid, buff, size, 0, &res); > + > + if (res.a0) > + return res.a0; > + > + *recv_size = res.a1; > + *ready = res.a2; > + same comment. > + return res.a0; > +} > +EXPORT_SYMBOL_GPL(gh_hypercall_msgq_recv); > + > MODULE_LICENSE("GPL"); > MODULE_DESCRIPTION("Gunyah Hypervisor Hypercalls"); > diff --git a/include/linux/gunyah.h b/include/linux/gunyah.h > index 6724d1264d58..b5f61c14ec1e 100644 > --- a/include/linux/gunyah.h > +++ b/include/linux/gunyah.h > @@ -104,4 +104,9 @@ struct gh_hypercall_hyp_identify_resp { > > void gh_hypercall_hyp_identify(struct gh_hypercall_hyp_identify_resp *hyp_identity); > > +#define GH_HYPERCALL_MSGQ_TX_FLAGS_PUSH BIT(0) Please move unrelated changes from this patch to the patch that actually uses these. > + > +int gh_hypercall_msgq_send(u64 capid, size_t size, uintptr_t buff, int tx_flags, bool *ready); > +int gh_hypercall_msgq_recv(u64 capid, uintptr_t buff, size_t size, size_t *recv_size, bool *ready); > + > #endif _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel