mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
HV: unify the sharing mode and partition mode coding style for similar functions
Both sharing mode and partition mode should follow the same coding logic/style for similar functions: vdev cfgread/cfgwrite: should all return -ENODEV if the pci reg access is not handled by it, but previously the partition mode code is not following this logic vpci cfgread/cfgwrite: if the vdev cfgread/cfgwrite does not handle this reg, pass on to next vdev cfgread/cfgwrite, if no vdev handles that req, passthru to physical pci device Tracked-On: #2534 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -45,14 +45,12 @@ static struct pci_vdev *sharing_mode_find_vdev_sos(union pci_bdf pbdf)
|
||||
void sharing_mode_cfgread(__unused struct acrn_vpci *vpci, union pci_bdf bdf,
|
||||
uint32_t offset, uint32_t bytes, uint32_t *val)
|
||||
{
|
||||
struct pci_vdev *vdev;
|
||||
struct pci_vdev *vdev = sharing_mode_find_vdev_sos(bdf);
|
||||
|
||||
vdev = sharing_mode_find_vdev_sos(bdf);
|
||||
*val = ~0U;
|
||||
|
||||
/* vdev == NULL: Could be hit for PCI enumeration from guests */
|
||||
if (vdev == NULL) {
|
||||
*val = ~0U;
|
||||
} else {
|
||||
if (vdev != NULL) {
|
||||
if ((vmsi_cfgread(vdev, offset, bytes, val) != 0)
|
||||
&& (vmsix_cfgread(vdev, offset, bytes, val) != 0)
|
||||
) {
|
||||
@@ -65,9 +63,8 @@ void sharing_mode_cfgread(__unused struct acrn_vpci *vpci, union pci_bdf bdf,
|
||||
void sharing_mode_cfgwrite(__unused struct acrn_vpci *vpci, union pci_bdf bdf,
|
||||
uint32_t offset, uint32_t bytes, uint32_t val)
|
||||
{
|
||||
struct pci_vdev *vdev;
|
||||
struct pci_vdev *vdev = sharing_mode_find_vdev_sos(bdf);
|
||||
|
||||
vdev = sharing_mode_find_vdev_sos(bdf);
|
||||
if (vdev != NULL) {
|
||||
if ((vmsi_cfgwrite(vdev, offset, bytes, val) != 0)
|
||||
&& (vmsix_cfgwrite(vdev, offset, bytes, val) != 0)
|
||||
|
||||
Reference in New Issue
Block a user