1. 29 Sep, 2020 1 commit
    • Christian Kellner's avatar
      daemon: support running without PolicyKit · 86d2596b
      Christian Kellner authored
      Make the dependency on PolicyKit optional. In that case, don't
      allow all methods and property access and fall back on the
      standard D-Bus policies. NB: These are designed to work with
      PolicyKit so most likely are not suitable at all. This is
      designed for a special use case not intended for general use.
      
      Since PolicyKit is the normal mode of operation, this feature
      requires explicit opt-in, via the new `require-polkit` configure
      option.
      86d2596b
  2. 23 Sep, 2020 12 commits
  3. 21 Sep, 2020 1 commit
  4. 02 Sep, 2020 16 commits
    • Christian Kellner's avatar
      test/integration: whitespace fixes · 70bdb25c
      Christian Kellner authored
      Just be a bit more PEP-8 compliant.
      70bdb25c
    • Christian Kellner's avatar
      test/integration: integrated tbts unstable uuids · de3d29bb
      Christian Kellner authored
      On integrated TBT (like ICL/TGL) the UUID of the controller is not
      stable, i.e. it changes between reboots. We therefore must not be
      saving the domain.
      de3d29bb
    • Christian Kellner's avatar
      manager: only store domains if uuid is stable · ba4ce0f7
      Christian Kellner authored
      The bolt daemon uses the uuid of the host controller, i.e. the
      thunderbolt switch, to uniquely identify the domain across
      reboots. The main reason for this was the boot acl, which can
      change in the absence of the domain: in older tbt hardware, the
      controller was powered in hardware when no device was attached.
      If a user then wanted to remove a device from the controller,
      that needed to be recorded and synced back to the boot acl
      when the controller later became available again.
      
      All this relies on the fact that the uuid of the controller is
      stable, i.e. does not change across reboots. This sadly, is not
      true for integrated TBT, like e.g. on ice lake (ICL) and tiger
      lake (TGL).
      
      In the manager, the stability of the domain's uuid is now
      detected via the PCI id of the native host interface. If it is
      in fact not stable, or if the PCI id is unknown, the domain will
      not be stored. As a result, removing devices from the boot acl
      while the controller is offline, will not properly be synced
      to the controller. Since modern controllers are actually not
      powered down, but use runtime PM, i.e. they go to D3 cold state,
      this should indeed not matter much. Additionally, modern systems
      use the IOMMU to secure device access and there the firmware can
      and will indeed authorize the device during boot. Therefore the
      boot acl becomes less important, and there seems indeed to be no
      boot acl entries slots on ICL even.
      ba4ce0f7
    • Christian Kellner's avatar
      test/integration: simulate native host interface · 7af91214
      Christian Kellner authored
      Add the native host interface (NHI) udev device as a parent of the
      thunderbolt domain for both, the device mock tree and the simple
      add_host_domain function. The NHI is a PCI device, which bolt will
      use to determine certain thunderbolt functionality, i.e. if the
      uuid of the controller is stable.
      7af91214
    • Christian Kellner's avatar
      test/integration: reset attrs at the device level · 2223de57
      Christian Kellner authored
      Overwrite the disconnect method in TbDevice and reset the 'key' and
      'authorized' attributes there, instead of conditional checks in the
      base class.
      2223de57
    • Christian Kellner's avatar
      test/sysfs: new check for nhi_uuid_is_stable · e928279f
      Christian Kellner authored
      Check well known stable and unstable cases and also check the
      error case, i.e. asking for information about an unknown id.
      e928279f
    • Christian Kellner's avatar
      sysfs: add NHI PCI id to uuid stability mapping · 4fc87a24
      Christian Kellner authored
      Add a table that contains the information for which native host
      interface (NHI), identified via their PCI ids, the uuid of the
      associated host / switch device is "stable", i.e. does not change
      across reboots.
      4fc87a24
    • Christian Kellner's avatar
      domain: log domain data on domain_export · 7c3840aa
      Christian Kellner authored
      When the domain gets exported, also log the detailed domain data,
      via LOG_DOM ().
      7c3840aa
    • Christian Kellner's avatar
      manager: extract domain storing coding · 1202173e
      Christian Kellner authored
      Extract the code that stores the domain, together with the error
      checking path, into its own small helper function.
      This is mostly to prepare for conditional storing of domains, in
      the case when their uuid is not stable across reboots.
      1202173e
    • Christian Kellner's avatar
      manager: better warning if device creation fails · a425544a
      Christian Kellner authored
      In handle_udev_device_added (), if the device creation failed,
      show the sysfs path, so it is easy to identify the underlying
      udev device.
      a425544a
    • Christian Kellner's avatar
      test/sysfs: check bolt_sysfs_nhi_id_for_domain · 09cbe01e
      Christian Kellner authored
      Now that every domain has an NHI PCI device as a parent, check that
      bolt_sysfs_nhi_id_for_domain works correctly.
      09cbe01e
    • Christian Kellner's avatar
      test/mock-sysfs: create NHI devices for domains · 34ea66ab
      Christian Kellner authored
      When creating a domain, also create a corresponding native host
      interface PCIe device for it, and use that as the parent.
      This better reflects the reality, where domain udev devices are
      children of the thunderbolt PCIe device.
      The PCI id of the NHI device can be controlled at domain creation
      time via the 'nhi' argument. It defaults to '0x15d2', i.e. Alpine
      Ridge.
      34ea66ab
    • Christian Kellner's avatar
      sysfs: helper to read the NHI PCI id for a domain · 9b7b7835
      Christian Kellner authored
      Add a new helper that, given the udev device for a domain, will
      return the PCIe id for the associated native host interface (NHI).
      9b7b7835
    • Christian Kellner's avatar
      test/sysfs: fix typo in test path · c9140c38
      Christian Kellner authored
      Device has an 'e' at the end.
      c9140c38
    • Christian Kellner's avatar
      test/common: checks for bolt_str_parse_uint32 · f5024ac9
      Christian Kellner authored
      Checks all the relevant cases.
      f5024ac9
    • Christian Kellner's avatar
      common/str: add str to uint32 parser · 3b70d47a
      Christian Kellner authored
      Defers to bolt_str_parse_as_uint64, but then ensures the resulting
      value is not bigger than G_MAXUINT32.
      3b70d47a
  5. 16 Jun, 2020 1 commit
  6. 15 Jun, 2020 9 commits