From nobody Sun Nov 24 02:47:50 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=1726499416; cv=none; d=zohomail.com; s=zohoarc; b=GiDSc9ZoTr8+bWvQqeMjjkfJ3BQ9SV7du0UJuQNacrzYpWKd5x6xbRntiaN0L3jrkJfQA8ThVlnyQAiWWPKkFG+W+IrKCdYhLbAd5ven71g0TCwAr4xESw+zn+vD/6h/Ibzbkl/lI9+GrP1BGsHfQASOWBvl5zYXSJHE2WvJk/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726499416; 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=SbKegTM3qN+Ytt+xHcqndYgbj2oaz5lyUbttYzNXA8U=; b=byVHB3pdDCDyZbC+54byLVco00NLo9r8ieuD2lU83e6HhaxzYzqsvKqtgjgLrlVg4D+/Zr+MvNBPwsESz/Tm85dqXyVPvQblTSG244HTDtHoYxoaXCBxwUTUJKdrsh4rkkZd9eEet4AI41yuKHv+/JYlAz4hyxYhRZcjfeNbW/0= 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 1726499416154102.46555629372074; Mon, 16 Sep 2024 08:10:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqDLf-0004fD-Dl; Mon, 16 Sep 2024 11:09:07 -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 1sqDLd-0004Z3-Bg for qemu-devel@nongnu.org; Mon, 16 Sep 2024 11:09:05 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqDLb-00048g-D0 for qemu-devel@nongnu.org; Mon, 16 Sep 2024 11:09:05 -0400 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-3a08489f757so13483725ab.0 for ; Mon, 16 Sep 2024 08:09:03 -0700 (PDT) Received: from gmail.com (ip190-5-140-142.intercom.com.sv. [190.5.140.142]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a092e8eea7sm16674175ab.77.2024.09.16.08.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 08:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726499342; x=1727104142; 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=SbKegTM3qN+Ytt+xHcqndYgbj2oaz5lyUbttYzNXA8U=; b=I2jOGv/vrNQ2F6+6OJ2pYyCsP80TCBylTbnHio7o1V+K1+7lytWAIEUBLzVGzwDye1 y7esGlZ+Tiel89ne4M61H9f3QvRvUL2yWa5zj1b9ivebULrpf54AopY9E4aRW+NFD0qR DPiFOfqGUxTjF3svgSO5QE37/ToW51BrE0rJD9oNh4iseNPTsLSza2aniYLHcv7BpRNO 6JFvmcofjKz5G8o7V/KycUXGWPW0TkbIpzn3k2OyTb+7KDcT1CD3IJnLDenhqbePBCYH IEIA/CZASIAM6gTFin0WjanVxrx6THIVNp5uClMzhm1MxadYLRJexgXdiQvov7IvIZsV mkNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726499342; x=1727104142; 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=SbKegTM3qN+Ytt+xHcqndYgbj2oaz5lyUbttYzNXA8U=; b=BMSpU1rp0Bq4mxhQ2c1fi80ghJMXBurfy0lBd6GpBEZZvaKqowHPEH3cQ8OmeZnDfQ rYJjNbhDrbO3yRKUaeTzcDiD9Kr2LfIHmFDN5eidkdhAWQzLdWabI4O6OxjoeEa8n9q4 wO9Sy5biWW8kjsOfvmPiPnA17i2ObdmxALx2yqTcwt3QjBh0pzWg/0Lzb0mhn2FArJoO 8V9/aOBdMUINiWxhyq884bvCYeOMKWUfjCAUSbDaB2pA6IFHk/yiirIvfpbth3ADN6Jj 4EiOCqbzF3kHAUhzPWJF/hyQLy74uYMWke2bTua10H42RV+tQhGWD0wZxcXYES+jccu3 3X4Q== X-Gm-Message-State: AOJu0YzqXeTHDL2WgFgC3bE/k0SE9+dosPh0OZRhmMF1CBh0SGcIn6lU gHHAghoyafGirmoK5MUgQh6+V8ov8unhopgmcleIiH1zGmmdOFfg9M1Oqsrp X-Google-Smtp-Source: AGHT+IG+/SW/D0yFpfEJ5d73OOBWnbYkm6OlW1UxBoRWx11pp93quvsquEBHNNv20XbyDW5ufhyR9g== X-Received: by 2002:a05:6e02:148f:b0:3a0:98ab:7932 with SMTP id e9e14a558f8ab-3a098ab7be4mr50233635ab.9.1726499341496; Mon, 16 Sep 2024 08:09:01 -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, alex.bennee@linaro.org, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v1 1/4] xen: Expose handle_bufioreq in xen_register_ioreq Date: Mon, 16 Sep 2024 17:08:49 +0200 Message-ID: <20240916150853.1216703-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240916150853.1216703-1-edgar.iglesias@gmail.com> References: <20240916150853.1216703-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=2607:f8b0:4864:20::130; envelope-from=edgar.iglesias@gmail.com; helo=mail-il1-x130.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=no 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: 1726499417778116600 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. Signed-off-by: Edgar E. Iglesias --- hw/i386/xen/xen-hvm.c | 4 +- hw/xen/xen-hvm-common.c | 100 +++++++++++++++++++------------- 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, 70 insertions(+), 44 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..d8824cccf1 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,72 @@ 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) { - trace_xen_map_ioreq_server_shared_page(ioreq_pfn); + if (state->has_bufioreq) { + 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 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) { - error_report("map shared IO page returned error %d handle=3D%p= ", - errno, xen_xc); + 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); - - 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; + trace_xen_map_ioreq_server_buffered_io_page(bufioreq_pfn); + + state->buffered_io_page =3D xenforeignmemory_map(xen_fmem, xen= _domid, + PROT_READ | PROT_WRITE, + 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 +845,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 +881,7 @@ err: } =20 void xen_register_ioreq(XenIOState *state, unsigned int max_cpus, + int handle_bufioreq, const MemoryListener *xen_memory_listener) { int rc; @@ -883,7 +900,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..7246941fe5 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, + int 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 02:47:50 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=1726499381; cv=none; d=zohomail.com; s=zohoarc; b=BRqNjtJfKdKVJ8ypNWVGF4dDFZL21Abnlt7t7/f+VVWYtxdpr3ggmPwdWE+hOpr94daaI0CR7C/beG4S8WjbAhJCVN9E0XTO3ZxN+cHlcyTGC6uSR+Zv9HIG9yONBYUbZD1Xp7LHKKYYOcMHf1Oka6gWXwzf/p9BwRm67sgew+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726499381; 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=z9fGayqu8/3BSy8pNgZk7M/4P7YOiJj/gcULOkYYJOg=; b=b9+3bepXQw8DKuin3zsTN2Qj5KZ1nqc2nfsbN/bGXFcfAYuZVLCN2DMawTEsxzoSyxNjE30mfdFzmcXFY9mcCOIowyT0c93IyxJF1X+Y5hw5yIjCG8EYYcFvX4WQ25GW0Wg3kwPyuFIg0NXCDCVv+wERjRcKXO1dUEDbh9M8GEI= 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 1726499381567963.4437461055004; Mon, 16 Sep 2024 08:09:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.799581.1209566 (Exim 4.92) (envelope-from ) id 1sqDLf-0006DK-SP; Mon, 16 Sep 2024 15:09:07 +0000 Received: by outflank-mailman (output) from mailman id 799581.1209566; Mon, 16 Sep 2024 15:09:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sqDLf-0006DD-O9; Mon, 16 Sep 2024 15:09:07 +0000 Received: by outflank-mailman (input) for mailman id 799581; Mon, 16 Sep 2024 15:09:06 +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 1sqDLe-0005jt-EG for xen-devel@lists.xenproject.org; Mon, 16 Sep 2024 15:09:06 +0000 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [2607:f8b0:4864:20::12c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9c990415-743d-11ef-99a2-01e77a169b0f; Mon, 16 Sep 2024 17:09:04 +0200 (CEST) Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-39f526fd19bso10278695ab.1 for ; Mon, 16 Sep 2024 08:09:04 -0700 (PDT) Received: from gmail.com (ip190-5-140-142.intercom.com.sv. [190.5.140.142]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4d37ec3d0aasm1507302173.84.2024.09.16.08.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 08:09:02 -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: 9c990415-743d-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726499343; x=1727104143; 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=z9fGayqu8/3BSy8pNgZk7M/4P7YOiJj/gcULOkYYJOg=; b=V3FaZAZFR6mOelvJJfOo8+gD3EtSRLxaRV5D3ZaPE1gbj7RRCh2/ZM11SjNqGkYPPj QpuW5tmOXxJozOXZ2c1CkzANPK24Leq7OZVNgQZR0l5MrseFxEiuU6GKYjavddClDfvv yqHM4oBFbJCh2gFRXrGSiPwb/1YDUCi2INocjsF50wGCy3mYZfCV5qrIbZvEKJRMUfhF UDsOReqH/VQN7cUQ2sAZYECo8zwdq2H8zYK8nvZqQ5xD3aStcG9AuDKvDyGh8Cg5w+yA /f/Fzwuio0vqGkFpmtaU5YCJSzYn1prmiZsU3jpXkVGZnSmEYGsuM25CsPFXzhnhW9cR QcbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726499343; x=1727104143; 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=z9fGayqu8/3BSy8pNgZk7M/4P7YOiJj/gcULOkYYJOg=; b=r6eyrm+eSGUegBvSt3Imnf7FVfaihuuEAEY2+OHl4AO/lMjzrGHMw6fbCtIpotS1vA KCazv5g/T3QEbZ1m0rFCDX+rz+tfvFoY1LSlytQHJBjec+g/208E5fHMvqB1QeaJsFrK LAMTimpJUXibmcdx8VbvAqBGjo7MOht8YoZH15+f1vfehCdE6ZRA6HiArLxFHmuh66gQ iFb9LXekrink/rnBuNxsVKsMhOEcY0jYtjrn+CnuujcZmwuSnR89KVyHznaKzd/gobHb 4NQ4SEm6EMki/zptYjYliM8uHhHH60Uf/a6YDPY2f4oxZSpsvHQtHOagrLiU7VO8jjFz zj9Q== X-Forwarded-Encrypted: i=1; AJvYcCXwv/i3aC1+8qas8x2GcB5kAEK01018yyMF4CTKSppCTrNvQEtlkz7vNueVZKBDV4TPgBbqpOZ/9ew=@lists.xenproject.org X-Gm-Message-State: AOJu0Yyax17ep94wugjK7jguxFsSMPh9isEaG9oxylqRPWnHnsDYCYcm 8oCPBgJHGMbMUZa8a/WNhaU/J3DId9PVEpQW/eMzq7/yhiqmFuLBS54B75h2 X-Google-Smtp-Source: AGHT+IEqUvGdjraR0wBvs0H47m4U/lbEz4963FbfsqjYnrckE5XmjraeI29NnHQZvwRQLEUjUdTYsg== X-Received: by 2002:a05:6e02:12e7:b0:3a0:8eb3:5160 with SMTP id e9e14a558f8ab-3a08eb35230mr80173955ab.11.1726499343305; Mon, 16 Sep 2024 08:09:03 -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, alex.bennee@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: [PATCH v1 2/4] hw/xen: xenpvh: Disable buffered IOREQs for ARM Date: Mon, 16 Sep 2024 17:08:50 +0200 Message-ID: <20240916150853.1216703-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240916150853.1216703-1-edgar.iglesias@gmail.com> References: <20240916150853.1216703-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1726499383399116600 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 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..62c44a1ce7 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. */ + int 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 02:47:50 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=1726499372; cv=none; d=zohomail.com; s=zohoarc; b=a2Lb9DBBALRHkt0/FTdUARr5YNcqmL79QnGYoozjhsUZxw7wlTr61qeZy5JcLX49JxdietwW1Qi9P2/6roJJVt8eGXBNRQO9m6g1vpJ0RumeuEsHS4YIcrQpPq+YyJimMGDdHhcLQCX8NiLtXwJ6/eaja6ZsWZhLpAysWmg84Ns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726499372; 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=OyzI0RstvYLpuGfxES5qaxdspprmer1imsnsZ+RTJfc=; b=lXpjHOTBQTsNenDyJYyQj3FWhei1/eJ4q+X8Z7KtpFO3gBdTJtIOVjxR9pLiVcG4dLPzkxHyo79c2rhIfK8LxsDx5UAPBmbPecrYd2I7x2ec8EoGkKQW2XHM5bAxjeh4uxNlFV3GaRZPeP3W07gOMJDBfQ2lZSnb1G6ZIsy1kyw= 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 172649937280114.4882651402703; Mon, 16 Sep 2024 08:09:32 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.799582.1209576 (Exim 4.92) (envelope-from ) id 1sqDLi-0006Th-3o; Mon, 16 Sep 2024 15:09:10 +0000 Received: by outflank-mailman (output) from mailman id 799582.1209576; Mon, 16 Sep 2024 15:09:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sqDLh-0006TY-W9; Mon, 16 Sep 2024 15:09:09 +0000 Received: by outflank-mailman (input) for mailman id 799582; Mon, 16 Sep 2024 15:09:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sqDLg-0006Jf-FH for xen-devel@lists.xenproject.org; Mon, 16 Sep 2024 15:09:08 +0000 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [2607:f8b0:4864:20::d33]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9e37ef1d-743d-11ef-a0b6-8be0dac302b0; Mon, 16 Sep 2024 17:09:07 +0200 (CEST) Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-82aa93774ceso261604939f.0 for ; Mon, 16 Sep 2024 08:09:07 -0700 (PDT) Received: from gmail.com (ip190-5-140-142.intercom.com.sv. [190.5.140.142]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-82d49338889sm161572039f.38.2024.09.16.08.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 08:09:05 -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: 9e37ef1d-743d-11ef-a0b6-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726499346; x=1727104146; 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=OyzI0RstvYLpuGfxES5qaxdspprmer1imsnsZ+RTJfc=; b=RAMAVOKFhl2xu3sMneqv6/Uljn0BwQoSaPRcOQXlouLs2a4Dty7RcDu0/NMXkrKlz0 ROASlRilT2q0iX2mc/ov2gzUAoUgzwe8CXJHjys0W7di16IxxdWQPx1uZZ/BvemQJDDn zFd3RjuUqg2gJKPXMLbZfMepe/kyi8+9n4q+wEjBFEhQMa+ScMEHhPIPO44a8VZgLd1y sUVOZQa1Q/aXMhsdtFOGMSVoju1aAPJZGGieDa5WCMWDxtMgRetX+u9kPoMvZ77YqeEc GHkzXoq/eVRild08h15iTtHNuvpj+2lCxzArbPwBKkcx+YaCJN+byXWQhUFqfmTgt3IZ jWoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726499346; x=1727104146; 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=OyzI0RstvYLpuGfxES5qaxdspprmer1imsnsZ+RTJfc=; b=BgHLkcAj2xb4uhDHYsbLlkCnWDgBDh4HtrC2TJgOF9QCNkoiyK88I/9dCX/iXmmANG Jng+f/nVNhcHdPCph+CenbyDenvXjCQRSoRXtsExqs221AAYT8zSEBrluDVTL5h5aFJY xVkZ1aVNy7tacIVxxVbVlLQs/o12KPaMb6Hc84G4ihk3zPkIqQfyyVDn6FSsTBrTi3QC le6Oez9cW2FRxCuNOPY5Au+9QTd9P93J3L1QGZLHl2xeO11+96+FikVMRPqGcXnwhEUt CrfzgFjt+MtVF0N2H5pCU7Nuz0zKOmkJrbWCUcm/KOOmaVFb8jGd0VOKi+HAHPxLb/FL W6QQ== X-Forwarded-Encrypted: i=1; AJvYcCVU/Ijd84kQUh9dH+LptyAuCQlgdc8I7FV0BVYwMnq8nN5wkb+NUyAxiQrz9WZn+Y7MmW4647/ycwc=@lists.xenproject.org X-Gm-Message-State: AOJu0YwoGRxFk6HWE84d4Yzh3KPQw27+fVNeKRS8plLzWo4u/tnJAVvA iAGvRSaQbVGyteGrkALZt4Si4GrW+UO/W+nen9m7M/w4j7lJMHPj X-Google-Smtp-Source: AGHT+IFk3CkyeCYvrPI4xTDPi8u/IiZ0rmyEE85GTpP+WG+LffchGyM0QorbzWrvqbgokOTwFKRghA== X-Received: by 2002:a05:6602:3420:b0:82c:f30d:fc9b with SMTP id ca18e2360f4ac-82d1f982f5dmr1267148039f.13.1726499345949; Mon, 16 Sep 2024 08:09:05 -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, alex.bennee@linaro.org, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" Subject: [PATCH v1 3/4] hw/xen: xenpvh: Add pci-intx-irq-base property Date: Mon, 16 Sep 2024 17:08:51 +0200 Message-ID: <20240916150853.1216703-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240916150853.1216703-1-edgar.iglesias@gmail.com> References: <20240916150853.1216703-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1726499374055116600 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Acked-by: Stefano Stabellini --- 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 02:47:50 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=1726499371; cv=none; d=zohomail.com; s=zohoarc; b=VZQknjU24n6bO4gEenjReXHMGUigAfkGPGDlCp9pwIfy0O1WCH2xN/pHiYCBKs1JBPtKGJ+vPgICtFO1CdXn4N34E9fWUILJubwy9SmphDGID5IHv3t/OTysPYYpauP0aL1syDC9yOR0a5XizDO0cslsp9HHv9PqCUZTIA+N/uE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726499371; 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=tIDS2BgSDN2sYeAiwQv8u9Oegpn8pHfzCYrmX62ewXA=; b=Ck1GcuTN0Uho0AfVsgplv79b/tpIu9RjU5TCHMKiovZUZ0c7VV9ES9JcnDp2FZA1go4MtvSAZCI5AViqQUe+jYj5kJRS1DagCqa5RSDelGcQdbPxEeVYiwryNR3cKE9UrK3NaqMspSw5mqzegsUQFvtSOZOvBlIAFdKXTeyN0oU= 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 1726499371405612.52304628593; Mon, 16 Sep 2024 08:09:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.799583.1209587 (Exim 4.92) (envelope-from ) id 1sqDLl-0006mA-EF; Mon, 16 Sep 2024 15:09:13 +0000 Received: by outflank-mailman (output) from mailman id 799583.1209587; Mon, 16 Sep 2024 15:09:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sqDLl-0006lq-8i; Mon, 16 Sep 2024 15:09:13 +0000 Received: by outflank-mailman (input) for mailman id 799583; Mon, 16 Sep 2024 15:09:11 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sqDLj-0006Jf-FO for xen-devel@lists.xenproject.org; Mon, 16 Sep 2024 15:09:11 +0000 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [2607:f8b0:4864:20::d2a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a0340fe5-743d-11ef-a0b6-8be0dac302b0; Mon, 16 Sep 2024 17:09:10 +0200 (CEST) Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-82cec47242eso171179139f.0 for ; Mon, 16 Sep 2024 08:09:10 -0700 (PDT) Received: from gmail.com (ip190-5-140-142.intercom.com.sv. [190.5.140.142]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a092e9005csm16897935ab.79.2024.09.16.08.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 08:09:08 -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: a0340fe5-743d-11ef-a0b6-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726499349; x=1727104149; 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=tIDS2BgSDN2sYeAiwQv8u9Oegpn8pHfzCYrmX62ewXA=; b=FzzBG2cAeI9OVS6ZfKSdMHbMb8qs2lb4Uzm/bb6rZEpRoGtFJI+8dnPeGGKq46FKaL DrTD9uGwtvoTasRRKsJNe1oIwq+WRJTj3nZVUHdapH1SMHWNWQxqV3sZ8l0MKPIemOKb bjT8oZm4a1Xazg2Dk5KY4VsdKjgJpYQSyt4D+Dg2rzdm7K+HjxnRbweZyQRBhFqtYlFW hMsfaJivzSPvkXrWav8F+f2KANJ7AOVzqa8B0aekYnwZUUpM+pg8G1uH28ofACLeL0Jd qEHvZU5akdQXwDrUn9K9p0zui0b7an2PdMIQ5m58WA5FLWo907zfuYEEZ7jgCX8FPBYt tRyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726499349; x=1727104149; 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=tIDS2BgSDN2sYeAiwQv8u9Oegpn8pHfzCYrmX62ewXA=; b=FmvFo+LilFldcF7C/MJlPggb9By+avz2HYZAbII2w8ceylCPyX2xb+dwJHCfhmaoOG pGOishA+8J07A72cGGRT9xtsNnOjxigklpoi6YlUxvZdA1hcaH4T5Ompo/7C25/k6rh8 GXT1VEVzWAoPZQNY6fhExhUtXJ+FK11jVN1cT14xCqojBaJ1jHMfVlDVm3witT8qv+15 nxRs50AjXoaOCEmcU3Nxu6d4gKKP3S+Wt0IUjX4KNUtFvksAUWi4qTaHU8dZGNnppA1G RdA7PCGKjTunYS16BhP0X2ckMOiimbaLohCmsrLHMF3sunRkRfyQMNyNE7a/UYW7hNBc p+jA== X-Forwarded-Encrypted: i=1; AJvYcCVY5MUGU+9LXTiqJ6T7SMcfu/54lqqdT0bLI6g4F9xAxC26QHnEuexWNFuYf7/UkGzofUWPrgDNz0A=@lists.xenproject.org X-Gm-Message-State: AOJu0YwUmX9bm2h6S69FLcSKax0dtzqQon+8AW61InWJwz9nqJ/45i67 UHo9i9PiEtlvh/GDBrmbnq2ZqAHasF7vPwba+EKE5t5F2s9emmvC X-Google-Smtp-Source: AGHT+IE86ZuS/7NQzNvR5tLVOdqaKbQKcpupAoW/xUcVW9ix1XY+RyPuORlI+lKWYit0Zg+iCQOwZg== X-Received: by 2002:a05:6e02:12c5:b0:39f:325f:78e6 with SMTP id e9e14a558f8ab-3a0845a0d55mr130717185ab.0.1726499349478; Mon, 16 Sep 2024 08:09: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, alex.bennee@linaro.org, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, qemu-arm@nongnu.org Subject: [PATCH v1 4/4] hw/arm: xenpvh: Enable PCI for ARM PVH Date: Mon, 16 Sep 2024 17:08:52 +0200 Message-ID: <20240916150853.1216703-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240916150853.1216703-1-edgar.iglesias@gmail.com> References: <20240916150853.1216703-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1726499374114116600 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Enable PCI support for the ARM Xen PVH machine. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- 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