Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6198460rwd; Mon, 5 Jun 2023 14:46:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JFeNUmeTBdybrOHhCYqYNPpBPRec96c9o8CPbZpvCeKoWqDIgG1T013BnnIMA5bVuIWgF X-Received: by 2002:a05:6a00:15d0:b0:65c:9e3e:889b with SMTP id o16-20020a056a0015d000b0065c9e3e889bmr1052469pfu.6.1686001595519; Mon, 05 Jun 2023 14:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686001595; cv=none; d=google.com; s=arc-20160816; b=nTsQi3ar4MT39wTI6T/ObDrvfzf/hrL+sLZXsCtz4f6qjA1R7xB6/Bwm7vH3fqPwgt wU8Mw5u9v9l+19EPb78jygB+RkXxtR6PEtJjsr7cnKmVBm//lr1tNpcfSBr7IZ0cONmi KUtQFNr6UdyEqRXhND4kMfgC4bEZ0Wh70k59WzAIC3/4Gvb8NGjnO1oCDP4Wsbhm6NdR uKNPQ/wY6SVrpRbg4z5tVjRkIRBpsiGDk9KsqUXGEUMEQVfCTFNp1r3PxqYAzrtS1WkU X6ps84cSXJoEeWo02ypXpzneUkBnPhDCkugBaxMk2H3IpuyFeUO5bDAzdDQGSeUNC7Yb te7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=rdtlZbGAkXgs/Vgno8yQ9QNGBZimOlkL72Nu0Bg8k+Y=; b=yxE4e+fGMadUZzzwHdWSXnka7e2ujl7+XGeiJIgPstv+o/LWlSYDW6LyGVTqPRWJ+b y95aUjo/H9WZRUleRNILtazEy86n8c3H0nm0j+b0ywQOGXNT2VYqJQZ9mT6zT6uCYjC/ QsACPxPeOltLGajwBWjRz1V/BuEcJVXoo51738XH2ULpt4ITbWqMcVMG6GE5ZNbybIiM eW1lgqgalSiJTWyb7IZhVz9jIWAYV+kMX2+5rY3LKSx82sFbxv6Rky5Rg8WbMFaq6IH6 3UZ+YYni+Q7/hvZfPjiNjIPOR2qLaO8+tavfeFe39gXU5j3EhXTK8Eg3SB89qPoMrOmv 4oaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hCpDQdAO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020aa79e8d000000b006501b3c200bsi5940379pfq.57.2023.06.05.14.46.22; Mon, 05 Jun 2023 14:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hCpDQdAO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231664AbjFEVcE (ORCPT + 99 others); Mon, 5 Jun 2023 17:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231562AbjFEVcC (ORCPT ); Mon, 5 Jun 2023 17:32:02 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A104D9 for ; Mon, 5 Jun 2023 14:32:00 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f730c1253fso20952195e9.1 for ; Mon, 05 Jun 2023 14:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686000718; x=1688592718; 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=rdtlZbGAkXgs/Vgno8yQ9QNGBZimOlkL72Nu0Bg8k+Y=; b=hCpDQdAOQAsN0KrmTo4NPJi5jsjUcQ+ZKvey4LhxLjTNk8K1cdJ0Z+RZywiaNMkFE1 6rWujBvNtD2W+MkBpxkbBUfynFPkShIEKVzP0QegqWVv+Mh+fbUIcMQTbwAbwn+18NGh gnVAXi6wef8KV+4Se9cv9OPRakbRjW16JvTXvya980pPL9Lv77ir2UCbVuVYh9S0inyS ckDvvBpsUbalZvqE+Pda/p6R/dL1iTcn8DkwqbWBw3/74MEKd5RlSFhOAU2MerTmkR6l HGz35+7emchd0ltBHotukD8KwezuzeQ37pzewa8QDcauW3Gwc9V3IfdiZDyHRwSklnxn 5WsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686000718; x=1688592718; 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=rdtlZbGAkXgs/Vgno8yQ9QNGBZimOlkL72Nu0Bg8k+Y=; b=XQUSAbJ7dC4PdTF8mo+H6zs9UFPr+gHDgFhuG7Ia2M1ih2U/esrTJmdKOC5RUeUwtt oFztQd+nKaqm58s8VUocbnTyKDxmZk9IpQPXOFLspY4Ko5MvopE9XjnktQs/Mo6e8/Lk e2/tXx4s9UsS6V/d91fjNE1QUb8Yd/rsUrUPvKwIF7PIgMIlKkFmhEwTRR++oUWd/ZeK FeqT7+r2QRufkzUjTTG2nD9R2SiOUZZs2aS4nqHMhhUPDn4HJQ3XJwnRq3yXFHzkYkwU SzRK26XxLeMWxojq5vOh2tWj6YVO72tkpDbVOVhV37jWVM1fMZZjOYLZ8deLjmTnmb7z XrdA== X-Gm-Message-State: AC+VfDyKcxjzM4FeILXbvg1TrSF/gd2q3ahNWkbE32D4xpik5xnH2d5b WdyNEfgdh/T1oRCqXlogAwQzEg== X-Received: by 2002:a1c:4c1a:0:b0:3f6:7fb:b60e with SMTP id z26-20020a1c4c1a000000b003f607fbb60emr300135wmf.35.1686000718695; Mon, 05 Jun 2023 14:31:58 -0700 (PDT) Received: from [192.168.1.195] ([5.133.47.210]) by smtp.googlemail.com with ESMTPSA id g7-20020a5d6987000000b0030632833e74sm10760624wru.11.2023.06.05.14.31.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 14:31:57 -0700 (PDT) Message-ID: <32754b3a-ccdb-f3cf-cbc7-f3590cc86cbf@linaro.org> Date: Mon, 5 Jun 2023 22:31:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v13 04/24] virt: gunyah: msgq: Add hypercalls to send and receive messages Content-Language: en-US To: Elliot Berman , Alex Elder , Prakruthi Deepak Heragu , Catalin Marinas , Will Deacon Cc: Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Dmitry Baryshkov , Bjorn Andersson , Konrad Dybcio , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Bagas Sanjaya , Andy Gross , Jassi Brar , 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: <20230509204801.2824351-1-quic_eberman@quicinc.com> <20230509204801.2824351-5-quic_eberman@quicinc.com> From: Srinivas Kandagatla In-Reply-To: <20230509204801.2824351-5-quic_eberman@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/05/2023 21:47, Elliot Berman wrote: > Add hypercalls to send and receive messages on a Gunyah message queue. > > Signed-off-by: Elliot Berman > --- Reviewed-by: Srinivas Kandagatla --srini > arch/arm64/gunyah/gunyah_hypercall.c | 31 ++++++++++++++++++++++++++++ > include/linux/gunyah.h | 6 ++++++ > 2 files changed, 37 insertions(+) > > diff --git a/arch/arm64/gunyah/gunyah_hypercall.c b/arch/arm64/gunyah/gunyah_hypercall.c > index 2166d5dab869..2b2a63e9b9e5 100644 > --- a/arch/arm64/gunyah/gunyah_hypercall.c > +++ b/arch/arm64/gunyah/gunyah_hypercall.c > @@ -33,6 +33,8 @@ EXPORT_SYMBOL_GPL(arch_is_gh_guest); > fn) > > #define GH_HYPERCALL_HYP_IDENTIFY GH_HYPERCALL(0x8000) > +#define GH_HYPERCALL_MSGQ_SEND GH_HYPERCALL(0x801B) > +#define GH_HYPERCALL_MSGQ_RECV GH_HYPERCALL(0x801C) > > /** > * gh_hypercall_hyp_identify() - Returns build information and feature flags > @@ -52,5 +54,34 @@ void gh_hypercall_hyp_identify(struct gh_hypercall_hyp_identify_resp *hyp_identi > } > EXPORT_SYMBOL_GPL(gh_hypercall_hyp_identify); > > +enum gh_error gh_hypercall_msgq_send(u64 capid, size_t size, void *buff, u64 tx_flags, bool *ready) > +{ > + struct arm_smccc_res res; > + > + arm_smccc_1_1_hvc(GH_HYPERCALL_MSGQ_SEND, capid, size, (uintptr_t)buff, tx_flags, 0, &res); > + > + if (res.a0 == GH_ERROR_OK) > + *ready = !!res.a1; > + > + return res.a0; > +} > +EXPORT_SYMBOL_GPL(gh_hypercall_msgq_send); > + > +enum gh_error gh_hypercall_msgq_recv(u64 capid, void *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, (uintptr_t)buff, size, 0, &res); > + > + if (res.a0 == GH_ERROR_OK) { > + *recv_size = res.a1; > + *ready = !!res.a2; > + } > + > + 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 6b36cf4787ef..01a6f202d037 100644 > --- a/include/linux/gunyah.h > +++ b/include/linux/gunyah.h > @@ -111,4 +111,10 @@ static inline u16 gh_api_version(const struct gh_hypercall_hyp_identify_resp *gh > > void gh_hypercall_hyp_identify(struct gh_hypercall_hyp_identify_resp *hyp_identity); > > +#define GH_HYPERCALL_MSGQ_TX_FLAGS_PUSH BIT(0) > + > +enum gh_error gh_hypercall_msgq_send(u64 capid, size_t size, void *buff, u64 tx_flags, bool *ready); > +enum gh_error gh_hypercall_msgq_recv(u64 capid, void *buff, size_t size, size_t *recv_size, > + bool *ready); > + > #endif