1f08c3bdfSopenharmony_ciOverall: (9 cases) 2f08c3bdfSopenharmony_ci 3f08c3bdfSopenharmony_ci- Test method 4f08c3bdfSopenharmony_ci * Add cases/soft-inj/panic/cases.sh into configuration file, and invoke 5f08c3bdfSopenharmony_ci a test driver on it. 6f08c3bdfSopenharmony_ci- Common 7f08c3bdfSopenharmony_ci * Test script of test cases in this file can be found in 8f08c3bdfSopenharmony_ci cases/soft-inj/panic/cases.sh 9f08c3bdfSopenharmony_ci 10f08c3bdfSopenharmony_ci1. fatal 11f08c3bdfSopenharmony_ci 12f08c3bdfSopenharmony_ci- Objective: 13f08c3bdfSopenharmony_ci * Test MSR read logic of MCE handler 14f08c3bdfSopenharmony_ci * Test synchronization between monarch and subject 15f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 16f08c3bdfSopenharmony_ci- Code path tested: 17f08c3bdfSopenharmony_ci * do_machine_check() 18f08c3bdfSopenharmony_ci * mce_start() 19f08c3bdfSopenharmony_ci * mce_end() 20f08c3bdfSopenharmony_ci * mce_reign() until mce_panic("Fatal Machine check",) 21f08c3bdfSopenharmony_ci * mce_severity() 22f08c3bdfSopenharmony_ci * mce_timeout() except if (*t <= 0) branch 23f08c3bdfSopenharmony_ci * mce_panic() 24f08c3bdfSopenharmony_ci * print_mce() 25f08c3bdfSopenharmony_ci * mce_log() 26f08c3bdfSopenharmony_ci- Reference: 27f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal 28f08c3bdfSopenharmony_ci- Expected result: 29f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 30f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 31f08c3bdfSopenharmony_ci * Kernel panic message is "Fatal Machine check" 32f08c3bdfSopenharmony_ci * Exception message is "Processor context corrupt" 33f08c3bdfSopenharmony_ci 34f08c3bdfSopenharmony_ci 35f08c3bdfSopenharmony_ci2. fatal timeout 36f08c3bdfSopenharmony_ci 37f08c3bdfSopenharmony_ci- Objective: 38f08c3bdfSopenharmony_ci * Test logic of timeout during monarch/subject synchronization 39f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 40f08c3bdfSopenharmony_ci- Code path tested: 41f08c3bdfSopenharmony_ci * do_machine_check() 42f08c3bdfSopenharmony_ci * mce_start() 43f08c3bdfSopenharmony_ci * mce_timeout() if (*t <= 0) branch 44f08c3bdfSopenharmony_ci * mce_severity() 45f08c3bdfSopenharmony_ci * mce_panic("Fatal machine check on current CPU",); 46f08c3bdfSopenharmony_ci * print_mce() 47f08c3bdfSopenharmony_ci * mce_log() 48f08c3bdfSopenharmony_ci- Reference: 49f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal_timeout 50f08c3bdfSopenharmony_ci- Expected result: 51f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 52f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 53f08c3bdfSopenharmony_ci * Kernel panic message is "Fatal machine check on current CPU" 54f08c3bdfSopenharmony_ci * Exception message is "Processor context corrupt" 55f08c3bdfSopenharmony_ci * Timeout message is "Some CPUs didn't answer in synchronization" 56f08c3bdfSopenharmony_ci 57f08c3bdfSopenharmony_ci 58f08c3bdfSopenharmony_ci3. fatal in irq 59f08c3bdfSopenharmony_ci 60f08c3bdfSopenharmony_ci- Objective: 61f08c3bdfSopenharmony_ci * Test fatal MCE occur in IRQ context 62f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 63f08c3bdfSopenharmony_ci- Code path tested: 64f08c3bdfSopenharmony_ci * Same as fatal 65f08c3bdfSopenharmony_ci- Reference: 66f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal_irq 67f08c3bdfSopenharmony_ci- Expected result: 68f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 69f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 70f08c3bdfSopenharmony_ci * Kernel panic message is "Fatal Machine check" 71f08c3bdfSopenharmony_ci * Exception message is "Processor context corrupt" 72f08c3bdfSopenharmony_ci 73f08c3bdfSopenharmony_ci 74f08c3bdfSopenharmony_ci4. fatal with RIPV 75f08c3bdfSopenharmony_ci 76f08c3bdfSopenharmony_ci- Objective: 77f08c3bdfSopenharmony_ci * Test combination of PCC and RIPV 78f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 79f08c3bdfSopenharmony_ci- Code path tested: 80f08c3bdfSopenharmony_ci * MCG_STATUS_RIPV branch of switch(m.mcgstatus) in do_machine_check 81f08c3bdfSopenharmony_ci * Others are same as fatal 82f08c3bdfSopenharmony_ci- Reference: 83f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal_ripv 84f08c3bdfSopenharmony_ci- Expected result: 85f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 86f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 87f08c3bdfSopenharmony_ci * Kernel panic message is "Fatal Machine check" 88f08c3bdfSopenharmony_ci * Exception message is "Processor context corrupt" 89f08c3bdfSopenharmony_ci 90f08c3bdfSopenharmony_ci 91f08c3bdfSopenharmony_ci5. fatal timeout with RIPV 92f08c3bdfSopenharmony_ci 93f08c3bdfSopenharmony_ci- Objective: 94f08c3bdfSopenharmony_ci * Test timeout logic of combination of PCC and RIPV 95f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 96f08c3bdfSopenharmony_ci- Code path tested: 97f08c3bdfSopenharmony_ci * MCG_STATUS_RIPV branch of switch(m.mcgstatus) in do_machine_check 98f08c3bdfSopenharmony_ci * Others are same as fatal_timeout 99f08c3bdfSopenharmony_ci- Reference: 100f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal_timeout_ripv 101f08c3bdfSopenharmony_ci- Expected result: 102f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 103f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 104f08c3bdfSopenharmony_ci * Kernel panic message is "Fatal machine check on current CPU" 105f08c3bdfSopenharmony_ci * Exception message is "Processor context corrupt" 106f08c3bdfSopenharmony_ci * Timeout message is "Some CPUs didn't answer in synchronization" 107f08c3bdfSopenharmony_ci 108f08c3bdfSopenharmony_ci 109f08c3bdfSopenharmony_ci6. fatal with OVER 110f08c3bdfSopenharmony_ci 111f08c3bdfSopenharmony_ci- Objective: 112f08c3bdfSopenharmony_ci * Test OVER flag in MCI_STATUS processing 113f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 114f08c3bdfSopenharmony_ci- Code path tested: 115f08c3bdfSopenharmony_ci * Same as fatal 116f08c3bdfSopenharmony_ci- Reference: 117f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal_over 118f08c3bdfSopenharmony_ci- Expected result: 119f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 120f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 121f08c3bdfSopenharmony_ci * Kernel panic message is "Fatal Machine check" 122f08c3bdfSopenharmony_ci * Exception message is "Processor context corrupt" 123f08c3bdfSopenharmony_ci 124f08c3bdfSopenharmony_ci 125f08c3bdfSopenharmony_ci7. fatal and UC without EN 126f08c3bdfSopenharmony_ci 127f08c3bdfSopenharmony_ci- Objective: 128f08c3bdfSopenharmony_ci * Test no EN processing. Only one MCE can be injected on one CPU, so 129f08c3bdfSopenharmony_ci a MCE without EN are injected on other CPU. 130f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 131f08c3bdfSopenharmony_ci- Code path tested: 132f08c3bdfSopenharmony_ci * Same as fatal except no EN branch in do_machine_check() 133f08c3bdfSopenharmony_ci- Reference: 134f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal_no_en 135f08c3bdfSopenharmony_ci * Reference MCE records: cases/soft-inj/panic/refer/fatal_no_en 136f08c3bdfSopenharmony_ci- Expected result: 137f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 138f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 139f08c3bdfSopenharmony_ci * Kernel panic message is "Machine check from unknown source" 140f08c3bdfSopenharmony_ci * No exception message 141f08c3bdfSopenharmony_ci 142f08c3bdfSopenharmony_ci8. fatal with EIPV 143f08c3bdfSopenharmony_ci 144f08c3bdfSopenharmony_ci- Objective: 145f08c3bdfSopenharmony_ci * Test combination of PCC and EIPV 146f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 147f08c3bdfSopenharmony_ci- Code path tested: 148f08c3bdfSopenharmony_ci * Same as fatal 149f08c3bdfSopenharmony_ci- Reference: 150f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal_eipv 151f08c3bdfSopenharmony_ci- Expected result: 152f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 153f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 154f08c3bdfSopenharmony_ci * Kernel panic message is "Fatal Machine check" 155f08c3bdfSopenharmony_ci * Exception message is "Processor context corrupt" 156f08c3bdfSopenharmony_ci 157f08c3bdfSopenharmony_ci 158f08c3bdfSopenharmony_ci9. fatal in userspace 159f08c3bdfSopenharmony_ci 160f08c3bdfSopenharmony_ci- Objective: 161f08c3bdfSopenharmony_ci * Test of PCC in userspace 162f08c3bdfSopenharmony_ci * Test logic to recognize a fatal (PCC) MCE 163f08c3bdfSopenharmony_ci- Code path tested: 164f08c3bdfSopenharmony_ci * Same as fatal 165f08c3bdfSopenharmony_ci- Reference: 166f08c3bdfSopenharmony_ci * Inject data file: cases/soft-inj/panic/data/fatal_eipv 167f08c3bdfSopenharmony_ci- Expected result: 168f08c3bdfSopenharmony_ci * No warning or bug during kernel processing. 169f08c3bdfSopenharmony_ci * MCE records collected via kernel panic log is same as reference ones. 170f08c3bdfSopenharmony_ci * Kernel panic message is "Fatal Machine check" 171f08c3bdfSopenharmony_ci * Exception message is "Processor context corrupt" 172f08c3bdfSopenharmony_ci 173f08c3bdfSopenharmony_ci 174