Re: [edk2-devel] [PATCH v3 05/13] OvmfPkg/MptScsiDxe: Install stubbed EXT_SCSI_PASS_THRU

2020-03-05 Thread Liran Alon
On 04/03/2020 21:22, Nikita Leshenko wrote: Support dynamic insertion and removal of the protocol Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by: Nikita Leshenko Reviewed-by: Laszlo Ersek --- OvmfPkg/MptScsiDxe/MptScsi.c | 179 +- O

Re: [edk2-devel] [PATCH v3 10/13] OvmfPkg/MptScsiDxe: Set and restore PCI attributes

2020-03-05 Thread Liran Alon
: Liran Alon -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55507): https://edk2.groups.io/g/devel/message/55507 Mute This Topic: https://groups.io/mt/71733505/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2

Re: [edk2-devel] [PATCH v3 02/13] OvmfPkg/MptScsiDxe: Install DriverBinding Protocol

2020-03-05 Thread Liran Alon
On 04/03/2020 21:22, Nikita Leshenko wrote: In order to probe and connect to the MptScsi device we need this protocol. Currently it does nothing. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by: Nikita Leshenko Reviewed-by: Laszlo Ersek --- Reviewed-by: Liran Alon

Re: [edk2-devel] [PATCH v3 11/13] OvmfPkg/MptScsiDxe: Initialize hardware

2020-03-05 Thread Liran Alon
On 04/03/2020 21:22, Nikita Leshenko wrote: Reset and send the IO controller initialization request. The reply is read back to complete the doorbell function but it isn't useful to us because it doesn't contain relevant data or status codes. See "LSI53C1030 PCI-X to Dual Channel Ultra320 SCSI

Re: [edk2-devel] [PATCH v3 08/13] OvmfPkg/MptScsiDxe: Implement GetTargetLun

2020-03-05 Thread Liran Alon
o ZeroMem() if you only use the first byte of Target? Seems redundant. In addition, I suggest squashing this patch with the previous one as GetTargetLun() and BuildDevicePath() kinda complement each other. Reviewed-by: Liran Alon + // + // This device support 256 targets only, so it'

Re: [edk2-devel] [PATCH v3 01/13] OvmfPkg/MptScsiDxe: Create empty driver

2020-03-05 Thread Liran Alon
On 04/03/2020 21:22, Nikita Leshenko wrote: In preparation for implementing LSI Fusion MPT SCSI devices, create a basic scaffolding for a driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by: Nikita Leshenko --- Reviewed-by: Liran Alon

Re: [edk2-devel] [PATCH v3 03/13] OvmfPkg/MptScsiDxe: Report name of driver

2020-03-05 Thread Liran Alon
--- Reviewed-by: Liran Alon -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55511): https://edk2.groups.io/g/devel/message/55511 Mute This Topic: https://groups.io/mt/71733494/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe

Re: [edk2-devel] [PATCH v3 04/13] OvmfPkg/MptScsiDxe: Probe PCI devices and look for MptScsi

2020-03-05 Thread Liran Alon
device. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by: Nikita Leshenko Reviewed-by: Laszlo Ersek --- Reviewed-by: Liran Alon -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55513): https://edk2.groups.io/g

Re: [edk2-devel] [PATCH v3 13/13] OvmfPkg/MptScsiDxe: Report multiple targets

2020-03-05 Thread Liran Alon
device for each one that responds. Support for multiple LUNs will be implemented in another series. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by: Nikita Leshenko --- Reviewed-by: Liran Alon -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to

Re: [edk2-devel] [PATCH v3 07/13] OvmfPkg/MptScsiDxe: Build DevicePath for discovered devices

