Skip to content

Instantly share code, notes, and snippets.

@neuthral
Created November 11, 2018 14:08
Show Gist options
  • Save neuthral/4543d3402c8ed4aab07a47666e5c25d7 to your computer and use it in GitHub Desktop.
Save neuthral/4543d3402c8ed4aab07a47666e5c25d7 to your computer and use it in GitHub Desktop.
intx_check #processor #cpu
#!/bin/sh
# Usage $0 <PCI device>, ex: 9:00.0
INTX=$(( 0x400 ))
ORIG=$(( 0x$(setpci -s $1 4.w) ))
if [ $(( $INTX & $ORIG )) -ne 0 ]; then
echo "INTx disable supported and enabled on $1"
exit 0
fi
NEW=$(printf %04x $(( $INTX | $ORIG )))
setpci -s $1 4.w=$NEW
NEW=$(( 0x$(setpci -s $1 4.w) ))
if [ $(( $INTX & $NEW )) -ne 0 ]; then
echo "INTx disable support available on $1"
else
echo "INTx disable support NOT available on $1"
fi
NEW=$(printf %04x $ORIG)
setpci -s $1 4.w=$NEW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment