#
✕ nick:arnd
#asahi · 2021-06-10 14:43
arndGlanzmann: on some architectures, using the iommu causes a fairly large overhead, so those would only be used if necessary to avoid bounce buffers, but fall back to bypass mode in other cases.
#asahi · 2021-06-10 14:40
arndGlanzmann: it depends on the iommu driver, and the CPU architectures. Most combinations support both strict and relaxed modes, but the defaults are inconsistent
#asahi · 2021-06-10 14:36
arndkettenis: it should work, but it feels slightly wrong, since it's not the PCIe port that is external facing, but rather the device that is hardwired to that port
#asahi · 2021-06-10 10:09
arndsven: is this on top of the other appple-specific quirks that are already in the driver, or are those just for older hardware?
#asahi · 2021-06-10 10:08
arndok, I see. That does seem quite invasive. We'll have to talk to the nvme maintainers anyway, to see if my approach for reworking the driver is what they want
#asahi · 2021-06-10 10:01
arndsven: what kind of quirks are those?
#asahi · 2021-06-10 09:48
arndI created a patch to add further inline functions, but on second thought I'm now removing the whole lot and just leave the declarations in place, with no inline stub. We'll see what breaks that way
#asahi · 2021-06-10 09:36
arndnormally we just make all those declarations visible in the kernel and only use the inline stubs for things that are commonly called but that can return an error code and have a working caller when the subsystem is disabled
#asahi · 2021-06-10 09:35
arndthe header uses an unconventional method of putting all its declarations inside of an #ifdef, and then having a small subset of them in the #else path as static inline helpers
#asahi · 2021-06-10 09:34
arndthe main change was rearranging parts of include/linux/pci.h so all the declarations are visible
#asahi · 2021-06-10 09:34
arndthe only driver change I needed in the end is to include linux/dmapool.h, which is not implicitly included in all non-PCI configurations
#asahi · 2021-06-10 09:33
arndsven: I figured out the build failures with my nvme series
#asahi · 2021-06-10 08:17
arndAh right, the mac mini has a Fresco Logic FL1100SX ​USB3.1 Gen1, using a single PCIe 2.1 lane. while ASM3142 uses two PCIe Gen3 lanes for USB3.1 Gen2 ports.
#asahi · 2021-06-10 08:03
arndI'm confused now, I thought dwc3 was driving the type-C ports, isn't that how you get the endpoint mode on type-c?
#asahi · 2021-06-10 08:01
arndwhat do the other ones use? I guess the difference is that the mini has two type-A ports, while the imac has additional Type-C ports next to the two thunderbolt ports.
#asahi · 2021-06-10 07:38
arndI don't see anything surprising in there, but they don't have the corresponding mac mini teardown for comparison
#asahi · 2021-06-10 07:37
arndifixit has a nice teardown at https://www.ifixit.com/Teardown/iMac+M1+24-Inch+Teardown/142850
#asahi · 2021-06-08 19:11
arndoh, actually it doesn't. In this case there must be some other heuristic, maybe they started building all trees with recent commits that forked from torvalds/linux.git
#asahi · 2021-06-08 19:09
arndand there is a manual opt-in and opt-out
#asahi · 2021-06-08 19:09
arndwith some heuristics, I think it only tests recent commits
#asahi · 2021-06-08 19:08
arndj_ey: yes, the kernel zero-day bot builds all branches of git repos that feed into linux-next
#asahi · 2021-06-08 19:05
arndsven: ah, now the build bot started reporting the !CONFIG_PCI failures on your tree that I had seen earlier. Curiously it doesn't happen on a defconfig build with PCI disabled, it needs some other config options that I have not analyzed yet.
#asahi · 2021-06-08 15:45
arndit's a bit of an anachronism now since only a few hundred non-DT boards remain, compared to over 2000 dts files in tree, and more that work with mainline kernels but were never submitted for inclusion
#asahi · 2021-06-08 15:43
arndwhen we converted embedded powerpc platform code to DT, we started out with having a separate device type for devices defined in there, but ended up merging the two as a ton of drivers ended up needing to support both board files and DT booting
#asahi · 2021-06-08 15:42
arndarch/x86/kernel/rtc.c: platform_device_register(&rtc_device);
#asahi · 2021-06-08 15:42
arndoriginally platform devices were always defined in board files or architecture code, such as
#asahi · 2021-06-08 15:36
arndI did not want to take that last step in order to make rebasing easier until the nvme maintainers are ready to merge it
#asahi · 2021-06-08 15:34
arndwhich doesn't matter for the M1, but in theory those two should be completely separate
#asahi · 2021-06-08 15:34
arndsven: actually in my build tree, I added a hack to only allow building CONFIG_BLK_DEV_NVME_PLATFORM when CONFIG_PCI is also set
#asahi · 2021-06-08 15:31
arndsven: wow, I was really lucky there, I fully expected some major screwup
#asahi · 2021-06-08 11:43
arndkettenis: 400MB seems quite a lot for the cache, but that must be what it's used for. The Linux NVMe driver allocates at most 128MB unless you override it with a boot time or module option.
#asahi · 2021-06-08 11:39
arndkettenis: that happens a lot. if you use irccloud, you'll now see my picture next to what I write, it used to also assign the same colour icon to both of us
#asahi · 2021-06-08 11:35
arndah, so maybe they did their own version of HMB before it became a standard NVMe feature?
#asahi · 2021-06-08 11:33
arnd_jannau_: my first guess would be in the same package as the NAND flash, at least if that comes in a custom package
#asahi · 2021-06-08 10:33
arndsven: ok, adding those printks would have been my first suggestion, all zeroes just means it has no HBM and presumably uses an internal DRAM cache like every high-end device does
#asahi · 2021-06-08 10:07
arndsven: if you boot into Linux with the nvme driver, are you able to run 'nvme id-ctrl /dev/nvme0n1'? I'm curious to see if it uses the host memory buffer (hmpre/hmmin/hmmaxd)
#asahi · 2021-06-08 08:26
arndmarcan had mentioned he would look into getting it to work in the near future when I initially created the patches, so I did not bother setting up an environment for testing the PCIe side of it, and I never got far enough with the mac in the office to actually try things out on that either
#asahi · 2021-06-08 08:24
arndah, nice
#asahi · 2021-06-07 15:55
arndsven: right, that would work, we could just put the "external-facing" property on the bridge node, but that feels wrong, as what we really want is to mark that whole class of broadcom wireless devices (or maybe any wireless network device?) as untrusted, regardless of what machine they are used in
#asahi · 2021-06-07 15:45
arndThat sounds exactly like what we want, though I'm not sure it would work if the wireless driver sets the flag from the probe function, that is probably too late.
#asahi · 2021-06-07 15:28
arndfor the thunderbolt ports, it would be set using the "external-facing" property, for the wireless device I suppose the driver could set it
#asahi · 2021-06-07 15:27
arndsven: the dev_is_untrusted() logic in there looks like the exact thing to use for determining whether to set up a linear map or not
#asahi · 2021-06-07 15:24
arndit looks like that was added fairly recently (last November) based on code from the Intel iommu driver.
#asahi · 2021-06-07 15:19
arndsven: ok, got it, thanks for the pointer
#asahi · 2021-06-07 15:17
arndsven: ok, good to know, I have to read up on that again
#asahi · 2021-06-07 15:16
arndRAM
#asahi · 2021-06-07 15:16
arndRMA
#asahi · 2021-06-07 15:16
arndor complete it after a day of wearing out the disks, instead of a few minutes of building in RMA
#asahi · 2021-06-07 15:16
arndWhen I tested kernel builds on Amazon EC2 comparing page sizes, I found that with 4GB RAM per core, 64KB pages were a few percent faster, but once I reduced the amount of RAM I found that 4KB pages still worked fine even after it started swapping, but as soon as the 64KB kernel went into swap space, it would start thrashing and never complete the kernel build
#asahi · 2021-06-07 15:13
arndbloom: ok the other hand, anything that is purely CPU bound and fits within a small working set tends to benefit from the lower TLB usage, so microbenchmarks almost always show 64KB pages come out winning

plus ›