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 AB00EC76196 for ; Fri, 31 Mar 2023 14:29:46 +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:References:Cc:To:Subject:From: 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=J3KBOLixSShcWcV0JGEW+n8q0cw2wQDFlp5AOQmAZtw=; b=cP7KtXoiMFifO3 NZEtzOy9L8AcUBTrH11OpmeGOn9k1+20S8FSIrRzgqWlyhAfZn13JNf/KspId7IwQRjcVkFgwAT0M direRBKngJsnjWzsvfzofGHt96M3Lc2IeD+QH0Gzyh+yFLxcpVqSmMgAE8DVcsrjwyBI2e2xQbFIR nafEtIPyCYutSfkqumqrzmiReYQPS8OFAoA8+y79TGxGmLGfuCEeMNwzvcCKcb6WdZRYOKTWwqmbn nO5iqQ0nQ6I8dfInUY8GOW6SMT1xVWaaEr6qGbsUMrF54imnwq6xpebidNuXflurYRFE+ZJDP08r/ fQU7TV9fWff3bRcVXJKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piFk3-007hZU-29; Fri, 31 Mar 2023 14:28:35 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piFj7-007h1i-1a for linux-arm-kernel@lists.infradead.org; Fri, 31 Mar 2023 14:27:39 +0000 Received: by mail-qt1-x829.google.com with SMTP id p2so16725780qtw.13 for ; Fri, 31 Mar 2023 07:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680272856; x=1682864856; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=Xf5n1p7jHpHvkrRgaWW38l7vENxHw15xBD2lZKkSQ6A=; b=MdTTYFwCWqSVkOu4qIAH7C1q9xYI6Eri+v/DfOyIPpe3IPemg+Nvt0FvQXwjUsGkxr OLra+2qBlKKOqyWEp9hKPAVd7Uz2dBqaENGbJxd0FpagTCknFaAMW4Q1p5i3n+b2yZZq VTT5O/fd2aWapfX0us5LGd8e9YX+/jhiE8UtnjIPamMFxhc43951J/1yjpDyHpCf94XG y7fCvPth2oMmtx70sBWu+Xt5nS+RWyX99hyKlitpLsaufxB31MdIFnwtkUjqv98plLzI OcCQ8c6NidiPrnM4VH99Po3kp+oUoCEpClPvi4BjqBy2Boil1DY9ycETzvHkmmWtoGTT KzwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680272856; x=1682864856; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Xf5n1p7jHpHvkrRgaWW38l7vENxHw15xBD2lZKkSQ6A=; b=ikdZ/Hpn54J/J3hFlAcdKqlFhn7b3vBiZxN/ppuLN0H3oZDFNsE8iaKieOjL/EdrYE PG02XMySGilZIVJNitmuBaPfrNfk5+sAuBdv1L4R7CZJ9CKML59JKfYilEyHuMMG8bQe eBXpJcG1Xd07xdqPeM69C+Qe0k8XxZOQfgci2X0yDaarCZI9gDSHASclYPd7VcrwvmOD kgFMCV8DN8QdIeX9eDIo0FU/5OI1jKr7ZtEG5MbMXTA8zEe9qUKG+OEBh4PPS+78sO3T T5H6QJfR9jyCuRexmL0RB3+8C/rBHTzVk3u4A5ROaULRrm/U7Ijr2yX8y1unjkAq2l+c 6dzQ== X-Gm-Message-State: AO0yUKWdP3GQHvOcq5yOxrgBG0ZnYd8QN8iDYc5pSNVtX3B7W3p0SNon VgXV9Nj4xxUthLqVYXdnVoDhmA== X-Google-Smtp-Source: AK7set/C5pqCW0ins+1roHtM3Ra5TZ5iADsNmdApxXIf/dZ7Lf6rRYntgQRnv9UBlWe8BjtwQdFS8A== X-Received: by 2002:ac8:5982:0:b0:3e3:c889:ed06 with SMTP id e2-20020ac85982000000b003e3c889ed06mr44780052qte.21.1680272856579; Fri, 31 Mar 2023 07:27:36 -0700 (PDT) Received: from [172.22.22.4] ([98.61.227.136]) by smtp.googlemail.com with ESMTPSA id ay8-20020a05622a228800b003e4d1d5ec8bsm645619qtb.52.2023.03.31.07.27.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Mar 2023 07:27:36 -0700 (PDT) Message-ID: <1cf1384a-e5b1-c445-c825-b63fcfa34f91@linaro.org> Date: Fri, 31 Mar 2023 09:27:34 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 From: Alex Elder Subject: Re: [PATCH v11 23/26] virt: gunyah: Add hypercalls for sending doorbell To: Elliot Berman , Srinivas Kandagatla , 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-24-quic_eberman@quicinc.com> Content-Language: en-US In-Reply-To: <20230304010632.2127470-24-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_072737_648593_25EE2DD8 X-CRM114-Status: GOOD ( 19.43 ) 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 3/3/23 7:06 PM, Elliot Berman wrote: > Gunyah doorbells allow two virtual machines to signal each other using > interrupts. Add the hypercalls needed to assert the interrupt. > > Signed-off-by: Elliot Berman One minor suggestion below. -Alex > --- > arch/arm64/gunyah/gunyah_hypercall.c | 25 +++++++++++++++++++++++++ > include/linux/gunyah.h | 3 +++ > 2 files changed, 28 insertions(+) > > diff --git a/arch/arm64/gunyah/gunyah_hypercall.c b/arch/arm64/gunyah/gunyah_hypercall.c > index f01f5cec4d23..0f1cdb706e91 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_BELL_SEND GH_HYPERCALL(0x8012) > +#define GH_HYPERCALL_BELL_SET_MASK GH_HYPERCALL(0x8015) > #define GH_HYPERCALL_MSGQ_SEND GH_HYPERCALL(0x801B) > #define GH_HYPERCALL_MSGQ_RECV GH_HYPERCALL(0x801C) > #define GH_HYPERCALL_VCPU_RUN GH_HYPERCALL(0x8065) > @@ -63,6 +65,29 @@ 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_bell_send(u64 capid, u64 new_flags, u64 *old_flags) > +{ > + struct arm_smccc_res res; > + > + arm_smccc_1_1_hvc(GH_HYPERCALL_BELL_SEND, capid, new_flags, 0, &res); > + > + if (res.a0 == GH_ERROR_OK) > + *old_flags = res.a1; At least one caller doesn't care about the result. So you could accept a null pointer as the old_flags argument, and in that case just don't assign it. > + > + return res.a0; > +} > +EXPORT_SYMBOL_GPL(gh_hypercall_bell_send); > + > +enum gh_error gh_hypercall_bell_set_mask(u64 capid, u64 enable_mask, u64 ack_mask) > +{ > + struct arm_smccc_res res; > + > + arm_smccc_1_1_hvc(GH_HYPERCALL_BELL_SET_MASK, capid, enable_mask, ack_mask, 0, &res); > + > + return res.a0; > +} > +EXPORT_SYMBOL_GPL(gh_hypercall_bell_set_mask); > + > enum gh_error gh_hypercall_msgq_send(u64 capid, size_t size, void *buff, int tx_flags, bool *ready) > { > struct arm_smccc_res res; > diff --git a/include/linux/gunyah.h b/include/linux/gunyah.h > index 37f1e2c822ce..63395dacc1a8 100644 > --- a/include/linux/gunyah.h > +++ b/include/linux/gunyah.h > @@ -169,6 +169,9 @@ struct gh_hypercall_hyp_identify_resp { > > void gh_hypercall_hyp_identify(struct gh_hypercall_hyp_identify_resp *hyp_identity); > > +enum gh_error gh_hypercall_bell_send(u64 capid, u64 new_flags, u64 *old_flags); > +enum gh_error gh_hypercall_bell_set_mask(u64 capid, u64 enable_mask, u64 ack_mask); > + > #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); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel