{"id":257,"date":"2025-01-02T21:01:09","date_gmt":"2025-01-02T13:01:09","guid":{"rendered":"https:\/\/www.yewpo.top\/?p=257"},"modified":"2025-01-02T21:01:09","modified_gmt":"2025-01-02T13:01:09","slug":"realm-%e7%9a%84%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.yewpo.top\/index.php\/257\/","title":{"rendered":"Realm \u7684\u5f02\u5e38\u5904\u7406"},"content":{"rendered":"<blockquote>\n<p>\u636e\u4e0a\u7bc7 <a href=\"http:\/\/aly.yewpo.top\/246\/\">Linaro RMM \u4ee3\u7801\u521d\u6b65\u9605\u8bfb<\/a>\uff0c\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\u5230\uff0c\u5f53 Realm \u53d1\u751f\u5f02\u5e38\u65f6\uff0c\u4f1a\u76f4\u63a5\u56de\u9000\u5230 RMM \u7684\u4e0a\u4e0b\u6587\u3002RMM \u5c06 Realm \u7684\u4e0a\u4e0b\u6587\u4fdd\u5b58\u5230 REC \u7ed3\u6784\u4f53\u4e2d\uff0c\u8c03\u7528 <code>handle_realm_exit()<\/code> \u51fd\u6570\u5bf9 Realm \u7684\u5f02\u5e38\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<\/blockquote>\n<h2 class=\"atx\" id=\"1-realm-\u7684\u5f02\u5e38\u5224\u65ad\u548c\u5206\u53d1\">1 Realm \u7684\u5f02\u5e38\u5224\u65ad\u548c\u5206\u53d1<\/h2>\n<p><code>handle_realm_exit()<\/code> \u51fd\u6570\u6709\u4e09\u4e2a\u53c2\u6570\uff0c\u5206\u522b\u662f REC \u7ed3\u6784\u4f53\u5730\u5740\uff0cRecExit \u7ed3\u6784\u4f53\u5730\u5740\u548c\u5f02\u5e38\u503c\u3002\u5bf9\u4e8e\u5f02\u5e38\u503c\uff0c\u662f\u4ece Realm \u9000\u51fa\u540e\uff0c\u7531 <code>el2_vectors<\/code> \u4ee3\u7801\u8bbe\u7f6e\u7684\u3002<\/p>\n<blockquote>\n<p><code>el2_vectors<\/code> \u4ee3\u7801\u5728 <code>rmm\/runtime\/core\/aarch64\/vectors.S<\/code> \u4e2d\u5b9e\u73b0\uff0c\u8bbe\u7f6e\u4e86\u6240\u6709\u4e2d\u65ad\u5904\u7406\u51fd\u6570\u7684\u5165\u53e3\u5730\u5740\uff0c\u8fd9\u4e9b\u5730\u5740\u5e94\u8be5\u5728\u521d\u59cb\u5316\u7684\u65f6\u5019\u5c31\u88ab\u8bbe\u7f6e\u5230\u4e86\u4e2d\u65ad\u5411\u91cf\u8868\u4e2d\u3002\u5f53\u4e2d\u65ad\u53d1\u751f\u65f6\uff0c\u76f4\u63a5\u8fdb\u5165\u76f8\u5e94\u51fd\u6570\u3002<\/p>\n<pre><code class=\"fenced-code-block\">ENTRY(el2_vectors):\n    ventry_unused    exc_sync_sp0\n    ventry_unused    exc_irq_sp0\n    ventry_unused    exc_fiq_sp0\n    ventry_unused    exc_serror_sp0\n\n    ventry        el2_sync_cel\n    ventry_unused    exc_irq_spx\n    ventry_unused    exc_fiq_spx\n    ventry_unused    exc_serror_spx\n\n    ventry        el2_sync_lel\n    ventry        el2_irq_lel\n    ventry        el2_fiq_lel\n    ventry        el2_serror_lel\n\n    ventry_unused    exc_sync_lel_32\n    ventry_unused    exc_irq_lel_32\n    ventry_unused    exc_fiq_lel_32\n    ventry_unused    exc_serror_lel_32\nENDPROC(el2_vectors)<\/code><\/pre>\n<blockquote>\n<p>X0 \u5bc4\u5b58\u5668\u662f aarch64 \u67b6\u6784\u51fd\u6570\u8fd4\u56de\u503c\u6240\u7528\u7684\u5bc4\u5b58\u5668\u3002<\/p>\n<\/blockquote>\n<p>\u6bcf\u4e2a\u4e2d\u65ad\u5904\u7406\u51fd\u6570\u5c06\u5f02\u5e38\u4fe1\u606f\u7801\u5b58\u50a8\u5230 X0 \u5bc4\u5b58\u5668\u4e2d\uff0c\u5e76\u8df3\u8f6c <code>realm_exit()<\/code> \u51fd\u6570\u3002<code>realm_exit()<\/code> \u51fd\u6570\u5728 <code>rmm\/runtime\/core\/aarch64\/run-asm.S<\/code> \u4e2d\u5b9e\u73b0\u3002\u8be5\u51fd\u6570\u4fdd\u5b58 Realm \u901a\u7528\u5bc4\u5b58\u5668\u548c\u6062\u590d\u4e00\u4e9b\u5bc4\u5b58\u5668\u503c\u540e\u76f4\u63a5\u8fd4\u56de\u5230 <code>rec_run_loop()<\/code> \u51fd\u6570\u4e2d\u3002<\/p>\n<\/blockquote>\n<p><code>handle_realm_exit()<\/code> \u51fd\u6570\u5728 <code>rmm\/runtime\/core\/exit.c<\/code> \u4e2d\u5b9e\u73b0\u3002RMM \u5c06 Realm \u7684\u5f02\u5e38\u5206\u6210\u4e86\u4ee5\u4e0b\u51e0\u7c7b\uff1a<\/p>\n<ul>\n<li>\n<p>ARM_EXCEPTION_SYNC_LEL: \u5c06 RecExit \u9000\u51fa\u539f\u56e0\u8bbe\u7f6e\u6210 RMI_EXIT_SYNC \u540e\uff0c\u4ea4\u7ed9 <code>handle_exception_sync()<\/code> \u51fd\u6570\u5904\u7406\uff0c\u7531\u8be5\u51fd\u6570\u51b3\u5b9a\u662f\u5426\u9700\u8981 REC_EXIT \u7684\u64cd\u4f5c\u3002\u5982\u679c\u9700\u8981 REC_EXIT\uff0c\u5219\u5c06\u4e00\u4e9b EL2 \u7279\u6743\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u5982 ESR, FAR, HPFAR\uff0c\u4fdd\u5b58\u5728 REC \u7ed3\u6784\u4f53\u7684 last_run_info \u57df\u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p>ARM_EXCEPTION_IRQ_LEL: \u4ea4\u7ed9 <code>handle_exception_irq_lel()<\/code> \u51fd\u6570\u5904\u7406\uff0c\u7531\u8be5\u51fd\u6570\u51b3\u5b9a\u662f\u5426\u9700\u8981 REC_EXIT \u7684\u64cd\u4f5c\u3002<\/p>\n<\/li>\n<li>\n<p>ARM_EXCEPTION_FIQ_LEL: \u5c06 RecExit \u9000\u51fa\u539f\u56e0\u8bbe\u7f6e\u6210 RMI_EXIT_FIQ\uff0c\u5e76\u9000\u51fa switch \u9009\u62e9\u8bed\u53e5\u3002<\/p>\n<\/li>\n<li>\n<p>ARM_EXCEPTION_SERROR_LEL: \u5c06 RecExit \u9000\u51fa\u539f\u56e0\u8bbe\u7f6e\u6210 RMI_EXIT_SERROR\uff0c\u7136\u540e\u4ea4\u7ed9 <code>hanle_exception_serror_lel()<\/code> \u51fd\u6570\u5904\u7406\uff0c\u5e76\u7531\u8be5\u51fd\u6570\u51b3\u5b9a\u662f\u5426\u9700\u8981 REC_EXIT \u64cd\u4f5c\u3002<\/p>\n<\/li>\n<li>\n<p>\u5176\u4ed6\u60c5\u51b5\uff0c\u9ed8\u8ba4\u9700\u8981 REC_EXIT \u64cd\u4f5c\u3002<\/p>\n<\/li>\n<\/ul>\n<h2 class=\"atx\" id=\"2-\u540c\u6b65\u5f02\u5e38\u7684\u5904\u7406\">2 \u540c\u6b65\u5f02\u5e38\u7684\u5904\u7406<\/h2>\n<p><code>handle_exception_sync()<\/code> \u51fd\u6570\u5728 <code>rmm\/runtime\/core\/exit.c<\/code> \u4e2d\u5b9e\u73b0\u3002\u51fd\u6570\u5148\u8bfb\u53d6 EL2 \u7684 ESR \u5bc4\u5b58\u5668\uff0c\u5e76\u6839\u636e\u8bfb\u53d6\u7684\u503c\uff0c\u5224\u65ad\u662f\u90a3\u79cd\u5f02\u5e38\u3002\u51fd\u6570\u80fd\u5904\u7406\u7684\u5f02\u5e38\u6709\u4ee5\u4e0b\u51e0\u7c7b\uff1a<\/p>\n<ul>\n<li>\n<p>ESR_EL2_EC_WFX: WF* \u7c7b\u6307\u4ee4\uff0c\u8bbe\u7f6e RecExit \u7684 ESR \u503c\u4e3a\u8bfb\u53d6\u7684 EL2 \u7684 ESR \u503c\uff0cPC \u66f4\u65b0\u5230\u4e0b\u4e00\u6761\u6307\u4ee4\u540e\uff0c\u9700\u8981 REC_EXIT\u3002<\/p>\n<\/li>\n<li>\n<p>ESR_EL2_EC_HVC: Realm \u6267\u884c\u4e86 HVC \u6307\u4ee4\uff0c\u8c03\u7528 <code>realm_inject_undef_abort()<\/code> \u51fd\u6570\uff0c\u6ce8\u5165\u5f02\u5e38\u5e76\u8fd4\u56de\u5230 Realm \u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p>ESR_EL2_EC_SMC: Realm \u6709 RSI \u8bf7\u6c42\uff0c\u8c03\u7528 <code>handle_realm_rsi()<\/code> \u51fd\u6570\u8fdb\u884c\u5904\u7406\uff0c\u5e76\u7531\u8be5\u51fd\u6570\u51b3\u5b9a\u662f\u5426\u9700\u8981 REC_EXIT\u3002<\/p>\n<\/li>\n<li>\n<p>ESR_EL2_EC_SYSREG: Realm \u5728\u5c1d\u8bd5\u8bfb\u53d6\u5bc4\u5b58\u5668\uff0c\u8c03\u7528 <code>handle_sysreg_access_trap()<\/code> \u5904\u7406\uff0c\u5e76\u7531\u8be5\u51fd\u6570\u51b3\u5b9a\u662f\u5426\u9700\u8981 REC_EXIT\u3002\u8fd4\u56de\u65f6\u9700\u8981\u5c06 PC \u503c\u8bbe\u7f6e\u4e3a\u4e0b\u4e00\u6761\u6307\u4ee4\u7684 PC \u7684\u5730\u5740\u3002<\/p>\n<\/li>\n<li>\n<p>ESR_EL2_EC_INST_ABORT \/ ESR_EL2_EC_DATA_ABORT: \u6307\u4ee4\u548c\u6570\u636e\u7684\u8bbf\u95ee\u5f02\u5e38\uff0c\u5206\u522b\u8c03\u7528 <code>handle_inst_abort()<\/code> \u548c <code>handle_data_abort()<\/code> \u51fd\u6570\u8fdb\u884c\u5904\u7406\uff0c\u5e76\u7531\u8fd9\u4e24\u4e2a\u51fd\u6570\u51b3\u5b9a\u662f\u5426\u9700\u8981 REC_EXIT\u3002<\/p>\n<\/li>\n<li>\n<p>ESR_EL2_EC_FPU \/ ESR_EL2_EC_SVE \/ ESR_EL2_EC_SME: SIMD \u76f8\u5173\u5f02\u5e38\uff0c\u4ea4\u7ed9 <code>handle_simd_exception()<\/code> \u51fd\u6570\u5904\u7406\u5e76\u51b3\u5b9a\u662f\u5426\u9700\u8981 REC_EXIT\u3002\u8be5\u5f02\u5e38\u6211\u4eec\u5e94\u8be5\u6682\u65f6\u4e0d\u9700\u8981\u4e86\u89e3\u3002<\/p>\n<\/li>\n<li>\n<p>\u5176\u4ed6\u5f02\u5e38\uff1a\u672a\u88ab\u5b9a\u4e49\u7684\u5f02\u5e38\uff0c\u9700\u8981 REC_EXIT\u3002<\/p>\n<\/li>\n<\/ul>\n<h3 class=\"atx\" id=\"21-\u5f02\u5e38\u6ce8\u5165\">2.1 \u5f02\u5e38\u6ce8\u5165<\/h3>\n<p>\u5728 <code>rmm\/runtime\/core\/inject-exp.c<\/code> \u4e2d\uff0c\u5b9e\u73b0\u4e86\u51e0\u4e2a\u5f02\u5e38\u6ce8\u5165\u7684\u51fd\u6570\uff1a<\/p>\n<ul>\n<li>\n<p><code>inject_sync_idabort()<\/code><\/p>\n<\/li>\n<li>\n<p><code>inject_sync_idabort_rec()<\/code><\/p>\n<\/li>\n<li>\n<p><code>realm_inject_undef_abort()<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u524d\u4e24\u4e2a\u4e3b\u8981\u533a\u522b\u5728\u4e8e\uff0c\u662f\u5426\u6307\u5b9a\u4e86\u6ce8\u5165\u5f02\u5e38\u7684\u5bf9\u8c61 REC\u3002\u6211\u4eec\u8fd9\u91cc\u66f4\u5173\u6ce8\u6700\u540e\u4e00\u4e2a\uff0c\u56e0\u4e3a\u5728 <span class=\"katex\"><span class=\"katex-mathml\"><\/span><span aria-hidden=\"true\" class=\"katex-html\"><span class=\"base\"><span style=\"height:0.8889em;vertical-align:-0.1944em;\" class=\"strut\"><\/span><span class=\"mord\">\u00b62<\/span><\/span><\/span><\/span> \u4e2d\u63d0\u5230\u4e86\u5b83\u3002\u4f46\u8fd9\u4e09\u8005\u53c8\u975e\u5e38\u7684\u76f8\u4f3c\uff0c\u6d89\u53ca\u7684\u4e3b\u8981\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\n<p>\u8bfb\u53d6 EL2 \u7684 ESR \/ ELR \u5bc4\u5b58\u5668\u503c\u548c\u8bfb\u53d6 EL12 \u7684 SPSR \/ VBAR \u5bc4\u5b58\u5668\u7684\u503c\u3002<\/p>\n<\/li>\n<li>\n<p>\u6839\u636e ESR \u548c SPSR \u7684\u503c\uff0c\u4ece VBAR \u4e2d\u5f97\u5230\u76f8\u5e94\u5f02\u5e38\u5904\u7406\u51fd\u6570\u7684\u5730\u5740\uff0c\u8fd9\u91cc\u5b9a\u4e49\u4e3a <span class=\"katex\"><span class=\"katex-mathml\"><\/span><span aria-hidden=\"true\" class=\"katex-html\"><span class=\"base\"><span style=\"height:0.8333em;vertical-align:-0.15em;\" class=\"strut\"><\/span><span class=\"mord\"><span style=\"margin-right:0.07847em;\" class=\"mord mathnormal\">I<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span style=\"height:0.1514em;\" class=\"vlist\"><span style=\"top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;\"><span style=\"height:2.7em;\" class=\"pstrut\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\">a<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span style=\"height:0.15em;\" class=\"vlist\"><span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u3002<\/p>\n<\/li>\n<li>\n<p>\u8ba1\u7b97 PSTATE \u7684\u503c\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06 ELR \/ ESR \/ SPSR \u7684\u503c\u5199\u5165\u5230 EL12 \u76f8\u5e94\u7684\u5bc4\u5b58\u5668\u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06 <span class=\"katex\"><span class=\"katex-mathml\"><\/span><span aria-hidden=\"true\" class=\"katex-html\"><span class=\"base\"><span style=\"height:0.8333em;vertical-align:-0.15em;\" class=\"strut\"><\/span><span class=\"mord\"><span style=\"margin-right:0.07847em;\" class=\"mord mathnormal\">I<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span style=\"height:0.1514em;\" class=\"vlist\"><span style=\"top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;\"><span style=\"height:2.7em;\" class=\"pstrut\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\">a<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span style=\"height:0.15em;\" class=\"vlist\"><span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span> \u5199\u5165\u5230 EL2 \u7684 ELR \u5bc4\u5b58\u5668\u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06 PSTATE \u503c\u5199\u5165\u5230 EL2 \u7684 SPSR \u5bc4\u5b58\u5668\u4e2d\u3002<\/p>\n<\/li>\n<\/ol>\n<h3 class=\"atx\" id=\"22-rsi-\u76f8\u5173\u8bf7\u6c42\u5904\u7406\">2.2 RSI \u76f8\u5173\u8bf7\u6c42\u5904\u7406<\/h3>\n<p><code>handle_realm_rsi()<\/code> \u51fd\u6570\u5728 <code>rmm\/runtime\/core\/exit.c<\/code> \u4e2d\u5b9e\u73b0\u3002\u51fd\u6570\u5148\u4ece REC \u4e2d\u7684 X0 \u5bc4\u5b58\u5668\u8bfb\u53d6 RSI \u529f\u80fd\u7f16\u53f7\uff0c\u5e76\u6839\u636e\u8be5\u529f\u80fd\u7f16\u53f7\u6267\u884c\u76f8\u5e94 RSI \u7684\u670d\u52a1\u51fd\u6570\u3002<\/p>\n<h3 class=\"atx\" id=\"23-\u5bc4\u5b58\u5668\u8bfb\u5199\u5904\u7406\">2.3 \u5bc4\u5b58\u5668\u8bfb\u5199\u5904\u7406<\/h3>\n<p><code>handle_sysreg_access_trap()<\/code> \u51fd\u6570\u5728 <code>rmm\/runtime\/core\/sysregs.c<\/code> \u4e2d\u5b9e\u73b0\u3002\u51fd\u6570\u5148\u4ece EL2 \u7684 ESR \u5bc4\u5b58\u5668\u4e2d\u8bfb\u53bb\u8981\u8bbf\u95ee\u7684 sysreg \u7684\u7f16\u53f7 <span class=\"katex\"><span class=\"katex-mathml\"><\/span><span aria-hidden=\"true\" class=\"katex-html\"><span class=\"base\"><span style=\"height:0.6151em;\" class=\"strut\"><\/span><span style=\"margin-right:0.02778em;\" class=\"mord mathnormal\">r<\/span><span class=\"mord mathnormal\">t<\/span><\/span><\/span><\/span> \u548c\u63a9\u7801 <span class=\"katex\"><span class=\"katex-mathml\"><\/span><span aria-hidden=\"true\" class=\"katex-html\"><span class=\"base\"><span style=\"height:0.6944em;\" class=\"strut\"><\/span><span class=\"mord mathnormal\">ma<\/span><span class=\"mord mathnormal\">s<\/span><span style=\"margin-right:0.03148em;\" class=\"mord mathnormal\">k<\/span><\/span><\/span><\/span>\u3002\u6839\u636e <span class=\"katex\"><span class=\"katex-mathml\"><\/span><span aria-hidden=\"true\" class=\"katex-html\"><span class=\"base\"><span style=\"height:0.6944em;\" class=\"strut\"><\/span><span class=\"mord mathnormal\">ma<\/span><span class=\"mord mathnormal\">s<\/span><span style=\"margin-right:0.03148em;\" class=\"mord mathnormal\">k<\/span><\/span><\/span><\/span> \u8df3\u8f6c\u76f8\u5e94\u7684\u5904\u7406\u51fd\u6570\u8fdb\u884c\u5904\u7406\uff08\u4e3b\u8981\u662f\u8bbf\u95ee\u865a\u62df\u4e2d\u65ad\u76f8\u5173\u5bc4\u5b58\u5668\uff0c\u5982 ICC\uff09\uff0c\u5e76\u51b3\u5b9a\u662f\u5426\u9700\u8981 REC_EXIT\u3002\u5176\u4ed6\u60c5\u51b5\uff0c\u89c6\u4e3a RAZ \u548c WI\uff0c\u8fd4\u56de\u5230 Realm \u4e2d\u3002<\/p>\n<h3 class=\"atx\" id=\"24-\u6307\u4ee4\u548c\u6570\u636e\u5f02\u5e38\">2.4 \u6307\u4ee4\u548c\u6570\u636e\u5f02\u5e38<\/h3>\n<p><code>handle_inst_abort()<\/code> \u548c <code>handle_data_abort<\/code> \u51fd\u6570\u5747\u5728 <code>rmm\/runtime\/core\/exit.c<\/code> \u4e2d\u5b9e\u73b0\u3002\u4e24\u8005\u90fd\u5148\u901a\u8fc7 <code>handle_sync_external_abort()<\/code> \u51fd\u6570\u5224\u65ad\u662f\u4e0d\u662f SEA\u3002\u5982\u679c\u662f\uff0c\u5c31\u76f4\u63a5 REC_EXIT\u3002<\/p>\n<p>\u5bf9\u4e8e\u6307\u4ee4\u5f02\u5e38\uff0c\u5219\u5224\u65ad\u662f\u5426\u5b58\u5728\u5185\u5b58\u8d8a\u754c\u3001\u8bbf\u95ee\u672a\u4fdd\u62a4\u7684 IPA \u4ea6\u6216\u8005\u662f RIPAS \u4e3a EMPTY \u7684\u60c5\u51b5\u3002\u5982\u679c\u662f\uff0c\u5219\u901a\u8fc7 <code>inject_sync_idabort()<\/code> \u51fd\u6570\u6ce8\u5165\u5f02\u5e38\uff0c\u4ea4\u7ed9 Realm \u8fdb\u884c\u5904\u7406\u3002<\/p>\n<p>\u5bf9\u4e8e\u6570\u636e\u5f02\u5e38\uff0c\u5219\u5224\u65ad\u662f\u5426\u5b58\u5728\u5185\u5b58\u8d8a\u754c\u6216\u8005\u662f RIPAS \u4e3a EMPTY \u7684\u60c5\u51b5\u3002\u5982\u679c\u662f\uff0c\u5219\u901a\u8fc7 <code>inject_sync_idabort()<\/code> \u51fd\u6570\u6ce8\u5165\u5f02\u5e38\uff0c\u4ea4\u7ed9 Realm \u8fdb\u884c\u5904\u7406\u3002<\/p>\n<p>\u5bf9\u4e8e\u5176\u4ed6\u60c5\u51b5\uff0c\u89c6\u4e3a\u672a\u5b9a\u4e49\u7684\u5f02\u5e38\u3002\u5c06\u76f8\u5173\u7684\u8bbf\u95ee\u4fe1\u606f\u5199\u5165\u5230 RecExit \u7ed3\u6784\u4f53\u4e2d\uff0c\u901a\u8fc7 REC_EXIT\uff0c\u4ea4\u7ed9\u666e\u901a\u73af\u5883\u4e2d\u7684 Host \u5904\u7406\u3002<\/p>\n<h2 class=\"atx\" id=\"3-irq-\u548c-fiq-\u7684\u5904\u7406\">3 IRQ \u548c FIQ \u7684\u5904\u7406<\/h2>\n<p>\u867d\u7136 IRQ \u63d0\u4f9b\u4e86 <code>handle_exception_irq_lel()<\/code> \u51fd\u6570\uff0c\u4f46\u548c FIQ \u6ca1\u6709\u4efb\u4f55\u533a\u522b\u3002\u5206\u522b\u628a RecExit \u4e2d\u7684\u9000\u51fa\u539f\u56e0\u8bbe\u7f6e\u6210 RMI_EXIT_IRQ \u548c RMI_EXIT_FIQ \u540e REC_EXIT\uff0c\u7531\u666e\u901a\u73af\u5883\u4e2d\u7684 Host \u6ce8\u5165\u865a\u62df\u4e2d\u65ad\u3002\u81f3\u4e8e\u865a\u62df\u4e2d\u65ad\u5982\u4f55\u53cd\u9988\u7ed9 Realm\uff0c\u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u4e2d\u6709\u4ecb\u7ecd\u3002<\/p>\n<h2 class=\"atx\" id=\"4-serror-\u7684\u5904\u7406\">4 SERROR \u7684\u5904\u7406<\/h2>\n<p><code>handle_exception_serror_lel()<\/code> \u51fd\u6570\u5728 <code>rmm\/runtime\/core\/exit.c<\/code> \u4e2d\u5b9e\u73b0\u3002\u51fd\u6570\u5148\u8bfb\u53d6 EL2 \u7684 ESR \u5bc4\u5b58\u5668\uff0c\u5224\u65ad SERROR \u7684\u7c7b\u578b\uff1a<\/p>\n<ul>\n<li>\n<p>\u5982\u679c\u662f\u672a\u5b9e\u73b0\u6216\u8005\u662f\u672a\u5b9a\u4e49\u7684 SERROR\uff0c\u76f4\u63a5\u8ba9\u7cfb\u7edf\u5d29\u6e83\uff0c\u505c\u6b62\u8fd0\u884c\u3002<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u662f ESR_EL2_SERROR_AET_UEU (Unrecoverable RAS Error) \u548c ESR_EL2_SERROR_UER (Recoverable RAS Error)\uff0c\u5219\u8c03\u7528 <code>inject_serror()<\/code> \u51fd\u6570\u5411 Realm \u6ce8\u5165\u5f02\u5e38\uff0c\u8fd9\u6837\u53ef\u4ee5\u8ba9 Realm \u4e2d\u8fd0\u884c\u7684\u7cfb\u7edf\u5173\u673a\u3002\u5c06 ESR \u5bc4\u5b58\u5668\u7684\u503c\u5199\u5165\u5230 RecExit \u4e2d\uff0c\u544a\u8bc9\u666e\u901a\u73af\u5883\u4e2d\u7684 Host \u6709\u5173\u8be5\u5f02\u5e38\u7684\u4fe1\u606f\u3002<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u662f ESR_EL2_SERROR_AET_CE (Corrected RAS Error) \u548c ESR_EL2_SERROR_UEO (Restartable RAS Error)\uff0c\u5219\u5c06 ESR \u5bc4\u5b58\u5668\u7684\u503c\u5230 RecExit \u4e2d\uff0c\u544a\u8bc9\u666e\u901a\u73af\u5883\u4e2d\u7684 Host \u6709\u5173\u8be5\u5f02\u5e38\u7684\u4fe1\u606f\u3002<\/p>\n<\/li>\n<li>\n<p>\u4ee5\u4e0a\u4e24\u8005\u90fd\u9700\u8981 REC_EXIT\u3002\u5bf9\u4e8e\u5176\u4ed6 SERROR\uff0c\u76f4\u63a5\u8ba9\u7cfb\u7edf\u5d29\u6e83\u3002<\/p>\n<\/li>\n<\/ul>\n<p><code>inject_serror()<\/code> \u51fd\u6570\u5728 <code>rmm\/runtime\/core\/run.c<\/code> \u4e2d\u5b9e\u73b0\uff0c\u5c06 ESR \u4fe1\u606f\u8bbe\u7f6e\u5230 REC \u7684 serror_info \u57df\u4e2d\u3002<\/p>\n<hr>\n<p>\u4ee5\u4e0a\u5c31\u662f Linaro RMM \u7684\u5f02\u5e38\u5904\u7406\u90e8\u5206\u3002\u6e90\u4ee3\u7801\u4e2d\u4e5f\u6709\u5f88\u591a\u7684 TODO\uff0c\u76f8\u5f53\u4e00\u90e8\u5206\u7684\u529f\u80fd\u8fd8\u6ca1\u6709\u5b9e\u73b0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linaro RMM \u7684\u5f02\u5e38\u5904\u7406\u90e8\u5206\u4ee3\u7801\u89e3\u6790\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[8],"class_list":["post-257","post","type-post","status-publish","format-standard","hentry","category-os","tag-cca"],"_links":{"self":[{"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":0,"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yewpo.top\/index.php\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}