From nobody Sun Nov 24 17:01:53 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=1727965889; cv=none; d=zohomail.com; s=zohoarc; b=AHE6cYM4iUvjwlIb2Q0h6OcB5b1Bz788HU5+WsV49z0uv/AudRoBvezdiSSBYNYwfOuof/s51wlq8k7HRt9ChHgjNPmC3VGpY9HVYc1Mj++Ykc5xLdmagqBi2CPnlyziIGRWiellZvna6yBWHVaU0dFuYwcZyoh9Ygj1lArVo34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727965889; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5QkDAThvHzn8nk+HGJi0H/5a08f7RDTFwzrMcXuWa4E=; b=OLtYjJp/wPukYYDMhv5p45DpGGPGlQ0jLYL5qJ5c4UB76AJdrS4vTlh9JZqt7NjGi7q3rQQsQQ7a8OKVV0VIAZK8bkId9uc2vnznMSBzYYIyf+IumRGaIeg//Bibl8juOK6+cLLTLBY68BZhOImfWrN9mNmnttcBoznl6pVcaxU= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 172796588940263.46796370492257; Thu, 3 Oct 2024 07:31:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.809513.1221884 (Exim 4.92) (envelope-from ) id 1swMrI-00005n-SE; Thu, 03 Oct 2024 14:31:12 +0000 Received: by outflank-mailman (output) from mailman id 809513.1221884; Thu, 03 Oct 2024 14:31: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 1swMrI-00005f-Oa; Thu, 03 Oct 2024 14:31:12 +0000 Received: by outflank-mailman (input) for mailman id 809513; Thu, 03 Oct 2024 14:31:11 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swMrH-0008IT-Kh for xen-devel@lists.xenproject.org; Thu, 03 Oct 2024 14:31:11 +0000 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [2a00:1450:4864:20::135]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2226ecd8-8194-11ef-99a2-01e77a169b0f; Thu, 03 Oct 2024 16:31:10 +0200 (CEST) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-53993564cb1so1186811e87.2 for ; Thu, 03 Oct 2024 07:31:10 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539a8296ba3sm191801e87.133.2024.10.03.07.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:31:07 -0700 (PDT) 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: 2226ecd8-8194-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727965869; x=1728570669; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5QkDAThvHzn8nk+HGJi0H/5a08f7RDTFwzrMcXuWa4E=; b=hqZ2Y5WtNcSUKmWSMjYQGi7qgPnQ3oD3AXa6ssY6M0yTMUxl+FR1BOJNMPzGtpcjup QbFLIZo0twFdwVUGT1blzdqjIhfDDlxLA6QmsdP3W+VoYUDsNGhtmwAU7nPAzzzdnDi+ 2UWvmz/6Uc2eIjf378jSzC4MgQi68jBfRDY0ObxuiO8nywH9tDFP/QlxVqaO+TZDk66G Q9g7mKZvk214TbJUBNTRIl3dmf8lN65PIteAIJufgO60XEEvnI3zuznEzJ5n3V97V9ZK bkMDStBEeq+4s74X0i78o4Lq89T+WyvCBE1lWfKd/t/aI3kkizXhbkdr4HP3Nc1CYs3P 8SKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727965869; x=1728570669; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5QkDAThvHzn8nk+HGJi0H/5a08f7RDTFwzrMcXuWa4E=; b=ALaidEvUMDQ6xK6lZLIn3T/aHb57Xm3boIIV/+6aPRC4fXDqPpIp4wznHigX5Toqr5 10SxsLqkYRC7Sp8TNwo75qCFKzGhKzGXfy5YLOwr+tnl1oDuR7YgyOtty9whPNR3z3Ly ymTQO0kuZlK57PWttpJLrStFAI9Frlkk7InXVFZISggkTcNX5YKB5yUAI/oOj88JJET1 tXP33EAYR6OcKbEA6NZhzvGO8kCqaVR0gWiPHxVZq1bnB1vEK1UkStTBPx6op/HLE8FK uGZY7Hde+lZVnwltXe7esWMrXjmSspF+x/RuCQ9UKOOscpNidsiN67N28m2FnkN62cA6 hdTg== X-Forwarded-Encrypted: i=1; AJvYcCVFkm1iCLHiQ7NqEcv82M/iyuhDBpIN+7/Qo4qvi1RGlWDTD3x6wler644Y+JW3ZkvmPWMzLXlW4ew=@lists.xenproject.org X-Gm-Message-State: AOJu0YzIxv6ulixkpKlXCPTGE7pZ5cBAoe8cJUEBtdHlcAb6bwlOPQev /7FyGqyFxgflEAy1WYzaX5mTLqBGIFLpePDrQru48X2IM9BEj3DE X-Google-Smtp-Source: AGHT+IENz5mwtWHtkPPjZFK+I8sGggUcDkXaE5WZHxkY3QmdHU4icE62BAzIHG+lJO+kM3iPAsGlug== X-Received: by 2002:a05:6512:2813:b0:539:9746:2d77 with SMTP id 2adb3069b0e04-539a07af74fmr3419652e87.61.1727965869012; Thu, 03 Oct 2024 07:31:09 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Dr. David Alan Gilbert" , Anthony PERARD , Thomas Huth , "Edgar E. Iglesias" Subject: [PULL v1 1/5] hw/xen: Remove deadcode Date: Thu, 3 Oct 2024 16:30:58 +0200 Message-ID: <20241003143103.1476805-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241003143103.1476805-1-edgar.iglesias@gmail.com> References: <20241003143103.1476805-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727965890735116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" xen_be_copy_grant_refs is unused since 2019's 19f87870ba ("xen: remove the legacy 'xen_disk' backend") xen_config_dev_console is unused since 2018's 6d7c06c213 ("Remove broken Xen PV domain builder") Remove them. Signed-off-by: Dr. David Alan Gilbert Acked-by: Anthony PERARD Reviewed-by: Thomas Huth Reviewed-by: Edgar E. Iglesias Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-legacy-backend.c | 18 ------------------ hw/xen/xen_devconfig.c | 8 -------- include/hw/xen/xen-legacy-backend.h | 5 ----- 3 files changed, 31 deletions(-) diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 5514184f9c..e8e1ee4f7d 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -147,24 +147,6 @@ void xen_be_unmap_grant_refs(struct XenLegacyDevice *x= endev, void *ptr, } } =20 -int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev, - bool to_domain, - XenGrantCopySegment segs[], - unsigned int nr_segs) -{ - int rc; - - assert(xendev->ops->flags & DEVOPS_FLAG_NEED_GNTDEV); - - rc =3D qemu_xen_gnttab_grant_copy(xendev->gnttabdev, to_domain, xen_do= mid, - segs, nr_segs, NULL); - if (rc) { - xen_pv_printf(xendev, 0, "xengnttab_grant_copy failed: %s\n", - strerror(-rc)); - } - return rc; -} - /* * get xen backend device, allocate a new one if it doesn't exist. */ diff --git a/hw/xen/xen_devconfig.c b/hw/xen/xen_devconfig.c index 2150869f60..45ae134b84 100644 --- a/hw/xen/xen_devconfig.c +++ b/hw/xen/xen_devconfig.c @@ -66,11 +66,3 @@ int xen_config_dev_vkbd(int vdev) xen_config_dev_dirs("vkbd", "vkbd", vdev, fe, be, sizeof(fe)); return xen_config_dev_all(fe, be); } - -int xen_config_dev_console(int vdev) -{ - char fe[256], be[256]; - - xen_config_dev_dirs("console", "console", vdev, fe, be, sizeof(fe)); - return xen_config_dev_all(fe, be); -} diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legac= y-backend.h index 943732b8d1..e198b120c5 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -50,10 +50,6 @@ void *xen_be_map_grant_refs(struct XenLegacyDevice *xend= ev, uint32_t *refs, void xen_be_unmap_grant_refs(struct XenLegacyDevice *xendev, void *ptr, uint32_t *refs, unsigned int nr_refs); =20 -int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev, - bool to_domain, XenGrantCopySegment segs[], - unsigned int nr_segs); - static inline void *xen_be_map_grant_ref(struct XenLegacyDevice *xendev, uint32_t ref, int prot) { @@ -70,6 +66,5 @@ static inline void xen_be_unmap_grant_ref(struct XenLegac= yDevice *xendev, void xen_config_cleanup(void); int xen_config_dev_vfb(int vdev, const char *type); int xen_config_dev_vkbd(int vdev); -int xen_config_dev_console(int vdev); =20 #endif /* HW_XEN_LEGACY_BACKEND_H */ --=20 2.43.0 From nobody Sun Nov 24 17:01:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1727965916; cv=none; d=zohomail.com; s=zohoarc; b=IyaJThP8nI5km3S2dZ+oFMs6/CcYcq2k3ODdX9HgsEuiO2xC0Psz88sKoQTb5EqVHr+LBNK7ootUGdJLXce9b4qKEcEe/sFlu0Q3I5P8gNhl8WDuAHIJInb8+KmhTqyP8lEji117dqX7GosU1yxLBxSTDr0L3WCqsaMIMDAanf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727965916; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=opHAkxizOwjrlq5VyQ2hdU0DAn4w0L6+u/XZM8FV3ts=; b=ffS+hzqF4m1J0GalqbV2OneQKlvH2yL0zsE283dBCcuXMj/kFX+SVwZMdXr+sjyN4C9apVW6FEeXRDzwwmqDho5t49nxHkJfPdNokWb44KA6jBwxk4VZ3vSSka78JQMPwD8Tj/LTjFvRmny/eJmXVUt9USZS7+DJWtPlyXMAmQo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727965916557224.092953137446; Thu, 3 Oct 2024 07:31:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swMrN-000668-UU; Thu, 03 Oct 2024 10:31:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swMrM-00065y-0G for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:31:16 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swMrJ-0003j6-R7 for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:31:15 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5398e53ca28so1200487e87.3 for ; Thu, 03 Oct 2024 07:31:13 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539a82a38a6sm191699e87.217.2024.10.03.07.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727965871; x=1728570671; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=opHAkxizOwjrlq5VyQ2hdU0DAn4w0L6+u/XZM8FV3ts=; b=CLg7OfoWYWqyeZnSEPSaS1Y8DDa8ArbmAj6aWbk1q1rMt98jFYkFgnYe0FdTgvrm3E AqDMSMNVesvlFB6MQV5ZKbxdJBIFJs/homQP4x9egRbmQOVl8foX3eIiFyIU25Xz6a4r cFZXzL/eRQPZ7Odj7YK2ARpnD7JiyIkcLa51wZTSBW/qMMLt2Gpv8RDGDOXkl4WMgsx0 cH4U3KFTA5oORYgCC8bTwZRSP2hQqLGKRHMWEzpW0jCbVkSNMDV08jjtpVwFVaIOriFZ tMGxhzRh9LKLPA1qZu4NoO2NFpNs8vyxVFADNMM4B9BSFspRPlpegfbq1ELVQwx4Xf3v 7l4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727965871; x=1728570671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=opHAkxizOwjrlq5VyQ2hdU0DAn4w0L6+u/XZM8FV3ts=; b=svU8AnOYlDuMLO11JggTbPF20uS+yizaZfo5WustN2pfw5r5ILlX1Lwp3RG7psE5Pm bXHkITYI2S3KZKv0F1HPdXEGI4Q0aCCDZ8mMOiYfKzcpG7nd3Fw9xesFtb2LKdAf/nFP lJpQpmdoYTmTCnngWeAN9fzaOiyoTuyGfOWFxUv5mAY64qzqMmWromOKUJD2l4YcrjsX s/wetG7+NbtQ+eeBmFTpICxMekqWNhg/SUKK6irXoqlCEgw8/KvK5CRAWXiclYyTUmQA 6W6wiHaJxcLucKSBl9mIM1GOnjJ4Wugedma4We6UZJk5h+ccDqFCahMijVmXcdkhr+BS c1xQ== X-Gm-Message-State: AOJu0YxOo67NDYSCh2bXxU/XivVbFxx7qVPdRZoy9p/SfzrsCCAfg7fG I3fTcPyrTZYjU3Of+UNx3++QxljcCofjNthXS9QnmRa+ezFKMIZO7PjtqEua X-Google-Smtp-Source: AGHT+IHt76trfUAo3X2djdRCfcBNTLDwcCDmqbU8H2X/oCHrgaYE6gDJizIgEZU7Zmu/NUrFBvluYg== X-Received: by 2002:a05:6512:6288:b0:539:a3cd:97cb with SMTP id 2adb3069b0e04-539a3cde6b7mr3099308e87.43.1727965871243; Thu, 03 Oct 2024 07:31:11 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL v1 2/5] hw/xen: Expose handle_bufioreq in xen_register_ioreq Date: Thu, 3 Oct 2024 16:30:59 +0200 Message-ID: <20241003143103.1476805-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241003143103.1476805-1-edgar.iglesias@gmail.com> References: <20241003143103.1476805-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727965917219116600 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Expose handle_bufioreq in xen_register_ioreq(). This is to allow machines to enable or disable buffered ioreqs. No functional change since all callers still set it to HVM_IOREQSRV_BUFIOREQ_ATOMIC. Reviewed-by: Stefano Stabellini Signed-off-by: Edgar E. Iglesias --- hw/i386/xen/xen-hvm.c | 4 +- hw/xen/xen-hvm-common.c | 101 ++++++++++++++++++++------------ hw/xen/xen-pvh-common.c | 4 +- include/hw/xen/xen-hvm-common.h | 3 + include/hw/xen/xen_native.h | 3 +- 5 files changed, 74 insertions(+), 41 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 4f6446600c..d3df488c48 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -614,7 +614,9 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion= **ram_memory) =20 state =3D g_new0(XenIOState, 1); =20 - xen_register_ioreq(state, max_cpus, &xen_memory_listener); + xen_register_ioreq(state, max_cpus, + HVM_IOREQSRV_BUFIOREQ_ATOMIC, + &xen_memory_listener); =20 xen_is_stubdomain =3D xen_check_stubdomain(state->xenstore); =20 diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 3a9d6f981b..3ce994fc3a 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -667,6 +667,8 @@ static int xen_map_ioreq_server(XenIOState *state) xen_pfn_t ioreq_pfn; xen_pfn_t bufioreq_pfn; evtchn_port_t bufioreq_evtchn; + unsigned long num_frames =3D 1; + unsigned long frame =3D 1; int rc; =20 /* @@ -675,59 +677,79 @@ static int xen_map_ioreq_server(XenIOState *state) */ QEMU_BUILD_BUG_ON(XENMEM_resource_ioreq_server_frame_bufioreq !=3D 0); QEMU_BUILD_BUG_ON(XENMEM_resource_ioreq_server_frame_ioreq(0) !=3D 1); + + if (state->has_bufioreq) { + frame =3D 0; + num_frames =3D 2; + } state->fres =3D xenforeignmemory_map_resource(xen_fmem, xen_domid, XENMEM_resource_ioreq_server, - state->ioservid, 0, 2, + state->ioservid, + frame, num_frames, &addr, PROT_READ | PROT_WRITE, 0); if (state->fres !=3D NULL) { trace_xen_map_resource_ioreq(state->ioservid, addr); - state->buffered_io_page =3D addr; - state->shared_page =3D addr + XC_PAGE_SIZE; + state->shared_page =3D addr; + if (state->has_bufioreq) { + state->buffered_io_page =3D addr; + state->shared_page =3D addr + XC_PAGE_SIZE; + } } else if (errno !=3D EOPNOTSUPP) { error_report("failed to map ioreq server resources: error %d handl= e=3D%p", errno, xen_xc); return -1; } =20 - rc =3D xen_get_ioreq_server_info(xen_domid, state->ioservid, - (state->shared_page =3D=3D NULL) ? - &ioreq_pfn : NULL, - (state->buffered_io_page =3D=3D NULL) ? - &bufioreq_pfn : NULL, - &bufioreq_evtchn); - if (rc < 0) { - error_report("failed to get ioreq server info: error %d handle=3D%= p", - errno, xen_xc); - return rc; - } - - if (state->shared_page =3D=3D NULL) { + /* + * If we fail to map the shared page with xenforeignmemory_map_resourc= e() + * or if we're using buffered ioreqs, we need xen_get_ioreq_server_inf= o() + * to provide the the addresses to map the shared page and/or to get t= he + * event-channel port for buffered ioreqs. + */ + if (state->shared_page =3D=3D NULL || state->has_bufioreq) { trace_xen_map_ioreq_server_shared_page(ioreq_pfn); + rc =3D xen_get_ioreq_server_info(xen_domid, state->ioservid, + (state->shared_page =3D=3D NULL) ? + &ioreq_pfn : NULL, + (state->has_bufioreq && + state->buffered_io_page =3D=3D NUL= L) ? + &bufioreq_pfn : NULL, + &bufioreq_evtchn); + if (rc < 0) { + error_report("failed to get ioreq server info: error %d handle= =3D%p", + errno, xen_xc); + return rc; + } =20 - state->shared_page =3D xenforeignmemory_map(xen_fmem, xen_domid, - PROT_READ | PROT_WRITE, - 1, &ioreq_pfn, NULL); + if (state->shared_page =3D=3D NULL) { + trace_xen_map_ioreq_server_shared_page(ioreq_pfn); + + state->shared_page =3D xenforeignmemory_map(xen_fmem, xen_domi= d, + PROT_READ | PROT_WRI= TE, + 1, &ioreq_pfn, NULL); + } if (state->shared_page =3D=3D NULL) { error_report("map shared IO page returned error %d handle=3D%p= ", errno, xen_xc); } - } =20 - if (state->buffered_io_page =3D=3D NULL) { - trace_xen_map_ioreq_server_buffered_io_page(bufioreq_pfn); + if (state->has_bufioreq && state->buffered_io_page =3D=3D NULL) { + trace_xen_map_ioreq_server_buffered_io_page(bufioreq_pfn); =20 - state->buffered_io_page =3D xenforeignmemory_map(xen_fmem, xen_dom= id, - PROT_READ | PROT_WR= ITE, - 1, &bufioreq_pfn, - NULL); - if (state->buffered_io_page =3D=3D NULL) { - error_report("map buffered IO page returned error %d", errno); - return -1; + state->buffered_io_page =3D xenforeignmemory_map(xen_fmem, xen= _domid, + PROT_READ | PROT_W= RITE, + 1, &bufioreq_pfn, + NULL); + if (state->buffered_io_page =3D=3D NULL) { + error_report("map buffered IO page returned error %d", err= no); + return -1; + } } } =20 - if (state->shared_page =3D=3D NULL || state->buffered_io_page =3D=3D N= ULL) { + if (state->shared_page =3D=3D NULL || + (state->has_bufioreq && state->buffered_io_page =3D=3D NULL)) { return -1; } =20 @@ -830,14 +852,15 @@ static void xen_do_ioreq_register(XenIOState *state, state->ioreq_local_port[i] =3D rc; } =20 - rc =3D qemu_xen_evtchn_bind_interdomain(state->xce_handle, xen_domid, - state->bufioreq_remote_port); - if (rc =3D=3D -1) { - error_report("buffered evtchn bind error %d", errno); - goto err; + if (state->has_bufioreq) { + rc =3D qemu_xen_evtchn_bind_interdomain(state->xce_handle, xen_dom= id, + state->bufioreq_remote_port); + if (rc =3D=3D -1) { + error_report("buffered evtchn bind error %d", errno); + goto err; + } + state->bufioreq_local_port =3D rc; } - state->bufioreq_local_port =3D rc; - /* Init RAM management */ #ifdef XEN_COMPAT_PHYSMAP xen_map_cache_init(xen_phys_offset_to_gaddr, state); @@ -865,6 +888,7 @@ err: } =20 void xen_register_ioreq(XenIOState *state, unsigned int max_cpus, + uint8_t handle_bufioreq, const MemoryListener *xen_memory_listener) { int rc; @@ -883,7 +907,8 @@ void xen_register_ioreq(XenIOState *state, unsigned int= max_cpus, goto err; } =20 - rc =3D xen_create_ioreq_server(xen_domid, &state->ioservid); + state->has_bufioreq =3D handle_bufioreq !=3D HVM_IOREQSRV_BUFIOREQ_OFF; + rc =3D xen_create_ioreq_server(xen_domid, handle_bufioreq, &state->ios= ervid); if (!rc) { xen_do_ioreq_register(state, max_cpus, xen_memory_listener); } else { diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index 28d7168446..08641fdcec 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -194,7 +194,9 @@ static void xen_pvh_init(MachineState *ms) } =20 xen_pvh_init_ram(s, sysmem); - xen_register_ioreq(&s->ioreq, ms->smp.max_cpus, &xen_memory_listener); + xen_register_ioreq(&s->ioreq, ms->smp.max_cpus, + HVM_IOREQSRV_BUFIOREQ_ATOMIC, + &xen_memory_listener); =20 if (s->cfg.virtio_mmio_num) { xen_create_virtio_mmio_devices(s); diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-commo= n.h index 3d796235dc..0f586c4384 100644 --- a/include/hw/xen/xen-hvm-common.h +++ b/include/hw/xen/xen-hvm-common.h @@ -81,6 +81,8 @@ typedef struct XenIOState { QLIST_HEAD(, XenPciDevice) dev_list; DeviceListener device_listener; =20 + bool has_bufioreq; + Notifier exit; } XenIOState; =20 @@ -95,6 +97,7 @@ void xen_device_unrealize(DeviceListener *listener, Devic= eState *dev); =20 void xen_hvm_change_state_handler(void *opaque, bool running, RunState rst= ate); void xen_register_ioreq(XenIOState *state, unsigned int max_cpus, + uint8_t handle_bufioreq, const MemoryListener *xen_memory_listener); =20 void cpu_ioreq_pio(ioreq_t *req); diff --git a/include/hw/xen/xen_native.h b/include/hw/xen/xen_native.h index 1a5ad693a4..5caf91a616 100644 --- a/include/hw/xen/xen_native.h +++ b/include/hw/xen/xen_native.h @@ -464,10 +464,11 @@ static inline void xen_unmap_pcidev(domid_t dom, } =20 static inline int xen_create_ioreq_server(domid_t dom, + int handle_bufioreq, ioservid_t *ioservid) { int rc =3D xendevicemodel_create_ioreq_server(xen_dmod, dom, - HVM_IOREQSRV_BUFIOREQ_ATOM= IC, + handle_bufioreq, ioservid); =20 if (rc =3D=3D 0) { --=20 2.43.0 From nobody Sun Nov 24 17:01:53 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=1727965898; cv=none; d=zohomail.com; s=zohoarc; b=D12M3iWV1HT+PpjxS5OuUdHz8Fp2qqYPZIiuu5jbTckpanXj0sZqBrj6aVO/buaP5BKx7qE09jHWuv8onfq1usIf4GR1Hvp2ROnuicYKSXJyrYTdSFHh09Afd/9kUgrl5eq85MHiJnoFx+gCSjmfVWfyJ11GPuYVtMuyfYlW4/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727965898; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=G14n863A5XJ+R3OWZM+ShGFWWx326n2e7KMDwbqTXOk=; b=PeY2TV97+aDKV212CfFG4QmhtZ3rrkhy16fxcILNQqU773Ixlw2xbzf/eqydwsuBQ8ySaHJ8Ng5pYZOplhTyfjS6gx++Mm3Nt4pHtEp/TifcOCVcX2+yO+e5qMguxnxNv0xsTsgHJmv5EEdD9Cykab2LFu0Y7S9HitcCYfIhvL8= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1727965898418603.8392899156737; Thu, 3 Oct 2024 07:31:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.809515.1221904 (Exim 4.92) (envelope-from ) id 1swMrN-0000ep-Ds; Thu, 03 Oct 2024 14:31:17 +0000 Received: by outflank-mailman (output) from mailman id 809515.1221904; Thu, 03 Oct 2024 14:31:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swMrN-0000eY-A7; Thu, 03 Oct 2024 14:31:17 +0000 Received: by outflank-mailman (input) for mailman id 809515; Thu, 03 Oct 2024 14:31:15 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swMrL-0008IT-RY for xen-devel@lists.xenproject.org; Thu, 03 Oct 2024 14:31:15 +0000 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [2a00:1450:4864:20::12f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 248dfebe-8194-11ef-99a2-01e77a169b0f; Thu, 03 Oct 2024 16:31:14 +0200 (CEST) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5399041167cso1754292e87.0 for ; Thu, 03 Oct 2024 07:31:14 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539a8256ab3sm188873e87.79.2024.10.03.07.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:31:12 -0700 (PDT) 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: 248dfebe-8194-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727965873; x=1728570673; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G14n863A5XJ+R3OWZM+ShGFWWx326n2e7KMDwbqTXOk=; b=gtBipwiL8/mWZjt7rgjpbEyZ+gZPw2VoYxBzvpV/1YAJ/iePVJzwZBUA3buXe4ulho hVOP2zAK3A1LUWMI1PFg7xPRBf9Co840gqswG1xkjl6dzHPqXmAhgGOX6JXYgVZ7s3V3 Phz5CjkPi5ljV/Hb+lEez2mK3bfZ09LDdIQHfTQh2qnGIx7odPI6fRH4Q4U9MH5N+uIV BC/rSmRiz8PuarRlnDVo7NTlxSciFYhDOc5h1LxqNy6Ty+/E7Utf0hGPXf49e7fFGw0Z jMbOgOla6H9QYNhGORvxtWnX/+fbCxUhcDz7tF18j70SrJx5Y8ndLadQ6Wo5F4AQakjD 5fEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727965873; x=1728570673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G14n863A5XJ+R3OWZM+ShGFWWx326n2e7KMDwbqTXOk=; b=f2V9s2TkP6jttm8Utv4SeHK/3aQ21/BWqVKHwcH3aq1fsM/p4bBCrKYu+9xfYejC+q br0znZCuqO1MrjEsRHKFuU56vH8rGL/kQ18H/baNQ5ZcX0JG/YixW0Gq4M0yiVP8YFA+ i7bL5PEGDCp4UACp1aj1SlzAvcZr3EChAxRxuZTcaAix7HaHwuTPjstYrUwZkhKAYnHD qyXIAltxLB2BTETWGb/ntgeVmk0iuc4RnOj3BUuT3phI2kPBMldHwhG9H9D+i76ndWV9 5mfVGhfXWWPywuOIY98FKYlFK0NbyfV6Sm8hxjHSZKwQffmbdEix9AHkTQ0JA7y2Obls 84GQ== X-Forwarded-Encrypted: i=1; AJvYcCWzsX/Gh4dO7OtVb6UT6FHVzH69FDjgbNihdddfeeTk68Kc/CNPUVVvX9NKcT/r17y9fPwAGtEsCUw=@lists.xenproject.org X-Gm-Message-State: AOJu0YzjYuxe463e255gmtQiu/QE7hhUDSK6nJG9JyYyI+4jYMVbrwGV WuM9+UzlINFuuwJuLgw5uFsEcb3VUT4nsy4UqAmY71GBZStABiZ9 X-Google-Smtp-Source: AGHT+IHOBNtTy8Z6hlO7HIVsJ2JrpsTcBJsLU3WHSwU8CKz+ObM1If7037IORqFyBvOjTb7coQLByw== X-Received: by 2002:a05:6512:304e:b0:539:8d9b:b61c with SMTP id 2adb3069b0e04-539a07a62c1mr6698903e87.51.1727965873124; Thu, 03 Oct 2024 07:31:13 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , qemu-arm@nongnu.org Subject: [PULL v1 3/5] hw/xen: xenpvh: Disable buffered IOREQs for ARM Date: Thu, 3 Oct 2024 16:31:00 +0200 Message-ID: <20241003143103.1476805-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241003143103.1476805-1-edgar.iglesias@gmail.com> References: <20241003143103.1476805-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727965898786116600 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add a way to enable/disable buffered IOREQs for PVH machines and disable them for ARM. ARM does not support buffered IOREQ's nor the legacy way to map IOREQ info pages. See the following for more details: https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dcommitdiff;h=3D2fbd7e609e18= 03ac5e5c26e22aa8e4b5a6cddbb1 https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Dxen/arch/arm/ioreq= .c;h=3D2e829d2e7f3760401b96fa7c930e2015fb1cf463;hb=3DHEAD#l138 Reviewed-by: Stefano Stabellini Signed-off-by: Edgar E. Iglesias --- hw/arm/xen-pvh.c | 3 +++ hw/i386/xen/xen-pvh.c | 3 +++ hw/xen/xen-pvh-common.c | 2 +- include/hw/xen/xen-pvh-common.h | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/arm/xen-pvh.c b/hw/arm/xen-pvh.c index 04cb9855af..28af3910ea 100644 --- a/hw/arm/xen-pvh.c +++ b/hw/arm/xen-pvh.c @@ -66,6 +66,9 @@ static void xen_arm_machine_class_init(ObjectClass *oc, v= oid *data) */ mc->max_cpus =3D GUEST_MAX_VCPUS; =20 + /* Xen/ARM does not use buffered IOREQs. */ + xpc->handle_bufioreq =3D HVM_IOREQSRV_BUFIOREQ_OFF; + /* List of supported features known to work on PVH ARM. */ xpc->has_tpm =3D true; xpc->has_virtio_mmio =3D true; diff --git a/hw/i386/xen/xen-pvh.c b/hw/i386/xen/xen-pvh.c index 45645667e9..f1f02d3311 100644 --- a/hw/i386/xen/xen-pvh.c +++ b/hw/i386/xen/xen-pvh.c @@ -89,6 +89,9 @@ static void xen_pvh_machine_class_init(ObjectClass *oc, v= oid *data) /* We have an implementation specific init to create CPU objects. */ xpc->init =3D xen_pvh_init; =20 + /* Enable buffered IOREQs. */ + xpc->handle_bufioreq =3D HVM_IOREQSRV_BUFIOREQ_ATOMIC; + /* * PCI INTX routing. * diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index 08641fdcec..76a9b2b945 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -195,7 +195,7 @@ static void xen_pvh_init(MachineState *ms) =20 xen_pvh_init_ram(s, sysmem); xen_register_ioreq(&s->ioreq, ms->smp.max_cpus, - HVM_IOREQSRV_BUFIOREQ_ATOMIC, + xpc->handle_bufioreq, &xen_memory_listener); =20 if (s->cfg.virtio_mmio_num) { diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-commo= n.h index bc09eea936..5cdd23c2f4 100644 --- a/include/hw/xen/xen-pvh-common.h +++ b/include/hw/xen/xen-pvh-common.h @@ -43,6 +43,9 @@ struct XenPVHMachineClass { */ int (*set_pci_link_route)(uint8_t line, uint8_t irq); =20 + /* Allow implementations to optionally enable buffered ioreqs. */ + uint8_t handle_bufioreq; + /* * Each implementation can optionally enable features that it * supports and are known to work. --=20 2.43.0 From nobody Sun Nov 24 17:01:53 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=1727965894; cv=none; d=zohomail.com; s=zohoarc; b=M6mMunXdx05lniBpLfcYyxYuLxOm0H/JcPg6FChbdTsdBw0QmG+IDgr7XgKpTtCMfCsw7oM2UZxZVOo7Us1inJXl2YQyQmYtfL/GKSD9DOSZ9Gsk8zdjFHodezDXhiR+7ztkq/OlTbvqTkyfcTgkI0vaglU8qkuz5843/1Zd29w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727965894; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Mm+KI23c86LD33sZYRxxXCIhV12T/Ywht8Xuz1hXe+0=; b=Gb4SkvtJlqQqTECHO/K8hvbcSbo+THRRIGwnnmnfIXik9dS28ttJeRmmKUi0MdMSU49rvp76OyQRXTizf/9yo71CNJz6f7+bKj8CdknRy2PVgMt49kGU+ak0vzdpwFYokbKx5tUHED1pbRylTTw3WQv1gRaYzu7u0gIIL2NY/k4= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1727965894367829.0401357392761; Thu, 3 Oct 2024 07:31:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.809516.1221913 (Exim 4.92) (envelope-from ) id 1swMrO-0000uf-L6; Thu, 03 Oct 2024 14:31:18 +0000 Received: by outflank-mailman (output) from mailman id 809516.1221913; Thu, 03 Oct 2024 14:31:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swMrO-0000uR-I5; Thu, 03 Oct 2024 14:31:18 +0000 Received: by outflank-mailman (input) for mailman id 809516; Thu, 03 Oct 2024 14:31:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swMrN-0008IT-PD for xen-devel@lists.xenproject.org; Thu, 03 Oct 2024 14:31:17 +0000 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [2a00:1450:4864:20::229]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 25d802d9-8194-11ef-99a2-01e77a169b0f; Thu, 03 Oct 2024 16:31:16 +0200 (CEST) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2fad784e304so13832881fa.2 for ; Thu, 03 Oct 2024 07:31:16 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2faecc6b0a7sm2305121fa.94.2024.10.03.07.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:31:13 -0700 (PDT) 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: 25d802d9-8194-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727965876; x=1728570676; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mm+KI23c86LD33sZYRxxXCIhV12T/Ywht8Xuz1hXe+0=; b=iorVldF5vsj1alGJS6X5b+4dcq1U3vB001sTeEbMYY+XZf0iC0FLExWm3BXm/AYJWq tpPmLjJmL0gT55qaboa8wRoaK0wCeCHCSxEMjx5oSk1SrjTJyxChbrgJR+SLIaWOAaUb Z4fTNIsAcmKEbFZD3fpcp1/Qii/ezbbvV7ds3mQ/4AB5t9OhBajGfW0GhanX/dIpfH0W /12zve0IyslZFK69epkbkW+/G7vxdLGzf8wKoCZWx6qsCPejYkqxXJF6LbrtIWXY0Ppt T+QdNQ7UuC8XJUfszoVJ5NZrmON1hzo2SRwvfrHKchxO/QYrnZIndAVBLc/lRHyCxyqX lHAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727965876; x=1728570676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mm+KI23c86LD33sZYRxxXCIhV12T/Ywht8Xuz1hXe+0=; b=CNhpdYF/EgaqnmLcvgpCCvk3i5MTnwf9tTqouE7k+MBcmVP7M9zAiDDeFv0blT1VRj xC/egBYgp+49uokjWyRxxiw9tVBao6rn/BRGRk8CXdh0vgDsZqfGNEqyAaafYAZHr1T2 1Uagq8aj0t/L43URbESKdxTGIHJZzvigDUuPjCctFzKoJOuPXHjEyzAKsvdedNQaWDcI LkFyJ1dhuptffvdMiwGiSES1TFBD9otIfKs5uA3sbB9UN8Gre/uL9zew/yEYd+Z4Qn4f mI/9o8Zb5H5WGFIv45ll+ZB0WSS1WhpRwBJZ6r0m6uokU1bMABblyO/T5qQxT+/QBPS7 SunA== X-Forwarded-Encrypted: i=1; AJvYcCUVcyPr4nbHqxsSIRDw9AU/nWzoMrH1FvvQ+Qcu6C2W9mt/CGxsTQIU2Ni5I9zw6AXpsPnHU/MRiNM=@lists.xenproject.org X-Gm-Message-State: AOJu0YwmBMQOHHvXCuBOhfWNXxjyAEztybWR6tbTlJX9aOePKadbK4BW 9b0r4qG1GLLliio3fFa7PDucf7Su3Lk7Cg2MWAlak2JE7qdp/Oti X-Google-Smtp-Source: AGHT+IHCsQYggo4+QHNTj+E9IQLO7FGvdIFdGsNJPj3Xn8OHbIfJIYVd+Xs40rnxZoWpf5j1Z25ZfA== X-Received: by 2002:a2e:bc1a:0:b0:2fa:d723:efc8 with SMTP id 38308e7fff4ca-2fae1033a7amr52001111fa.26.1727965875455; Thu, 03 Oct 2024 07:31:15 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" Subject: [PULL v1 4/5] hw/xen: xenpvh: Add pci-intx-irq-base property Date: Thu, 3 Oct 2024 16:31:01 +0200 Message-ID: <20241003143103.1476805-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241003143103.1476805-1-edgar.iglesias@gmail.com> References: <20241003143103.1476805-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727965896794116600 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Acked-by: Stefano Stabellini Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-pvh-common.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index 76a9b2b945..218ac851cf 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -218,6 +218,11 @@ static void xen_pvh_init(MachineState *ms) error_report("pci-ecam-size only supports values 0 or 0x100000= 00"); exit(EXIT_FAILURE); } + if (!s->cfg.pci_intx_irq_base) { + error_report("PCI enabled but pci-intx-irq-base not set"); + exit(EXIT_FAILURE); + } + xenpvh_gpex_init(s, xpc, sysmem); } =20 @@ -273,6 +278,30 @@ XEN_PVH_PROP_MEMMAP(pci_ecam) XEN_PVH_PROP_MEMMAP(pci_mmio) XEN_PVH_PROP_MEMMAP(pci_mmio_high) =20 +static void xen_pvh_set_pci_intx_irq_base(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + XenPVHMachineState *xp =3D XEN_PVH_MACHINE(obj); + uint32_t value; + + if (!visit_type_uint32(v, name, &value, errp)) { + return; + } + + xp->cfg.pci_intx_irq_base =3D value; +} + +static void xen_pvh_get_pci_intx_irq_base(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + XenPVHMachineState *xp =3D XEN_PVH_MACHINE(obj); + uint32_t value =3D xp->cfg.pci_intx_irq_base; + + visit_type_uint32(v, name, &value, errp); +} + void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc) { ObjectClass *oc =3D OBJECT_CLASS(xpc); @@ -318,6 +347,13 @@ do { = \ OC_MEMMAP_PROP(oc, "pci-ecam", pci_ecam); OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio); OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high); + + object_class_property_add(oc, "pci-intx-irq-base", "uint32_t", + xen_pvh_get_pci_intx_irq_base, + xen_pvh_set_pci_intx_irq_base, + NULL, NULL); + object_class_property_set_description(oc, "pci-intx-irq-base", + "Set PCI INTX interrupt base line."); } =20 #ifdef CONFIG_TPM --=20 2.43.0 From nobody Sun Nov 24 17:01:53 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=1727965899; cv=none; d=zohomail.com; s=zohoarc; b=MI3FKjMYNZS3xw+tNEzmpfBzZ7ECk2MCJUenFjuUdFU8IkJ+0tqkOT7pG4N74HPNnXs0iBrgQH5gUrq9KVdBVeYE67XllnR0hE6ReMqLWan2Go/kalFXGd88NvrNcQ/gwmCu/Es71E+PYTO+M3KKhj4rQN5GHVATx0aMHK5zkg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727965899; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7NqZgDSIdmym8k9v4wrElx9POiJdcsjS85l4BMSFw2Y=; b=VavK4zarJWxXzOmgCmreVgRbZdq9u4sbIpczv0//5TMy9GWtu1leXxc1SXKZoA4S9EpLri4TOESM+kc7mfYyXlanhB4IecDX0pVt5o221qmp1iBjBX6SEwV68fQttQ4O29ys7+4E/mHdEJ/2Zi6FPxe6t4dkizTvmLW3X5Welfw= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1727965899612971.7883737752866; Thu, 3 Oct 2024 07:31:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.809517.1221924 (Exim 4.92) (envelope-from ) id 1swMrQ-0001Dc-TE; Thu, 03 Oct 2024 14:31:20 +0000 Received: by outflank-mailman (output) from mailman id 809517.1221924; Thu, 03 Oct 2024 14:31:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swMrQ-0001DV-PQ; Thu, 03 Oct 2024 14:31:20 +0000 Received: by outflank-mailman (input) for mailman id 809517; Thu, 03 Oct 2024 14:31:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swMrP-0008IT-Rc for xen-devel@lists.xenproject.org; Thu, 03 Oct 2024 14:31:19 +0000 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [2a00:1450:4864:20::133]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 271af55b-8194-11ef-99a2-01e77a169b0f; Thu, 03 Oct 2024 16:31:18 +0200 (CEST) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5398e33155fso1320156e87.3 for ; Thu, 03 Oct 2024 07:31:18 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539a82570b4sm190849e87.91.2024.10.03.07.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:31:16 -0700 (PDT) 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: 271af55b-8194-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727965878; x=1728570678; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7NqZgDSIdmym8k9v4wrElx9POiJdcsjS85l4BMSFw2Y=; b=Oib+6qKVXssGS/34dQCIZgsuM+ApUmF2KD8TKhjyw0cw1a/Sguf3c7vnm/cHwQIYLB T9nkv2eTYi3BpUOJ+0ei3JH7dw81cZbWlSigrqD84Dc/XBpRN+twaxDOgbF0p6NfEUKW kFV4cPtL3VdvpA0t1srR8n7ZynNt7NHBqmn0OC4aWeezwXLk/3nawEphKMyLpv1qh+Tx LfbMltpd2tB4Pyy7xKaIuZjxyuiD0nJB8blM0bQriVInDzvedlRI8wV8gPmUgweIQBlb SdvR64L6smD6ezB1QNpoJ+1vAZNRyNdYs2xuXZQSt6SMgn1w69TWQVX8z3ILWiZ2/F+R yjdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727965878; x=1728570678; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7NqZgDSIdmym8k9v4wrElx9POiJdcsjS85l4BMSFw2Y=; b=qI1NupL4SF0+b7VwgBHE/Agh0C7FchnCjlDfYHFmYqLl1kYq8wJ9VinMI/P+LUB9wp AowFsK53auT1Z5uLgzMJIe0bwt5oIDqyBlf3Fjt6nObEHBeS/yDudJA0K37B8+f9D9DG v6w0EtJzVUZ7ZJttSzk8eRq3sFUspAH1hePxf0LpKXOdIy1J+wHijuSz964noLgCBvcE zopYLGKhbCZUyUw9q2zAkuJ/QtdLA8P8gE8JbgJM9A+B0XzXGPz6TPcNpaYsHgFPebNC iq9vNlZ9nkol8SYJeboLkkTUyIoTRG2NaNBeNuTsJehfOtje68rUkwK1tKn+P3jV6+WI cf9A== X-Forwarded-Encrypted: i=1; AJvYcCVz4VFIR+r+CnM/hRpKv+u7a9naB9e4eF2+gFl0piADQTAgjThTY+1L7//IonzRJgLf66DUzLH4rM0=@lists.xenproject.org X-Gm-Message-State: AOJu0YyOx7SOi2rfqUw7UVZzxJnJDpQoLvYlZuqsBz+QiTUc9wyiiQRW Dc8gtkNk7D/QZdcguFk4b7O2TD7TbUK9JbQQHqh8KpPUM56vejCh X-Google-Smtp-Source: AGHT+IET81PHAds/Q3QNcBRs8kVhS58wFGAWTG93rqF8wvxXNPYtyFncOLDYwbQheecmXThSjwTeoQ== X-Received: by 2002:a05:6512:3da1:b0:539:93b2:1383 with SMTP id 2adb3069b0e04-539a07a1d8emr4381480e87.46.1727965877639; Thu, 03 Oct 2024 07:31:17 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, qemu-arm@nongnu.org Subject: [PULL v1 5/5] hw/arm: xenpvh: Enable PCI for ARM PVH Date: Thu, 3 Oct 2024 16:31:02 +0200 Message-ID: <20241003143103.1476805-6-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241003143103.1476805-1-edgar.iglesias@gmail.com> References: <20241003143103.1476805-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727965900768116600 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Enable PCI support for the ARM Xen PVH machine. Reviewed-by: Stefano Stabellini Signed-off-by: Edgar E. Iglesias --- hw/arm/xen-pvh.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/arm/xen-pvh.c b/hw/arm/xen-pvh.c index 28af3910ea..33f0dd5982 100644 --- a/hw/arm/xen-pvh.c +++ b/hw/arm/xen-pvh.c @@ -39,6 +39,16 @@ static void xen_arm_instance_init(Object *obj) VIRTIO_MMIO_DEV_SIZE }; } =20 +static void xen_pvh_set_pci_intx_irq(void *opaque, int intx_irq, int level) +{ + XenPVHMachineState *s =3D XEN_PVH_MACHINE(opaque); + int irq =3D s->cfg.pci_intx_irq_base + intx_irq; + + if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) { + error_report("xendevicemodel_set_pci_intx_level failed"); + } +} + static void xen_arm_machine_class_init(ObjectClass *oc, void *data) { XenPVHMachineClass *xpc =3D XEN_PVH_MACHINE_CLASS(oc); @@ -69,7 +79,11 @@ static void xen_arm_machine_class_init(ObjectClass *oc, = void *data) /* Xen/ARM does not use buffered IOREQs. */ xpc->handle_bufioreq =3D HVM_IOREQSRV_BUFIOREQ_OFF; =20 + /* PCI INTX delivery. */ + xpc->set_pci_intx_irq =3D xen_pvh_set_pci_intx_irq; + /* List of supported features known to work on PVH ARM. */ + xpc->has_pci =3D true; xpc->has_tpm =3D true; xpc->has_virtio_mmio =3D true; =20 --=20 2.43.0