Thursday, 2022-04-28

*** tpb <[email protected]> has joined #openrisc00:00
*** zx2c4 <zx2c4!sid204921@gentoo/developer/zx2c4> has joined #openrisc00:00
zx2c4shorne: hey!00:00
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)00:15
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc00:19
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)04:16
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc04:23
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)06:28
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc06:31
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)06:49
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc07:02
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)08:05
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc11:08
shornezx2c4: hello12:06
zx2c4shorne: howdy!12:06
zx2c4as you can see, i've been quite busy with openrisc stuff :)12:07
zx2c4nearly managed to get the wireguard test suite CI ported to it, so that it runs on every commit on build.wireguard.com12:07
shornenice12:07
shornezx2c4: yeah, it seems you have been busy12:07
shorneAre you mainly doing this on openrisc? or all platforms?12:08
zx2c4btw, in light of my reply to https://lore.kernel.org/lkml/[email protected]/ do you think you can Ack that?12:08
tpbTitle: [PATCH v6 11/17] openrisc: use fallback for random_get_entropy() instead of zero - Jason A. Donenfeld (at lore.kernel.org)12:08
zx2c4well the other platforms were easy... OpenRISC is the one that's required work12:08
shorneI am doing another reply12:08
shornemaybe we can discuss here12:08
zx2c4shorne: ahh and it's not a simple Ack?12:08
zx2c4we can just discuss it here, yea12:08
zx2c4you still object?12:08
shornethe main thing I was thinking is that patch 6 just sets: 12:08
shorne#define random_get_entropy()   ((unsigned long)get_cycles())12:08
zx2c4yes. this is intentional12:08
zx2c4the fallback code should _not_ have that branch12:09
shornebut it seems all architectures are defining random_get_entropy now12:09
shorneare there any that are not?12:09
zx2c4no, many are not12:09
zx2c4yes12:09
zx2c4the bulk of that patchset is me getting rid of `#define get_cycles() (0)` from various archs12:10
zx2c4so that it can hit the fallback code12:10
shorneyes so they will hit:12:10
shorne#define random_get_entropy()   random_get_entropy_fallback()12:10
zx2c4yes.12:11
shornewhich architectures no longer define random_get_entropy, but do define get_cycles?12:11
zx2c4ia64, parisc, sparc64, alpha, arm64, s390, powerpc...12:12
zx2c4look, you're coming to this a bit late at this point. the scheme in the patchset is coherent and minimized given the set of platforms12:13
zx2c4i played with every iteration of which is the fallback and which isnt12:13
shorneok, it's making sense12:16
zx2c4Explicit random_get_entropy(): x86, m68k, arm, nios2, openrisc, riscv12:16
zx2c4Always-functional get_cycles(): ia64, parisc, sparc64, alpha, arm64, s390, powerpc12:16
zx2c4No random_get_entropy() or get_cycles(): sparc32, arc, csky, h3800, hexagon, microblaze, sh, um, xtensa12:16
shorneone more question, you mention openrisc you want to use the get_cycles/fallback_random_get_entropy because qemu returns 0?12:17
zx2c4Yup!12:17
shornebut I see in qemu we do:12:17
shorner1k_timer->ttcr += (uint32_t)((now - or1k_timer->last_clk) ...12:17
shorneso I would think get_cycles would not be returning 012:18
zx2c4let me check12:18
shornebut I guess you can confirmed this12:18
zx2c4double checking...12:19
zx2c4yea, it returns 012:19
zx2c4everytime12:20
zx2c4so the qemu "silicon" is broken12:20
zx2c4hence the need for the branch12:20
shorneok, let me double check this and get back, when would you merge this, the merge window is not open now so I would think you have some time?12:21
zx2c4shorne: no, i dont have time actually. this is already on v6 and i have other things blocking this12:21
zx2c4so i'd like to get the acks squared away this week12:21
zx2c4only 4 weeks left til the window opens12:21
shorneunderstand, I just want to understand what is going wrong or right here, give me a few hours12:22
zx2c4well, regardless of what the root cause winds up being, fact is that qemu as it's deployed is buggy, and hence we need that branch in the kernel side of things12:22
zx2c4i'm wrong!12:24
zx2c4shorne: qemu works as expected. issue is that the counter starts out as 012:25
zx2c4at early boot12:25
zx2c4which trips a bunch of warnings12:25
zx2c4since as a cycle counter, that's kinda bad12:25
zx2c4so in that cas,e i have a different patch for openrisc...12:25
zx2c4#define random_get_entropy() ((unsigned long)get_cycles() + 1)12:26
zx2c4how about that?12:26
shorneit seems ok, we could also just add +1 inside of get_cycles12:28
zx2c4shorne: do you have a preference?12:28
zx2c4im rewriting the commit message now12:29
zx2c4i can do +1 to get_cycles() or add that extra definition12:29
zx2c4tell me what you'd prefer12:29
shorneNot really, please do as per your suggested patch, and just mention in the commit message that starting out at zero causes errors12:29
zx2c4alright, ill do the extra definition12:29
shorneqemu starts at 0 an increments as per the qemu tick timer, I guess thats too slow to update during kernel boot12:30
zx2c4right12:30
shorneThanks perhaps, in the future I can add entropy in to the initialization of ttcr in qemu12:31
shorneThanks for taking time to help clarify my questions, I know I am late, I was busy with something too12:31
shornejust ping me and Ill understand when its urgent12:32
zx2c4shorne: huh interestingly it looks like the TTCR counter doesn't start until kinda late12:34
zx2c4takes a second to initialize or osmething12:34
zx2c4and then it starts tickig normally12:34
zx2c4not sure why12:34
zx2c4anyway, ill send this for v7 https://git.zx2c4.com/linux-rng/commit/?id=9b04e032c856ab52f56e154aba4964984d65e2a412:35
tpbTitle: linux-rng - Development tree for the kernel CSPRNG (at git.zx2c4.com)12:35
zx2c4or like it requires a trip through the scheduler?12:36
zx2c4not sure12:36
zx2c4anyway, the +1 thing works, so ill roll with that12:36
shorneok, the commit message looks good12:37
zx2c4shorne: if you want to ack it now on IRC, ill just amend it there. otherwise you can do it on the mailing list when i post v712:37
shorneWait, do you still need to #define get_cycles get_cyles?12:38
zx2c4no it's not necessarily but i'm defining it uniformly for all archs12:39
shorneok12:39
zx2c4As it stands, right now the logic won't test `#ifdef get_cycles` if random_get_entropy() is defined. But that's a detail. I'd rather have all of them defined if thta later changes12:39
zx2c4So other things... what'd ya think of that FDT-fixing patch?12:39
shorneAcked-by: Stafford Horne <[email protected]>12:39
shorneI think I already replied to the FDT fix patch, it looks good to me12:39
zx2c4oh, missed it sorry12:40
zx2c4patching my local qemu for the FDT thing, the only issue left is the reboot thing12:40
zx2c4seeing if i can hack sed to notice the "reboot: Machine rebooting..." thing on stdout of qemu and kill the process...12:40
shorneuse 'expect'12:41
shorne?12:41
shorneI have to step away12:41
zx2c4yea might use expect12:42
zx2c4okay ttyl!12:42
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)13:30
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc14:17
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)14:55
zx2c4shorne: alright... https://w-g.pw/l/yHIh16:17
tpbTitle: wireguard-linux - WireGuard for the Linux kernel (at w-g.pw)16:17
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc18:00
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)18:25
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc18:52
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)19:03
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc19:06
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)19:42
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc20:34
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)20:53
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc20:54
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)21:05
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc21:21
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)21:28
shornezx2c4: cool21:35
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc21:38
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)22:03
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc22:03
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)22:29
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc22:33
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 240 seconds)23:21
zx2c4shorne: i suspect the clock might really be cursed23:38
zx2c4first I noticed that TTCR was returning 0 until something happened and then all of the sudden it started working23:39
zx2c4so okay whatever that sucks but the +1 trick fixes things, done deal we can look at it later23:39
zx2c4But nowwwww im back to trying to get things working in wireguard and23:39
zx2c4it looks like the system's internal clock is really megafast23:39
zx2c4and i wonder if it's related23:40
zx2c4tests are timing out way faster than they should etc23:40
zx2c4maybe this is because im running at CONFIG_HZ_250? ill try CONFIG_HZ_100=y23:42
zx2c4also qemu sometimes does arithmetic wrong23:43
zx2c4[    1.590000] curve25519 self-test 47: FAIL23:43
zx2c4[    2.210000] curve25519 self-test 68: FAIL23:43
zx2c4i get this sometimes but not always23:43
zx2c4maybe i should disable this dcache writethrough thing23:59

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!