lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0ab5cded-c1e1-e0bc-25fb-f4f8ef9567b6@loongson.cn>
Date: Wed, 13 Aug 2025 10:33:32 +0800
From: gaosong <gaosong@...ngson.cn>
To: Yanteng Si <si.yanteng@...ux.dev>, maobibo@...ngson.cn,
 zhaotianrui@...ngson.cn, chenhuacai@...nel.org, lixianglai@...ngson.cn
Cc: loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] LoongArch: KVM: Use kvm_get_vcpu_by_id() instead of
 kvm_get_vcpu()

在 2025/8/12 上午10:06, Yanteng Si 写道:
> 在 8/11/25 10:55 AM, Song Gao 写道:
>> Use kvm_get_vcpu() may can't get vcpu context, use kvm_get_vcpu_by_id()
>> instead of kvm_get_vcpu().
> Since using kvm_get_vcpu() may fail to retrieve the vcpu context,
> kvm_get_vcpu_by_id() should be used instead.
>
> Under this premise, and under the premise of making revisions
> in accordance with Bibo's and Huacai's suggestions,pick up my tag in v2.
>
Got it .
> Reviewed-by: Yanteng Si <siyanteng@...oftware.com.cm>
>
> Additionally, do we need a fixes tag?
>
I will add a fixes tag on v2.

Thanks.
Song Gao
> Thanks,
> Yanteng
>>
>> Signed-off-by: Song Gao <gaosong@...ngson.cn>
>> ---
>>   arch/loongarch/kvm/intc/eiointc.c | 5 ++++-
>>   arch/loongarch/kvm/intc/ipi.c     | 2 +-
>>   2 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/loongarch/kvm/intc/eiointc.c 
>> b/arch/loongarch/kvm/intc/eiointc.c
>> index a3a12af9ecbf..5180da91d2e6 100644
>> --- a/arch/loongarch/kvm/intc/eiointc.c
>> +++ b/arch/loongarch/kvm/intc/eiointc.c
>> @@ -45,7 +45,10 @@ static void eiointc_update_irq(struct 
>> loongarch_eiointc *s, int irq, int level)
>>       }
>>         cpu = s->sw_coremap[irq];
>> -    vcpu = kvm_get_vcpu(s->kvm, cpu);
>> +    vcpu = kvm_get_vcpu_by_id(s->kvm, cpu);
>> +    if (unlikely(vcpu == NULL)) {
>> +        return;
>> +    }
>>       if (level) {
>>           /* if not enable return false */
>>           if (!test_bit(irq, (unsigned long *)s->enable.reg_u32))
>> diff --git a/arch/loongarch/kvm/intc/ipi.c 
>> b/arch/loongarch/kvm/intc/ipi.c
>> index e658d5b37c04..0348a83a7ed7 100644
>> --- a/arch/loongarch/kvm/intc/ipi.c
>> +++ b/arch/loongarch/kvm/intc/ipi.c
>> @@ -298,7 +298,7 @@ static int kvm_ipi_regs_access(struct kvm_device 
>> *dev,
>>       cpu = (attr->attr >> 16) & 0x3ff;
>>       addr = attr->attr & 0xff;
>>   -    vcpu = kvm_get_vcpu(dev->kvm, cpu);
>> +    vcpu = kvm_get_vcpu_by_id(dev->kvm, cpu);
>>       if (unlikely(vcpu == NULL)) {
>>           kvm_err("%s: invalid target cpu: %d\n", __func__, cpu);
>>           return -EINVAL;
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