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 EDCD8C77B73 for ; Mon, 5 Jun 2023 19:50:59 +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=e5y3dEEN/rEjJC/J9iW+LOAsPHPQU6GvmbA5awQZVok=; b=jjs/pthO/Qoqyn l+nsuNz81Nv7gFXS/zsUi80dFyxQ4y+hm4s98ygjttNxQLNa1MSrD8J3bMUybJ3nl/JH/HoPoBfXw 8DoD6DDovo7XX6bG+yICC649EzPGKFLz8IAg2snRmvCVi3S/sT7PXoskUEmW3Trl3TfTiD4NYl4WW hFQcjYZ/SFOL2cT0goVKldL1BJIlyub8yy+KOHLX9ZE0JuN4efsXVTZ2G8OqRcICem1cOQROICuYj FhnF+ytf7lTv0vMk3ubY37tQoDSLWfDvITWablJVuzD830mC3ok9UYOrayFsWNCG+h2LzzqPRhAOO UEnYLeE/z/dsYe0o8Iwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6GDu-00GcGh-0a; Mon, 05 Jun 2023 19:50:38 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6GDr-00GcEU-1o for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 19:50:36 +0000 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-777ac4344f9so45118739f.0 for ; Mon, 05 Jun 2023 12:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685994633; x=1688586633; 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=AWux2zN8aBm4AOKOzL2QZg5moSP9cBqza5x96VmFFH0=; b=gb72ZjOG2T702JUBTjXQJ9M8dsR7IB11iT/qMvGwCr5aWKIZizAkkPbHfIK1swW0RK NlqdcWs+K3nHISF6/Ejna0au5d/9swKxDbEnalNGbGz5U4YkhYtUlyaMJGrkXOv/k+4o MaffWmHh+lTfNVqM3KyLaUAx7+IGE7FEYxyGt9zHkw4wFXvJRVNmKbFrNCH/25Etn6w2 a4zGjilqkFAzUj4tTqUPC0LorwmzfnqnAHOhDyJxDPUcizI37jqh6H728mVQbKbn+ik7 KmkVhuMuQg7NYX2JxmtlRhAIoE8XsCzto2efDbhRbPxG9EXR6TjhT4nV7+EzTq3/ej/x XOlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685994633; x=1688586633; 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=AWux2zN8aBm4AOKOzL2QZg5moSP9cBqza5x96VmFFH0=; b=FnkIc1WvPMiH4RSIK8uzl+3C04lGWRGs+hqE5QpK3sigKN+bPtY1BSq36mxutg/r5k yHuQN40S6qm3BwUp9lyLwo2RCkULhlwe1XXnacwsY0XZHIalxRUkN9gLUd69vwhgYL4e hcHFNg7UlNzpBB3uG3s/G/METYFTyeLMlq5N4uxdS85WlhsqImofSXpUKkJCCufpraqp 7gekue1+6zOl7v8p2BNgMFPIphM5617O0iqpnyklP5B9zmjLfre9NA52oNH1X4uv29N2 Kr8fgLMvsjjzNWaHwg7MVmYAGViBIzVzAmPb+A+9s6P1RyHWgsHa44/GXSe31dW1l1+s O/0Q== X-Gm-Message-State: AC+VfDzzuKbewm6d/aKx6HZXI+f3si73NcLz8eiqS8INGyywj5M+1j2J OI3/om3mXiYKnJxc+K49erHXAQ== X-Google-Smtp-Source: ACHHUZ79gpJfC3/JN7fry1AODi9w0klUZaKa8fmJlnNw5Wdoe/QxZtf4v4+bIbEII1SP0JleX9WuGQ== X-Received: by 2002:a6b:6f15:0:b0:776:feaf:8cec with SMTP id k21-20020a6b6f15000000b00776feaf8cecmr243634ioc.3.1685994633721; Mon, 05 Jun 2023 12:50:33 -0700 (PDT) Received: from [172.22.22.28] ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id i13-20020a6bf40d000000b00776a991d35asm2642558iog.14.2023.06.05.12.50.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 12:50:33 -0700 (PDT) Message-ID: <1c386f4e-e2dd-eb79-9117-9b19877f2ccc@linaro.org> Date: Mon, 5 Jun 2023 14:50:32 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Alex Elder Subject: Re: [PATCH v13 22/24] virt: gunyah: Add irqfd interface To: Elliot Berman , Srinivas Kandagatla , Prakruthi Deepak Heragu , Jonathan Corbet 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 , Bagas Sanjaya , Will Deacon , Andy Gross , Catalin Marinas , 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-23-quic_eberman@quicinc.com> Content-Language: en-US In-Reply-To: <20230509204801.2824351-23-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230605_125035_602458_409CEA67 X-CRM114-Status: GOOD ( 23.66 ) 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 5/9/23 3:47 PM, Elliot Berman wrote: > Enable support for creating irqfds which can raise an interrupt on a > Gunyah virtual machine. irqfds are exposed to userspace as a Gunyah VM > function with the name "irqfd". If the VM devicetree is not configured > to create a doorbell with the corresponding label, userspace will still > be able to assert the eventfd but no interrupt will be raised on the > guest. > > Co-developed-by: Prakruthi Deepak Heragu > Signed-off-by: Prakruthi Deepak Heragu > Signed-off-by: Elliot Berman I have a minor suggestion. I think I'd like to look at this again, so: Acked-by: Alex Elder > --- > Documentation/virt/gunyah/vm-manager.rst | 2 +- > drivers/virt/gunyah/Kconfig | 9 ++ > drivers/virt/gunyah/Makefile | 1 + > drivers/virt/gunyah/gunyah_irqfd.c | 180 +++++++++++++++++++++++ > include/uapi/linux/gunyah.h | 35 +++++ > 5 files changed, 226 insertions(+), 1 deletion(-) > create mode 100644 drivers/virt/gunyah/gunyah_irqfd.c > . . . > @@ -99,6 +102,38 @@ struct gh_fn_vcpu_arg { > __u32 id; > }; > > +/** > + * enum gh_irqfd_flags - flags for use in gh_fn_irqfd_arg > + * @GH_IRQFD_FLAGS_LEVEL: make the interrupt operate like a level triggered > + * interrupt on guest side. Triggering IRQFD before > + * guest handles the interrupt causes interrupt to > + * stay asserted. > + */ > +enum gh_irqfd_flags { > + GH_IRQFD_FLAGS_LEVEL = 1UL << 0, BIT(0), /* ? */ > +}; > + > +/** > + * struct gh_fn_irqfd_arg - Arguments to create an irqfd function. > + * > + * Create this function with &GH_VM_ADD_FUNCTION using type &GH_FN_IRQFD. > + * > + * Allows setting an eventfd to directly trigger a guest interrupt. > + * irqfd.fd specifies the file descriptor to use as the eventfd. > + * irqfd.label corresponds to the doorbell label used in the guest VM's devicetree. > + * > + * @fd: an eventfd which when written to will raise a doorbell > + * @label: Label of the doorbell created on the guest VM > + * @flags: see &enum gh_irqfd_flags > + * @padding: padding bytes > + */ > +struct gh_fn_irqfd_arg { > + __u32 fd; > + __u32 label; > + __u32 flags; > + __u32 padding; > +}; > + > /** > * struct gh_fn_desc - Arguments to create a VM function > * @type: Type of the function. See &enum gh_fn_type. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel