This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # SPDX-License-Identifier: GPL-2.0 | |
| # | |
| # Check whether a RISC-V KVM host kernel leaks G-stage page tables on VM | |
| # destroy. | |
| # | |
| # The test program creates VMs whose guest writes one word in every 2 MiB | |
| # of an 8 GiB guest RAM region and then shuts down via SBI SRST. Each such | |
| # VM needs one last-level G-stage page table per 2 MiB, about 16 MiB of page | |
| # tables in total. A kernel with the leak loses that memory on every VM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Find the MMVQ -> MMQ crossover per quant type for ggml_cuda_should_use_mmvq. | |
| Run from a llama.cpp checkout that has a CUDA build in ./build. Needs no model file. | |
| 1. builds a second test-backend-ops in ./wt-mmq with MMQ forced for ne11 >= 2 | |
| 2. writes MUL_MAT cases (weight shapes x quant types x ne11 = 1..8) for test-backend-ops --test-file | |
| 3. runs `test-backend-ops perf` with both builds and picks, per type, the last ne11 where MMVQ is still faster | |
| Prints the per-shape table (markdown, for the PR) and the resulting switch() entries. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pych9329 import HIDController, SerialTransport, CH9329 | |
| import time | |
| PASSWORD = "123456" | |
| def xiaomi_devmode(controller): | |
| # assume it's already in settings | |
| # press arrow down 3x to enter my device menu | |
| for i in range(3): | |
| controller.press("down") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | |
| KERNEL="${SCRIPT_DIR}/linux/arch/x86/boot/bzImage" | |
| ROOTFS="${SCRIPT_DIR}/debian-root" | |
| QMP_SOCK="${SCRIPT_DIR}/.qemu-qmp.sock" | |
| # Host topology: AMD EPYC 7V73X | |
| # 1 socket, 8 CCDs (dies), 8 cores/CCD, 2 threads/core = 128 vCPUs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| class DTSGen: | |
| def __init__(self, | |
| compatible: str = "xiangshan,nemu-board", | |
| model: str = "XiangShan", | |
| isa_extensions: list = ["i", "m", "a", "f", "d", "c"], | |
| mmu_type="riscv,sv39", | |
| timebase_freq: int = 10000000, # 10 MHz | |
| nr_harts: int = 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // C++ includes used for precompiling -*- C++ -*- | |
| // Copyright (C) 2003-2023 Free Software Foundation, Inc. | |
| // | |
| // This file is part of the GNU ISO C++ Library. This library 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 3, or (at your option) | |
| // any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| PREFIX = "2001:470:19:a65:" | |
| SUFFIX = "/64" | |
| LEN = 14 | |
| print("brctl addbr pathgen") | |
| print("ip link set pathgen up") | |
| print("ip addr add %sffff:ffff:ffff:ffff%s dev pathgen" % (PREFIX, SUFFIX)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| # Check if multiple IPv6 addresses are assigned to the usb0 interface | |
| # If so, we have deprecated addresses and need to restart the interface. | |
| if [ $(cat /proc/net/if_inet6 | grep usb0 | wc -l) -gt 2 ]; then | |
| ifdown wwan6 | |
| ifup wwan6 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| wg_filter="wg0 wg1" # EDITME | |
| current_time=$(date +%s) | |
| wg show all dump | awk '{if ($5 != "off") print $1,$6}' | while read -r each_dump; do | |
| interface=$(echo $each_dump | cut -d' ' -f1) | |
| last_handshake=$(echo $each_dump | cut -d' ' -f2) | |
| if echo $wg_filter | grep -q $interface; then | |
| if [ $((current_time - last_handshake)) -gt 240 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ip-full kmod-veth iptables-nft ip6tables-mod-nat ip6tables-nft | |
| ip6tables -t nat -A POSTROUTING -s fd05::1/64 -j MASQUERADE | |
| ip link add 5g_lan type veth peer 5g_lan_peer | |
| ip netns add 5g_lan | |
| ip link set dev 5g_lan_peer netns 5g_lan | |
| ip netns exec 5g_lan sh <<EOF | |
| sysctl -w net.ipv4.conf.all.forwarding=1 | |
| sysctl -w net.ipv6.conf.all.forwarding=1 | |
| ip link set dev lo up | |
| ip link set dev 5g_lan_peer up |
NewerOlder