Though I will say I got a chuckle out of the ojisan who threw a perfect Microwaveでwarmしますか? at me once :-)
11,384 karma · joined December 5, 2017
Though I will say I got a chuckle out of the ojisan who threw a perfect Microwaveでwarmしますか? at me once :-)
Most of the kernel bugs around this are state/race issues. Device disappears in the middle of kernel code that doesn't have proper error recovery, boom. That's a kernel bug that applies in normal circumstances too, not just under an adversarial device model, because USB is designed to be hotpluggable at any time. Doesn't matter if the device disappeared because it crashed or because the user yanked the cable; it's just easier to reproduce with a crashy device. And the error recovery logic is notoriously hard to get right, which is why I'm not surprised the kernel is still buggy after all these years.
I wouldn't, because I've found and fixed bugs in the kernel's xHCI implementation, and I still regularly panic or oops my kernel with dodgy USB devices, which is by definition a kernel bug (and a security one at that). USB is an overcomplicated standard and extremely difficult to implement properly.
> Is it technically possible that usbmon will say that it sent proper data to the device when in fact it didn’t due to a bug in the kernel XHCI stack? Yes it is. Is it likely? very much not.
As someone who works with USB regularly, I very much disagree with your assessment.
> Usbmon was invented for this exact use case: debugging usb issues under the assumption that there is no fault in the kernel’s usb stack.
Usbmon was invented for debugging USB issues with a single device, under the assumption that there is no fault with the kernel's USB stack and the controller. Once you're having controller-global issues that could be caused by either of those, usbmon is not useful because that assumption no longer holds.
> Basic intuition tells us it’s a hardware issue, either controller, hub, or device.
We clearly have very different intuitions here. I would absolutely split my bets on it being a controller or kernel issue.
Source: I wrote the virtual xHCI implementation in QEMU (and worked around broken Windows drivers in it), I have experience with this.
Also, the audio frame size is 2352 bytes. Those correspond to 2048 data bytes for data CDs (plus extra error correction).
Turns out I was right.
The Mac Pro chip will be a different thing/die.
But you know, I'm still happy to double my current build perf in a small box I can stick in my closet. Ordered one :-)
Quoting the xHCI spec:
> In past generations of USB host controller implementations, there was a 1:1 correspondence between a host controller interface and USB bandwidth. The xHCI diverges from this model in that it enables vendors to tailor the bandwidth available through its root hub ports to the needs of the vendor’s target application space. The xHCI can support the legacy model where the bandwidth of a single USB is shared across all its root hub ports, a “bus per port” model where the full bandwidth of a USB is available on every root hub port, or any combination in between.
I believe most real 3.0 implementations do it per port, or at least have a bunch of instances, because it doesn't really make any sense to do otherwise. You're not really saving much money by somehow having a global bottleneck equal to the PHY bandwidth. Of course, it's possible for the controller to be bottlenecked upstream in some other way (e.g. by DMA bandwidth), but it would be very weird to find an xHCI controller with a single 480Mbps domain for all 2.0 ports IMO.
You are misremembering. All 2.0 hubs have TTs. The question is whether they have one (same problem as USB3, all ports share a single 12Mbps pipe in 1.0 mode) or multiple (can aggregate multiple 12Mbps devices without bottlenecks). What USB3/4 have done is doom us to a world equivalent to multi-TT hubs not existing. Except it's worse because with single TT hubs, at least you can still chain multiple to a parent hub and aggregate without bottlenecks at that level.
> Once we start adding isosynchronous profiles & perhaps various other usb2 gimmicks, I imagine the transaction translation problem becoming much more thorny
Thorny, perhaps. Impossible, no. This is trivial to prove: sticking a PCI USB2 host controller behind a Thunderbolt/USB4 bridge works fine, and that is for all intents and purposes a USB2 to TB/PCIe "transaction translator", and PCIe itself is more like Ethernet and can be tunnelled over almost anything. The USB host transaction layer (which is a pretty 1:1 map to xHCI) is tunnelable just fine (this is how USB over the network protocols work too, with host support). It's the wire layer that isn't, because once you drop to that layer you can't reconstruct or control the original transaction states properly. What USB2 did for TTs is extend the protocol in such away that the missing information/cases could be handled properly, with cooperation from the host. There's no reason why they couldn't have done this for USB2 to 3 too.
> Making a hub that passes through usb4, but which also exposes a variety of simple peripherals is much easier without mandating the transaction translator.
As I said, they could still keep the USB 2 lines. Having TT support in the standard doesn't mean hubs have to implement it. We'd still have the differentiation between TT-ful and TT-less hubs if you want. The problem is, right now, TT-ful USB3 hubs aren't possible. I agree that having the 2.0 lane in Type C makes a ton of sense. Just let me tunnel it over the SS lanes too!
Source: I've written USB support for projects way too often, including a bare-bones OHCI driver once. I also authored the virtual xHCI implementation in qemu.
By refusing to make that part of the spec, they have doomed us to always being limited to a total of 480Mbps per host port for USB2 devices, no matter what you do or how many you have sharing it, whether that host port is USB3 or USB4 (unless you use PCI mode). That is ridiculous.
USB4 with native USB3 tunneling but no native USB2 tunneling is a regression over TB3, and as silicon switches from the TB3 way to the USB4 way with native tunneling, we're now bringing back this problem, all thanks to the USB-IF's incompetence at designing standards. There is absolutely no reason for USB3 and USB4 not to support USB2 encapsulation/transaction translation the same way USB2 did with USB1.
> There's two other ways. One is to use a USB 3 to PCI express bridge and then functional pcie USB controller chipsets. I'm not aware of any such bridge silicon existing.
Not USB3, but this is what Thunderbolt docks/hubs do, use embedded PCI USB host controllers for the downstream ports. Which is great! But not for long: the USB-IF took over Thunderbolt and surprise surprise! USB4 includes a new USB3 tunneling mechanism but still not USB2. Yes, really. USB4 docks are expected to still have a ridiculous sidecar USB2 hub just handling USB2 duties and squeezing all that traffic into the USB2 lane all the way to the host. Because that makes sense. Of course, since PCI tunneling is still a thing and standard in USB4, at least you can ignore that nonsense and keep doing it the Thunderbolt way, but I think we're going to see fewer and fewer solutions that do it this way, and USB4 docks which do USB3 tunneling and USB2 passthrough will be a regression over TB3 docks that include full host controllers. You can thank the USB-IF for this.
> The second way is what you said, to skip the bridge and create a USB host controller that connects though via USB. Again, I'm not aware of the existence of any such silicon.
Such silicon exists, I just can't find it right now. It's another very niche thing in a similar vein to the VL67x from another manufacturer.
There are two nonstandard ways to do it. One is what this chip does, which is pretend all USB 2 devices behind it are USB 3. It literally virtualizes and rewrites desctiptors and does a whole pile of horrible hacks to get it to work. It works most of the time, but not always, and it is actually impossible to make it 100% reliable due to peculiarities of the standard. USB is impossible to tunnel or masquerade transparently at the link level due to its design, and since this device tries to do that to bridge incompatible link types, it can never be 100% spec compliant; there will always be corner cases where it breaks down. It's a hack.
The other way, which is implemented by some other niche hub chip whose name I forget, is to use a proprietary protocol to encapsulate USB2 in USB3, effectively making a USB2 host controller that just happens to connect to the host CPU via USB3. That can be done in a 100% spec-compliant and reliable way as far as downstream devices go, but then of course the upstream side is not standard, so you need special drivers for it.
There will never be a USB 2 to USB 3 translating hub that works as you'd expect because it's just not possible to build one, because the USB-IF are notoriously bad at designing standards. Seriously, so much about USB is a giant clusterfuck, from USB2's differential-but-not-really physical layer to the monster that is USB-PD.
I'm surprised they let that fly. Removing existing copyright headers from code you copy wholesale is a very bad idea, even if the license is compatible. Especially if you're making a copy as a new file, so there is no Git history to trace past authorship.
The inverse square law always applies, but it relates to the total amount of light received by a constant area observer (or density at a pointlike observer). Once you're projecting the image of the source onto a plane with a lens, that doesn't map to surface brightness.
Another place where the inverse square law breaks down is with beams of light, in the near field - consider something like a laser beam. While it will expand, and eventually follow the law once you get far enough, it very much doesn't at close range. And there's an interesting parallel here: to an observer, a collimated laser beam looks like a perfect pointlike object at infinity (modulo the diffraction limit, of course). Another way to see it is that focusing a beam of light in a certain way creates a virtual emitter much further away, and so you need to add that to the distance you plug into the inverse square law.
You missed my point about pointlike objects.
If you moved the sun 1 AU further away, it would of course cast 1/4 of the total light on the Earth, but as an object in the sky it would have the same surface brightness as it does now. It would just look smaller. I'm talking about the appearance of objects in the sky to a camera-like observer.
Once the distance increases to the point where the human eye cannot resolve it beyond a single point, then brightness starts diminishing with distance. This is the case for all single stars other than the sun. This is not the case for aggregate objects like galaxies that are large enough to see as non-points with the naked eye, like Andromeda, regardless of whether they are composed of individual pointlike stars or not.
> You're modifying the program whether you've touched any files containing plain text source code or not.
And that is just not how copyright works.
(Separately, if you ever find yourself linking to completely unrelated comments by the person you are replying to in order to construct an attack on them personally, then your own argument is probably nonsense, and you're probably not a fun person to have around.)
This is why things can get interesting with binary hooks and patches, which, depending on how they're done, can be argued not to be modifying the copyrighted work (e.g. a hook done via a hardware debug breakpoint does not require making any alterations to the target software per se, in the copyright sense). Similarly, interpreting (e.g. emulating) software is widely understood to be legal since you aren't modifying the underlying software, even if the emulator causes it to behave differently from the original intent.
Of course, then things get murky again with emulation techniques such as JIT, which could be argued to be creating a transient derivative work. Or not so transient, in the case of AOT. I would dare say there is a legal argument to be made that running older x86 Mac apps on an M1 Mac could constitute unauthorized creation of a derivative work (since it outright caches AOT recompiled versions of the apps you run using Rosetta). Of course, this seems stupid from a technical point of view, but I'd love to see if there is prior case law on this kind of situation, where a newly introduced technological mechanism can conceivably cause re-classification of the copyright effects of merely running software. It's certainly a deep rabbit hole to go into.
Some people might disagree with that interpretation, which is okay because it's the kind of fine point nobody will ever agree on until it ends up in front of a judge. Which is why I bring up the two party example, to sidestep that question.