Skip to content

Map L2CFG region to tlb - #85

Draft
zbelinsk wants to merge 5 commits into
masterfrom
fast-l2vic
Draft

Map L2CFG region to tlb#85
zbelinsk wants to merge 5 commits into
masterfrom
fast-l2vic

Conversation

@zbelinsk

Copy link
Copy Markdown
Contributor
  • Add pinned TLB entry for L2 config
  • Refactor getxreg/setxreg to use permanent VA instead of tmpmap
  • Add SIZE_*_MASK macros for page offset extraction

- Add pinned TLB entry for L2 config
- Refactor getxreg/setxreg to use permanent VA instead of tmpmap
- Add SIZE_*_MASK macros for page offset extraction

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
@github-actions github-actions Bot added the untested Mark untested PRs label Jul 27, 2026
@zbelinsk zbelinsk changed the title Map L2CFG region permanently to avoid per-call tmpmap overhead Map L2CFG region to tlb Jul 27, 2026
@zbelinsk
zbelinsk marked this pull request as draft July 27, 2026 15:06

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good overall. Should be ok to merge after requested changes.

Comment thread kernel/init/boot/boot.ref.S Outdated
Comment on lines +440 to +444
FROM = cfgbase
FROM = asl(FROM, #(CFG_TABLE_SHIFT - PHYSREAD_HI_SHIFT))
TO = #CFG_TABLE_L2REGS
TO = memw_phys(TO, FROM)
TO = asl(TO, #CFG_TABLE_SHIFT)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using FROM and TO here, how about defining CFG_* back to their regs:

#undef SYSCFG
#undef SIG_COUNT
#define CFG_IDX r8
#define CFG_HI r9

and then s/FROM/CFG_HI/g; s/TO/CFG_IDX/g

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Don't know why haven't done that at first.

Done.

Comment thread kernel/util/max/max.h Outdated
/* Hardware threads this build supports; never start or account beyond it. */
#define MAX_HTHREADS_MASK ((1U << MAX_HTHREADS) - 1)

#define L2CFG_BASE_VA 0xffb00000 // leaves at most 3M for tmpmap at 0xff800000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this at 0xffd00000? I think we should leave room to be able to tmpmap a 4M page.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Move L2CFG_BASE_VA to 0xffd00000 and ANGEL_VA to 0xffe00000.
Clarify boot.ref.S register names (FROM→CFG_HI, TO→L2_CFG_BASE).

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️ after minor fix

Comment thread kernel/util/max/max.h Outdated
#define DEVICE_PAGE_SIZE SIZE_1M

#define Q6_SS_BASE_VA 0xffc00000 // leaves at most 4M for tmpmap at 0xff800000
#define Q6_SS_BASE_VA 0xffc00000 // leaves at most 3M for tmpmap at 0xff800000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4M

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Signed-off-by: zbelinsk <zbelinsk@qti.qualcomm.com>
@zbelinsk

Copy link
Copy Markdown
Contributor Author

✔️ after minor fix

Do we want to merge now, or wait to simulate fast l2vic support?

@bryanb-h2

Copy link
Copy Markdown
Contributor

Ok to merge.

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

Labels

untested Mark untested PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants