pci-hyperv.c (00937f36b09e89c74e4a059dbb8acbf4b971d5eb) pci-hyperv.c (721612994f53ed600b39a80d912b10f51960e2e3)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) Microsoft Corporation.
4 *
5 * Author:
6 * Jake Oshins <jakeo@microsoft.com>
7 *
8 * This driver acts as a paravirtual front-end for PCI Express root buses.

--- 1212 unchanged lines hidden (view full) ---

1221 params->device_id = (hbus->hdev->dev_instance.b[5] << 24) |
1222 (hbus->hdev->dev_instance.b[4] << 16) |
1223 (hbus->hdev->dev_instance.b[7] << 8) |
1224 (hbus->hdev->dev_instance.b[6] & 0xf8) |
1225 PCI_FUNC(pdev->devfn);
1226 params->int_target.vector = cfg->vector;
1227
1228 /*
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) Microsoft Corporation.
4 *
5 * Author:
6 * Jake Oshins <jakeo@microsoft.com>
7 *
8 * This driver acts as a paravirtual front-end for PCI Express root buses.

--- 1212 unchanged lines hidden (view full) ---

1221 params->device_id = (hbus->hdev->dev_instance.b[5] << 24) |
1222 (hbus->hdev->dev_instance.b[4] << 16) |
1223 (hbus->hdev->dev_instance.b[7] << 8) |
1224 (hbus->hdev->dev_instance.b[6] & 0xf8) |
1225 PCI_FUNC(pdev->devfn);
1226 params->int_target.vector = cfg->vector;
1227
1228 /*
1229 * Honoring apic->irq_delivery_mode set to dest_Fixed by
1229 * Honoring apic->delivery_mode set to APIC_DELIVERY_MODE_FIXED by
1230 * setting the HV_DEVICE_INTERRUPT_TARGET_MULTICAST flag results in a
1231 * spurious interrupt storm. Not doing so does not seem to have a
1232 * negative effect (yet?).
1233 */
1234
1235 if (hbus->protocol_version >= PCI_PROTOCOL_VERSION_1_2) {
1236 /*
1237 * PCI_PROTOCOL_VERSION_1_2 supports the VP_SET version of the

--- 81 unchanged lines hidden (view full) ---

1319static u32 hv_compose_msi_req_v1(
1320 struct pci_create_interrupt *int_pkt, struct cpumask *affinity,
1321 u32 slot, u8 vector)
1322{
1323 int_pkt->message_type.type = PCI_CREATE_INTERRUPT_MESSAGE;
1324 int_pkt->wslot.slot = slot;
1325 int_pkt->int_desc.vector = vector;
1326 int_pkt->int_desc.vector_count = 1;
1230 * setting the HV_DEVICE_INTERRUPT_TARGET_MULTICAST flag results in a
1231 * spurious interrupt storm. Not doing so does not seem to have a
1232 * negative effect (yet?).
1233 */
1234
1235 if (hbus->protocol_version >= PCI_PROTOCOL_VERSION_1_2) {
1236 /*
1237 * PCI_PROTOCOL_VERSION_1_2 supports the VP_SET version of the

--- 81 unchanged lines hidden (view full) ---

1319static u32 hv_compose_msi_req_v1(
1320 struct pci_create_interrupt *int_pkt, struct cpumask *affinity,
1321 u32 slot, u8 vector)
1322{
1323 int_pkt->message_type.type = PCI_CREATE_INTERRUPT_MESSAGE;
1324 int_pkt->wslot.slot = slot;
1325 int_pkt->int_desc.vector = vector;
1326 int_pkt->int_desc.vector_count = 1;
1327 int_pkt->int_desc.delivery_mode = dest_Fixed;
1327 int_pkt->int_desc.delivery_mode = APIC_DELIVERY_MODE_FIXED;
1328
1329 /*
1330 * Create MSI w/ dummy vCPU set, overwritten by subsequent retarget in
1331 * hv_irq_unmask().
1332 */
1333 int_pkt->int_desc.cpu_mask = CPU_AFFINITY_ALL;
1334
1335 return sizeof(*int_pkt);

--- 4 unchanged lines hidden (view full) ---

1340 u32 slot, u8 vector)
1341{
1342 int cpu;
1343
1344 int_pkt->message_type.type = PCI_CREATE_INTERRUPT_MESSAGE2;
1345 int_pkt->wslot.slot = slot;
1346 int_pkt->int_desc.vector = vector;
1347 int_pkt->int_desc.vector_count = 1;
1328
1329 /*
1330 * Create MSI w/ dummy vCPU set, overwritten by subsequent retarget in
1331 * hv_irq_unmask().
1332 */
1333 int_pkt->int_desc.cpu_mask = CPU_AFFINITY_ALL;
1334
1335 return sizeof(*int_pkt);

--- 4 unchanged lines hidden (view full) ---

1340 u32 slot, u8 vector)
1341{
1342 int cpu;
1343
1344 int_pkt->message_type.type = PCI_CREATE_INTERRUPT_MESSAGE2;
1345 int_pkt->wslot.slot = slot;
1346 int_pkt->int_desc.vector = vector;
1347 int_pkt->int_desc.vector_count = 1;
1348 int_pkt->int_desc.delivery_mode = dest_Fixed;
1348 int_pkt->int_desc.delivery_mode = APIC_DELIVERY_MODE_FIXED;
1349
1350 /*
1351 * Create MSI w/ dummy vCPU set targeting just one vCPU, overwritten
1352 * by subsequent retarget in hv_irq_unmask().
1353 */
1354 cpu = cpumask_first_and(affinity, cpu_online_mask);
1355 int_pkt->int_desc.processor_array[0] =
1356 hv_cpu_number_to_vp_number(cpu);

--- 2142 unchanged lines hidden ---
1349
1350 /*
1351 * Create MSI w/ dummy vCPU set targeting just one vCPU, overwritten
1352 * by subsequent retarget in hv_irq_unmask().
1353 */
1354 cpu = cpumask_first_and(affinity, cpu_online_mask);
1355 int_pkt->int_desc.processor_array[0] =
1356 hv_cpu_number_to_vp_number(cpu);

--- 2142 unchanged lines hidden ---