Skip to content

Instantly share code, notes, and snippets.

Working from home

Geoffrey McRae gnif

Working from home
Block or report user

Report or block gnif

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gnif /
Last active Oct 6, 2019
Some bash helper functions for launching QEMU guests directly
allocateRAM $NODE $RAM
takeDevByName "\[AMD/ATI\] Navi 10 (rev c1)" 1
gnif /
Created Apr 26, 2019
Direct spool HPGL to a Roland DXY-1100 (Likely works with other models too)
# - HPGL Spooler for Serial attached Roland DXY-1100
# Copyright (C) 2019 Geoffrey McRae <>
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
gnif / vega-10-reset.c
Last active Jul 28, 2019
Experimental NON FUNCTIONAL vega 10 reset
View vega-10-reset.c
static int reset_amdgpu_vega(struct pci_dev *dev, int probe) {
#define MP0_BASE 0x16000
#define mmMP0_SMN_C2PMSG_33 ((MP0_BASE + 0x0061) * 4)
#define mmMP0_SMN_C2PMSG_64 ((MP0_BASE + 0x0080) * 4)
#define mmMP0_SMN_C2PMSG_81 ((MP0_BASE + 0x0091) * 4)
resource_size_t rmmio_base, rmmio_size;
void __iomem *rmmio;
int ret;
gnif /
Created Nov 3, 2018
[BASH] Convert bytes to human readable
function bytesToHR()
local SIZE=$1
local UNITS="B KiB MiB GiB TiB PiB"
for F in $UNITS; do
local UNIT=$F
test ${SIZE%.*} -lt 1024 && break;
SIZE=$(echo "$SIZE / 1024" | bc -l)
gnif / qemu-pcie-nasty.patch
Created Oct 7, 2018
Nasty/hacky QEMU patch to enable PCIe x 16 Gen 3.0 for Qemu VFIO
View qemu-pcie-nasty.patch
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 6c91bd44a0..f3c7b9d328 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -39,6 +39,166 @@
#define PCIE_DEV_PRINTF(dev, fmt, ...) \
PCIE_DPRINTF("%s:%x "fmt, (dev)->name, (dev)->devfn, ## __VA_ARGS__)
+static uint16_t pcie_link_max_width(PCIDevice *dev)
You can’t perform that action at this time.