Re: [PATCH v2] target/arm: Support PSCI 1.1 and SMCCC 1.0
On Fri, 25 Feb 2022 at 03:36, Akihiko Odaki wrote: > > On 2022/02/24 21:53, Peter Maydell wrote: > > On Sun, 13 Feb 2022 at 03:58, Akihiko Odaki wrote: > >> > >> Support the latest PSCI on TCG and HVF. A 64-bit function called from > >> AArch32 now returns NOT_SUPPORTED, which is necessary to adhere to SMC > >> Calling Convention 1.0. It is still not compliant with SMCCC 1.3 since > >> they do not implement mandatory functions. > >> > >> Signed-off-by: Akihiko Odaki > >> --- > > > > Applied, thanks. > > > > Please update the changelog at https://wiki.qemu.org/ChangeLog/7.0 > > for any user-visible changes. > > > > (I noticed while reviewing this that we report KVM's PSCI via > > the DTB as only 0.2 even if KVM's actually implementing better > > than that; I'll write a patch to clean that up.) > I don't have an account on https://wiki.qemu.org/ so can you create one? > I'll update the changelog once I get access to the account. Oops, I accidentally used my canned-email-reply for "applied a pull request" when I meant to use "applied a patch to target-arm.next". You don't need to update the changelog -- I'll do that when I next send a pull request for the arm tree and it gets merged. Sorry for the confusion. -- PMM
Re: [PATCH v2] target/arm: Support PSCI 1.1 and SMCCC 1.0
On 2022/02/24 21:53, Peter Maydell wrote: On Sun, 13 Feb 2022 at 03:58, Akihiko Odaki wrote: Support the latest PSCI on TCG and HVF. A 64-bit function called from AArch32 now returns NOT_SUPPORTED, which is necessary to adhere to SMC Calling Convention 1.0. It is still not compliant with SMCCC 1.3 since they do not implement mandatory functions. Signed-off-by: Akihiko Odaki --- Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.0 for any user-visible changes. (I noticed while reviewing this that we report KVM's PSCI via the DTB as only 0.2 even if KVM's actually implementing better than that; I'll write a patch to clean that up.) -- PMM I don't have an account on https://wiki.qemu.org/ so can you create one? I'll update the changelog once I get access to the account. Regards, Akihiko Odaki
Re: [PATCH v2] target/arm: Support PSCI 1.1 and SMCCC 1.0
On Thu, 24 Feb 2022 at 14:37, Akihiko Odaki wrote: > > Support the latest PSCI on TCG and HVF. A 64-bit function called from > AArch32 now returns NOT_SUPPORTED, which is necessary to adhere to SMC > Calling Convention 1.0. It is still not compliant with SMCCC 1.3 since > they do not implement mandatory functions. > > Signed-off-by: Akihiko Odaki You didn't need to repost this; I've already queued it. thanks -- PMM
Re: [PATCH v2] target/arm: Support PSCI 1.1 and SMCCC 1.0
On Thu, 24 Feb 2022 at 13:25, Peter Maydell wrote: > > On Sun, 13 Feb 2022 at 03:58, Akihiko Odaki wrote: > > > > Support the latest PSCI on TCG and HVF. A 64-bit function called from > > AArch32 now returns NOT_SUPPORTED, which is necessary to adhere to SMC > > Calling Convention 1.0. It is still not compliant with SMCCC 1.3 since > > they do not implement mandatory functions. > > > /* PSCI v0.2 return values used by TCG emulation of PSCI */ > > > > /* No Trusted OS migration to worry about when offlining CPUs */ > > #define QEMU_PSCI_0_2_RET_TOS_MIGRATION_NOT_REQUIRED2 > > > > -/* We implement version 0.2 only */ > > -#define QEMU_PSCI_0_2_RET_VERSION_0_2 2 > > +#define QEMU_PSCI_VERSION_0_1 0x1 > > +#define QEMU_PSCI_VERSION_0_2 0x2 > > +#define QEMU_PSCI_VERSION_1_1 0x10001 > > Just noticed that there's a minor issue with this change -- it > deletes the definition of QEMU_PSCI_0_2_RET_VERSION_0_2, but > it is still used below: > > > > > MISMATCH_CHECK(QEMU_PSCI_0_2_RET_TOS_MIGRATION_NOT_REQUIRED, > > PSCI_0_2_TOS_MP); > > MISMATCH_CHECK(QEMU_PSCI_0_2_RET_VERSION_0_2, > > here ^^ which means that this breaks compilation on Arm hosts. > > I'll squash in the fix: > > --- a/target/arm/kvm-consts.h > +++ b/target/arm/kvm-consts.h > @@ -98,8 +98,11 @@ MISMATCH_CHECK(QEMU_PSCI_1_0_FN_PSCI_FEATURES, > PSCI_1_0_FN_PSCI_FEATURES); > #define QEMU_PSCI_VERSION_1_1 0x10001 > > MISMATCH_CHECK(QEMU_PSCI_0_2_RET_TOS_MIGRATION_NOT_REQUIRED, > PSCI_0_2_TOS_MP); > -MISMATCH_CHECK(QEMU_PSCI_0_2_RET_VERSION_0_2, > +/* We don't bother to check every possible version value */ > +MISMATCH_CHECK(QEMU_PSCI_VERSION_0_2, > (PSCI_VERSION_MAJOR(0) | PSCI_VERSION_MINOR(2))); > +MISMATCH_CHECK(QEMU_PSCI_VERSION_1_1, > + (PSCI_VERSION_MAJOR(1) | PSCI_VERSION_MINOR(1))); Ha, turns out the existing check line was wrong : it ORs together the major and minor, which only works if the major happens to be 0. Actually working lines: MISMATCH_CHECK(QEMU_PSCI_VERSION_0_2, PSCI_VERSION(0, 2)); MISMATCH_CHECK(QEMU_PSCI_VERSION_1_1, PSCI_VERSION(1, 1)); -- PMM
Re: [PATCH v2] target/arm: Support PSCI 1.1 and SMCCC 1.0
On Sun, 13 Feb 2022 at 03:58, Akihiko Odaki wrote: > > Support the latest PSCI on TCG and HVF. A 64-bit function called from > AArch32 now returns NOT_SUPPORTED, which is necessary to adhere to SMC > Calling Convention 1.0. It is still not compliant with SMCCC 1.3 since > they do not implement mandatory functions. > /* PSCI v0.2 return values used by TCG emulation of PSCI */ > > /* No Trusted OS migration to worry about when offlining CPUs */ > #define QEMU_PSCI_0_2_RET_TOS_MIGRATION_NOT_REQUIRED2 > > -/* We implement version 0.2 only */ > -#define QEMU_PSCI_0_2_RET_VERSION_0_2 2 > +#define QEMU_PSCI_VERSION_0_1 0x1 > +#define QEMU_PSCI_VERSION_0_2 0x2 > +#define QEMU_PSCI_VERSION_1_1 0x10001 Just noticed that there's a minor issue with this change -- it deletes the definition of QEMU_PSCI_0_2_RET_VERSION_0_2, but it is still used below: > > MISMATCH_CHECK(QEMU_PSCI_0_2_RET_TOS_MIGRATION_NOT_REQUIRED, > PSCI_0_2_TOS_MP); > MISMATCH_CHECK(QEMU_PSCI_0_2_RET_VERSION_0_2, here ^^ which means that this breaks compilation on Arm hosts. I'll squash in the fix: --- a/target/arm/kvm-consts.h +++ b/target/arm/kvm-consts.h @@ -98,8 +98,11 @@ MISMATCH_CHECK(QEMU_PSCI_1_0_FN_PSCI_FEATURES, PSCI_1_0_FN_PSCI_FEATURES); #define QEMU_PSCI_VERSION_1_1 0x10001 MISMATCH_CHECK(QEMU_PSCI_0_2_RET_TOS_MIGRATION_NOT_REQUIRED, PSCI_0_2_TOS_MP); -MISMATCH_CHECK(QEMU_PSCI_0_2_RET_VERSION_0_2, +/* We don't bother to check every possible version value */ +MISMATCH_CHECK(QEMU_PSCI_VERSION_0_2, (PSCI_VERSION_MAJOR(0) | PSCI_VERSION_MINOR(2))); +MISMATCH_CHECK(QEMU_PSCI_VERSION_1_1, + (PSCI_VERSION_MAJOR(1) | PSCI_VERSION_MINOR(1))); /* PSCI return values (inclusive of all PSCI versions) */ #define QEMU_PSCI_RET_SUCCESS 0 thanks -- PMM
Re: [PATCH v2] target/arm: Support PSCI 1.1 and SMCCC 1.0
On Sun, 13 Feb 2022 at 03:58, Akihiko Odaki wrote: > > Support the latest PSCI on TCG and HVF. A 64-bit function called from > AArch32 now returns NOT_SUPPORTED, which is necessary to adhere to SMC > Calling Convention 1.0. It is still not compliant with SMCCC 1.3 since > they do not implement mandatory functions. > > Signed-off-by: Akihiko Odaki > --- Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.0 for any user-visible changes. (I noticed while reviewing this that we report KVM's PSCI via the DTB as only 0.2 even if KVM's actually implementing better than that; I'll write a patch to clean that up.) -- PMM