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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84681C7EE23 for ; Mon, 5 Jun 2023 19:51:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjFETvh (ORCPT ); Mon, 5 Jun 2023 15:51:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235972AbjFETvO (ORCPT ); Mon, 5 Jun 2023 15:51:14 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FF7C19C for ; Mon, 5 Jun 2023 12:50:43 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-7606d460da7so139663839f.1 for ; Mon, 05 Jun 2023 12:50:43 -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=RV0uKxvu3flhlkN48PU/BXcE+56jFn9HYXpFNn2tYWuIaSicU8XfbGIADxwHM4q1yb A6MxYS7Bjx5/Rtk0s7kLjzycSeXK6fxzdCGWgQzOq22iIBwcTba1Ix0cBWfSTKzvzg5o jPxMMWN4xdJE7/brhBWOMoUe2VrjzZwCkxkXLXwAJtQ/HiWBg6Wlvv4NOrH8buWfuG7d fpTdDETh6vqAUd84F/6jZAI0JcKjbeX6lTBIX+fTxN9ZixH5RFaGZqxOYekEISpbYBNS jOx8Wl0Gz6ab+XHguoHYD7hx5JVbcINymGlF5WMxqng02NdHfPEyq4XmIImoon70YdGK o99A== X-Gm-Message-State: AC+VfDyMsZyMj8gjbYqy7yp7hgmw9vgXOGwyuT+v8VXBwGt8ZeeVaqem GljCbw0WGrsiCRZRpjBL0sSqcQ== 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> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.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.