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 EB8F2C74A5B for ; Tue, 21 Mar 2023 15:51:15 +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=Erw1RCVDVc2xxHsEDKKHpUlnm3mYP6KEXR7EytWiscw=; b=HKbCHT+Y71QVRY sCWzCRmjQIRF3Jo3Oa+VRdzQNTQE1E8bHntyBuEmcuu71Z/vNTh8XdKsisDclZL4QDtGdKm/K87KF SM6xGaPxSd+YeZuNjfhiOU5+nT+gBP0TTZK5X5cPvpZXD4+tUfxm11x8K8Q6MxG+I0mvcHAJTKfOu R7FhFC/mOKwQohVfV9edkgQvWZkdToqKKFqzuv9w/LijDdZw55u0d2VJHN7syZj+Upm6A9msTrhGI PEOTO+4Mgry/03f4Q1MDaAvfFb8Mf/0kz5gEuw07IMA2xos4qYIlP0pt9vHpHw6qbube743DdECi1 TuHJiultoUZoLE0kceQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peeF6-00CzJH-00; Tue, 21 Mar 2023 15:49:44 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1peeF2-00CzIA-1v for linux-arm-kernel@lists.infradead.org; Tue, 21 Mar 2023 15:49:42 +0000 Received: by mail-ed1-x52c.google.com with SMTP id y4so61564445edo.2 for ; Tue, 21 Mar 2023 08:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679413779; 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=qVyJMxLLt9V1BcoFqKd8pjnJHsSXtyBIzuBrMRPzTYg=; b=Z4mXDYQzwCqGi3T12yWoKMGSngcKpTRClrvVz9eAZISdwtm5ARW3pIZ5ddFP3xCzvV A4PeFHzEOSviauwirR/jzNaDTbK7oRVXMHvGbbI0YE9bQqMrtaZuQyd0p9Zte/w+ItQ7 q0dNPJL6QkQZVlws9vTIvbYngjkpuoq1YftqCzOjphEz2VVXydhaqRvAKVp9iYruIMbn qicplBbMtQGSbt+pwuMIowR6H6+SXRBpzCeaTR9hilEKtCTMMJjJWHBrHTIFsx1/yS9H 029K47ex37CaSHrPNZtL504KOWZUZFkh5N/8UQX4Xi9RbTN/THWIeh4/49nM0E02ugtU ecKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679413779; 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=qVyJMxLLt9V1BcoFqKd8pjnJHsSXtyBIzuBrMRPzTYg=; b=kdgasmqaDaY3uXGaEvoTIO63SexYvioSf2zTaTV5hMX09zJwKjzj1FHyXrQDxdGaVo ktrRkacx6+Nf/VwbLBEzJDeFuTjt/0FFFqJdPlwHP+8qiRSrzOTviYEEUO2iAZJCz27y Ndo3nPMp14At6T2YeTqesPVly2pU7P23ENVEiPKTnZhElbDn7nPVcF9CgZ8zCNQJ8FMe 02UHsY2Awa3NuR0p166w/moB5IEjJCQIu4jFwKYMdF8Njz5aZEgOFanYkabRy3UnDHX6 o+Q4U7KzG2cTL0UgXZB4lFwDYVG6Tg/3wiqPrBOFZOZepbqkxKT3+gBgD4tUfIApMACn 1zdQ== X-Gm-Message-State: AO0yUKWdNdMn9PlcQjMkVQ/behD8phbe4YfWGLKCAVGTD7w2GL+BAGnX 8v1jntGG6mt/MoKQp/glfGwZGg== X-Google-Smtp-Source: AK7set/v7EtXCG8c8bpthQcAsWwXbRQyN2L/SFPdqduXrbjXnxoJ3VSTiW1XBy8gfJysBk30r8vCYw== X-Received: by 2002:a17:906:9bd8:b0:879:ab3:93d1 with SMTP id de24-20020a1709069bd800b008790ab393d1mr2982425ejc.4.1679413779316; Tue, 21 Mar 2023 08:49:39 -0700 (PDT) Received: from [192.168.1.195] ([5.133.47.210]) by smtp.googlemail.com with ESMTPSA id k6-20020a1709063e0600b00930aa50372csm5977851eji.43.2023.03.21.08.49.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Mar 2023 08:49:38 -0700 (PDT) Message-ID: <55f401bf-5b52-bcf5-bab5-a73d3457c470@linaro.org> Date: Tue, 21 Mar 2023 15:49:36 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v11 06/26] 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: <20230304010632.2127470-1-quic_eberman@quicinc.com> <20230304010632.2127470-7-quic_eberman@quicinc.com> From: Srinivas Kandagatla In-Reply-To: <20230304010632.2127470-7-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230321_084940_645881_3B483941 X-CRM114-Status: GOOD ( 18.16 ) 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 04/03/2023 01:06, Elliot Berman wrote: > Add hypercalls to send and receive messages on a Gunyah message queue. > > Signed-off-by: Elliot Berman > --- Reviewed-by: Srinivas Kandagatla > 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 0d14e767e2c8..3420d8f286a9 100644 > --- a/arch/arm64/gunyah/gunyah_hypercall.c > +++ b/arch/arm64/gunyah/gunyah_hypercall.c > @@ -41,6 +41,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 > @@ -60,5 +62,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, int 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 bd080e3a6fc9..18cfbf5ee48b 100644 > --- a/include/linux/gunyah.h > +++ b/include/linux/gunyah.h > @@ -108,4 +108,10 @@ 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) > + > +enum gh_error gh_hypercall_msgq_send(u64 capid, size_t size, void *buff, int 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel