Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Linux-Kernel Archive: Re: [PATCH v2] MIPS: undefine and redefine cpu_has_fpu when it is overrided Re: [PATCH v2] MIPS: undefine and redefine cpu_has_fpu when it is overrided From: Maciej W. Rozycki Date: Sat Apr 30 2022 - 11:38:53 EST Next message: Palmer Dabbelt: "[PATCH v4 6/7] RISC-V: Move to queued RW locks" Previous message: Palmer Dabbelt: "[PATCH v4 7/7] csky: Move to generic ticket-spinlock" In reply to: Stephen Zhang: "Re: [PATCH v2] MIPS: undefine and redefine cpu_has_fpu when it is overrided" Next in thread: Stephen Zhang: "Re: [PATCH v2] MIPS: undefine and redefine cpu_has_fpu when it is overrided" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] On Sat, 30 Apr 2022, Stephen Zhang wrote: > > Additionally I've thought of adding something like: > > > > #if cpu_has_fpu > > # undef cpu_has_fpu > > #endif > > > > or maybe even: > > > > #if cpu_has_fpu > > # error "Forcing `cpu_has_fpu' to non-zero is not supported" > > #endif > > > > to arch/mips/include/asm/cpu-features.h, but maybe that's an overkill. > > Yeah, but why do you think that's an overkill? There is a great chance > people will ignore the note of 'cpu_has_fpu', and it did happen. When > that happens, there should exist a way to point out or fix that. Maybe it's the language, but my intent has been to express my uncertainty here rather than asserting that indeed it is an overkill. People do make mistakes from time to time, both code writers and reviewers do. It's not clear to me where to draw the line for safety checks though. Here `cpu_has_fpu' is a bit unusual in that unlike with the other feature override macros we don't want it to expand to a non-zero constant. The comment didn't work twice, though I suspect both cpu-feature-overrides.h files may have been written before the comment went in (I'm fairly sure the IP30 port lived outside the tree for a while). But I have only added the comment in the first place when I tripped over the `nofpu' option not working for the machine I needed to run FPU emulator verification with, and several platforms were fixed alongside. Given these circumstances it probably makes sense to have such a safety check after all. > > I prefer just removing the #defines from ip27/ip30 cpu-feasture-overrides.h. > > Or isn't that enough for fixing the problem ? > > > > Thomas. > > So maybe that's why I don't think just removing the #defines from > ip27/ip30 cpu-feasture-overrides.h. is enough for fixing the problem. Well, that *is* the fix for the problem at hand, as this macro is not supposed to be defined such as to expand to a non-zero constant. Adding a safety check would be a separate improvement. Please feel free to submit one. We need to keep fixes and improvements as separate changes. For one fixes can be candidates for backporting while improvements are never backported; cf. Documentation/process/stable-kernel-rules.rst. I hope this clears your concerns. Let me know if you have further questions. Maciej Next message: Palmer Dabbelt: "[PATCH v4 6/7] RISC-V: Move to queued RW locks" Previous message: Palmer Dabbelt: "[PATCH v4 7/7] csky: Move to generic ticket-spinlock" In reply to: Stephen Zhang: "Re: [PATCH v2] MIPS: undefine and redefine cpu_has_fpu when it is overrided" Next in thread: Stephen Zhang: "Re: [PATCH v2] MIPS: undefine and redefine cpu_has_fpu when it is overrided" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]