Processor Mode Switching via Kernel Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The overhead of system calls in modern processors, which can become a bottleneck due to faster memory technologies, and lead to pipeline stalls and reduced processor throughput, as they do not provide enough information for pipelining and degrade performance when user processes need to access kernel services.

Innovation Solution

The solution involves mapping privileged functions into the address space of user programs using a security bit in the page table entry, allowing the processor to switch directly to kernel mode without a system call, thereby reducing the need for conventional system calls and improving pipelining predictability.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If system calls are used to access kernel services from user mode, then security is maintained through privilege separation, but processor throughput decreases due to pipeline stalls and execution overhead

Engineering Contradiction:
Improvesystem securityVSAvoidprocessor throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent pre-positions kernel mode code within the user process address space at known locations, and pre-configures the processor with the address of kernel mode switch code in a system register. This preliminary arrangement eliminates the need for runtime system call overhead, allowing direct jumps to kernel mode while maintaining security through controlled access paths.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces kernel mode switch code as an intermediary mechanism that facilitates transitions between user mode and kernel mode. This switch code acts as a mediator that enables direct mode switching without traditional system calls, reducing pipeline stalls while maintaining the security boundary through controlled entry points.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If traditional system calls are used for mode switching, then security boundaries are enforced, but execution time increases by several hundred nanoseconds

Engineering Contradiction:
Improvesecurity boundary enforcementVSAvoidmode switching time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system pre-configures the address of kernel mode switch code in a system register during initialization, and pre-positions kernel mode code within user process address space. This eliminates runtime overhead for address resolution and enables direct jumps to kernel mode, reducing mode switching time from hundreds of nanoseconds to minimal latency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent segments the mode switching process into distinct components: user mode code, kernel mode switch code, and kernel mode code. Each segment has a specific function and location, allowing efficient direct jumps between segments without traversing the entire system call chain, thus reducing transition time while maintaining security boundaries.

Inventive Principle:
Principle #1Segmentation

3Reliability

If system calls are used to request kernel services, then privilege separation is maintained, but pipelining performance degrades due to lack of prediction information

Engineering Contradiction:
Improveprivilege separationVSAvoidpipelining throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The processor is pre-configured with the address of kernel mode switch code in a system register, and kernel mode code locations are pre-determined within user process address space. This preliminary information provides the pipeline with predictable branch targets, enabling better instruction prefetching and reducing pipeline stalls caused by unpredictable system call transitions.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent changes the fundamental parameter of mode switching from using register-based system call information to using pre-configured address-based direct jumps. This parameter change provides the processor pipeline with deterministic control flow information, improving prediction accuracy and maintaining privilege separation through controlled access paths.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentEP3828708B1Method and system for controlling a switch in the execution mode of a processor
Publication Date: 2024.04.24 JOHANNES GUTENBERG UNIV
  • EP3828708B1 patent drawingFigure 1
  • EP3828708B1 patent drawingFigure 2
  • EP3828708B1 patent drawingFigure 3

AI summary

Summarizing the invention, a computer-implemented method is provided. The computer-implemented method comprises: allocating, by an operating system kernel, a physical memory block for a privileged function; storing, by the operating system kernel, the privileged function in the physical memory block; creating, by the operating system kernel, an entry for the physical memory block in a mapping table, wherein the entry associates the physical memory block to a virtual memory block in an address space of a program; setting, by the operating system kernel, a security bit for the entry in the mapping table; executing, by a processor, the program in unprivileged mode; and if the program requests the privileged function: checking, by the processor, whether the security bit is set; if the security bit is set, switching, by the processor, execution to kernel mode for performing the privileged function.