[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 07/16] hw/arm/smmuv3: Check validity of stage-2 page tabl
From: |
Mostafa Saleh |
Subject: |
Re: [RFC PATCH 07/16] hw/arm/smmuv3: Check validity of stage-2 page table |
Date: |
Thu, 16 Feb 2023 13:20:16 +0000 |
Hi Eric,
> > can have a valid page table as described in ARM ARM D8.2 Translation
> > process.
> > The idea is to see for the highest possible number of IPA bits, how
> > many concatenated tables we would need, if it is more than 16, then
> > this is not possible.
>
> This rather checks the validity and consistency of the STE S2 fields.
> The patch title sounds a bit misleading to me.
I will update the wording.
> > +static bool s2_pgtable_config_valid(uint8_t sl0, uint8_t t0sz, uint8_t
> > gran)
> > +{
> > + int level = get_start_level(sl0, gran);
> > + uint64_t ia_bits = 64 - t0sz;
> s/ia/ipa
I will update it.
> > + uint64_t mx = (1ULL << ia_bits) - 1;
> s/mx/max_ipa
I will update it.
> >
> > + if (!s2_pgtable_config_valid(cfg->s2cfg.sl0, cfg->s2cfg.tsz,
> > + cfg->s2cfg.granule_sz)) {
> > + qemu_log_mask(LOG_GUEST_ERROR,
> > + "SMMUv3 STE stage 2 config not valid!\n");
> > + goto bad_ste;
> > + }
> > +
> To me this would need to be integrated into the STE decoding patch. This
> latter shall be self-contained if possible to ease the review
I will squash it, I was trying to keep patches small, but it makes sense
to validate STE in the same patch parsing it.
Thanks,
Mostafa
- Re: [RFC PATCH 04/16] hw/arm/smmuv3: Add a system property to choose translation stage, (continued)
- [RFC PATCH 06/16] hw/arm/smmuv3: Parse STE config for stage-2, Mostafa Saleh, 2023/02/05
- [RFC PATCH 07/16] hw/arm/smmuv3: Check validity of stage-2 page table, Mostafa Saleh, 2023/02/05
- [RFC PATCH 08/16] hw/arm/smmuv3: Support S2AFFD, Mostafa Saleh, 2023/02/05
- [RFC PATCH 09/16] hw/arm/smmuv3: Don't touch CD if stage-1 is not supported., Mostafa Saleh, 2023/02/05
- [RFC PATCH 11/16] hw/arm/smmuv3: Read VMID from STE, Mostafa Saleh, 2023/02/05
- [RFC PATCH 13/16] hw/arm/smmuv3: Add CMDs related to stage 2, Mostafa Saleh, 2023/02/05
[RFC PATCH 10/16] hw/arm/smmuv3: Make TLB lookup work for stage-2, Mostafa Saleh, 2023/02/05