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 F3D9FC5479D for ; Mon, 9 Jan 2023 21:46:07 +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=HbKBNERaHgkjHFbnRrUzONxvTw3m3c3P42QseRvnnHM=; b=Im7f6HX1pkBAOs UhjqxZfze0j9nmRzF4OeguYKXM21o7lC/EiBW001l6Lbd2FYli0xkr6QyMdHJmq2ZOKd5C94ECGXW kXP9QH8GlwxfrMcImG2WwpNjU22WhwBA6oibRSzd0bt0TFjsAfR+le+OJPz1DigIAkWHXFRmFq49F um6r3bj2BkTyrkYrB1ZoMTOgrojFZwMoPcLkVGZHOwFMx6IEGuETcyOIDn4ok7fKM7e+zGEV9gLko UuWtt20nqMf5pk9CSFt96P83x2CQUXeY0Lw4MpGL6TpBNTEiFTmcrfc0RDnfkH6k1M5szNBRx6uDc LvNZRCd7Axvu1N4xu3/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEzwl-004JY0-IC; Mon, 09 Jan 2023 21:44:48 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEzmg-004Fic-3n for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2023 21:34:24 +0000 Received: by mail-io1-xd35.google.com with SMTP id v65so942499ioe.4 for ; Mon, 09 Jan 2023 13:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=jgKqcAZtTPAWpAPXzq52W1m4zeeDN2d547UDbCE4Yak=; b=DQM04VXj/zxsii0d9hiGcYkmhj9XQ7VtFP6+QXxo1IQPEAxcWItpbBs0CvzcHfTclX m38CLCKrOaHwOjQY6FZ3YURiIDrhJV1XH77ohCzCdxDq7PMRmpvJVCbcrIxxDucJitnt 8kJsamnk563ShbWaYmN4siIcnCZ/Tvmv5G3mkKN8kp/YVBK7+3eMn69104kv7CVFhs+M kvyNbknS2Y6H03P8urjDRDdp/wdQz99knCaSOj3TTIML5OmVVmfUyghZXwXzLDaCOaBI zFAeVzbx/oaPJcUjdfFE2Nz9xjUVLhtPR0WfKkUj+G+bQlU07Nbhw5/AtCDTtTUADi6D X5rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=jgKqcAZtTPAWpAPXzq52W1m4zeeDN2d547UDbCE4Yak=; b=RiEk/E6Evs9AViR4IYEp/nYXSFybGJPtHd2+sZnNJrH90upKQAkgcGgVuBVSBDNT8X BaSlA2O6rJ6eTo1B1mqqT1O/id8ZIO3xKe6WWHpmCZ/ToJfK702SjM7vOlQvxEjJ4A57 lq4Jhd8O1qtZJYLkm/Ob8u1yBKQt5LvH+nNMSKMbfsd+2nOK4OZ/9Z2nkHPVK6OJ3Rlv 37Md6SD0ixwG6r3z6tLwN6kctxOSTa95lRceRAEPWXk9MJmC8pJjlA8DIeCQuqvnuMLU k6wNXLy5eSuv0K8Hn6cereetj8vfzlYZO3u7S+gS2HyK08GqP/4/ok5hAUFdfqHzwO46 9zaA== X-Gm-Message-State: AFqh2kpxRSHVRaV+om0MCJHO40zGUzynx1GxbwjAxhS2u+8jfMbhVINd TzChVLd4da+7/Af1jkoaVn0XYQ== X-Google-Smtp-Source: AMrXdXtYGtRAxGls2gGKrjWvkzPPJp94p4qpoNrderYEp6UAEo+HikmjAK7gxeFOEpO7lh19ufhrOw== X-Received: by 2002:a5e:c809:0:b0:6e0:10d4:6ac7 with SMTP id y9-20020a5ec809000000b006e010d46ac7mr57436217iol.7.1673300059572; Mon, 09 Jan 2023 13:34:19 -0800 (PST) Received: from [172.22.22.4] ([98.61.227.136]) by smtp.googlemail.com with ESMTPSA id y4-20020a056638228400b0038a416931edsm3111165jas.91.2023.01.09.13.34.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Jan 2023 13:34:19 -0800 (PST) Message-ID: <14eba2db-6f35-8b29-2b5e-6f1937b4e318@linaro.org> Date: Mon, 9 Jan 2023 15:34:17 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 From: Alex Elder Subject: Re: [PATCH v8 03/28] gunyah: Common types and error codes for Gunyah hypercalls To: Elliot Berman , Bjorn Andersson , Murali Nalajala Cc: Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Bagas Sanjaya , Catalin Marinas , Will Deacon , Jassi Brar , Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , Dmitry Baryshkov , 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, linux-acpi@vger.kernel.org References: <20221219225850.2397345-1-quic_eberman@quicinc.com> <20221219225850.2397345-4-quic_eberman@quicinc.com> Content-Language: en-US In-Reply-To: <20221219225850.2397345-4-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230109_133422_212697_A72F5B00 X-CRM114-Status: GOOD ( 21.32 ) 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 12/19/22 4:58 PM, Elliot Berman wrote: > Add architecture-independent standard error codes, types, and macros for > Gunyah hypercalls. > > Reviewed-by: Dmitry Baryshkov > Signed-off-by: Elliot Berman > --- > MAINTAINERS | 1 + > include/linux/gunyah.h | 74 ++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 75 insertions(+) > create mode 100644 include/linux/gunyah.h > > diff --git a/MAINTAINERS b/MAINTAINERS > index f32320a9efa4..74e76e0ab14d 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -8941,6 +8941,7 @@ L: linux-arm-msm@vger.kernel.org > S: Supported > F: Documentation/devicetree/bindings/firmware/gunyah-hypervisor.yaml > F: Documentation/virt/gunyah/ > +F: include/linux/gunyah.h > > HABANALABS PCI DRIVER > M: Oded Gabbay > diff --git a/include/linux/gunyah.h b/include/linux/gunyah.h > new file mode 100644 > index 000000000000..824e20a11d27 > --- /dev/null > +++ b/include/linux/gunyah.h > @@ -0,0 +1,74 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. > + */ > + > +#ifndef _GUNYAH_H Maybe use _LINUX_GUNYAH_H? > +#define _GUNYAH_H > + > +#include Why is types.h included? U64_MAX is defined in (in case that's why). Otherwise this just defines a fixed API exposed by Gunyah so there's not much more for me to comment on. -Alex > +#include > + > +/* Common Gunyah macros */ > +#define GH_CAPID_INVAL U64_MAX > +#define GH_VMID_ROOT_VM 0xff > + > +#define GH_ERROR_OK 0 > + > +#define GH_ERROR_UNIMPLEMENTED -1 > +#define GH_ERROR_RETRY -2 > + > +#define GH_ERROR_ARG_INVAL 1 > +#define GH_ERROR_ARG_SIZE 2 > +#define GH_ERROR_ARG_ALIGN 3 > + > +#define GH_ERROR_NOMEM 10 > + > +#define GH_ERROR_ADDR_OVFL 20 > +#define GH_ERROR_ADDR_UNFL 21 > +#define GH_ERROR_ADDR_INVAL 22 > + > +#define GH_ERROR_DENIED 30 > +#define GH_ERROR_BUSY 31 > +#define GH_ERROR_IDLE 32 > + > +#define GH_ERROR_IRQ_BOUND 40 > +#define GH_ERROR_IRQ_UNBOUND 41 > + > +#define GH_ERROR_CSPACE_CAP_NULL 50 > +#define GH_ERROR_CSPACE_CAP_REVOKED 51 > +#define GH_ERROR_CSPACE_WRONG_OBJ_TYPE 52 > +#define GH_ERROR_CSPACE_INSUF_RIGHTS 53 > +#define GH_ERROR_CSPACE_FULL 54 > + > +#define GH_ERROR_MSGQUEUE_EMPTY 60 > +#define GH_ERROR_MSGQUEUE_FULL 61 > + > +static inline int gh_remap_error(int gh_error) > +{ > + switch (gh_error) { > + case GH_ERROR_OK: > + return 0; > + case GH_ERROR_NOMEM: > + return -ENOMEM; > + case GH_ERROR_DENIED: > + case GH_ERROR_CSPACE_CAP_NULL: > + case GH_ERROR_CSPACE_CAP_REVOKED: > + case GH_ERROR_CSPACE_WRONG_OBJ_TYPE: > + case GH_ERROR_CSPACE_INSUF_RIGHTS: > + case GH_ERROR_CSPACE_FULL: > + return -EACCES; > + case GH_ERROR_BUSY: > + case GH_ERROR_IDLE: > + return -EBUSY; > + case GH_ERROR_IRQ_BOUND: > + case GH_ERROR_IRQ_UNBOUND: > + case GH_ERROR_MSGQUEUE_FULL: > + case GH_ERROR_MSGQUEUE_EMPTY: > + return -EPERM; > + default: > + return -EINVAL; > + } > +} > + > +#endif _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel