From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2909C4167B for ; Tue, 28 Nov 2023 14:17:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.643225.1003205 (Exim 4.92) (envelope-from ) id 1r7yu0-0005t6-Qq; Tue, 28 Nov 2023 14:17:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 643225.1003205; Tue, 28 Nov 2023 14:17:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r7yu0-0005sj-OH; Tue, 28 Nov 2023 14:17:28 +0000 Received: by outflank-mailman (input) for mailman id 643225; Tue, 28 Nov 2023 14:17:27 +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 1r7ytz-0005rc-AE for xen-devel@lists.xenproject.org; Tue, 28 Nov 2023 14:17:27 +0000 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [2a00:1450:4864:20::22c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id da70b49a-8df8-11ee-9b0e-b553b5be7939; Tue, 28 Nov 2023 15:17:25 +0100 (CET) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c9b88cf626so4866651fa.3 for ; Tue, 28 Nov 2023 06:17:25 -0800 (PST) Received: from localhost ([213.195.113.99]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c231800b0040b36050f1bsm17325619wmo.44.2023.11.28.06.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:17:24 -0800 (PST) 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: da70b49a-8df8-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1701181045; x=1701785845; darn=lists.xenproject.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VsMkPMJah0sshQqUAObhpuJvuKhX90P2yhCTBHvAGbQ=; b=mM7wHdjUXp3ouCmshgO9xNkSL5Dcv9gOiD9PXD07TIJCMUsWXzSZdj56mHvDPoba9c O3+GXhMgQF4nTHNCuLcBC4YqQd9wnjfG6yKX08x7CSO3BTPuLOa1XkKxWDnJrODWRxre +W6LkXhLzpOfN95EIS+N/NoIf9SlpfFzUQdcU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701181045; x=1701785845; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VsMkPMJah0sshQqUAObhpuJvuKhX90P2yhCTBHvAGbQ=; b=UMm9wyHdgQDriSKnns+E5CN8QtFgaXPdPKf1d1jUphdqAGC/2XbCPlXdpNc+xZk3HG Nlt16/bHmY18eF2EEKO1rZmBtoJ4IyoLpHjua2+bk4LHGdsW3zOg6JF6VxItRbAWcVFi LrKyDdDMAE+/cg2KFowX3zaEA24t7Kw8eQ86jj/qLQ73JWb8hjbuigidRU2ITrlIATcO uGokO6aJMqNLd11IU+P/Gh8pkpemZhTeMGF6NiohPoSS7EHf0284THZAO/0yB9Wm4ZSB WjmVgd1TUkCntIZwtZjp4oHrc4CDxj2ERxTkWazOOkuCh1bSoteIMY2InBgKunrwzdLG bnqA== X-Gm-Message-State: AOJu0YxJ3n9AWAAFMVTyuPmu0AMB/5jw1cVot2+g9bAZxFYWz0zP78f6 b1TvDRKlDQ6nCScZJPtPDiUpow== X-Google-Smtp-Source: AGHT+IE2VidwYduX3+IUWzCNWkz7fH0MJcFoy+9n6bs9SgisPO6hvJgpWGU9CHGg3fgT+xIjWSxO2A== X-Received: by 2002:ac2:4a91:0:b0:50b:b9f4:b9e3 with SMTP id l17-20020ac24a91000000b0050bb9f4b9e3mr1265253lfp.53.1701181044692; Tue, 28 Nov 2023 06:17:24 -0800 (PST) Date: Tue, 28 Nov 2023 15:17:23 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Jiqian Chen Cc: Jan Beulich , Wei Liu , Anthony PERARD , Juergen Gross , Stefano Stabellini , xen-devel@lists.xenproject.org, Stewart Hildebrand , Alex Deucher , Xenia Ragiadakou , Stefano Stabellini , Huang Rui , Honglei Huang , Julia Zhang Subject: Re: [RFC XEN PATCH v2 2/3] x86/pvh: Open PHYSDEVOP_map_pirq for PVH dom0 Message-ID: References: <20231124104136.3263722-1-Jiqian.Chen@amd.com> <20231124104136.3263722-3-Jiqian.Chen@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231124104136.3263722-3-Jiqian.Chen@amd.com> On Fri, Nov 24, 2023 at 06:41:35PM +0800, Jiqian Chen wrote: > If we run Xen with PVH dom0 and hvm domU, hvm will map a pirq for > a passthrough device by using gsi, see xen_pt_realize->xc_physdev_map_pirq > and pci_add_dm_done->xc_physdev_map_pirq. Then xc_physdev_map_pirq will > call into Xen, but in hvm_physdev_op, PHYSDEVOP_map_pirq is not allowed > because currd is PVH dom0 and PVH has no X86_EMU_USE_PIRQ flag, it will > fail at has_pirq check. > > So, I think we may need to allow PHYSDEVOP_map_pirq when currd is dom0 (at And PHYSDEVOP_unmap_pirq also? > present dom0 is PVH). IMO it would be better to implement a new set of DMOP hypercalls that handle the setup of interrupts from physical devices that are assigned to a guest. That should allow us to get rid of the awkward PHYSDEVOP + XEN_DOMCTL_{,un}bind_pt_irq hypercall interface, which currently prevents QEMU from being hypervisor version agnostic (since the domctl interface is not stable). I understand this might be too much to ask for, but something to take into account. Thanks, Roger.