From nobody Fri Apr 26 02:22:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610488409; cv=none; d=zohomail.com; s=zohoarc; b=mDuvicSzcdZ9m155IehjCIBe4tf77l8TVhw18NYNWmrl3yjKHF6hnS2rHdDWCyF+rEeAmLvzq3ph0V+c8QbZb9D9Y/u9/CjLwTWj8cP7WK+WHXDtpRIbxB6XpCtAf6n7bi/pqrBlrWm/u93ZxpfqMVri6/4E344a0A+PBkqswBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610488409; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=2tk65VOMw3jKSdrbjvPdRwki3JpePSSllFpesiDYEBY=; b=blz/mS3gGPzNmw1jbwAoPnrMpgSv4Rm66761dawO1SybFw7Gv5zvoNbyJZGZtypMGolJ7TUFvLhql/cPka1g9mSdPsOEvnUQTo4OdcHoLKIKiIeiPBH5bmQAeCfIckeinkmQkAWcjl/wpBatND4Nj7Vr0pRJH3H7W5e/hVGzicg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1610488409588610.5001238095089; Tue, 12 Jan 2021 13:53:29 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.66042.117148 (Exim 4.92) (envelope-from ) id 1kzRbE-0002ZW-Eu; Tue, 12 Jan 2021 21:53:12 +0000 Received: by outflank-mailman (output) from mailman id 66042.117148; Tue, 12 Jan 2021 21:53:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kzRbE-0002ZN-Ak; Tue, 12 Jan 2021 21:53:12 +0000 Received: by outflank-mailman (input) for mailman id 66042; Tue, 12 Jan 2021 21:53:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kzRbC-0002PK-Gp for xen-devel@lists.xenproject.org; Tue, 12 Jan 2021 21:53:10 +0000 Received: from mail-wm1-x330.google.com (unknown [2a00:1450:4864:20::330]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 429ab65e-718c-4e48-ae97-b36cf6066a68; Tue, 12 Jan 2021 21:52:56 +0000 (UTC) Received: by mail-wm1-x330.google.com with SMTP id r4so3488135wmh.5 for ; Tue, 12 Jan 2021 13:52:56 -0800 (PST) Received: from otyshchenko.www.tendawifi.com ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id 138sm6574053wma.41.2021.01.12.13.52.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2021 13:52:54 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 429ab65e-718c-4e48-ae97-b36cf6066a68 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2tk65VOMw3jKSdrbjvPdRwki3JpePSSllFpesiDYEBY=; b=TvvwPbdYFdvWGZuc/0gCrpu3QfUvvXgWDxTjSF33qp4Qvuypt3NJbFmE+aLWzZ+ppT Nxa9AjIUnCnoA8sQgI+i05zp3BzQMSuoiMLbpIROAyKgMsHt2lxbAAmrC8gc1c5Y+kSo no2oRtNmrCuRT0eR/OyirZx5AVCrAXm96aKVejfUCytmarrxASQtC/fsD5vUBgzPG3kn JxCSmNVtP6gYmOrbwO/dLJZSG3Lo/DJI3fB0QiEcGyxT+7e5HtnnQ/mfXhC4fc774Y6P 29fl+3cilNLLe80aC8p/1t891E4t6PoZ/UG1FFw+lzm78DmhJZcDy69KViLVWD4wnRAD hiyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2tk65VOMw3jKSdrbjvPdRwki3JpePSSllFpesiDYEBY=; b=lTUxzmhxUYBM9x6D2nXj4PfXFrTSU+7qOPHXwrwuoy2xV3qemS0LOpmUJ58WbPMkEO JW6YOoE5SIhDHbqz2M39iIs0j41pgzSPG9MfCHROvlGgy5yNAYkn5V7yma0HcoxsU9CP 0tz2oHbxADvapR8M8dkvLFK89cPEcUhnEXCxyNNVR4z5DymQBv6s5W9Buiifirrxkcps KWgiDcdQQh8l2Fs4Nl8kVXnVTGveqUEv/iKkcaP5S/wumx1t2dcLP9kkBchOG3M/bWj1 8KW4gkZo4rPd11h7RqWDJOg1BK2VJCjVMeWMrqLArFAd5RS28wXqBePap+vN/owbw+IT ojgA== X-Gm-Message-State: AOAM532FwgaNnQssMOVGj7eLsSYjhWvfug/a0VfFIQqRRROL3c0WLAYz OJpnq+l0++6uAqx2LEDdBChYobFhimxnYg== X-Google-Smtp-Source: ABdhPJy2qmg2+2rotDljbXzcPM4UU//GyC2s3SuUhtv/OfjlxAQK9sctT/mWAiWQfZVdoNvYFdGl+g== X-Received: by 2002:a1c:cc19:: with SMTP id h25mr1164357wmb.124.1610488375118; Tue, 12 Jan 2021 13:52:55 -0800 (PST) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Cc: Oleksandr Tyshchenko , Paul Durrant , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Julien Grall , Stefano Stabellini , Julien Grall Subject: [PATCH V4 03/24] x86/ioreq: Provide out-of-line wrapper for the handle_mmio() Date: Tue, 12 Jan 2021 23:52:11 +0200 Message-Id: <1610488352-18494-4-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1610488352-18494-1-git-send-email-olekstysh@gmail.com> References: <1610488352-18494-1-git-send-email-olekstysh@gmail.com> X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko The IOREQ is about to be common feature and Arm will have its own implementation. But the name of the function is pretty generic and can be confusing on Arm (we already have a try_handle_mmio()). In order not to rename the function (which is used for a varying set of purposes on x86) globally and get non-confusing variant on Arm provide a wrapper arch_ioreq_complete_mmio() to be used on common and Arm code. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Jan Beulich CC: Julien Grall [On Arm only] Tested-by: Wei Chen Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Julien Grall Reviewed-by: Paul Durrant --- Please note, this is a split/cleanup/hardening of Julien's PoC: "Add support for Guest IO forwarding to a device emulator" Changes RFC -> V1: - new patch Changes V1 -> V2: - remove "handle" - add Jan's A-b Changes V2 -> V3: - remove Jan's A-b - update patch subject/description - use out-of-line function instead of #define - put earlier in the series to avoid breakage Changes V3 -> V4: - add Jan's R-b - rename ioreq_complete_mmio() to arch_ioreq_complete_mmio() --- xen/arch/x86/hvm/ioreq.c | 7 ++++++- xen/include/asm-x86/hvm/ioreq.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c index ff9a546..00c68f5 100644 --- a/xen/arch/x86/hvm/ioreq.c +++ b/xen/arch/x86/hvm/ioreq.c @@ -35,6 +35,11 @@ #include #include =20 +bool arch_ioreq_complete_mmio(void) +{ + return handle_mmio(); +} + static void set_ioreq_server(struct domain *d, unsigned int id, struct hvm_ioreq_server *s) { @@ -225,7 +230,7 @@ bool handle_hvm_io_completion(struct vcpu *v) break; =20 case HVMIO_mmio_completion: - return handle_mmio(); + return arch_ioreq_complete_mmio(); =20 case HVMIO_pio_completion: return handle_pio(vio->io_req.addr, vio->io_req.size, diff --git a/xen/include/asm-x86/hvm/ioreq.h b/xen/include/asm-x86/hvm/iore= q.h index f140ef4..0e64e76 100644 --- a/xen/include/asm-x86/hvm/ioreq.h +++ b/xen/include/asm-x86/hvm/ioreq.h @@ -58,6 +58,7 @@ unsigned int hvm_broadcast_ioreq(ioreq_t *p, bool buffere= d); =20 void hvm_ioreq_init(struct domain *d); =20 +bool arch_ioreq_complete_mmio(void); bool arch_vcpu_ioreq_completion(enum hvm_io_completion io_completion); int arch_ioreq_server_map_pages(struct hvm_ioreq_server *s); void arch_ioreq_server_unmap_pages(struct hvm_ioreq_server *s); --=20 2.7.4