Re: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: ScsiBusDxe: Refactor DiscoverScsiDevice()

2023-02-01 Thread Yuan Yu via groups.io
Sounds good. Thank you! Best, Yuan On Tue, Jan 31, 2023 at 10:48 PM Wu, Hao A wrote: > Reviewed-by: Hao A Wu > Will update the function comment for ScsiScanCreateDevice() in ScsiBus.c > to match the change in ScsiBus.h during merge. > > Best Regards, > Hao Wu > > > -Original Message-

[edk2-devel] [PATCH v1 0/1] Fix comment in ScsiDisk.c

2023-01-31 Thread Yuan Yu via groups.io
This patch cleans up comment of ScsiDisk.c. The change can be seen at: https://github.com/yyu/edk2/tree/comment_fix_v1 Cc: Ard Biesheuvel Cc: Liming Gao Cc: Hao A Wu Cc: Ray Ni Cc: Sivaparvathi chellaiah Yuan Yu (1): MdeModulePkg: ScsiDiskDxe: clean up comment in ScsiDisk.c

[edk2-devel] [PATCH v1 1/1] MdeModulePkg: ScsiDiskDxe: clean up comment in ScsiDisk.c

2023-01-31 Thread Yuan Yu via groups.io
Comment of MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c was polluted by some previous merge. This patch clean it up. Cc: Ard Biesheuvel Cc: Liming Gao Cc: Hao A Wu Cc: Ray Ni Cc: Sivaparvathi chellaiah Signed-off-by: Yuan Yu --- MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 4 1

Re: [edk2-devel] [PATCH v1 1/2] MdeModulePkg: Fix bug in ScsiBusDxe/ScsiBus.c

2023-01-30 Thread Yuan Yu via groups.io
Hi Hao Wu, Thank you very much for the review and the detailed advice, which is much appreciated! I have made the changes accordingly and sent patch v2. Please take another look. Thank you! Yuan On Wed, Jan 18, 2023 at 10:33 PM Wu, Hao A wrote: > Thanks for the patch, inline comments

[edk2-devel] [PATCH v2 1/1] MdeModulePkg: ScsiBusDxe: Refactor DiscoverScsiDevice()

2023-01-30 Thread Yuan Yu via groups.io
Currently DiscoverScsiDevice() returns a boolean which cannot distinguish a "not found" situation from a real problem like memory allocation failures. This patch changes the return value to an EFI_STATUS so that when memory allocation fails, it will return EFI_OUT_OF_RESOURCES. Without this

[edk2-devel] [PATCH v2 0/1] Refactor DiscoverScsiDevice()

2023-01-30 Thread Yuan Yu via groups.io
Refactor DiscoverScsiDevice() so that it returns EFI_STATUS instead of BOOLEAN. This will enable its callers to distinguish a "not found" situation from real problems like memory allocation failures. The changes can be seen at: https://github.com/yyu/edk2/tree/scsi_bus_fix_v2 Yuan Yu (1):

[edk2-devel] [PATCH v1 2/2] MdeModulePkg: Clean up unused Status.

2023-01-18 Thread Yuan Yu via groups.io
Logically, the while loop that contains ScsiScanCreateDevice() should continue regardless what the returned Status is, because the purpose of the while loop is to scan all possible Puns in the SCSI channel. Without this fix, some static analyzer may complain about the unused return value. Cc:

[edk2-devel] [PATCH v1 1/2] MdeModulePkg: Fix bug in ScsiBusDxe/ScsiBus.c

2023-01-18 Thread Yuan Yu via groups.io
A while loop in SCSIBusDriverBindingStart() is supposed to scan all the possible Puns in the SCSI channel by calling ScsiScanCreateDevice() for each of them. Therefore, we should not abort the loop even when one of the Puns is disconnected. The following is one of the scenarios.

[edk2-devel] [PATCH v1 0/2] Fix boot failure caused by loop abortion

2023-01-18 Thread Yuan Yu via groups.io
A goto following an error check may cause boot failure, because the function that returns the status is supposed to be called for all the possible Puns in the SCSI channel. This patch removes the check and the goto so that the while loop will continue to run until all devices are scanned. The

[edk2-devel] [PATCH v1 1/1] CryptoPkg: Fix integer overflow

2022-09-28 Thread Yuan Yu via groups.io
SECSPERDAY is 86400 which exceeds the limit of a UINT16 which is 65536. Therefore DayRemainder cannot use UINT16. This patch makes it UINT32. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Laszlo Ersek Cc: Anthony Perard Cc: Julien Grall Signed-off-by: Yuan Yu ---

[edk2-devel] [PATCH v1 0/1] Fix integer overflow in CryptoPkg

2022-09-28 Thread Yuan Yu via groups.io
Some value uses UINT16 which is not wide enough to hold the values that it is supposed to hold. This series fix it by using UINT32. The changes can be seen at: https://github.com/yyu/edk2/tree/overflow_fix_v1 Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Laszlo Ersek Cc: Anthony Perard Cc: Julien

[edk2-devel] [PATCH v1 1/1] OvmfPkg/PlatformDxe: Check RouteConfig arguments for spec compliance

2022-08-23 Thread Yuan Yu via groups.io
Per UEFI Spec 2.9, EFI_HII_CONFIG_ROUTING_PROTOCOL.RouteConfig() should return EFI_INVALID_PARAMETERS if caller passes in a NULL for the Configuration parameter (see 35.4 EFI HII Configuration Routing Protocol). Add a check to return EFI_INVALID_PARAMETERS when Configuration is NULL. Cc: Ard

[edk2-devel] [PATCH v1 0/1] Check arguments to be compliant with spec

2022-08-23 Thread Yuan Yu via groups.io
Some function doesn't have certain checks to be compliant with UEFI specification. This series adds a check to return EFI_INVALID_PARAMETER if certain argument is NULL. The changes can be seen at: https://github.com/yyu/edk2/tree/return_value_fix_v1 Cc: Ard Biesheuvel Cc: Jordan Justen Cc:

[edk2-devel] [PATCH v1 1/2] OvmfPkg: Introduce NetworkCfgLib

2022-08-04 Thread Yuan Yu via groups.io
Introduce NetworkCfgLib which will set PcdNetworkSupport based on "etc/networking" qemu file. If "etc/networking" (type bool) is TRUE, then PcdNetworkSupport will be TRUE and vice versa. In the following patch, PcdNetworkSupport will be used to enable/disable VirtIo net driver so that VMM will

[edk2-devel] [PATCH v1 0/2] Add support to disable VirtIo net at runtime

2022-08-04 Thread Yuan Yu via groups.io
Currently networking can only be enabled/disabled at compile time. This patch series will add support to disable VirtIo net at runtime even if the functionality is built into binary at compile time. This will enable VMM to reduce attack surface without recompilation. The changes can be seen at:

[edk2-devel] [PATCH v1 2/2] OvmfPkg: Use PcdNetworkSupport to enable/disable VirtIo net

2022-08-04 Thread Yuan Yu via groups.io
Enable/Disable VirtIo net based on the value of PcdNetworkSupport which is controlled in NetworkCfgLib, which sets the PCD based on "etc/networking" qemu file. With this change, VMM can disable networking even if it is enabled at compile time. This will allow to reduce attack surface by simply