RISC-V: KVM: Require alternatives
Subsystems (2)
cover RISC-V: KVM: Require alternatives
KVM makes use of riscv_has_extension_unlikely() to check for the svinval extension. riscv_has_extension_unlikely() is built on alternatives, which means KVM should ensure alternatives support is available.
The first patch takes the opportunity to cleanup KVM's select list. The second patch selects RISCV_ALTERNATIVE.
Thanks,
drew
Andrew Jones (2):
RISC-V: KVM: Alphabetize selects
RISC-V: KVM: Require alternatives
arch/riscv/kvm/Kconfig | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/2 RISC-V: KVM: Alphabetize selects
While alphabetized lists tend to become unalphabetized almost as quickly as they get fixed up, it is preferred to keep select lists in Kconfigs in order. Let's fix KVM's up.
--- arch/riscv/kvm/Kconfig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/riscv/kvm/Kconfig +5 -5
@@ -20,14 +20,14 @@ if VIRTUALIZATION config KVM tristate "Kernel-based Virtual Machine (KVM) support (EXPERIMENTAL)" depends on RISCV_SBI && MMU + select HAVE_KVM_EVENTFD + select HAVE_KVM_VCPU_ASYNC_IOCTL + select KVM_GENERIC_DIRTYLOG_READ_PROTECT select KVM_GENERIC_HARDWARE_ENABLING - select MMU_NOTIFIER - select PREEMPT_NOTIFIERS select KVM_MMIO - select KVM_GENERIC_DIRTYLOG_READ_PROTECT select KVM_XFER_TO_GUEST_WORK - select HAVE_KVM_VCPU_ASYNC_IOCTL - select HAVE_KVM_EVENTFD + select MMU_NOTIFIER + select PREEMPT_NOTIFIERS select SRCU help Support hosting virtualized guest machines.
Signature · 1 line
2.39.2
Anup Patel
maintainerPATCH 1/2 RISC-V: KVM: Alphabetize selects
Quoted 6 lines · On Thu, Mar 23, 2023 at 12:59?AM Andrew Jones <[email protected]> wrote:
While alphabetized lists tend to become unalphabetized almost as quickly as they get fixed up, it is preferred to keep select lists in Kconfigs in order. Let's fix KVM's up.
Signed-off-by Andrew Jones <[email protected]>
Queued this patch for Linux-6.4
Thanks,
Anup
Quoted 31 lines
--- arch/riscv/kvm/Kconfig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)arch/riscv/kvm/Kconfig +5
-6@@ -20,14 +20,14 @@ if VIRTUALIZATION config KVM tristate "Kernel-based Virtual Machine (KVM) support (EXPERIMENTAL)" depends on RISCV_SBI && MMU + select HAVE_KVM_EVENTFD + select HAVE_KVM_VCPU_ASYNC_IOCTL + select KVM_GENERIC_DIRTYLOG_READ_PROTECT select KVM_GENERIC_HARDWARE_ENABLING - select MMU_NOTIFIER - select PREEMPT_NOTIFIERS select KVM_MMIO - select KVM_GENERIC_DIRTYLOG_READ_PROTECT select KVM_XFER_TO_GUEST_WORK - select HAVE_KVM_VCPU_ASYNC_IOCTL - select HAVE_KVM_EVENTFD + select MMU_NOTIFIER + select PREEMPT_NOTIFIERS select SRCU help Support hosting virtualized guest machines. --2.39.2
PATCH 2/2 RISC-V: KVM: Require alternatives
In reply to Andrew JonesKVM makes use of riscv_has_extension_unlikely() to check for the svinval extension. riscv_has_extension_unlikely() is built on alternatives, which means KVM should ensure alternatives support is available. Select RISCV_ALTERNATIVE from KVM.
--- arch/riscv/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/riscv/kvm/Kconfig +1 -0
@@ -28,6 +28,7 @@ config KVM select KVM_XFER_TO_GUEST_WORK select MMU_NOTIFIER select PREEMPT_NOTIFIERS + select RISCV_ALTERNATIVE select SRCU help Support hosting virtualized guest machines.
Signature · 1 line
2.39.2
cover RISC-V: KVM: Require alternatives
In reply to Andrew JonesQuoted 7 lines · Andrew Jones
KVM makes use of
riscv_has_extension_unlikely()to check for the svinval extension.riscv_has_extension_unlikely()is built on alternatives, which means KVM should ensure alternatives support is available.The first patch takes the opportunity to cleanup KVM's select list. The second patch selects
RISCV_ALTERNATIVE.
Reminds me, I need to re-submit my patch doing that for the top-level RISC-V Kconfig...
For the pair:
Thanks,
Conor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kvm-riscv/attachments/20230322/5f47598b/attachment-0001.sig>
cover RISC-V: KVM: Require alternatives
Quoted 6 lines · Conor Dooley
Quoted 5 lines · Andrew Jones
KVM makes use of
riscv_has_extension_unlikely()to check for the svinval extension.riscv_has_extension_unlikely()is built on alternatives, which means KVM should ensure alternatives support is available.
Quoted 7 lines
Quoted 2 lines
The first patch takes the opportunity to cleanup KVM's select list. The second patch selects
RISCV_ALTERNATIVE.Reminds me, I need to re-submit my patch doing that for the top-level RISC-V
Kconfig...
For the pair:Reviewed-by Conor Dooley <[email protected]>
Actually, I would like to take this back for patch 2.
Per the discussion on the other thread about XIP [1], I don't think that KVM should be selecting alternatives like this.
Would you mind if I picked up these patches & submitted them as a v2, alongside a patch trying to make sure that we do not clip the wings of of XIP kernels by selecting RISCV_ALTERNATIVE?
Cheers,
Conor.
1 - https://lore.kernel.org/all/20230322120907.2968494-1-Jason at zx2c4.com/ -------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kvm-riscv/attachments/20230323/c4a44a6e/attachment-0001.sig>
cover RISC-V: KVM: Require alternatives
Quoted 15 lines · Conor Dooley
Quoted 6 lines · Conor Dooley
Quoted 5 lines · Andrew Jones
KVM makes use of
riscv_has_extension_unlikely()to check for the svinval extension.riscv_has_extension_unlikely()is built on alternatives, which means KVM should ensure alternatives support is available.Quoted 7 lines
Quoted 2 lines
The first patch takes the opportunity to cleanup KVM's select list. The second patch selects
RISCV_ALTERNATIVE.Reminds me, I need to re-submit my patch doing that for the top-level RISC-V
Kconfig...
For the pair:Reviewed-by Conor Dooley <[email protected]>
Quoted 7 lines
Actually, I would like to take this back for patch 2.
Per the discussion on the other thread about XIP [1], I don't think that KVM should be selecting alternatives like this.
Would you mind if I picked up these patches & submitted them as a v2, alongside a patch trying to make sure that we do not clip the wings of of XIP kernels by selectingRISCV_ALTERNATIVE?
Sounds good to me. Thanks, Conor.
drew
cover RISC-V: KVM: Require alternatives
In reply to Conor DooleyQuoted 15 lines · Conor Dooley
Quoted 6 lines · Conor Dooley
Quoted 5 lines · Andrew Jones
KVM makes use of
riscv_has_extension_unlikely()to check for the svinval extension.riscv_has_extension_unlikely()is built on alternatives, which means KVM should ensure alternatives support is available.Quoted 7 lines
Quoted 2 lines
The first patch takes the opportunity to cleanup KVM's select list. The second patch selects
RISCV_ALTERNATIVE.Reminds me, I need to re-submit my patch doing that for the top-level RISC-V
Kconfig...
For the pair:Reviewed-by Conor Dooley <[email protected]>
Quoted 6 lines
Actually, I would like to take this back for patch 2.
Per the discussion on the other thread about XIP [1], I don't think that KVM should be selecting alternatives like this.
Would you mind if I picked up these patches & submitted them as a v2, alongside a patch trying to make sure that we do not clip the wings of of XIP kernels by selectingRISCV_ALTERNATIVE?
Hi Conor,
I take it that resubmitting these patches is no longer part of the plan. Should I rebase on "[PATCH v1 0/2] RISC-V: Fixes for riscv_has_extension[un]likely()'s alternative dependency" and change the select to a depends on?
Thanks,
drew
cover RISC-V: KVM: Require alternatives
Quoted 23 lines · Andrew Jones
Quoted 15 lines · Conor Dooley
Quoted 6 lines · Conor Dooley
Quoted 5 lines · Andrew Jones
KVM makes use of
riscv_has_extension_unlikely()to check for the svinval extension.riscv_has_extension_unlikely()is built on alternatives, which means KVM should ensure alternatives support is available.Quoted 7 lines
Quoted 2 lines
The first patch takes the opportunity to cleanup KVM's select list. The second patch selects
RISCV_ALTERNATIVE.Reminds me, I need to re-submit my patch doing that for the top-level RISC-V
Kconfig...
For the pair:Reviewed-by Conor Dooley <[email protected]>Quoted 6 lines
Actually, I would like to take this back for patch 2.
Per the discussion on the other thread about XIP [1], I don't think that KVM should be selecting alternatives like this.
Would you mind if I picked up these patches & submitted them as a v2, alongside a patch trying to make sure that we do not clip the wings of of XIP kernels by selectingRISCV_ALTERNATIVE?
Quoted 3 lines
Hi Conor,
I take it that resubmitting these patches is no longer part of the plan.
Ah crap, sorry. I meant to reply here after submitting and forgot.
Quoted 3 lines
Should I rebase on "[PATCH v1 0/2] RISC-V: Fixes for riscv_has_extension[un]likely()'s alternative dependency" and change the select to a depends on?
I don't think you need to. Does KVM actually make use of alternatives, other than for riscv_has_extension_unlikely(), that are not gated by extension/erratum specific config options?
With my patch 2/2, alternatives are always enabled for !XIP_KERNEL
builds, and will fall back to the "slow" path inriscv_has_extension_unlikely() otherwise.
If KVM doesn't need alternatives for another reason, I don't think you
need to introduce a dependency on them and just inherit the decision
made by CONFIG_RISCV.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kvm-riscv/attachments/20230324/d18529fd/attachment-0001.sig>
cover RISC-V: KVM: Require alternatives
Quoted 38 lines · Conor Dooley
Quoted 23 lines · Andrew Jones
Quoted 15 lines · Conor Dooley
Quoted 6 lines · Conor Dooley
Quoted 5 lines · Andrew Jones
KVM makes use of
riscv_has_extension_unlikely()to check for the svinval extension.riscv_has_extension_unlikely()is built on alternatives, which means KVM should ensure alternatives support is available.Quoted 7 lines
Quoted 2 lines
The first patch takes the opportunity to cleanup KVM's select list. The second patch selects
RISCV_ALTERNATIVE.Reminds me, I need to re-submit my patch doing that for the top-level RISC-V
Kconfig...
For the pair:Reviewed-by Conor Dooley <[email protected]>Quoted 6 lines
Actually, I would like to take this back for patch 2.
Per the discussion on the other thread about XIP [1], I don't think that KVM should be selecting alternatives like this.
Would you mind if I picked up these patches & submitted them as a v2, alongside a patch trying to make sure that we do not clip the wings of of XIP kernels by selectingRISCV_ALTERNATIVE?Quoted 3 lines
Hi Conor,
I take it that resubmitting these patches is no longer part of the plan.
Ah crap, sorry. I meant to reply here after submitting and forgot.
Quoted 3 lines
Should I rebase on "[PATCH v1 0/2] RISC-V: Fixes for riscv_has_extension[un]likely()'s alternative dependency" and change the select to a depends on?
I don't think you need to. Does KVM actually make use of alternatives, other than for
riscv_has_extension_unlikely(), that are not gated by extension/erratum specific config options?
Quoted 6 lines
With my patch 2/2, alternatives are always enabled for !XIP_KERNEL builds, and will fall back to the "slow" path in
riscv_has_extension_unlikely()otherwise.
If KVM doesn't need alternatives for another reason, I don't think you need to introduce a dependency on them and just inherit the decision made byCONFIG_RISCV.
Ack, thanks, Conor.
Anup, we can either drop patch 2/2 or the whole series, as you like.
Thanks,
drew
Anup Patel
maintainercover RISC-V: KVM: Require alternatives
Quoted 47 lines · On Fri, Mar 24, 2023 at 5:26?PM Andrew Jones <[email protected]> wrote:
Quoted 38 lines · Conor Dooley
Quoted 23 lines · Andrew Jones
Quoted 15 lines · Conor Dooley
Quoted 6 lines · Conor Dooley
Quoted 5 lines · Andrew Jones
KVM makes use of
riscv_has_extension_unlikely()to check for the svinval extension.riscv_has_extension_unlikely()is built on alternatives, which means KVM should ensure alternatives support is available.Quoted 7 lines
Quoted 2 lines
The first patch takes the opportunity to cleanup KVM's select list. The second patch selects
RISCV_ALTERNATIVE.Reminds me, I need to re-submit my patch doing that for the top-level RISC-V
Kconfig...
For the pair:Reviewed-by Conor Dooley <[email protected]>Quoted 6 lines
Actually, I would like to take this back for patch 2.
Per the discussion on the other thread about XIP [1], I don't think that KVM should be selecting alternatives like this.
Would you mind if I picked up these patches & submitted them as a v2, alongside a patch trying to make sure that we do not clip the wings of of XIP kernels by selectingRISCV_ALTERNATIVE?Quoted 3 lines
Hi Conor,
I take it that resubmitting these patches is no longer part of the plan.
Ah crap, sorry. I meant to reply here after submitting and forgot.
Quoted 3 lines
Should I rebase on "[PATCH v1 0/2] RISC-V: Fixes for riscv_has_extension[un]likely()'s alternative dependency" and change the select to a depends on?
I don't think you need to. Does KVM actually make use of alternatives, other than for
riscv_has_extension_unlikely(), that are not gated by extension/erratum specific config options?Quoted 6 lines
With my patch 2/2, alternatives are always enabled for !XIP_KERNEL builds, and will fall back to the "slow" path in
riscv_has_extension_unlikely()otherwise.
If KVM doesn't need alternatives for another reason, I don't think you need to introduce a dependency on them and just inherit the decision made byCONFIG_RISCV.
Quoted 3 lines
Ack, thanks, Conor.
Anup, we can either drop patch 2/2 or the whole series, as you like.
If alternatives are going to be always enabled for !XIP_KERNEL then we can drop PATCH2. I am okay taking PATCH1.
Regards,
Anup