Lines Matching refs:desc
142 struct user_desc desc = *d; in install_valid_mode() local
152 desc.entry_number = gdt_entry_num; in install_valid_mode()
154 ret = syscall(SYS_set_thread_area, &desc); in install_valid_mode()
157 &desc, sizeof(desc)); in install_valid_mode()
169 uint32_t limit = desc.limit; in install_valid_mode()
170 if (desc.limit_in_pages) in install_valid_mode()
172 check_valid_segment(desc.entry_number, ldt, ar, limit, true); in install_valid_mode()
175 if (desc.seg_32bit) { in install_valid_mode()
189 static bool install_valid(const struct user_desc *desc, uint32_t ar) in install_valid() argument
191 bool ret = install_valid_mode(desc, ar, false, true); in install_valid()
193 if (desc->contents <= 1 && desc->seg_32bit && in install_valid()
194 !desc->seg_not_present) { in install_valid()
196 install_valid_mode(desc, ar, false, false); in install_valid()
202 static void install_invalid(const struct user_desc *desc, bool oldmode) in install_invalid() argument
205 desc, sizeof(*desc)); in install_invalid()
209 check_invalid_segment(desc->entry_number, 1); in install_invalid()
213 if (desc->seg_32bit) { in install_invalid()
232 static void fail_install(struct user_desc *desc) in fail_install() argument
234 if (safe_modify_ldt(0x11, desc, sizeof(*desc)) == 0) { in fail_install()
246 struct user_desc desc = { in do_simple_tests() local
257 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | AR_S | AR_P | AR_DB); in do_simple_tests()
259 desc.limit_in_pages = 1; in do_simple_tests()
260 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | in do_simple_tests()
265 desc.entry_number = 2; in do_simple_tests()
266 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | in do_simple_tests()
271 desc.base_addr = 0xf0000000; in do_simple_tests()
272 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | in do_simple_tests()
275 desc.useable = 1; in do_simple_tests()
276 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | in do_simple_tests()
279 desc.seg_not_present = 1; in do_simple_tests()
280 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | in do_simple_tests()
283 desc.seg_32bit = 0; in do_simple_tests()
284 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | in do_simple_tests()
287 desc.seg_32bit = 1; in do_simple_tests()
288 desc.contents = 0; in do_simple_tests()
289 install_valid(&desc, AR_DPL3 | AR_TYPE_RWDATA | in do_simple_tests()
292 desc.read_exec_only = 1; in do_simple_tests()
293 install_valid(&desc, AR_DPL3 | AR_TYPE_RODATA | in do_simple_tests()
296 desc.contents = 1; in do_simple_tests()
297 install_valid(&desc, AR_DPL3 | AR_TYPE_RODATA_EXPDOWN | in do_simple_tests()
300 desc.read_exec_only = 0; in do_simple_tests()
301 desc.limit_in_pages = 0; in do_simple_tests()
302 install_valid(&desc, AR_DPL3 | AR_TYPE_RWDATA_EXPDOWN | in do_simple_tests()
305 desc.contents = 3; in do_simple_tests()
306 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE_CONF | in do_simple_tests()
309 desc.read_exec_only = 1; in do_simple_tests()
310 install_valid(&desc, AR_DPL3 | AR_TYPE_XOCODE_CONF | in do_simple_tests()
313 desc.read_exec_only = 0; in do_simple_tests()
314 desc.contents = 2; in do_simple_tests()
315 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | in do_simple_tests()
318 desc.read_exec_only = 1; in do_simple_tests()
321 desc.lm = 1; in do_simple_tests()
322 install_valid(&desc, AR_DPL3 | AR_TYPE_XOCODE | in do_simple_tests()
324 desc.lm = 0; in do_simple_tests()
327 bool entry1_okay = install_valid(&desc, AR_DPL3 | AR_TYPE_XOCODE | in do_simple_tests()
335 check_valid_segment(desc.entry_number, 1, in do_simple_tests()
337 AR_S | AR_DB | AR_AVL, desc.limit, in do_simple_tests()
358 desc.entry_number = i; in do_simple_tests()
359 desc.limit = i; in do_simple_tests()
360 if (safe_modify_ldt(0x11, &desc, sizeof(desc)) != 0) { in do_simple_tests()
376 desc.entry_number = 8192; in do_simple_tests()
377 fail_install(&desc); in do_simple_tests()
380 memset(&desc, 0, sizeof(desc)); in do_simple_tests()
381 install_valid(&desc, AR_DPL3 | AR_TYPE_RWDATA | AR_S | AR_P); in do_simple_tests()
383 desc.seg_not_present = 1; in do_simple_tests()
384 install_valid(&desc, AR_DPL3 | AR_TYPE_RWDATA | AR_S); in do_simple_tests()
386 desc.seg_not_present = 0; in do_simple_tests()
387 desc.read_exec_only = 1; in do_simple_tests()
388 install_valid(&desc, AR_DPL3 | AR_TYPE_RODATA | AR_S | AR_P); in do_simple_tests()
390 desc.read_exec_only = 0; in do_simple_tests()
391 desc.seg_not_present = 1; in do_simple_tests()
392 install_valid(&desc, AR_DPL3 | AR_TYPE_RWDATA | AR_S); in do_simple_tests()
394 desc.read_exec_only = 1; in do_simple_tests()
395 desc.limit = 1; in do_simple_tests()
396 install_valid(&desc, AR_DPL3 | AR_TYPE_RODATA | AR_S); in do_simple_tests()
398 desc.limit = 0; in do_simple_tests()
399 desc.base_addr = 1; in do_simple_tests()
400 install_valid(&desc, AR_DPL3 | AR_TYPE_RODATA | AR_S); in do_simple_tests()
402 desc.base_addr = 0; in do_simple_tests()
403 install_invalid(&desc, false); in do_simple_tests()
405 desc.seg_not_present = 0; in do_simple_tests()
406 desc.seg_32bit = 1; in do_simple_tests()
407 desc.read_exec_only = 0; in do_simple_tests()
408 desc.limit = 0xfffff; in do_simple_tests()
410 install_valid(&desc, AR_DPL3 | AR_TYPE_RWDATA | AR_S | AR_P | AR_DB); in do_simple_tests()
412 desc.limit_in_pages = 1; in do_simple_tests()
414 install_valid(&desc, AR_DPL3 | AR_TYPE_RWDATA | AR_S | AR_P | AR_DB | AR_G); in do_simple_tests()
415 desc.read_exec_only = 1; in do_simple_tests()
416 install_valid(&desc, AR_DPL3 | AR_TYPE_RODATA | AR_S | AR_P | AR_DB | AR_G); in do_simple_tests()
417 desc.contents = 1; in do_simple_tests()
418 desc.read_exec_only = 0; in do_simple_tests()
419 install_valid(&desc, AR_DPL3 | AR_TYPE_RWDATA_EXPDOWN | AR_S | AR_P | AR_DB | AR_G); in do_simple_tests()
420 desc.read_exec_only = 1; in do_simple_tests()
421 install_valid(&desc, AR_DPL3 | AR_TYPE_RODATA_EXPDOWN | AR_S | AR_P | AR_DB | AR_G); in do_simple_tests()
423 desc.limit = 0; in do_simple_tests()
424 install_invalid(&desc, true); in do_simple_tests()
451 const struct user_desc desc = {}; in threadproc() local
452 if (syscall(SYS_modify_ldt, 1, &desc, sizeof(desc)) != 0) in threadproc()
572 struct user_desc desc = { in do_multicpu_tests() local
584 if (safe_modify_ldt(0x11, &desc, sizeof(desc)) != 0) { in do_multicpu_tests()
641 struct user_desc desc = { in do_exec_test() local
652 install_valid(&desc, AR_DPL3 | AR_TYPE_XRCODE | AR_S | AR_P | AR_DB); in do_exec_test()