pci.c (d7646f241c8efc17b4b86cc7a304472792f0cc74) pci.c (67cc32ebfd8c0ee3fcdb26780a8991baf5eb1d45)
1/*
2 * vfio based device assignment support
3 *
4 * Copyright Red Hat, Inc. 2012
5 *
6 * Authors:
7 * Alex Williamson <alex.williamson@redhat.com>
8 *

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

3372 * config reset magic is relatively common on AMD GPUs, but the setup and SMC
3373 * poking is largely ASIC specific.
3374 */
3375static bool vfio_radeon_smc_is_running(VFIOPCIDevice *vdev)
3376{
3377 uint32_t clk, pc_c;
3378
3379 /*
1/*
2 * vfio based device assignment support
3 *
4 * Copyright Red Hat, Inc. 2012
5 *
6 * Authors:
7 * Alex Williamson <alex.williamson@redhat.com>
8 *

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

3372 * config reset magic is relatively common on AMD GPUs, but the setup and SMC
3373 * poking is largely ASIC specific.
3374 */
3375static bool vfio_radeon_smc_is_running(VFIOPCIDevice *vdev)
3376{
3377 uint32_t clk, pc_c;
3378
3379 /*
3380 * Registers 200h and 204h are index and data registers for acessing
3380 * Registers 200h and 204h are index and data registers for accessing
3381 * indirect configuration registers within the device.
3382 */
3383 vfio_region_write(&vdev->bars[5].region, 0x200, 0x80000004, 4);
3384 clk = vfio_region_read(&vdev->bars[5].region, 0x204, 4);
3385 vfio_region_write(&vdev->bars[5].region, 0x200, 0x80000370, 4);
3386 pc_c = vfio_region_read(&vdev->bars[5].region, 0x204, 4);
3387
3388 return (!(clk & 1) && (0x20100 <= pc_c));

--- 408 unchanged lines hidden ---
3381 * indirect configuration registers within the device.
3382 */
3383 vfio_region_write(&vdev->bars[5].region, 0x200, 0x80000004, 4);
3384 clk = vfio_region_read(&vdev->bars[5].region, 0x204, 4);
3385 vfio_region_write(&vdev->bars[5].region, 0x200, 0x80000370, 4);
3386 pc_c = vfio_region_read(&vdev->bars[5].region, 0x204, 4);
3387
3388 return (!(clk & 1) && (0x20100 <= pc_c));

--- 408 unchanged lines hidden ---