On Wed, Jul 7, 2021 at 6:48 PM Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:
Followup to my patch "Fixes to Linus' 'remove set_fs patch'", with kernel mode copy macros used in __get/put_kernel_nofault(). (As soon as I use the same __get/put_user_asm() macros with parameters, like in Christoph's patch, everything falls to pieces.)
Ok, strange. If this works for you, then the _concept_ is fine, and there's something odd going on with the "macros with 'moves' vs 'move' as a parameter" thing.
The fact that I had to touch include/linux/uaccess.h at all means I got something horribly wrong in my use of MAKE_MM_SEG() to set the segments.
Oh, that's straightforward enough: the m68k segment code uses the same 'mm_segment_t' type that the geberic kernel just wants to make empty for the non-CONFIG_SET_FS case. So the m68k segment type should just use a different name. In fact, the m68k manuals call them "alternate function code registers", so maybe it shouldn't be about "mm_segment_t" at all, but the type should really be named as such. The "segment" naming is just legacy x86 nomenclature, so I suspect it would be a good thing to really walk away from that and make it very explicit about what this is on m68k. So maybe it could be typedef struct { unsigned char val:3; } function_code_reg_t; or something like that. I suspect some real m68k person should make up the name, not me. The alternate function code registers are all from after my time ;) Linus