Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp133322rdg; Tue, 10 Oct 2023 06:22:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyi7b/PMiQrRnjUtErsbQGftFTHEvPl/V2JPYkJiIe9X9X8UklILygvUhOCiRSerRNcdlg X-Received: by 2002:a17:902:9b8e:b0:1c6:2780:3adc with SMTP id y14-20020a1709029b8e00b001c627803adcmr13640316plp.24.1696944158797; Tue, 10 Oct 2023 06:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696944158; cv=none; d=google.com; s=arc-20160816; b=1Ddvbbgkx6ORFVuKS4YWDFUWNJIOm21yiFIemZcONJgSSNVd8FImtqri/3yRKwucJf y6amabZhHO9GsMQXSH+NDBDXoQyElg1GugCakoM3AdZex28nUnfvftWmDuWA9J+cVOj9 VETWS5QvJ1Fyo4+dDfGMjvWIGyiln//rXfE5i8kMPqK33xRNqUO/Css4aK9l0qbPSeEn SW3+/cpL+ArnMrG/7cIG+UX6UsWCuoW7SrqK2WS2kOnXp4vSAM8gs0SPaZBRCgzjhSU/ E4+Qf8FmkvGsuWwtyIelXSYO4WtcX3XguD4Aa5JgSK1qFO/+RKRCwRTVGn+4xt4LOHmD onMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=kFYaphee/OWYJ27akU61ySL2pcyi+L0fBa4hg4/3zoY=; fh=FVo16zKm/55wadZF6TgRkuKBnz/aCNFsoMwog7xXq7s=; b=ka5OndlK4MVug0qRW9n4k0PFFh/dIbL3fz0GItVI4gHGz4CiaeWeBo43DhT850dJVD RGbEFWmxCvGeqZvq8RkBYe2mNoxGX3LyRxdIc6qQ0iX9f4xXpivrng57BmPymnNCpnY+ gIwni30fXhhpQSOeQjXKI7h8MCQwb2czaSw1dQ+q/BfIQfMgT1AN6V9ApjLk0f3bTDPZ cZW2neZYa5vl4yCNu2BqvU1IpmhnHWAyW51zg+Y5lOcGlLXnUfddxMr+GYJh7HDIWkjR aoS/OXb1vQFmWb9w6pb0uWylCVGA4QwV2HjvrRRB/pH4eG35Yqu4yy9OBt+YnLV+MmhN Sp9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BgdjTdPC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id g11-20020a1709026b4b00b001c426636990si11306661plt.637.2023.10.10.06.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 06:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BgdjTdPC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 05574817C1D7; Tue, 10 Oct 2023 06:22:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232052AbjJJNW1 (ORCPT + 99 others); Tue, 10 Oct 2023 09:22:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232024AbjJJNWZ (ORCPT ); Tue, 10 Oct 2023 09:22:25 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E021B0 for ; Tue, 10 Oct 2023 06:22:24 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3af65455e7cso4083845b6e.1 for ; Tue, 10 Oct 2023 06:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696944143; x=1697548943; darn=vger.kernel.org; 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=kFYaphee/OWYJ27akU61ySL2pcyi+L0fBa4hg4/3zoY=; b=BgdjTdPC8Ng01xi+Q0/55efSNnkwtmnc6+NJpj/F0j/J01VfkW/FwJ+GzRXhdPX7/g qbxbxkcGDErAfB6QO7FF/axX8U3lWU9YDYtXpTUe+9kQu8iuZvIFcjK1ofhKaDlAsb80 qG+/m2pPFFQMxDAhm82iBzOTd8s/exTuPK/TuaLyEHnWfCm75dz7eWd4dZKLqbxo9dzT ez2ZuvaMD4FkF98RUjCexd2SHHs4oEDrz47+LO1qt59swSXs9QCB6DYwBARBNTSpi+x/ VZhFWQNIfXALR4X75RCOZ7Uwra1O3FKqVZGJhTVZSdLEEagZUKFoUXWWnDC5bCvVbYm6 R/mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696944143; x=1697548943; 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=kFYaphee/OWYJ27akU61ySL2pcyi+L0fBa4hg4/3zoY=; b=LbPDKiNIcKPtv6tvqsZ34d0POA+guEDQQJEhAbSYwqCLQOwOdOiNJ9ZJQxDjOeJt5Y O0ArKC77lZhFdIKbo553TDm5BiePiRSQ014AcQq60ssNbwpak7DyP02M/LpmbgLN4uE1 d32MBynvUWpPE2PilTKZBhu3Wf5l7tqyqDuPLvNbZ2myj4KNjFYa+TEVOZ683n4EJX3N ILBHte73NCiDScXZv15dwPUPYKUo/jU1YksCo7UGMK2uVryWr56jQwgDxxWf6Vsmcmwd 5OrGXDWAdJXVqaaNHx9wOyswmCuUEWmhedXrkbRbyqPtOO6zWJJAf0VbnkU8JSbL85C5 LpDQ== X-Gm-Message-State: AOJu0YzJvS6jwSESUxqpTm6A9EBpDit9vbLiy75kdUQ/BIt8h3WJAEHl 2DArrmq6uxfIcfmc/gouH5m6IuPCvLD4qnVWunw= X-Received: by 2002:aca:1c18:0:b0:3ae:5c89:dcc2 with SMTP id c24-20020aca1c18000000b003ae5c89dcc2mr19889308oic.34.1696944142863; Tue, 10 Oct 2023 06:22:22 -0700 (PDT) Received: from [192.168.2.7] (pool-108-31-156-225.washdc.fios.verizon.net. [108.31.156.225]) by smtp.gmail.com with ESMTPSA id r5-20020ac85205000000b004181aa90b46sm4492961qtn.89.2023.10.10.06.22.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Oct 2023 06:22:22 -0700 (PDT) Message-ID: <920a671c-1927-4086-950f-db8e3293a989@linaro.org> Date: Tue, 10 Oct 2023 09:22:21 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Stratos-dev] [PATCH V3 2/2] xen: privcmd: Add support for ioeventfd Content-Language: en-US To: Viresh Kumar , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko Cc: stratos-dev@op-lists.linaro.org, Erik Schilling , Manos Pitsidianakis , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org References: <957de2a53dde99a653b47af9c95bc17692870294.1696850733.git.viresh.kumar@linaro.org> From: Bill Mills In-Reply-To: <957de2a53dde99a653b47af9c95bc17692870294.1696850733.git.viresh.kumar@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 10 Oct 2023 06:22:36 -0700 (PDT) X-Spam-Level: ** Hi Viresh, On 10/9/23 7:29 AM, Viresh Kumar via Stratos-dev wrote: > Virtio guests send VIRTIO_MMIO_QUEUE_NOTIFY notification when they need > to notify the backend of an update to the status of the virtqueue. The > backend or another entity, polls the MMIO address for updates to know > when the notification is sent. > > It works well if the backend does this polling by itself. But as we move > towards generic backend implementations, we end up implementing this in > a separate user-space program. > > Generally, the Virtio backends are implemented to work with the Eventfd > based mechanism. In order to make such backends work with Xen, another > software layer needs to do the polling and send an event via eventfd to > the backend once the notification from guest is received. This results > in an extra context switch. > > This is not a new problem in Linux though. It is present with other > hypervisors like KVM, etc. as well. The generic solution implemented in > the kernel for them is to provide an IOCTL call to pass the address to > poll and eventfd, which lets the kernel take care of polling and raise > an event on the eventfd, instead of handling this in user space (which > involves an extra context switch). > > This patch adds similar support for xen. > > Inspired by existing implementations for KVM, etc.. > > This also copies ioreq.h header file (only struct ioreq and related > macros) from Xen's source tree (Top commit 5d84f07fe6bf ("xen/pci: drop > remaining uses of bool_t")). > > Signed-off-by: Viresh Kumar > --- > drivers/xen/Kconfig | 8 +- > drivers/xen/privcmd.c | 405 +++++++++++++++++++++++++++++- > include/uapi/xen/privcmd.h | 18 ++ > include/xen/interface/hvm/ioreq.h | 51 ++++ > 4 files changed, 476 insertions(+), 6 deletions(-) > create mode 100644 include/xen/interface/hvm/ioreq.h > > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig > index d43153fec18e..d5989871dd5d 100644 > --- a/drivers/xen/Kconfig > +++ b/drivers/xen/Kconfig > @@ -269,12 +269,12 @@ config XEN_PRIVCMD > disaggregated Xen setups this driver might be needed for other > domains, too. > > -config XEN_PRIVCMD_IRQFD > - bool "Xen irqfd support" > +config XEN_PRIVCMD_EVENTFD > + bool "Xen Ioeventfd and irqfd support" You certainly know about kernel policies better than I but why the CONGIG_ name change? With this change all downstream distros need to find this and re-enable it if they want to keep a working Xen system. I presume the kernel can still work in the old way and not use your new mode correct? I would certainly change the description but I wonder about keeping the CONFIG_ name the same. No issue if I am obviously wrong and this is done all the time. Thanks, Bill