HNHacker News
TopNewBestAskShowJobs

christina_b

590 karma · joined June 9, 2012

submissionscomments
christina_b··on Why has Plan 9 chosen statically linked binaries instead of dynamic ones? (2004)
Regular LTO for large sized projects (think Chromium sized), in my experience is by far the biggest bottleneck in the build process. It's partially the reason so much is being invested into development and improving parallel linking as well as techniques like ThinLTO that all aim at reducing the link times since often, LTO linking takes around 60-70% of all build time combined despite the heavy use of C++ code (although with no exceptions or RTTI).

Unless you have build servers capable of rebuilding all Qt, WebKit etc. and performing an LTO link (which pulls in all build artifacts in form of bitcode archives/objects) in a reasonable amount of time (big reason buildlabs exist - it takes a long time), LTO is not likely to be suitable, it's an extremely expensive optimization that essentially defers all real compilation until the link step at which the linker calls back into libLLVM/libLTO and have them do all the heavy lifting.

At the very least you need a workstation grade machine to be able to do that kind of stuff on regular basis, you really can't expect everyone to have that. And there's a reason libLLVM.so is usually dynamically linked, it cuts a massive amount of time spent on builds, which is especially useful while developing and it's a middle ground between building all LLVM and Clang libraries as shared objects and having to wait for static linking of various LLVM modules into every LLVM toolchain binary (which tends to result in the toolchain being much much bigger). The build cache with shared libLLVM.so for Clang/LLVM/LLD builds is around 6-7GB (Asserts/Test builds). Statically linking LLVM modules blows that up to 20GB. God forbid you actually do a full debug build with full debug information with that.

That's a terrible argument against dynamic linking. That's not to say static linking is bad, in fact, recently it's been making a comeback for exactly that reason - LTO and next-generation optimizers. But saying LTO makes static linking viable for everyone including consumers is somewhat far fetched.

christina_b··on Researcher Who Stopped WannaCry Ransomware Detained in US After Def Con
I was pretty sure TouchMe was BetaMonkey's new nick, I don't think it was Ntoskrnl (MalwareTech). From what I've heard TouchMe continued support of his drone's users until he dissapeared without a trace. This was so long ago and my memory isn't amazing.
christina_b··on Researcher Who Stopped WannaCry Ransomware Detained in US After Def Con
BetaMonkey/TouchMe was in fact the person I was referring to who was providing support for his botnet drone builder until he dissapeared with no trace at a later date. Just could not recall the nick at the time of making my original post.
christina_b··on Researcher Who Stopped WannaCry Ransomware Detained in US After Def Con
I may be totally off base here but IIRC, before he ran MalwareTech and was a whitehat, he participated (and was an op) in fairly "shady" IRC channels, with his oldest nick I can recall being `Ntoskrnl`, dedicated to malware and malware development which even had a person (Edit3: As pointed out in this thread, that person was `BetaMonkey/TouchMe`) who was selling a variant of a botnet drone client builder. Edit2: From one of the comments below in this thread, the network on which he was present (and was an IRC operator of) was `irc.voidptr.cz` or a variation of that, I could not recall the name of the network at first but when someone mentioned it, I instantly recognized it.

If he's who I think he is, I doubt his early background is that clean, despite him being a whitehat now. It is very much possible he is being held because of something related to that and not because of anything related to WannaCry. This was all before he even started running the MalwareTech blog, it's very much possible the FBI decided to look into his background or were already familiar with it prior to him arriving in or leaving the US.

That being said, it's possible that I'm mistaking him for someone else in which case I do apologize. I edited the post a bit, to clarify, the first paragraph to the best of my knowledge is certainly true, second one is based on my own speculation so take it with a grain of salt.

christina_b··on Blobless Linux on Raspberry Pi
Hm, I may have been wrong, would be nice to have someone who owns one of these boards to verify that:

1). The first stage bootloader doesn't require signing.

