UPSTREAM: src/arch/x86/smbios.c: Fix type 17 part number

Some DIMMs have invalid strings when it comes to device part number
(bytes 0x149-0x15c). From DDR4 SPD specs it should be ASCIIZ with unused
space filled with white spaces (ASCII 0x20). Byte 20 should be 0 (ASCIIZ),
all others should be ASCII.

Create a test that detects invalid strings and replace invalid
characters with *. If a replacement was made the output string then must
be <Invalid (replaced string)>.

BUG=b:73122207
TEST=Build, boot and record serial output for kahlee while injecting
different strings to dmi17->PartNumber. Use code to examine SMBIOS,
while testing different valid and invalid strings.
Remove string injection before committing.

Change-Id: I8c054555109220daccf2910af93497e34dec06d4
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: bd654805933f70ed77e5a03921c31262d9347cc6
Original-Change-Id: Iead2a4cb14ff28d263d7214111b637e62ebd2921
Original-Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
Original-Reviewed-on: https://review.coreboot.org/23844
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/937512
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2 files changed