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 AA41ACD3436 for ; Fri, 8 May 2026 05:52:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1303188.1576682 (Exim 4.92) (envelope-from ) id 1wLE8A-0001rs-7E; Fri, 08 May 2026 05:52:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1303188.1576682; Fri, 08 May 2026 05:52: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 1wLE8A-0001r0-0m; Fri, 08 May 2026 05:52:10 +0000 Received: by outflank-mailman (input) for mailman id 1303188; Fri, 08 May 2026 05:52:09 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wLE89-0001qP-C3 for xen-devel@lists.xenproject.org; Fri, 08 May 2026 05:52:09 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wLE88-0045ao-PF for xen-devel@lists.xenproject.org; Fri, 08 May 2026 07:52:08 +0200 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69fd79ff-5cb7-0a2a0a5109dd-0a2a450cb8f4-8 for ; Fri, 08 May 2026 07:52:08 +0200 Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69fd7a08-62f1-0a2a450c0019-d1558032d55a-3 for ; Fri, 08 May 2026 07:52:08 +0200 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-488ba840146so14027085e9.1 for ; Thu, 07 May 2026 22:52:08 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e642e2b29sm17617545e9.1.2026.05.07.22.52.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 May 2026 22:52:06 -0700 (PDT) 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" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1778219528; x=1778824328; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=QiUDegGJK2Q/CSkBpiVME5VeFHxmVrExfgV9xxQPMFo=; b=f2X0HScIYrdd8PLGp2YzkwM2HSFip5YNJXQhckY1y0HEW8LhX+xp0PJynwXLQHxUmT lhYiCkhj7/wR/SIjU15DgQNurtDNXLHrTQ6SfV0KltsaTalA/rVCgk0+dOwkFeKFp4Qg IvML79GU7ebUWfqEJBoboC2Gzov6a1VoiOcZvtXBFHvwASnz3G6kFDoT9prmBAeKCWKu Tqm4jYPYH8JW6MJAOBR9AAu0MpUw8VWK38XWXg1SuRDQiUjMao9Zso4ASDmaxdlh9rYM yafnskNfR3o+5zFpDpJbWZWXX6i20FB6YLUEBD65RGJieRZ6aaV6pygPjE8KJ36xUGEz Watg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778219528; x=1778824328; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QiUDegGJK2Q/CSkBpiVME5VeFHxmVrExfgV9xxQPMFo=; b=dnvClJQhKJFvtQ88EMcCEvyUDZubtDg0LxbIqctdqjC7c3QWJo6hHFpxLlq9YS3K8o ErYFUGU4Lu0jtq/bmE6H62szOS39Y5I8LOAxNf24sRlHAXOFBhhLXf+5sN0ZDDm430Jh vrgtXwzwVVWbWLTj3SYPi2YYqkkPc8fnNPLBPIOvL8DfDn4PT3QFX5WeOymn2YV7G1Bm TGb7bMMud4yuxp+K9/0N9v3ykQg5wfrz9nqUOBH3ITaBt7uC5qCAUHDKbJbbNFEC6QS4 007LmguRDTaJ1g9ws4VYELW5o9/ZfU/odyLZ7hBaAoYcgjB+hisoXiWKgVDrcZTcJe9j CxQA== X-Forwarded-Encrypted: i=1; AFNElJ9h9aLg9/fKm2EG+xxcVIi2Li7dpf0gsj3Vfxc2z5jHLIcCyiFztJXY9dIXzc716Rb31mhkr0penwA=@lists.xenproject.org X-Gm-Message-State: AOJu0Yy6ov1CyRQbLoOLBPL0pbc8ZdYW9Wgh0ILKQjGFe8X3Kyqnioz+ hQErIdPKyAz8zk5MrtmYqJArdxdnkI4gd42NSh9QlJlVGmuDGXiwnBmvlEbeXdiubA== X-Gm-Gg: AeBDievQnckLi9nLyu0+P+51JooERV1ZtPE9oIMFQ7bIrQC1w2vFV4cX1tue4FUxQjC xNzOBnJ30pylyz+zQNo4W1rZiODEZedCU5l7OfssguqDVZNlUlTBprIlVdBlSgpRcokl0m9Mw1p Zpsm7yDZs7L4ryQvQ4TmHhza3G7+G+J4u0ZvI+41J2AQpD5k/48izdGcGiLda89nPGPpgEln+PZ /VNowyVpDwH4fLbE4i1n1rtRaKztQH+JXYC2LIuwGtReLd4nSEsBTOZTE7eE1lZZTfekZRbafqb V76pJT0xywJbxT5ni4GjrSJCwnuIdmChbz4giaLWNV3QCSQsiTJl/k2rZvxN3sGSoqdYSChxljZ 5HcYhRqbGqgxBYNl27EUnv+GXMM5CrhCsTAPjZpYlEadOsY/ZCIu+qRDf8ho/OcBeWGwB+zORvd M/XsNhlaTAboeld7mX+qq6DcoBCs3DGkTLQ6fN/x6DoRxW95dETm5FezNRu8zc1Y+BdIC/CgtSs xr0d3lzzMOjGXA= X-Received: by 2002:a05:600c:a111:b0:488:79a3:f04c with SMTP id 5b1f17b1804b1-48e51f46d1bmr128938915e9.27.1778219528065; Thu, 07 May 2026 22:52:08 -0700 (PDT) Message-ID: <33465631-2de8-4d27-9e1a-4ea68481a070@suse.com> Date: Fri, 8 May 2026 07:52:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/7] vpci: add SR-IOV support for PVH Dom0 To: Volodymyr Babchuk Cc: Mykyta Poturai , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "Daniel P. Smith" , "xen-devel@lists.xenproject.org" , Stewart Hildebrand References: <5efddecc-3665-4a53-9eaa-b117370cc0e4@suse.com> <5168207f-33ed-4fc4-918e-6c3b454b0efa@epam.com> <878q9vt0lg.fsf@epam.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32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OxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <878q9vt0lg.fsf@epam.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-d25034/1778219528-E3B7CCF5-C0C7345E/0/0 X-purgate-type: clean X-purgate-size: 3575 On 07.05.2026 22:40, Volodymyr Babchuk wrote: > Jan Beulich writes: >> On 06.05.2026 11:39, Mykyta Poturai wrote: >>> On 5/4/26 08:37, Jan Beulich wrote: >>>> On 23.04.2026 12:12, Mykyta Poturai wrote: >>>>> On 4/21/26 17:43, Jan Beulich wrote: >>>>>> On 09.04.2026 16:01, Mykyta Poturai wrote: >>>>>>> From: Stewart Hildebrand >>>>>>> >>>>>>> This code is expected to only be used by privileged domains, >>>>>>> unprivileged domains should not get access to the SR-IOV capability. >>>>>>> >>>>>>> Implement RW handlers for PCI_SRIOV_CTRL register to dynamically >>>>>>> map/unmap VF BARS. Recalculate BAR sizes before mapping VFs to account >>>>>>> for possible changes in the system page size register. Also force VFs to >>>>>>> always use emulated reads for command register, this is needed to >>>>>>> prevent some drivers accidentally unmapping BARs. >>>>>> >>>>>> This apparently refers to the change to vpci_init_header(). Writes are >>>>>> already intercepted. How would a read lead to accidental BAR unmap? Even >>>>>> for writes I don't see how a VF driver could accidentally unmap BARs, as >>>>>> the memory decode bit there is hardwired to 0. >>>>>> >>>>>>> Discovery of VFs is >>>>>>> done by Dom0, which must register them with Xen. >>>>>> >>>>>> If we intercept control register writes, why would we still require >>>>>> Dom0 to report the VFs that appear? >>>>>> >>>>> >>>>> Sorry, I don't understand this question. You specifically requested this >>>>> to be done this way in V2. Quoting your reply from V2 below. >>>>> >>>>> > Aren't you effectively busy-waiting for these 100ms, by simply >>>>> returning "true" >>>>> > from vpci_process_pending() until the time has passed? This imo is a >>>>> no-go. You >>>>> > want to set a timer and put the vCPU to sleep, to wake it up again >>>>> when the >>>>> > timer has expired. That'll then eliminate the need for the >>>>> not-so-nice patch 4. >>>>> >>>>> > Question is whether we need to actually go this far (right away). I >>>>> expect you >>>>> > don't mean to hand PFs to DomU-s. As long as we keep them in the hardware >>>>> > domain, can't we trust it to set things up correctly, just like we >>>>> trust it in >>>>> > a number of other aspects? >>>> >>>> How's any of this related to the question I raised here, or your reply >>>> thereto? If we intercept PCI_SRIOV_CTRL, we know when VFs are created. >>>> Why still demand Dom0 to report them then? >>>> >>> >>> The spec states that VFs can take up to 100ms after the VF_ENABLE bit is >>> set to become alive. We discussed in the V2 that it is not acceptable to >>> do a required 100ms wait in Xen while blocking a domain. And not doing >>> that blocking would require some mechanism to only allow a domain to run >>> for precisely 99(or more?)ms. You yourself suggested that we can trust >>> the hardware domain with registering VFs if we already trust it with >>> other PCI-related stuff. Did you change your mind, or am I completely >>> misunderstanding this question? >> >> No, I still think that we can trust hwdom enough. Nevertheless we should >> aim at being independent of it where possible. And I seem to recall that >> I had also outlined an approach how to avoid spin-waiting for 100ms in >> the hypervisor. > > I want to clarify: you are telling that Xen should not wait for hwdom to > report VFs and instead create them by itself. Is this correct? If that's technically possible, yes. Jan