Skip to content

Commit 3d72e6b

Browse files
committed
[BOLT] Fix stuck for x86 linux kernel 5.10
The paravirtualization of kernel will update function implementation at runtime. For funtions involving paravirtualization, mark them as non-optimizable at appropriate locations.
1 parent 7ab04d7 commit 3d72e6b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bolt/lib/Rewrite/LinuxKernelRewriter.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ class LinuxKernelRewriter final : public MetadataRewriter {
337337
/// Paravirtual instruction patch sites.
338338
Error readParaInstructions();
339339
Error rewriteParaInstructions();
340+
void processParaInstructionsPostCFG();
340341

341342
/// __bug_table section handling.
342343
Error readBugTable();
@@ -445,6 +446,7 @@ class LinuxKernelRewriter final : public MetadataRewriter {
445446
if (Error E = processORCPostCFG())
446447
return E;
447448

449+
processParaInstructionsPostCFG();
448450
processAltInstructionsPostCFG();
449451

450452
return Error::success();
@@ -1435,10 +1437,6 @@ Error LinuxKernelRewriter::readParaInstructions() {
14351437
}
14361438
}
14371439

1438-
// Disable output of functions with paravirtual instructions before the
1439-
// rewrite support is complete.
1440-
skipFunctionsWithAnnotation("ParaSite");
1441-
14421440
BC.outs() << "BOLT-INFO: parsed " << EntryID << " paravirtual patch sites\n";
14431441

14441442
return Error::success();
@@ -1461,6 +1459,12 @@ void LinuxKernelRewriter::skipFunctionsWithAnnotation(
14611459
}
14621460
}
14631461

1462+
void LinuxKernelRewriter::processParaInstructionsPostCFG() {
1463+
// Disable output of functions with paravirtual instructions before the
1464+
// rewrite support is complete.
1465+
skipFunctionsWithAnnotation("ParaSite");
1466+
}
1467+
14641468
Error LinuxKernelRewriter::rewriteParaInstructions() {
14651469
return Error::success();
14661470
}

0 commit comments

Comments
 (0)