2). The first stage bootloader starts in EL3 mode (ie. BootROM doesn't exit it like it did on some OMAP dev boards)

christina_b··on Blobless Linux on Raspberry Pi
All modern ARM chips support secure mode, it's a set of modes, in AArch64, we colloquially call them EL3 (Exception level 3, highest privilege level above EL2, the hypervisor level).

Most ARM cores start in secure supervisor mode, which can transition to secure monitor mode at will (secure monitor being a special version of secure supervisor). Most bootloaders including Allwinner's will exit secure mode by setting the NS bit in SCR and therefore enter user provided code in non-secure supervisor (or hypervisor mode) which would be called EL1 (or EL2 for hypervisor) on AArch64.

EL3 has nothing to do with ROM or Allwinner or anything else, it's an execution mode defined by ARM themselves, the core is reset in that mode.

(Secure mode is also known as TrustZone, if that term seems more familiar though TrustZone is usually "the whole package" including support from the CPU and the corresponding peripherals)

christina_b··on Blobless Linux on Raspberry Pi
See my other comment about Allwinner, but basically my biggest issue is that they lock down their bootloader with signing and do not allow you to execute code in EL3/Secure mode without exploits.
christina_b··on Blobless Linux on Raspberry Pi
If a "development" board does not let me run my own code in EL3 (Secure monitor mode), I'm not buying it, as simple as that. A lot of boards that use Allwinner chips will use a signed bootloader that exits secure mode before passing control to your code.

My favourite is probably NVIDIA Jetson TX1 where development boards do not have a key fused in them and have documented TrustZone peripherals, so you're free to run your own secure monitor.

Sadly while ARM on rPi does start in secure mode, it lacks any secure peripherals (AxPROT[1] is forced to high so even if ARM is in secure mode, it cannot make secure bus transactions) but it's mostly a matter of principle of being able to have ARM code run in EL3 for me.

The entire point of a development board is to be able to mess around with it, I'm not wasting my time on boards with locked down features.

christina_b··on Blobless Linux on Raspberry Pi
>All of these could probably have been fixed with minimal support from broadcom (and a bit more open thinking from them during the design).

Support from Broadcom is unlikely to fix it, the BCM283x family of SoCs are just a huge mess and in my opinion are either suited for really specific applications (TV boxes) or as "toys".

The ARM core itself is integrated very poorly almost as an afterthought, since it wasn't in the original design, the BCM283x family is just BCM27xx family VideoCore4 VPU+QPU combinations with an ARM core hacked (and I really do mean hacked) on top.

christina_b··on Blobless Linux on Raspberry Pi
>drivers handling graphics

Actually that's open and mainlined now, there are DRM drivers for BCM285x family but they rely on mailbox interfaces for power and clock management.

christina_b··on Blobless Linux on Raspberry Pi
Currently it sleeps and waits for a mailbox interrupt after which it acks it and goes back to sleep. We're planning on using the interface to load a second stage firmware that would emulate the closed source firmware's power/clock management interfaces (but not framebuffer/PV/HVS/HDMI related stuff since there are Linux drivers for that now).
christina_b··on Blobless Linux on Raspberry Pi
>No, Broadcom is quite unique in requiring blobs to boot.

Yes precisely, so we offer an alternative to those blobs that allows you to boot ARM without needing a closed-source firmware.

christina_b··on Blobless Linux on Raspberry Pi
We have considered it, however, because there's still a need for a firmware, the first stage bootloader and the firmware itself are using a common driver framework, it just makes things easier. Besides, the firmware will later run an RTOS (for example LittleKernel) and Uboot doesn't provide RTOS-like services.
christina_b··on Blobless Linux on Raspberry Pi
binutils/GCC, have Julian to thank for his wonderful toolchain: https://github.com/puppeh/vc4-toolchain
christina_b··on Blobless Linux on Raspberry Pi
>unlocking the unique video core to get anywhere near there

We actually have documented most vector instructions of VC4 and Julian's toolchain supports pretty much all documented ones, so the toolchain we have is pretty close to what Broadcom would have with their MetaWare compiler for VC4.

>The RPI3 is rated for 24GFLOPS

You mean the VPU, we also have QPU and ARM on the side.

>so many really weird abnormal subsystems

True that, lack of TZPCs, ARM AxPROT[1] being forced to high causing all ARM accesses to be insecure on AXI even in secure monitor mode (sadness), lack of a GIC. I could go on and on about what's wrong with BCM283x family but hey at least it's interesting.

>But I am sincerely impressed and it has been amazing work slowly wrangling this abomination into order.

Thank you ^^

christina_b··on Minimal Raspberry Pi VPU firmware
Oh, which aspects?
christina_b··on Open source VPU side bootloader for Raspberry Pi
Actually, the bulk SDRAM/ARM work was done by me in the space of around month (though I only ARM to finally work three days ago with Herman's help).

You could run Linux on ARM using this but you would need to write some more drivers, otherwise you'd be limited to pretty much GPIO/serial/SDHOST PIO.

SDHOST is actually a fairly trivial interface to implement, I'm going to use it in my chainloader but I haven't had the time to look at it yet.

christina_b··on Open source VPU side bootloader for Raspberry Pi
Yes if you can implement high performance video codecs using pretty much undocumented vector instructions of the VPU, you are welcome to do so.
christina_b··on Open source VPU side bootloader for Raspberry Pi
It wasn't a leak, Broadcom publicly released all this code a while ago to aid the making of an open source GPU driver. All this has been licensed under 3-Clause BSD license and distributed by Broadcom themselves. There's no point in making a copy since you can just download these files from Broadcom themselves.

This won't help you with codecs, codecs are mostly code in the firmware that uses vector instructions of the VPU to accelerate the video decoding. If you want to use the codecs I would recommend paying for them instead of engaging in piracy.

christina_b··on LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
Yeah, I saw, I haven't looked at it in detail but I think yours probably works better than mine since you did comprehensive testing. My only tests involved compiling my own firmware code, but from what I can tell, it works well, I haven't ran into any bugs yet aside from what I outlined in the README.

The assembler/linker I'm using is not ideal, I want to get MC code emission working eventually. I saw that you mentioned limitations on ld/st, why not use lea for data?

For example:

  BB1_12:                                 # %sdram_clkman_update_end.exit2
	mov r0, 2114982312 # long
	ld r2, (r0)
	lea r0, .str8(pc) # PCrel load
	lea r1, __FUNCTION__.sdram_init_late(pc) # PCrel load
	bl xprintf
christina_b··on LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
I outlined what I did in another comment, here's a log from my current firmware: http://crna.cc/vpu_bootlog.txt

I think I'm on the right track but I don't have ARM working yet, most likely due to clock misconfiguration. Can probably fix it when I have more time.

Sidenote, I wish #raspberrypi-internals was more active :(

christina_b··on LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
VC4 itself doesn't have a MMU per se, it supports very limited memory remap (like PPC BATs) so running a conventional kernel on it is probably not possible. Best bet would be to port an RTOS to it, but my current plan for my firmware pretty much involves halting the VPU once the ARM is running.
christina_b··on LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
Don't think I can without first implementing MC emission and running LLVM unit tests on it.
christina_b··on LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
Yeah I looked at it, my firmware mostly just aims at bringing up enough stuff to be able to boot ARM, which is essentially just:

  - Setting up exception vectors and enabling exceptions
  - Reclocking VPU from PLLC
  - UART initialization
  - SDRAM initialization
  - Copying an ARM blinker stub to 0x0
  - ARM power domain initialization
  - PLLB initialization
  - Enabling passthrough mapping for ARM
  - ARM AXI interface initilaization
I'm still trying to figure out what I'm missing in order to get it to work but I suspect it's related to not properly setting up the ARM PLL. I was going to port the RPi clock management driver from Linux but I don't have the time at the moment.

As far as the compiler goes, I think it works reasonably well, though I only tested it by compiling my own code with it, there may be things that cause it to error out (anything that involves the frame pointer like VLAs/some C++ features). Also code quality is not ideal since it still doesn't make use of conditional instructions (aside from conditional branches) and doesn't implement AnalyzeBranch to eliminate redundant branches.

I started cleaning up TableGen to turn multi-instruction asm prints into glue DAG in SelDAGtoDAG but I still have to do it for like 4 instructions, which is pretty much a requirement to have MC code emission.

christina_b··on LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
This isn't the same, the document in question relates to the QPU ISA. The VPU ISA hasn't been officially documented but there were many projects that involved reverse engineering it. The VC4 ISA is documented here:

https://github.com/hermanhermitage/videocoreiv

The VPU is basically a general purpose RISC processor with some fancy vector instructions on top. In fact, most of the firmware that runs on it is written in C.

christina_b··on LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
To elaborate, I made this to develop an open source VPU side bootloader for Raspberry Pi because I was unhappy with the state of other C compilers targeting VC4 (I explained why in my blog). I haven't had the time to work on my firmware recently due to IRL events so I decided to publish the compiler.

Not publishing any of the firmware work yet since it can't boot ARM yet (but SDRAM init reliably works across all boards). Once I get ARM working to some extent, I'll probably clean the code up and publish it too.

christina_b··on Was jquery.com compromised?
Strange, it doesn't happen for me.
christina_b··on Cider Project: Run iOS apps on Android
There were a couple of attempts at similar stuff before, I was working on a similar thing (called Magenta) but I kind of lost motivation a long time ago.
christina_b··on AMI-Bios Sourcecode and UEFI Signing Key leaked?
Now it has a password. Oh dear, I'm depressed I've missed out on this. The FTP server appeared to have quite a few interesting things on it (for example, a folder called "Samsung ARM").
christina_b··on I’m writing my own OS
Good lord ...
Page 1 of 2Next →