Skip to content

Commit 8cba6c8

Browse files
author
Marc Zyngier
committed
Merge branch kvm-arm64/52bit-at into kvmarm-master/next
* kvm-arm64/52bit-at: : . : Upgrade the S1 page table walker to support 52bit PA, and use it to : report the fault level when taking a S2 fault on S1PTW, which is required : by the architecture (20250915114451.660351-1-maz@kernel.org). : . KVM: arm64: selftest: Expand external_aborts test to look for TTW levels KVM: arm64: Populate level on S1PTW SEA injection KVM: arm64: Add S1 IPA to page table level walker KVM: arm64: Add filtering hook to S1 page table walk KVM: arm64: Don't switch MMU on translation from non-NV context KVM: arm64: Allow EL1 control registers to be accessed from the CPU state KVM: arm64: Allow use of S1 PTW for non-NV vcpus KVM: arm64: Report faults from S1 walk setup at the expected start level KVM: arm64: Expand valid block mappings to FEAT_LPA/LPA2 support KVM: arm64: Populate PAR_EL1 with 52bit addresses KVM: arm64: Compute shareability for LPA2 KVM: arm64: Pass the walk_info structure to compute_par_s1() KVM: arm64: Decouple output address from the PT descriptor KVM: arm64: Compute 52bit TTBR address and alignment KVM: arm64: Account for 52bit when computing maximum OA KVM: arm64: Add helper computing the state of 52bit PA support Signed-off-by: Marc Zyngier <maz@kernel.org>
2 parents 32314d9 + 00a3727 commit 8cba6c8

7 files changed

Lines changed: 374 additions & 112 deletions

File tree

arch/arm64/include/asm/kvm_nested.h

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,18 @@ static inline u64 decode_range_tlbi(u64 val, u64 *range, u16 *asid)
265265
return base;
266266
}
267267

268-
static inline unsigned int ps_to_output_size(unsigned int ps)
268+
static inline unsigned int ps_to_output_size(unsigned int ps, bool pa52bit)
269269
{
270270
switch (ps) {
271271
case 0: return 32;
272272
case 1: return 36;
273273
case 2: return 40;
274274
case 3: return 42;
275275
case 4: return 44;
276-
case 5:
276+
case 5: return 48;
277+
case 6: if (pa52bit)
278+
return 52;
279+
fallthrough;
277280
default:
278281
return 48;
279282
}
@@ -285,20 +288,36 @@ enum trans_regime {
285288
TR_EL2,
286289
};
287290

291+
struct s1_walk_info;
292+
293+
struct s1_walk_context {
294+
struct s1_walk_info *wi;
295+
u64 table_ipa;
296+
int level;
297+
};
298+
299+
struct s1_walk_filter {
300+
int (*fn)(struct s1_walk_context *, void *);
301+
void *priv;
302+
};
303+
288304
struct s1_walk_info {
305+
struct s1_walk_filter *filter;
289306
u64 baddr;
290307
enum trans_regime regime;
291308
unsigned int max_oa_bits;
292309
unsigned int pgshift;
293310
unsigned int txsz;
294311
int sl;
312+
u8 sh;
295313
bool as_el0;
296314
bool hpd;
297315
bool e0poe;
298316
bool poe;
299317
bool pan;
300318
bool be;
301319
bool s2;
320+
bool pa52bit;
302321
};
303322

304323
struct s1_walk_result {
@@ -334,6 +353,8 @@ struct s1_walk_result {
334353

335354
int __kvm_translate_va(struct kvm_vcpu *vcpu, struct s1_walk_info *wi,
336355
struct s1_walk_result *wr, u64 va);
356+
int __kvm_find_s1_desc_level(struct kvm_vcpu *vcpu, u64 va, u64 ipa,
357+
int *level);
337358

338359
/* VNCR management */
339360
int kvm_vcpu_allocate_vncr_tlb(struct kvm_vcpu *vcpu);

0 commit comments

Comments
 (0)