[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260120142210.9891-1-fangyu.yu@linux.alibaba.com>
Date: Tue, 20 Jan 2026 22:22:10 +0800
From: fangyu.yu@...ux.alibaba.com
To: andrew.jones@....qualcomm.com
Cc: ajones@...tanamicro.com,
alex@...ti.fr,
anup@...infault.org,
aou@...s.berkeley.edu,
atish.patra@...ux.dev,
corbet@....net,
fangyu.yu@...ux.alibaba.com,
guoren@...nel.org,
kvm-riscv@...ts.infradead.org,
kvm@...r.kernel.org,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org,
palmer@...belt.com,
pbonzini@...hat.com,
pjw@...nel.org,
rkrcmar@...tanamicro.com
Subject: Re: Re: [PATCH v2] RISC-V: KVM: add KVM_CAP_RISCV_SET_HGATP_MODE
>...
>> + case KVM_CAP_RISCV_SET_HGATP_MODE:
>> +#ifdef CONFIG_64BIT
>> + if (cap->args[0] < HGATP_MODE_SV39X4 ||
>> + cap->args[0] > kvm_riscv_gstage_max_mode)
>> + return -EINVAL;
>> + if (kvm->arch.gstage_mode_initialized)
>> + return 0;
>> + kvm->arch.gstage_mode_initialized = true;
>> + kvm->arch.kvm_riscv_gstage_mode = cap->args[0];
>> + kvm->arch.kvm_riscv_gstage_pgd_levels = 3 +
>> + kvm->arch.kvm_riscv_gstage_mode - HGATP_MODE_SV39X4;
>> + kvm_info("using SV%lluX4 G-stage page table format\n",
>> + 39 + (cap->args[0] - HGATP_MODE_SV39X4) * 9);
>
>I don't think we want this kvm_info line, particularly if it doesn't also
>include a VM ID in some form to allow readers to know which VM is using
>the selected format. Let's either drop it or change it to kvm_debug and
>include a VM ID.
Agreed, I will switch it to kvm_debug() and include a VM ID.
>
>Thanks,
>drew
>
>> +#endif
>> + return 0;
>> default:
>> return -EINVAL;
>> }
>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
>> index dddb781b0507..00c02a880518 100644
>> --- a/include/uapi/linux/kvm.h
>> +++ b/include/uapi/linux/kvm.h
>> @@ -974,6 +974,7 @@ struct kvm_enable_cap {
>> #define KVM_CAP_GUEST_MEMFD_FLAGS 244
>> #define KVM_CAP_ARM_SEA_TO_USER 245
>> #define KVM_CAP_S390_USER_OPEREXEC 246
>> +#define KVM_CAP_RISCV_SET_HGATP_MODE 247
>>
>> struct kvm_irq_routing_irqchip {
>> __u32 irqchip;
>> --
>> 2.50.1
>
>
Powered by blists - more mailing lists