2020-03-05 Thread Liran Alon
0 || Lun > 0) { +return EFI_NOT_FOUND; + } + + ScsiDevicePath = AllocateZeroPool (sizeof (*ScsiDevicePath)); Nit: It should also be sufficient to use AllocatePool() as below overrides all fields of SCSI_DEVICE_PATH. Reviewed-by: Liran Alon + if (ScsiDevicePath == NULL) {

Re: [edk2-devel] [PATCH v3 09/13] OvmfPkg/MptScsiDxe: Open PciIo protocol for later use

2020-03-05 Thread Liran Alon
On 04/03/2020 21:22, Nikita Leshenko wrote: This will give us an exclusive access to the PciIo of this device after it was started and until is will be stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by: Nikita Leshenko --- Reviewed-by: Liran Alon

Re: [edk2-devel] [PATCH v3 12/13] OvmfPkg/MptScsiDxe: Implement the PassThru method

2020-03-05 Thread Liran Alon
On 04/03/2020 21:22, Nikita Leshenko wrote: Machines should be able to boot after this commit. Tested with different Linux distributions (Ubuntu, CentOS) and different Windows versions (Windows 7, Windows 10, Server 2016). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by:

Re: [edk2-devel] [PATCH v3 06/13] OvmfPkg/MptScsiDxe: Report one Target and one LUN

2020-03-05 Thread Liran Alon
On 04/03/2020 21:22, Nikita Leshenko wrote: Support for multiple targets will be implemented in a later commit in this series. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by: Nikita Leshenko Reviewed-by: Laszlo Ersek --- OvmfPkg/MptScsiDxe/MptScsi.c | 38 ++

Re: [edk2-devel] [PATCH v3 00/13] OvmfPkg: Support booting from Fusion-MPT SCSI controllers

2020-03-06 Thread Liran Alon
Hi Lazlo, On 06/03/2020 22:14, Laszlo Ersek wrote: Hi Nikita, On 03/04/20 20:22, Nikita Leshenko wrote: This series adds driver support for: - LSI53C1030 - SAS1068 - SAS1068E These controllers are widely supported by QEMU, VirtualBox and VMWare. This work is part of the more general agenda

[edk2-devel] [PATCH 01/17] OvmfPkg/PvScsiDxe: Create empty driver

2020-03-16 Thread Liran Alon
In preparation for support booting from PvScsi devices, create a basic scaffolding for a driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkgIa32.dsc | 8 OvmfPkg/OvmfPkgIa32.fdf | 3

[edk2-devel] [PATCH 10/17] OvmfPkg/PvScsiDxe: Enable IOSpace & Bus-Mastering in PCI attributes

2020-03-16 Thread Liran Alon
Enable IOSpace & Bus-Mastering PCI attributes when device is started. Note that original PCI attributes is restored when device is stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c

[edk2-devel] [PATCH 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-16 Thread Liran Alon
Implement EXT_SCSI_PASS_THRU.PassThru(). Machines should be able to boot after this commit. Tested with Ubuntu 16.04 guest. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkg.dec | 6 + OvmfPkg

[edk2-devel] [PATCH 06/17] OvmfPkg/PvScsiDxe: Report the number of targets and LUNs

2020-03-16 Thread Liran Alon
e future when PVSCSI will have bigger values for MaxTarget and MaxLun. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkg.dec | 9 +++ OvmfPkg/PvScsiDxe/PvScsi.c

[edk2-devel] [PATCH 04/17] OvmfPkg/PvScsiDxe: Probe PCI devices and look for PvScsi

2020-03-16 Thread Liran Alon
Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/Include/IndustryStandard/PvScsi.h | 21 ++ OvmfPkg/PvScsiDxe/PvScsi.c| 49 ++- OvmfPkg/PvScsiDxe/PvScsi.inf | 5 +++ 3 files changed, 74 insertions(+), 1 deletion(-) create

[edk2-devel] [PATCH 05/17] OvmfPkg/PvScsiDxe: Install stubbed EXT_SCSI_PASS_THRU

2020-03-16 Thread Liran Alon
Support dynamic insertion and removal of the protocol. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 209 ++- OvmfPkg/PvScsiDxe/PvScsi.h | 29 + OvmfPkg

[edk2-devel] [PATCH 16/17] OvmfPkg/PvScsiDxe: Reset device on ExitBootServices()

2020-03-16 Thread Liran Alon
-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 42 +- OvmfPkg/PvScsiDxe/PvScsi.h | 1 + 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c index e7d0a23db6ab..33167c177b42 100644 --- a

[edk2-devel] [PATCH 00/17]: OvmfPkg: Support booting from VMware PVSCSI controller

2020-03-16 Thread Liran Alon
Hi, This series adds driver support for VMware PVSCSI controller. This controller is supported by VMware and QEMU. This work is part of the more general agenda of enhancing OVMF boot device support to have feature parity with SeaBIOS (Which supports booting from VMware PVSCSI). The BugZilla tick

[edk2-devel] [PATCH 02/17] OvmfPkg/PvScsiDxe: Install DriverBinding protocol

2020-03-16 Thread Liran Alon
In order to probe and connect to the PvScsi device we need this protocol. Currently it does nothing. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 68

[edk2-devel] [PATCH 08/17] OvmfPkg/PvScsiDxe: Open PciIo protocol for later use

2020-03-16 Thread Liran Alon
This will give us an exclusive access to the PciIo of this device after it was started and until is will be stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 29

[edk2-devel] [PATCH 14/17] OvmfPkg/PvScsiDxe: Introduce DMA communication buffer

2020-03-16 Thread Liran Alon
the following commits. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 24 OvmfPkg/PvScsiDxe/PvScsi.h | 10 ++ 2 files changed, 34 insertions(+) diff --git a/OvmfPkg/PvScsi

[edk2-devel] [PATCH 07/17] OvmfPkg/PvScsiDxe: Translate Target & LUN to/from DevicePath

2020-03-16 Thread Liran Alon
Implement EXT_SCSI_PASS_THRU.BuildDevicePath() and EXT_SCSI_PASS_THRU.GetTargetLun(). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 60 -- 1 file changed, 58

[edk2-devel] [PATCH 12/17] OvmfPkg/PvScsiDxe: Reset adapter on init

2020-03-16 Thread Liran Alon
The following commits will complete the implementation of device initialization. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 77 ++ 1 file changed, 77

[edk2-devel] [PATCH 13/17] OvmfPkg/PvScsiDxe: Setup requests and completions rings

2020-03-16 Thread Liran Alon
sure to map these rings to device by using PciIo->Map(). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 235 + OvmfPkg/PvScsiDxe/PvScsi.h | 17 +++ 2 fi

[edk2-devel] [PATCH 17/17] OvmfPkg/PvScsiDxe: Enable device 64-bit DMA addresses

2020-03-16 Thread Liran Alon
Enable PCI dual-address cycle attribute to signal device supports 64-bit DMA addresses. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 21 + 1 file changed, 21 insertions

[edk2-devel] [PATCH 11/17] OvmfPkg/PvScsiDxe: Define device interface structures and constants

2020-03-16 Thread Liran Alon
These definitions will be used by the following commits to complete the implementation of PVSCSI device driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/Include/IndustryStandard/PvScsi.h | 162

[edk2-devel] [PATCH 03/17] OvmfPkg/PvScsiDxe: Report name of driver

2020-03-16 Thread Liran Alon
Install Component Name protocols to have a nice display name for the driver in places such as UEFI shell. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 63

[edk2-devel] [PATCH 09/17] OvmfPkg/PvScsiDxe: Backup/Restore PCI attributes on Init/UnInit

2020-03-16 Thread Liran Alon
This commit doesn't change semantics. It is done as a preparation for future commits which will modify PCI attributes. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c

Re: [edk2-devel] [PATCH 09/17] OvmfPkg/PvScsiDxe: Backup/Restore PCI attributes on Init/UnInit

2020-03-24 Thread Liran Alon
On 24/03/2020 17:14, Laszlo Ersek wrote: On 03/16/20 16:01, Liran Alon wrote: I'm going to stop reviewing this iteration now; please rework the rest of the series for v2 with this resource management pattern. Thanks! Laszlo Thanks for the very detailed review! I have read all your com

Re: [edk2-devel] [PATCH 12/17] OvmfPkg/PvScsiDxe: Reset adapter on init

2020-03-24 Thread Liran Alon
On 24/03/2020 18:00, Laszlo Ersek wrote: On 03/16/20 16:01, Liran Alon wrote: +STATIC +EFI_STATUS +PvScsiWriteCmdDesc ( + IN CONST PVSCSI_DEV *Dev, + IN UINT32 Cmd, + IN VOID *Desc, + IN UINTN Length + ) +{ + EFI_STATUS Status; + UINTN

Re: [edk2-devel] [PATCH 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-24 Thread Liran Alon
On 24/03/2020 18:43, Laszlo Ersek wrote: On 03/16/20 16:01, Liran Alon wrote: +STATIC +BOOLEAN +PvScsiIsReqRingFull ( + IN CONST PVSCSI_DEV *Dev + ) +{ + PVSCSI_RINGS_STATE *RingsState; + UINT64 ReqNumEntries; + + RingsState = Dev->RingDesc.RingState; + ReqNumEntries

Re: [edk2-devel] [PATCH 09/17] OvmfPkg/PvScsiDxe: Backup/Restore PCI attributes on Init/UnInit

2020-03-25 Thread Liran Alon
On 25/03/2020 3:48, Laszlo Ersek wrote: On 03/24/20 16:35, Liran Alon wrote: On 24/03/2020 17:14, Laszlo Ersek wrote: On 03/16/20 16:01, Liran Alon wrote: I'm going to stop reviewing this iteration now; please rework the rest of the series for v2 with this resource management pa

[edk2-devel] [PATCH v2 01/17] OvmfPkg/PvScsiDxe: Create empty driver

2020-03-25 Thread Liran Alon
In preparation for support booting from PvScsi devices, create a basic scaffolding for a driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkgIa32.dsc | 8 OvmfPkg/OvmfPkgIa32.fdf | 3 +++ OvmfPkg/OvmfPkgIa32X64

[edk2-devel] [PATCH v2 13/17] OvmfPkg/PvScsiDxe: Setup requests and completions rings

2020-03-25 Thread Liran Alon
sure to map these rings to device by using PciIo->Map(). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 269 + OvmfPkg/PvScsiDxe/PvScsi.h | 17 +++ 2 files changed, 286 insertions(+) d

[edk2-devel] [PATCH v2 09/17] OvmfPkg/PvScsiDxe: Backup/Restore PCI attributes on Init/UnInit

2020-03-25 Thread Liran Alon
This commit doesn't change semantics. It is done as a preparation for future commits which will modify PCI attributes. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 54 +- OvmfPkg/PvSc

[edk2-devel] [PATCH v2 08/17] OvmfPkg/PvScsiDxe: Open PciIo protocol for later use

2020-03-25 Thread Liran Alon
This will give us an exclusive access to the PciIo of this device after it was started and until it will be stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 29

[edk2-devel] [PATCH v2 12/17] OvmfPkg/PvScsiDxe: Reset adapter on init

2020-03-25 Thread Liran Alon
The following commits will complete the implementation of device initialization. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 91 ++ 1 file changed, 91 insertions(+) diff --git a/OvmfPkg

[edk2-devel] [PATCH v2 04/17] OvmfPkg/PvScsiDxe: Probe PCI devices and look for PvScsi

2020-03-25 Thread Liran Alon
Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/Include/IndustryStandard/PvScsi.h | 21 ++ OvmfPkg/PvScsiDxe/PvScsi.c| 49 ++- OvmfPkg/PvScsiDxe/PvScsiDxe.inf | 5 +++ 3 files changed, 74 insertions(+), 1 deletion(-) create

[edk2-devel] [PATCH v2 02/17] OvmfPkg/PvScsiDxe: Install DriverBinding protocol

2020-03-25 Thread Liran Alon
In order to probe and connect to the PvScsi device we need this protocol. Currently it does nothing. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 66 - OvmfPkg

[edk2-devel] [PATCH v2 10/17] OvmfPkg/PvScsiDxe: Enable MMIO-Space & Bus-Mastering in PCI attributes

2020-03-25 Thread Liran Alon
Enable MMIO-Space & Bus-Mastering PCI attributes when device is started. Note that original PCI attributes are restored when device is stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 12 +++- 1 file changed

[edk2-devel] [PATCH v2 07/17] OvmfPkg/PvScsiDxe: Translate Target & LUN to/from DevicePath

2020-03-25 Thread Liran Alon
Implement EXT_SCSI_PASS_THRU.BuildDevicePath() and EXT_SCSI_PASS_THRU.GetTargetLun(). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 61 -- 1 file changed, 59

[edk2-devel] [PATCH v2 05/17] OvmfPkg/PvScsiDxe: Install stubbed EXT_SCSI_PASS_THRU

2020-03-25 Thread Liran Alon
Support dynamic insertion and removal of the protocol. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 209 +++- OvmfPkg/PvScsiDxe/PvScsi.h | 29 + OvmfPkg

[edk2-devel] [PATCH v2 11/17] OvmfPkg/PvScsiDxe: Define device interface structures and constants

2020-03-25 Thread Liran Alon
These definitions will be used by the following commits to complete the implementation of PVSCSI device driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/Include/IndustryStandard/PvScsi.h | 165 ++ 1 file changed, 165

[edk2-devel] [PATCH v2 03/17] OvmfPkg/PvScsiDxe: Report name of driver

2020-03-25 Thread Liran Alon
Install Component Name protocols to have a nice display name for the driver in places such as UEFI shell. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 59 -- 1

[edk2-devel] [PATCH v2 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-25 Thread Liran Alon
Implement EXT_SCSI_PASS_THRU.PassThru(). Machines should be able to boot after this commit. Tested with Ubuntu 16.04 guest. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkg.dec | 6 + OvmfPkg/PvScsiDxe/PvScsi.c | 442

[edk2-devel] [PATCH v2 06/17] OvmfPkg/PvScsiDxe: Report the number of targets and LUNs

2020-03-25 Thread Liran Alon
e future when PVSCSI will have bigger values for MaxTarget and MaxLun. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkg.dec | 9 +++ OvmfPkg/PvScsiDxe/PvScsi.c

[edk2-devel] [PATCH v2 14/17] OvmfPkg/PvScsiDxe: Introduce DMA communication buffer

2020-03-25 Thread Liran Alon
the following commits. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 27 +++ OvmfPkg/PvScsiDxe/PvScsi.h | 10 ++ 2 files changed, 37 insertions(+) diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/Ovmf

[edk2-devel] [PATCH v2 16/17] OvmfPkg/PvScsiDxe: Reset device on ExitBootServices()

2020-03-25 Thread Liran Alon
-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 43 +- OvmfPkg/PvScsiDxe/PvScsi.h | 1 + 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c index de4122e39a81..42a18494efb7 100644 --- a

[edk2-devel] [PATCH v2 00/17] OvmfPkg: Support booting from VMware PVSCSI controller

2020-03-25 Thread Liran Alon
Hi, This series adds driver support for VMware PVSCSI controller. This controller is supported by VMware and QEMU. This work is part of the more general agenda of enhancing OVMF boot device support to have feature parity with SeaBIOS (Which supports booting from VMware PVSCSI). I pushed a copy o

[edk2-devel] [PATCH v2 17/17] OvmfPkg/PvScsiDxe: Enable device 64-bit DMA addresses

2020-03-25 Thread Liran Alon
Enable PCI dual-address cycle attribute to signal device supports 64-bit DMA addresses. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/OvmfPkg

Re: [edk2-devel] [PATCH 12/17] OvmfPkg/PvScsiDxe: Reset adapter on init

2020-03-25 Thread Liran Alon
On 25/03/2020 18:31, Laszlo Ersek wrote: On 03/25/20 02:11, Liran Alon wrote: On 24/03/2020 18:00, Laszlo Ersek wrote: On 03/16/20 16:01, Liran Alon wrote: +STATIC +EFI_STATUS +PvScsiWriteCmdDesc ( + IN CONST PVSCSI_DEV *Dev, + IN UINT32 Cmd, + IN VOID *Desc

Re: [edk2-devel] [PATCH 12/17] OvmfPkg/PvScsiDxe: Reset adapter on init

2020-03-25 Thread Liran Alon
On 25/03/2020 18:40, Liran Alon wrote: On 25/03/2020 18:31, Laszlo Ersek wrote: On 03/25/20 02:11, Liran Alon wrote: To avoid further style comments, what is the coding convention in EDK2 to align the "PVSCSI_CMD_DESC_SETUP_RINGS Cmd;" var properly? The best I can recommend o

Re: [edk2-devel] [PATCH v2 14/17] OvmfPkg/PvScsiDxe: Introduce DMA communication buffer

2020-03-26 Thread Liran Alon
On 27/03/2020 0:17, Laszlo Ersek wrote: On 03/25/20 17:10, Liran Alon wrote: PvScsiRestorePciAttributes (Dev); diff --git a/OvmfPkg/PvScsiDxe/PvScsi.h b/OvmfPkg/PvScsiDxe/PvScsi.h index 6d23b6e1eccf..7f91d70fec79 100644 --- a/OvmfPkg/PvScsiDxe/PvScsi.h +++ b/OvmfPkg/PvScsiDxe/PvScsi.h

Re: [edk2-devel] [PATCH v2 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-27 Thread Liran Alon
On 27/03/2020 14:26, Laszlo Ersek wrote: On 03/25/20 17:10, Liran Alon wrote: +/** + Returns if PVSCSI request ring is full +**/ +STATIC +BOOLEAN +PvScsiIsReqRingFull ( + IN CONST PVSCSI_DEV *Dev + ) +{ + PVSCSI_RINGS_STATE *RingsState; + UINT32 ReqNumEntries

Re: [edk2-devel] [PATCH v2 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-27 Thread Liran Alon
On 27/03/2020 16:04, Liran Alon wrote: On 27/03/2020 14:26, Laszlo Ersek wrote: On 03/25/20 17:10, Liran Alon wrote: + +  // +  // Report target status +  // +  Packet->TargetStatus = Response->ScsiStatus; + +  // +  // Host adapter status and function return value depend on +  //

Re: [edk2-devel] [PATCH v2 14/17] OvmfPkg/PvScsiDxe: Introduce DMA communication buffer

2020-03-27 Thread Liran Alon
On 27/03/2020 16:35, Laszlo Ersek wrote: On 03/27/20 01:05, Liran Alon wrote: On 27/03/2020 0:17, Laszlo Ersek wrote: On 03/25/20 17:10, Liran Alon wrote: PvScsiRestorePciAttributes (Dev); diff --git a/OvmfPkg/PvScsiDxe/PvScsi.h b/OvmfPkg/PvScsiDxe/PvScsi.h index 6d23b6e1eccf

Re: [edk2-devel] [PATCH v2 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-27 Thread Liran Alon
On 28/03/2020 0:05, Laszlo Ersek wrote: On 03/27/20 14:04, Liran Alon wrote: On 27/03/2020 14:26, Laszlo Ersek wrote: On 03/25/20 17:10, Liran Alon wrote: +  Packet->HostAdapterStatus = +    EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN; +  ret

Re: [edk2-devel] [PATCH v2 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-27 Thread Liran Alon
On 28/03/2020 1:04, Liran Alon wrote: On 28/03/2020 0:05, Laszlo Ersek wrote: On 03/27/20 14:04, Liran Alon wrote: On 27/03/2020 14:26, Laszlo Ersek wrote: On 03/25/20 17:10, Liran Alon wrote: +  Packet->HostAdapterStatus = + EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDER

Re: [edk2-devel] [PATCH v2 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-28 Thread Liran Alon
On 28/03/2020 1:17, Liran Alon wrote: On 28/03/2020 1:04, Liran Alon wrote: On 28/03/2020 0:05, Laszlo Ersek wrote: On 03/27/20 14:04, Liran Alon wrote: On 27/03/2020 14:26, Laszlo Ersek wrote: On 03/25/20 17:10, Liran Alon wrote: + Packet->HostAdapterSta

[edk2-devel] [PATCH v3 01/17] OvmfPkg/PvScsiDxe: Create empty driver

2020-03-28 Thread Liran Alon
In preparation for support booting from PvScsi devices, create a basic scaffolding for a driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkgIa32.dsc | 8 OvmfPkg/OvmfPkgIa32.fdf | 3

[edk2-devel] [PATCH v3 05/17] OvmfPkg/PvScsiDxe: Install stubbed EXT_SCSI_PASS_THRU

2020-03-28 Thread Liran Alon
Support dynamic insertion and removal of the protocol. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 209 +++- OvmfPkg/PvScsiDxe/PvScsi.h | 29 + OvmfPkg

[edk2-devel] [PATCH v3 08/17] OvmfPkg/PvScsiDxe: Open PciIo protocol for later use

2020-03-28 Thread Liran Alon
This will give us an exclusive access to the PciIo of this device after it was started and until it will be stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 29

[edk2-devel] [PATCH v3 00/17] OvmfPkg: Support booting from VMware PVSCSI controller

2020-03-28 Thread Liran Alon
Hi, This series adds driver support for VMware PVSCSI controller. This controller is supported by VMware and QEMU. This work is part of the more general agenda of enhancing OVMF boot device support to have feature parity with SeaBIOS (Which supports booting from VMware PVSCSI). I pushed a copy o

[edk2-devel] [PATCH v3 02/17] OvmfPkg/PvScsiDxe: Install DriverBinding protocol

2020-03-28 Thread Liran Alon
In order to probe and connect to the PvScsi device we need this protocol. Currently it does nothing. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 66 - OvmfPkg

[edk2-devel] [PATCH v3 03/17] OvmfPkg/PvScsiDxe: Report name of driver

2020-03-28 Thread Liran Alon
Install Component Name protocols to have a nice display name for the driver in places such as UEFI shell. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 59 -- 1

[edk2-devel] [PATCH v3 04/17] OvmfPkg/PvScsiDxe: Probe PCI devices and look for PvScsi

2020-03-28 Thread Liran Alon
Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/Include/IndustryStandard/PvScsi.h | 21 ++ OvmfPkg/PvScsiDxe/PvScsi.c| 49 ++- OvmfPkg/PvScsiDxe/PvScsiDxe.inf | 5 +++ 3 files changed, 74 insertions(+), 1 deletion(-) create

[edk2-devel] [PATCH v3 10/17] OvmfPkg/PvScsiDxe: Enable MMIO-Space & Bus-Mastering in PCI attributes

2020-03-28 Thread Liran Alon
Enable MMIO-Space & Bus-Mastering PCI attributes when device is started. Note that original PCI attributes are restored when device is stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c

[edk2-devel] [PATCH v3 06/17] OvmfPkg/PvScsiDxe: Report the number of targets and LUNs

2020-03-28 Thread Liran Alon
e future when PVSCSI will have bigger values for MaxTarget and MaxLun. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkg.dec | 9 +++ OvmfPkg/PvScsiDxe/PvScsi.c

[edk2-devel] [PATCH v3 09/17] OvmfPkg/PvScsiDxe: Backup/Restore PCI attributes on Init/UnInit

2020-03-28 Thread Liran Alon
This commit doesn't change semantics. It is done as a preparation for future commits which will modify PCI attributes. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c

[edk2-devel] [PATCH v3 07/17] OvmfPkg/PvScsiDxe: Translate Target & LUN to/from DevicePath

2020-03-28 Thread Liran Alon
Implement EXT_SCSI_PASS_THRU.BuildDevicePath() and EXT_SCSI_PASS_THRU.GetTargetLun(). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 61 -- 1 file changed, 59

[edk2-devel] [PATCH v3 16/17] OvmfPkg/PvScsiDxe: Reset device on ExitBootServices()

2020-03-28 Thread Liran Alon
-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 43 +- OvmfPkg/PvScsiDxe/PvScsi.h | 1 + 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c index da3535c75220..d7f0d3c8790c 100644 --- a

[edk2-devel] [PATCH v3 15/17] OvmfPkg/PvScsiDxe: Support sending SCSI request and receive response

2020-03-28 Thread Liran Alon
Implement EXT_SCSI_PASS_THRU.PassThru(). Machines should be able to boot after this commit. Tested with Ubuntu 16.04 guest. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/OvmfPkg.dec | 6 + OvmfPkg/PvScsiDxe/PvScsi.c | 456

[edk2-devel] [PATCH v3 11/17] OvmfPkg/PvScsiDxe: Define device interface structures and constants

2020-03-28 Thread Liran Alon
These definitions will be used by the following commits to complete the implementation of PVSCSI device driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Acked-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/Include/IndustryStandard/PvScsi.h | 165

[edk2-devel] [PATCH v3 13/17] OvmfPkg/PvScsiDxe: Setup requests and completions rings

2020-03-28 Thread Liran Alon
sure to map these rings to device by using PciIo->Map(). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 219 OvmfPkg/PvScsiDxe/PvScsi.h | 17 +++ OvmfPkg/PvScsiDxe/PvScsiDxe.inf |

[edk2-devel] [PATCH v3 12/17] OvmfPkg/PvScsiDxe: Reset adapter on init

2020-03-28 Thread Liran Alon
The following commits will complete the implementation of device initialization. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 114 + 1 file changed, 114

[edk2-devel] [PATCH v3 14/17] OvmfPkg/PvScsiDxe: Introduce DMA communication buffer

2020-03-28 Thread Liran Alon
the following commits. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 60 ++ OvmfPkg/PvScsiDxe/PvScsi.h | 20 + 2 files changed, 68 insertions(+), 12 deletions(-) diff --git a/Ovmf

[edk2-devel] [PATCH v3 17/17] OvmfPkg/PvScsiDxe: Enable device 64-bit DMA addresses

2020-03-28 Thread Liran Alon
Enable PCI dual-address cycle attribute to signal device supports 64-bit DMA addresses. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 23 +++ 1 file changed, 23 insertions

Re: [edk2-devel] [PATCH v3 13/17] OvmfPkg/PvScsiDxe: Setup requests and completions rings

2020-03-30 Thread Liran Alon
On 30/03/2020 18:54, Laszlo Ersek wrote: On 03/28/20 21:00, Liran Alon wrote: STATIC EFI_STATUS PvScsiInit ( @@ -466,6 +669,14 @@ PvScsiInit ( goto RestorePciAttributes; } + // + // Init PVSCSI rings + // + Status = PvScsiInitRings (Dev); + if (EFI_ERROR (Status

[edk2-devel] [PATCH] Maintainers.txt: Add Liran and Nikita as OvmfPkg/PvScsiDxe reviewers

2020-03-31 Thread Liran Alon
driver as-well. Cc: Nikita Leshenko Suggested-by: Laszlo Ersek Signed-off-by: Liran Alon --- Maintainers.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/Maintainers.txt b/Maintainers.txt index 342bb8d0850c..de443ba7ba1f 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -435,6

[edk2-devel] [PATCH] OvmfPkg/PvScsiDxe: Fix VS2019 build error because of implicit cast

2020-03-31 Thread Liran Alon
hat this truncation do not result in loss of data. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2651 Reported-by: Sean Brogan Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PvScsiDxe/PvScsi.

[edk2-devel] [PATCH] OvmfPkg/PvScsiDxe: Refactor setup of rings to separate function

2020-03-31 Thread Liran Alon
PvScsiInitRings(). Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 150 +++-- 1 file changed, 76 insertions(+), 74 deletions(-) diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c index 1ca50390c0e5..5b7fdcbda10b 100644 --- a/OvmfPkg

Re: [edk2-devel] [PATCH] OvmfPkg/PvScsiDxe: Fix VS2019 build error because of implicit cast

2020-03-31 Thread Liran Alon
On 01/04/2020 0:56, Laszlo Ersek wrote: On 03/31/20 17:53, Sean via Groups.Io wrote: A couple of thoughts. 1. I would suggest that ASSERT should not be the only protection for an invalid operation as ASSERT is usually disabled on release builds. 2. We do have a library to make this more expli

Re: [edk2-devel] [PATCH] OvmfPkg/PvScsiDxe: Fix VS2019 build error because of implicit cast

2020-03-31 Thread Liran Alon
On 01/04/2020 1:13, Liran Alon wrote: On 01/04/2020 0:56, Laszlo Ersek wrote: On 03/31/20 17:53, Sean via Groups.Io wrote: A couple of thoughts. 1. I would suggest that ASSERT should not be the only protection for an invalid operation as ASSERT is usually disabled on release builds. 2. We

Re: [edk2-devel] [PATCH] OvmfPkg/PvScsiDxe: Refactor setup of rings to separate function

2020-03-31 Thread Liran Alon
On 01/04/2020 1:19, Laszlo Ersek wrote: Hi Liran, On 03/31/20 13:47, Liran Alon wrote: Previous to this change, PvScsiFreeRings() was not undoing all operations that was done by PvScsiInitRings(). This is because PvScsiInitRings() was both preparing rings (Allocate memory and map it for

[edk2-devel] [PATCH v2] OvmfPkg/PvScsiDxe: Refactor setup of rings to separate function

2020-03-31 Thread Liran Alon
PvScsiInitRings(). Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 163 +++-- 1 file changed, 85 insertions(+), 78 deletions(-) diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c index 1ca50390c0e5..8c458ecceeb0 100644 --- a/OvmfPkg

Re: [edk2-devel] [PATCH v2] OvmfPkg/PvScsiDxe: Refactor setup of rings to separate function

2020-04-01 Thread Liran Alon
On 01/04/2020 13:41, Laszlo Ersek wrote: On 04/01/20 00:56, Liran Alon wrote: + // + // Setup rings against device + // + Status = PvScsiSetupRings (Dev); + if (EFI_ERROR (Status)) { +goto FreeDMACommBuffer; I'm going to rename this label to "FreeDmaCommBuffer" up

Re: [edk2-devel] [PATCH 1/1] OvmfPkg/OvmfPkg.dec: Adjust PcdMptScsiStallPerPollUsec

2020-07-15 Thread Liran Alon
On 15/07/2020 11:20, Gary Lin wrote: The toke value of PcdMptScsiStallPerPollUsec should be 0x3a since the previous toke value is 0x39. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Liran Alon Cc: Nikita Leshenko Signed-off-by: Gary Lin --- Reviewed-by: Liran Alon

Re: [edk2-devel] [PATCH v5 06/12] OvmfPkg/MptScsiDxe: Report targets and one LUN

2020-04-29 Thread Liran Alon
On 29/04/2020 16:39, Laszlo Ersek wrote: On 04/29/20 15:38, Laszlo Ersek wrote: On 04/24/20 19:59, Nikita Leshenko wrote: diff --git a/OvmfPkg/MptScsiDxe/MptScsiDxe.inf b/OvmfPkg/MptScsiDxe/MptScsiDxe.inf index 9f7c98829ee1..4862ff9dd497 100644 --- a/OvmfPkg/MptScsiDxe/MptScsiDxe.inf +++ b/O