x86_cpu.cc (12155:5dc92ea01323) x86_cpu.cc (12392:e0dbdf30a2a5)
1/*
2 * Copyright (c) 2013 Andreas Sandberg
3 * All rights reserved
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 382 unchanged lines hidden (view full) ---

391 warn("Illegal %s base: 0x%x\n", name, seg.base);
392 break;
393
394 case MISCREG_SS:
395 case MISCREG_DS:
396 case MISCREG_ES:
397 if (seg.unusable)
398 break;
1/*
2 * Copyright (c) 2013 Andreas Sandberg
3 * All rights reserved
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 382 unchanged lines hidden (view full) ---

391 warn("Illegal %s base: 0x%x\n", name, seg.base);
392 break;
393
394 case MISCREG_SS:
395 case MISCREG_DS:
396 case MISCREG_ES:
397 if (seg.unusable)
398 break;
399 M5_FALLTHROUGH;
399 case MISCREG_CS:
400 if (seg.base & 0xffffffff00000000ULL)
401 warn("Illegal %s base: 0x%x\n", name, seg.base);
402 break;
403 }
404
405 // Check the type
406 switch (idx) {

--- 21 unchanged lines hidden (view full) ---

428
429 case MISCREG_SS:
430 if (seg.unusable)
431 break;
432 switch (seg.type) {
433 case 3:
434 if (sregs.cs.type == 3 && seg.dpl != 0)
435 warn("CS type is 3, but SS DPL is != 0.\n");
400 case MISCREG_CS:
401 if (seg.base & 0xffffffff00000000ULL)
402 warn("Illegal %s base: 0x%x\n", name, seg.base);
403 break;
404 }
405
406 // Check the type
407 switch (idx) {

--- 21 unchanged lines hidden (view full) ---

429
430 case MISCREG_SS:
431 if (seg.unusable)
432 break;
433 switch (seg.type) {
434 case 3:
435 if (sregs.cs.type == 3 && seg.dpl != 0)
436 warn("CS type is 3, but SS DPL is != 0.\n");
436 /* FALLTHROUGH */
437 M5_FALLTHROUGH;
437 case 7:
438 if (!(sregs.cr0 & 1) && seg.dpl != 0)
439 warn("SS DPL is %i, but CR0 PE is 0\n", seg.dpl);
440 break;
441 default:
442 warn("Illegal SS type: %i\n", seg.type);
443 break;
444 }

--- 27 unchanged lines hidden (view full) ---

472 switch (idx) {
473 case MISCREG_SS:
474 case MISCREG_DS:
475 case MISCREG_ES:
476 case MISCREG_FS:
477 case MISCREG_GS:
478 if (seg.unusable)
479 break;
438 case 7:
439 if (!(sregs.cr0 & 1) && seg.dpl != 0)
440 warn("SS DPL is %i, but CR0 PE is 0\n", seg.dpl);
441 break;
442 default:
443 warn("Illegal SS type: %i\n", seg.type);
444 break;
445 }

--- 27 unchanged lines hidden (view full) ---

473 switch (idx) {
474 case MISCREG_SS:
475 case MISCREG_DS:
476 case MISCREG_ES:
477 case MISCREG_FS:
478 case MISCREG_GS:
479 if (seg.unusable)
480 break;
481 M5_FALLTHROUGH;
480 case MISCREG_CS:
481 if (!seg.s)
482 warn("%s: S flag not set\n", name);
483 break;
484
485 case MISCREG_TSL:
486 if (seg.unusable)
487 break;
482 case MISCREG_CS:
483 if (!seg.s)
484 warn("%s: S flag not set\n", name);
485 break;
486
487 case MISCREG_TSL:
488 if (seg.unusable)
489 break;
490 M5_FALLTHROUGH;
488 case MISCREG_TR:
489 if (seg.s)
490 warn("%s: S flag is set\n", name);
491 break;
492 }
493
494 switch (idx) {
495 case MISCREG_SS:
496 case MISCREG_DS:
497 case MISCREG_ES:
498 case MISCREG_FS:
499 case MISCREG_GS:
500 case MISCREG_TSL:
501 if (seg.unusable)
502 break;
491 case MISCREG_TR:
492 if (seg.s)
493 warn("%s: S flag is set\n", name);
494 break;
495 }
496
497 switch (idx) {
498 case MISCREG_SS:
499 case MISCREG_DS:
500 case MISCREG_ES:
501 case MISCREG_FS:
502 case MISCREG_GS:
503 case MISCREG_TSL:
504 if (seg.unusable)
505 break;
506 M5_FALLTHROUGH;
503 case MISCREG_TR:
504 case MISCREG_CS:
505 if (!seg.present)
506 warn("%s: P flag not set\n", name);
507
508 if (((seg.limit & 0xFFF) == 0 && seg.g) ||
509 ((seg.limit & 0xFFF00000) != 0 && !seg.g)) {
510 warn("%s limit (0x%x) and g (%i) combination is illegal.\n",

--- 1118 unchanged lines hidden ---
507 case MISCREG_TR:
508 case MISCREG_CS:
509 if (!seg.present)
510 warn("%s: P flag not set\n", name);
511
512 if (((seg.limit & 0xFFF) == 0 && seg.g) ||
513 ((seg.limit & 0xFFF00000) != 0 && !seg.g)) {
514 warn("%s limit (0x%x) and g (%i) combination is illegal.\n",

--- 1118 unchanged lines hidden ---