Skip to content

B4/pmu event info v3 - #6

Open
atishp04 wants to merge 10 commits into
masterfrom
b4/pmu_event_info_v3
Open

atishp04 wants to merge 10 commits into
masterfrom
b4/pmu_event_info_v3

Conversation

@atishp04

@atishp04 atishp04 commented May 22, 2025 •

Copy link
Copy Markdown
Owner

Summary by Sourcery

Support the SBI v3 PMU event info extension with extended raw event widths and integrate it into KVM with proper guest memory validation

New Features:

  • Add SBI v3 PMU event info support via pmu_sbi_check_event_info and riscv_pmu_get_event_info to query firmware for available events
  • Extend raw PMU event encoding to 56 bits for SBI v3 with new masks (RISCV_PMU_RAW_EVENT_V2_MASK) and index (RISCV_PMU_RAW_EVENT_V2_IDX)
  • Introduce KVM SBI v3 PMU event info handler (kvm_riscv_vcpu_pmu_event_info) and expose SBI_EXT_PMU_EVENT_GET_INFO in KVM

Enhancements:

  • Add sbi_v3_available flag and conditionally use v3-specific event probing
  • Simplify pmu_sbi_event_map by delegating to riscv_pmu_get_event_info
  • Add kvm_vcpu_validate_gpa_range helper and replace direct GPA-to-HVA checks in KVM PMU/SBI handlers
  • Update KVM SBI version to 3.0 and add new SBI PMU extension ID for event info

Summary by CodeRabbit

  • New Features

    • Added support for SBI PMU version 3.0, including extended event configuration and new event types.
    • Introduced the ability to query information for multiple PMU events in bulk.
    • Enhanced PMU event mapping and validation for improved compatibility and accuracy.
  • Bug Fixes

    • Improved validation of guest physical address ranges and permissions for memory operations.
  • Refactor

    • Simplified and centralized event info retrieval and address validation logic for better maintainability.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants