Skip to content

Instantly share code, notes, and snippets.

@Keno
Keno / README.md
Last active November 29, 2023 18:51
Mac TESmart KVM display issues lab notes
View README.md

I am debugging an issue attempting to manage multiple macs through a TESmart KVM switch and a PiKVM. Everything works beautifully if the PiKVM is hooked up directly to the mac. Unfortunately, with the TESmart switch in the middle, the mac display goes dark after 30s or so. AllRez (https://github.com/joevt/AllRez) output from both the direct attach and with the temsart in the middle are attached.

Of particular note (to me at least) is that the HDCP status differs. Without the TESmart switch in the middle, HDCP is disabled:

    68028h AUX_HDCP_BCAPS: BCAPS_HDCP_CAPABLE, BCAPS_REPEATER_PRESENT
 68029h AUX_HDCP_BSTATUS: BSTATUS_LINK_FAILURE
View bad.jl
### A Pluto.jl notebook ###
# v0.19.25
using Markdown
using InteractiveUtils
# ╔═╡ 3f8b71ed-d04c-4ce1-8c5d-663329993d6d
Main.foo
# ╔═╡ Cell order:
View abstractlattice.jl
abstract type AbstractLattice; end
function widen; end
"""
struct JLTypeLattice
A singleton type representing the lattice of Julia types, without any inference
extensions.
"""
View gist:95d5faba39523d1cd57ae57f249394da
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <pthread.h>
#include <errno.h>
#include <sys/mman.h>
View index.html
<!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width"><meta charset="utf-8">
<meta name="pluto-insertion-spot-meta">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#2a2928"><meta name="color-scheme" content="light dark"><link rel="icon" type="image/png" sizes="16x16" href="https://cdn.jsdelivr.net/gh/fonsp/Pluto.jl@0.19.9/frontend-dist/favicon-16x16.347d2855.png" integrity="sha384-3qsGeVLdddzV9oIkj3PhXXQX2CZCjOD/CiyrPQOX6InOWw3HAHClrsQhPfX9uRAj" crossorigin="anonymous"><link rel="icon" type="image/png" sizes="32x32" href="https://cdn.jsdelivr.net/gh/fonsp/Pluto.jl@0.19.9/frontend-dist/favicon-32x32.8789add4.png" integrity="sha384-cOe5vSoBIgKNgkUL27p9RpsGVY0uBg9PejLccDy+fR8ZD1Iv5dF1MGHjIZAIZwm6" crossorigin="anonymous"><link rel="icon" type="image/png" sizes="96x96" href="https://cdn.jsdelivr.net/gh/fonsp/Pluto.jl@0.19.9/frontend-dist/favicon-96x96.48689391.png" integrity="sh
View amd_cpuid.patch
commit ec046ffc2b8b9ed6916e402ee580e18da6673709
Author: Keno Fischer <keno@juliacomputing.com>
Date: Sun Jul 3 01:53:53 2022 +0000
WIP: AMD CPUID override
Since e9ea1e7, we've had the ability to turn a userspace `cpuid`
instruction into a SIGSEGV using the ARCH_(GET|SET)_CPUID arch_prctl.
However, this capability is limited to supported hardware, which
currently means Intel CPUs. AMD CPUs do not have a documented facility
@Keno
Keno / IntercatsTalk.pdf
Last active September 7, 2022 11:33
Intercats Talk
View IntercatsTalk.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:eb3a40a9e63ba33c7d49b82a519c04f7
/* -*- Mode: C; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
#include "util.h"
pid_t main_thread_tid = 0;
int fds[2];
char zeros[8192];
void sigproc_and_hang(void)
{
View gist:fc4b00960d3954649a42fd1b40f746bc
This file has been truncated, but you can view the full file.
------------------------------------------
7) rr:juli-21726 => rr-21725
------------------------------------------
7) | switch_mm_irqs_off() {
7) 1.624 us | load_new_mm_cr3();
7) 8.897 us | }
------------------------------------------
7) rr-21725 => rr:juli-21726
------------------------------------------
@Keno
Keno / bad.ll
Created March 30, 2022 02:36
bad loop vectorize
View bad.ll
define internal {} addrspace(10)* @japi1_vect_42283({} addrspace(10)** %0, i32 %1) #0 {
top:
%2 = sext i32 %1 to i64
%3 = load atomic {} addrspace(10)* ({} addrspace(10)*, i64)*, {} addrspace(10)* ({} addrspace(10)*, i64)** bitcast (void ()** @jlplt_ijl_alloc_array_1d_10294_got to {} addrspace(10)* ({} addrspace(10)*, i64)**) unordered, align 8
%4 = call {} addrspace(10)* %3({} addrspace(10)* null, i64 0)
%5 = bitcast {} addrspace(10)** %0 to { {} addrspace(10)*, i64 } addrspace(10)**
%6 = load { {} addrspace(10)*, i64 } addrspace(10)*, { {} addrspace(10)*, i64 } addrspace(10)** %5, align 8, !tbaa !0
%7 = bitcast {} addrspace(10)* %4 to { {} addrspace(10)*, i64 } addrspace(13)* addrspace(10)*
%8 = addrspacecast { {} addrspace(10)*, i64 } addrspace(13)* addrspace(10)* %7 to { {} addrspace(10)*, i64 } addrspace(13)* addrspace(11)*
%9 = load { {} addrspace(10)*, i64 } addrspace(13)*, { {} addrspace(10)*, i64 } addrspace(13)* addrspace(11)* %8, align 8, !tbaa !5