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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3243eeef-2891-5b79-29cb-bc969802c5dc@intel.com>
Date:   Wed, 28 Apr 2021 18:00:07 +0800
From:   "Zhu, Lingshan" <lingshan.zhu@...el.com>
To:     Jason Wang <jasowang@...hat.com>, mst@...hat.com
Cc:     virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] vDPA/ifcvf: record virtio notify base



On 4/28/2021 4:39 PM, Jason Wang wrote:
>
> 在 2021/4/28 下午4:21, Zhu Lingshan 写道:
>> This commit records virtio notify base addr to implemente
>> doorbell mapping feature
>>
>> Signed-off-by: Zhu Lingshan <lingshan.zhu@...el.com>
>> ---
>>   drivers/vdpa/ifcvf/ifcvf_base.c | 1 +
>>   drivers/vdpa/ifcvf/ifcvf_base.h | 1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/vdpa/ifcvf/ifcvf_base.c 
>> b/drivers/vdpa/ifcvf/ifcvf_base.c
>> index 1a661ab45af5..cc61a5bfc5b1 100644
>> --- a/drivers/vdpa/ifcvf/ifcvf_base.c
>> +++ b/drivers/vdpa/ifcvf/ifcvf_base.c
>> @@ -133,6 +133,7 @@ int ifcvf_init_hw(struct ifcvf_hw *hw, struct 
>> pci_dev *pdev)
>> &hw->notify_off_multiplier);
>>               hw->notify_bar = cap.bar;
>>               hw->notify_base = get_cap_addr(hw, &cap);
>> +            hw->notify_pa = pci_resource_start(pdev, cap.bar) + 
>> cap.offset;
>
>
> To be more generic and avoid future changes, let's use the math 
> defined in the virtio spec.
>
> You may refer how it is implemented in virtio_pci vdpa driver[1].
Are you suggesting every vq keep its own notify_pa? In this case, we 
still need to record notify_pa in hw when init_hw, then initialize 
vq->notify_pa accrediting to hw->notify_pa.

Thanks
Zhu Lingshan
>
> Thanks
>
> [1] 
> https://lore.kernel.org/virtualization/20210415073147.19331-5-jasowang@redhat.com/T/
>
>
>> IFCVF_DBG(pdev, "hw->notify_base = %p\n",
>>                     hw->notify_base);
>>               break;
>> diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h 
>> b/drivers/vdpa/ifcvf/ifcvf_base.h
>> index 0111bfdeb342..bcca7c1669dd 100644
>> --- a/drivers/vdpa/ifcvf/ifcvf_base.h
>> +++ b/drivers/vdpa/ifcvf/ifcvf_base.h
>> @@ -98,6 +98,7 @@ struct ifcvf_hw {
>>       char config_msix_name[256];
>>       struct vdpa_callback config_cb;
>>       unsigned int config_irq;
>> +    phys_addr_t  notify_pa;
>>   };
>>     struct ifcvf_adapter {
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