Commit bb857c5
iommu/arm-smmu-v3: Make domain_alloc_paging_flags() directly determine the S1/S2
The selection of S1/S2 is a bit indirect today, make
domain_alloc_paging_flags() directly decode the flags and select the
correct S1/S2 type.
Directly reject flag combinations the HW doesn't support when processing
the flags.
Fix missing rejection of some flag combinations that are not supported
today (ie NEST_PARENT | DIRTY_TRACKING) by using a switch statement to
list out exactly the combinations that are currently supported.
Move the determination of the stage out of arm_smmu_domain_finalise() and
into both callers. As today the default stage is S1 if supported in HW.
This makes arm_smmu_domain_alloc_paging_flags() self contained and no
longer calling arm_smmu_domain_alloc_paging().
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/2-v1-0bb8d5313a27+27b-smmuv3_paging_flags_jgg@nvidia.com
Signed-off-by: Will Deacon <will@kernel.org>1 parent 48e7b8e commit bb857c5
1 file changed
Lines changed: 30 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2481 | 2481 | | |
2482 | 2482 | | |
2483 | 2483 | | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
2484 | 2489 | | |
2485 | 2490 | | |
2486 | 2491 | | |
| |||
2554 | 2559 | | |
2555 | 2560 | | |
2556 | 2561 | | |
2557 | | - | |
2558 | | - | |
2559 | | - | |
2560 | | - | |
2561 | | - | |
2562 | | - | |
2563 | 2562 | | |
2564 | 2563 | | |
2565 | 2564 | | |
| |||
3231 | 3230 | | |
3232 | 3231 | | |
3233 | 3232 | | |
| 3233 | + | |
3234 | 3234 | | |
3235 | 3235 | | |
3236 | 3236 | | |
| |||
3242 | 3242 | | |
3243 | 3243 | | |
3244 | 3244 | | |
3245 | | - | |
3246 | | - | |
3247 | | - | |
3248 | 3245 | | |
3249 | 3246 | | |
3250 | 3247 | | |
3251 | 3248 | | |
3252 | | - | |
3253 | | - | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
3254 | 3259 | | |
3255 | 3260 | | |
3256 | 3261 | | |
3257 | 3262 | | |
3258 | 3263 | | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
3259 | 3277 | | |
3260 | 3278 | | |
3261 | 3279 | | |
3262 | 3280 | | |
3263 | | - | |
| 3281 | + | |
3264 | 3282 | | |
3265 | 3283 | | |
3266 | 3284 | | |
| |||
0 commit comments