Privileged API Hardware Access Bypassing Kernel Traps

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing operating systems incur excessive overhead and decreased processing efficiency due to frequent switching between user and kernel modes when user programs access hardware resources, necessitating a method to reduce these overheads.

Innovation Solution

Configuring permission for privileged instructions to allow direct access to hardware resources without kernel trapping, using a privileged API in user mode that encapsulates these instructions, and executing them based on kernel permission and policy determination.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If user programs call APIs to access hardware resources through the existing operating system kernel interface, then hardware access can be performed with kernel management and control, but frequent switching between user space and kernel mode increases system overhead and decreases processing efficiency

Engineering Contradiction:
Improvekernel management controlVSAvoidprocessing efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the hardware access path into two parts: privileged instructions that can be executed directly in user space (with configured permissions) and kernel management functions that handle higher-level operations. This segmentation allows frequent hardware accesses to bypass the kernel, reducing mode switching overhead while maintaining kernel control for critical operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces privileged instructions as an intermediary mechanism between user programs and hardware resources. These instructions are configured with special permissions allowing direct hardware access from user space, acting as a mediator that eliminates the need for frequent kernel mode transitions while still providing controlled hardware access.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If privileged instructions are configured to allow direct user mode access to hardware resources, then system overhead is reduced and processing efficiency improves, but system security and access control may be compromised

Engineering Contradiction:
Improveprocessing efficiencyVSAvoidsystem security
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent applies local quality by configuring permissions selectively for specific privileged instructions rather than granting universal access. Each privileged instruction can be individually enabled or disabled based on security requirements, allowing direct hardware access for approved instructions while maintaining security controls for others.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent changes the permission parameters of privileged instructions through configuration mechanisms. By modifying the permission state of specific privileged instructions, the system enables direct user-mode access for authorized instructions while maintaining security restrictions for unauthorized ones, thus balancing efficiency and security.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentEP3035192B1Method and device for hardware resource access
Publication Date: 2020.03.11 HUAWEI TECH CO LTD
  • EP3035192B1 patent drawingFigure 1
  • EP3035192B1 patent drawingFigure 2
  • EP3035192B1 patent drawingFigure 3~4

AI summary

Embodiments of the present invention provide a method and an apparatus for accessing a hardware resource, and an operating system. The method of the present invention includes: configuring permission for one or more privileged instructions that are used for hardware access, so that when the one or more privileged instructions are used by a user mode application program, the application program can access a hardware resource without trapping into a kernel, where the application program calls, at a code level, a privileged application programming interface API that is in user mode and has the one or more privileged instructions encapsulated therein; and executing the one or more privileged instructions that are encapsulated in the privileged API that is called at the code level by the application program, so that the application program can access the hardware resource without trapping into the kernel. In the embodiments of the present invention, a privileged instruction for direct access to a hardware resource is set and encapsulated into an API, which is deployed in user space, so as to reduce system overheads for accessing the hardware resource and improve processing efficiency.