[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/9] x86/PVH: permit more physdevop-s to be used by Dom0

  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 24 Sep 2021 14:18:34 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nU9oC7z5BXKFkeO02V59+X3J20q93nT+VQB78TQv6mg=; b=OHS8bvKC8HYIRUbaidkdtcY0fX3OoBfsB6dpI9Yjy0p6exg6D2RbJoTA9FSOQ43ccaR+kC2VjHyJOIfs0JckvoLVQxmT6jnwI3Jw8lAmEC9CbBqCY/Cd5orARTTkuUW2nahRXJpoS+zcOtnLwc8pDzrBnDVuh5GJ97hPkJSHwxGK2SXRlmN8a7GOz2nzZQLk6JK4TncqUVY/9/l+O24yBTgb9vxxbPZvqJSa49EOEQDxCUuYTcezbbmgVz97r+61OfpcKR+uqzyxNgUeN7/9Xtw4+3i+lWEdHkPgxVz/qrfsRSs5Xh0k1K6EbH846lA9UaWzjtPFhWcQlb7uz4dGMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WJ4KGtpoVPVH1m7pem8BsA0O7iEkwqwdarLRBwPpJ3jq6kcK7GAZM9tV30saBe8lRymZD/8jAvYhUmwESvcNN2IlRWvHu2QDZlPpuJAf3VwxSN/YPmKwDVfDQ++Fb4gMgwHdFJvZ+/4P7oTFsayUJpKH51ahI5/EGa2PHzx1AnIabvOpjdB15pMkxUn7o++bKjSui0MqH7yxgvw4oBezMyRElIYq7T+boIv/Peo7W0wDaK0Yidgm0pyWo23U3eFB1vP3zgOQaWM0YaCk69c61ndWyy/hZYy1uPhVyZ0031/Q3fokEbP17fMwSCnmCS+YmaIztOTbdQOFvh1f+V33/A==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 24 Sep 2021 12:18:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.09.2021 16:22, Roger Pau Monné wrote:
> On Tue, Sep 21, 2021 at 09:17:37AM +0200, Jan Beulich wrote:
>> Certain notifications of Dom0 to Xen are independent of the mode Dom0 is
>> running in. Permit further PCI related ones (only their modern forms).
>> Also include the USB2 debug port operation at this occasion.
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> I'm uncertain about the has_vpci() part of the check: I would think
>> is_hardware_domain() is both sufficient and concise. Without vPCI a PVH
>> Dom0 won't see any PCI devices in the first place (and hence would
>> effectively be non-functioning). Dropping this would in particular make
>> PHYSDEVOP_dbgp_op better fit in the mix.
>> ---
>> v3: New.
>> --- a/xen/arch/x86/hvm/hypercall.c
>> +++ b/xen/arch/x86/hvm/hypercall.c
>> @@ -94,6 +94,12 @@ static long hvm_physdev_op(int cmd, XEN_
>>          break;
>>      case PHYSDEVOP_pci_mmcfg_reserved:
>> +    case PHYSDEVOP_pci_device_add:
>> +    case PHYSDEVOP_pci_device_remove:
>> +    case PHYSDEVOP_restore_msi_ext:
> Hm, I'm slightly unsure we need the restore operation. Wouldn't it be
> better to just reset all device state on suspend and then let dom0
> restore it's state as it does on native?

Hmm - Linux (even after my patch separating XEN_DOM0 from XEN_PV)
only issues this call when running in PV mode, so from that
perspective leaving it out would be okay. (Otherwise, i.e. if we
decide to permit its use, I guess we would better also permit
PHYSDEVOP_restore_msi. Somehow I had managed to not spot that.)
However, ...

> Maybe there's some wrinkle that prevents that from working properly.

... Xen might be using MSI for the serial console, and I'm not sure
this interrupt would get properly re-setup.

>> +    case PHYSDEVOP_dbgp_op:
>> +    case PHYSDEVOP_prepare_msix:
>> +    case PHYSDEVOP_release_msix:
> Albeit I think those two operations won't strictly conflict with vPCI
> usage (as they require no MSIX entries to be activ) I still wonder
> whether we will end up needing them on a PVH dom0. They are used by
> pciback and it's not yet clear how we will end up using pciback on a
> PVH dom0, hence I would prefer if we could leave them out until
> strictly required.

Even without a clear plan towards pciback, do you have any idea how
their function could sensibly be replaced in the PVH case? If there
is at least a rough idea, I'd be fine leaving them out here.




Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.