• Huacai Chen's avatar
    MIPS: Loongson-3: Enable Store Fill Buffer at runtime · c824ad16
    Huacai Chen authored
    New Loongson-3 (Loongson-3A R2, Loongson-3A R3, and newer) has SFB
    (Store Fill Buffer) which can improve the performance of memory access.
    Now, SFB enablement is controlled by CONFIG_LOONGSON3_ENHANCEMENT, and
    the generic kernel has no benefit from SFB (even it is running on a new
    Loongson-3 machine). With this patch, we can enable SFB at runtime by
    detecting the CPU type (the expense is war_io_reorder_wmb() will always
    be a 'sync', which will hurt the performance of old Loongson-3).
    
    [paul.burton@mips.com: Further info from Huacai:
      In practise, I found that sometimes there are boot failures if I
      enable SFB/LPA in cpu_probe(). I don't know why because processor
      designers also haven't give me an explaination, but I think this may
      have some relationships to speculative execution.]
    Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
    Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
    Patchwork: https://patchwork.linux-mips.org/patch/20426/
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: James Hogan <jhogan@kernel.org>
    Cc: linux-mips@linux-mips.org
    Cc: Fuxin Zhang <zhangfx@lemote.com>
    Cc: Zhangjin Wu <wuzhangjin@gmail.com>
    Cc: Huacai Chen <chenhuacai@gmail.com>
    c824ad16
io.h 18.8 KB