ANDROID: KVM: arm64: Remove struct kvm_cpu_context from the KMI

struct kvm_cpu_context pulls in a lot of KVM-internal types into the KMI
(struct kvm, struct kvm_vcpu, ...). None of these should be needed by
modules, so let's remove it from the KMI.

Bug: 357781595
Change-Id: I2302a9354721e5ef504a6c3e67d9bd4f17582ac8
Signed-off-by: Quentin Perret <qperret@google.com>
This commit is contained in:
Quentin Perret
2025-05-13 13:49:52 +00:00
committed by Carlos Llamas
parent 15bf9aa274
commit ef10b442e4
3 changed files with 7 additions and 7 deletions

View File

@@ -69,7 +69,7 @@ struct kvm_iommu_ops {
phys_addr_t (*iova_to_phys)(struct kvm_hyp_iommu_domain *domain, unsigned long iova);
void (*iotlb_sync)(struct kvm_hyp_iommu_domain *domain,
struct iommu_iotlb_gather *gather);
bool (*dabt_handler)(struct kvm_cpu_context *host_ctxt, u64 esr, u64 addr);
bool (*dabt_handler)(struct user_pt_regs *regs, u64 esr, u64 addr);
void (*host_stage2_idmap)(struct kvm_hyp_iommu_domain *domain,
phys_addr_t start, phys_addr_t end, int prot);
void (*host_stage2_idmap_complete)(bool map);

View File

@@ -609,7 +609,7 @@ bool kvm_iommu_host_dabt_handler(struct kvm_cpu_context *host_ctxt, u64 esr, u64
bool ret = false;
if (kvm_iommu_ops && kvm_iommu_ops->dabt_handler)
ret = kvm_iommu_ops->dabt_handler(host_ctxt, esr, addr);
ret = kvm_iommu_ops->dabt_handler(&host_ctxt->regs, esr, addr);
if (ret)
kvm_skip_host_instr();

View File

@@ -1503,7 +1503,7 @@ static phys_addr_t smmu_iova_to_phys(struct kvm_hyp_iommu_domain *domain,
}
static bool smmu_dabt_device(struct hyp_arm_smmu_v3_device *smmu,
struct kvm_cpu_context *host_ctxt,
struct user_pt_regs *regs,
u64 esr, u32 off)
{
bool is_write = esr & ESR_ELx_WNR;
@@ -1539,9 +1539,9 @@ static bool smmu_dabt_device(struct hyp_arm_smmu_v3_device *smmu,
if (!mask)
return false;
if (is_write)
writel_relaxed(cpu_reg(host_ctxt, rd) & mask, smmu->base + off);
writel_relaxed(regs->regs[rd] & mask, smmu->base + off);
else
cpu_reg(host_ctxt, rd) = readl_relaxed(smmu->base + off);
regs->regs[rd] = readl_relaxed(smmu->base + off);
return true;
}
@@ -1601,14 +1601,14 @@ static int smmu_dev_block_dma(struct kvm_hyp_iommu *iommu, u32 sid, bool is_host
return ret;
}
static bool smmu_dabt_handler(struct kvm_cpu_context *host_ctxt, u64 esr, u64 addr)
static bool smmu_dabt_handler(struct user_pt_regs *regs, u64 esr, u64 addr)
{
struct hyp_arm_smmu_v3_device *smmu;
for_each_smmu(smmu) {
if (addr < smmu->mmio_addr || addr >= smmu->mmio_addr + smmu->mmio_size)
continue;
return smmu_dabt_device(smmu, host_ctxt, esr, addr - smmu->mmio_addr);
return smmu_dabt_device(smmu, regs, esr, addr - smmu->mmio_addr);
}
return false;
}