/* * Early implementations of PMT on client platforms have some * differences from the server platforms (which use the Out Of Band * Management Services Module OOBMSM).
*/ return !!(ivdev->quirks & VSEC_QUIRK_EARLY_HW);
}
EXPORT_SYMBOL_NS_GPL(intel_pmt_is_early_client_hw, "INTEL_PMT");
staticinlineint
pmt_memcpy64_fromio(void *to, const u64 __iomem *from, size_t count)
{ int i, remain;
u64 *buf = to;
if (!IS_ALIGNED((unsignedlong)from, 8)) return -EFAULT;
for (i = 0; i < count/8; i++)
buf[i] = readq(&from[i]);
/* Copy any remaining bytes */
remain = count % 8; if (remain) {
u64 tmp = readq(&from[i]);
/* * Place the discovery features folder in /sys/class/intel_pmt, but * exclude the common attributes as they are not applicable.
*/ if (ivdev->cap_id == ilog2(VSEC_CAP_DISCOVERY)) return 0;
/* * The base offset should always be 8 byte aligned. * * For non-local access types the lower 3 bits of base offset * contains the index of the base address register where the * telemetry can be found.
*/
bir = GET_BIR(header->base_offset);
/* Local access and BARID only for now */ switch (header->access_type) { case ACCESS_LOCAL: if (bir) {
dev_err(dev, "Unsupported BAR index %d for access type %d\n",
bir, header->access_type); return -EINVAL;
} /* * For access_type LOCAL, the base address is as follows: * base address = end of discovery region + base offset
*/
entry->base_addr = disc_res->end + 1 + header->base_offset;
/* * Some hardware use a different calculation for the base address * when access_type == ACCESS_LOCAL. On the these systems * ACCESS_LOCAL refers to an address in the same BAR as the * header but at a fixed offset. But as the header address was * supplied to the driver, we don't know which BAR it was in. * So search for the bar whose range includes the header address.
*/ if (intel_pmt_is_early_client_hw(dev)) { int i;
entry->base_addr = 0; for (i = 0; i < 6; i++) if (disc_res->start >= pci_resource_start(pci_dev, i) &&
(disc_res->start <= pci_resource_end(pci_dev, i))) {
entry->base_addr = pci_resource_start(pci_dev, i) +
header->base_offset; break;
} if (!entry->base_addr) return -EINVAL;
}
break; case ACCESS_BARID: /* Use the provided base address if it exists */ if (ivdev->base_addr) {
entry->base_addr = ivdev->base_addr +
GET_ADDRESS(header->base_offset); break;
}
/* * If another BAR was specified then the base offset * represents the offset within that BAR. SO retrieve the * address from the parent PCI device and add offset.
*/
entry->base_addr = pci_resource_start(pci_dev, bir) +
GET_ADDRESS(header->base_offset); break; default:
dev_err(dev, "Unsupported access type %d\n",
header->access_type); return -EINVAL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.