On Fri, Mar 6, 2026 at 1:14 PM Peter Maydell <[email protected]> wrote:
>
> On Fri, 6 Mar 2026 at 10:19, Mohamed Mediouni <[email protected]> 
> wrote:
> > > On 6. Mar 2026, at 11:05, Manos Pitsidianakis 
> > > <[email protected]> wrote:
> > >
> > > On Fri, Mar 6, 2026 at 11:48 AM Peter Maydell <[email protected]> 
> > > wrote:
> > >> While you're retesting, could you also look at / test patches
> > >> 17 and 18 in Mohamed's series
> > >> https://lore.kernel.org/qemu-devel/[email protected]/T/#m2d1e3dfbfa5aecd41af6c0aa9e3b574a72c6f04d
> > >>
> > >> ?
> > >>
> > >> They look to me like bugfixes that we should be squashing/including
> > >> in the "enable SME2 for hvf" handling.
> > >
> > > Had a quick look, 17 seems to be nested-virt specific so not a bugfix
> > > if nested-virt was not already supported in the first place, right?
> >
> > Hello,
> >
> > This part isn’t:
> >
> > @@ -1370,16 +1373,22 @@ int hvf_arch_init_vcpu(CPUState *cpu)
> > arm_cpu->cpreg_indexes[sregs_cnt++] = kvm_id;
> > }
> > }
> > - if (__builtin_available(macOS 15.2, *)) {
> > - for (i = 0; i < ARRAY_SIZE(hvf_sreg_list_sme2); i++) {
> > - hv_sys_reg_t hvf_id = hvf_sreg_list_sme2[i].sreg;
> > - uint64_t kvm_id = HVF_TO_KVMID(hvf_id);
> > - uint32_t key = kvm_to_cpreg_id(kvm_id);
> > - const ARMCPRegInfo *ri = get_arm_cp_reginfo(arm_cpu->cp_regs, key);
> > -
> > - if (ri) {
> > - assert(!(ri->type & ARM_CP_NO_RAW));
> > - arm_cpu->cpreg_indexes[sregs_cnt++] = kvm_id;
> > + if (hvf_arm_sme2_supported()) {
> > + /*
> > + * Clang doesn't allow us to combine the two checks together.
> > + * -Wunsupported-availability-guard
> > + */
> > + if (__builtin_available(macOS 15.2, *)) {
> > + for (i = 0; i < ARRAY_SIZE(hvf_sreg_list_sme2); i++) {
> > + hv_sys_reg_t hvf_id = hvf_sreg_list_sme2[i].sreg;
> > + uint64_t kvm_id = HVF_TO_KVMID(hvf_id);
> > + uint32_t key = kvm_to_cpreg_id(kvm_id);
> > + const ARMCPRegInfo *ri = get_arm_cp_reginfo(arm_cpu->cp_regs, key);
> > +
> > + if (ri) {
> > + assert(!(ri->type & ARM_CP_NO_RAW));
> > + arm_cpu->cpreg_indexes[sregs_cnt++] = kvm_id;
> > + }
> > }
>
> Yes; the patch is doing two things and really ought to be two patches,
> so we can put the bit that we need for "make SME2 hvf work correctly"
> before the "enable SME2 HVF" patch, and the bit that is nested-virt
> specific in the nested-virt patches.
>

Patch v18 needs an adjustment, because clang prints warnings about the
`static const struct sme_isar_regs` array.


../target/arm/hvf/hvf.c:1098:11: warning:
'HV_FEATURE_REG_ID_AA64SMFR0_EL1' is only available on macOS 15.2 or
newer [-Wunguarded-availability-new]

Peter,

Maybe I should send a new revision since you haven't merged these
patches anyway?

> thanks
> -- PMM

-- 
Manos Pitsidianakis
Emulation and Virtualization Engineer at Linaro Ltd

Reply via email to