History log of /openbmc/libpldm/tests/ (Results 76 – 100 of 169)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
e424067928-Jun-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

requester: instance-id: Release read lock on conflict

36af84cdbb66 ("requester: Add new APIs for instance ID allocation and
freeing") introduced the new instance ID allocation APIs, and some
unbalan

requester: instance-id: Release read lock on conflict

36af84cdbb66 ("requester: Add new APIs for instance ID allocation and
freeing") introduced the new instance ID allocation APIs, and some
unbalanced locking along with it. When a conflict arose on an instance
ID, the read lock was not released by the non-owning caller.

Release the lock on conflict and on error, and add a test case to
prevent regression.

gitlint-ignore: UC1, B1
Fixes: 36af84cdbb66 ("requester: Add new APIs for instance ID allocation and freeing")
Reported-by: Jerry Chen <jerry_c_chen@wiwynn.com>
Change-Id: Iecd1583c6b8863b458cc4fbf1ac42b20ca2a3433
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

9e3a5d4517-Jun-2024 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://githu

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://github.com/codespell-project/codespell

Change-Id: I25415165df192cfc3bd1405aca81bfa5bf2f7a63
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>

show more ...

de67ab6230-May-2024 Tal Yacobi <talycb8@gmail.com>

platform: Stabilise GetStateEffecterStates functions

See usage example at:
https://gerrit.openbmc.org/c/openbmc/pldm/+/71657

Change-Id: I8ef0961dbc8e87fb4ca8533142104b852a7fb0a4
Signed-off-by: Tal

platform: Stabilise GetStateEffecterStates functions

See usage example at:
https://gerrit.openbmc.org/c/openbmc/pldm/+/71657

Change-Id: I8ef0961dbc8e87fb4ca8533142104b852a7fb0a4
Signed-off-by: Tal Yacobi <talycb8@gmail.com>
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

f490a38f31-May-2024 Tal Yacobi <talycb8@gmail.com>

platform: Change GetStateEffecterStates API error personality

APIs should return negative errno instead of PLDM completion codes.

Change-Id: Ic7017ecc02f3d969aa8fd5c6b1fa89dced484ab1
Signed-off-by:

platform: Change GetStateEffecterStates API error personality

APIs should return negative errno instead of PLDM completion codes.

Change-Id: Ic7017ecc02f3d969aa8fd5c6b1fa89dced484ab1
Signed-off-by: Tal Yacobi <talycb8@gmail.com>
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

48761c6203-Jun-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

libpldm: Reorganize source and test files

Primarily this is about moving specification-specific files into
'dsp/' (in the "DMTF Standard Publication" sense[1]) subdirectories of
both src/ and tests/

libpldm: Reorganize source and test files

Primarily this is about moving specification-specific files into
'dsp/' (in the "DMTF Standard Publication" sense[1]) subdirectories of
both src/ and tests/.

[1]: https://www.dmtf.org/sites/default/files/standards/documents/DSP4014_2.14.0.pdf

libpldm is a concrete C implementation of the PLDM family of
specifications. This invokes some accidental complexity[2] such as the
msgbuf APIs and other concerns.

[2]: https://en.wikipedia.org/wiki/No_Silver_Bullet

Separate the essential complexity (everything under the dsp/
subdirectories) from the accidental complexity (almost everything else).

While doing so, I took the opportunity to drop the 'libpldm_' prefix
and '_test' suffix from a variety of tests. The 'libpldm_' prefix is a
hangover from the days when libpldm was a subproject of OpenBMC's pldm
repo. The '_test' suffix feels redundant given the parent directory
path.

Note that we maintain separation of the src/ and tests/. The test suite
is implemented in C++ while libpldm's APIs are declared and defined in
C. The ability to chop all the tests and C++ out of the implementation
by ignoring a subtree seems like a desirable property when vendoring the
library into other projects.

Finally, update the x86_64 GCC ABI dump, as rearranging the source
causes a lot of churn in its definitions.

Change-Id: Icffcc6cf48b3101ecd38168827c0a81cffb8f083
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

d480b70403-Jun-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

tests: meson: Push build configuration down to leaf directories

I feel this keeps things a bit more self-contained.

Change-Id: I68de6e4b0269d64b620b6c339825113e31074b4c
Signed-off-by: Andrew Jeffer

tests: meson: Push build configuration down to leaf directories

I feel this keeps things a bit more self-contained.

Change-Id: I68de6e4b0269d64b620b6c339825113e31074b4c
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

9ca7670102-Jun-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

tests: meson: Add note about guarding the transport tests

The transport tests rely on a 'test' transport implementation that will
never be marked as stable.

Change-Id: Ib7766c25a435d1bd27f13d45a500

tests: meson: Add note about guarding the transport tests

The transport tests rely on a 'test' transport implementation that will
never be marked as stable.

Change-Id: Ib7766c25a435d1bd27f13d45a50018806b225cae
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

44925df802-Jun-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

tests: meson: Sort tests alphabetically

Try to maintain some sense of coherence.

Change-Id: I14b7d8a07a65670e632c03f8532ec48229806a45
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

1111a97c02-Jun-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

tests: Add macro guards around new testing APIs

This was overlooked when submitting 37552b998a8b ("pdr: Add contained
entity to an association PDR").

`meson configure -Dabi=deprecated,stable build

tests: Add macro guards around new testing APIs

This was overlooked when submitting 37552b998a8b ("pdr: Add contained
entity to an association PDR").

`meson configure -Dabi=deprecated,stable build && meson test -C build`
now links successfully.

Change-Id: I861e478db73528a40088bd19e247cd33e9adc766
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

37552b9912-Feb-2024 Varsha Kaverappa <vkaverap@in.ibm.com>

pdr: Add contained entity to an association PDR

Include function to add a contained entity into an entity association
PDR. A contained entity may be added to an existing container thereby
Imodifying

pdr: Add contained entity to an association PDR

Include function to add a contained entity into an entity association
PDR. A contained entity may be added to an existing container thereby
Imodifying the association PDR or it can be added to the association
PDR by attaching both the container and its contained entity. This API
covers both these cases.

DSP0248_1.2.0 - SECTION 11 explains entity association PDR

Tested By: Adding/Removing an entity(FRU) to an existing PDR on
SIMICS.

Change-Id: Id4ac34f03311dbc7633e7fd6db7f772cfd811a2d
Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>

show more ...

c8df31c121-May-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

msgbuf: Add error code personalities

libpldm is in a bit of a transitional period with respect to returned
error codes. A historical choice was to return PLDM completion codes
from the library API t

msgbuf: Add error code personalities

libpldm is in a bit of a transitional period with respect to returned
error codes. A historical choice was to return PLDM completion codes
from the library API to indicate errors. This is unfortunate because
we're now constrained to errors that are specified by the PLDM protocol,
which is much less expressive than the set of errors that might be
produced by a run-time environment for the library.

The choice going forward is to return C's errno codes. However at this
point we step on another rake in the libpldm design, which is that some
internal data structures are very much the wire format of corresponding
PLDM messages (such as the PDR repository implementation). Working with
wire-format buffers is most safely done via the msgbuf APIs, however we
then hit the conflict of different error code styles in various parts of
the API surface.

Do a bit of surgery to provide different error code personalities for
msgbuf, such that the caller can pick the style of error code they need
it to return to maintain consistency.

Note that like the previous patch marking all msgbuf APIs as
__attribute__((always_inline)), the rework here makes another small
impact on the argument register allocation of several stable APIs. The
ABI dump is updated accordingly.

Change-Id: Id59c39c5c822f514f546dab88575317071a97c96
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

a6fa555905-May-2024 Tal Yacobi <talycb8@gmail.com>

platform: Add support for GetStateEffecterStates command

Based on DSP0248 PLDM for Platform Monitoring
and Control Specification version 1.2.0a Section 22.6

Implement encode and decode for both req

platform: Add support for GetStateEffecterStates command

Based on DSP0248 PLDM for Platform Monitoring
and Control Specification version 1.2.0a Section 22.6

Implement encode and decode for both request and response
for GetStateEffecterStates PLDM command.

Include unit-tests.

Change-Id: Ia3bd71151d40b56f91afe2fe23b8bf2f26915b64
Signed-off-by: Tal Yacobi <talycb8@gmail.com>

show more ...

688be62b22-May-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

tests: Guard test functions exercising testing APIs

Otherwise when the build is configured with `-Dabi=deprecated,stable`
the test binaries will fail to link.

Change-Id: I0f7937a01f38ca12ef6a7c47d7

tests: Guard test functions exercising testing APIs

Otherwise when the build is configured with `-Dabi=deprecated,stable`
the test binaries will fail to link.

Change-Id: I0f7937a01f38ca12ef6a7c47d72e7c393a03d8f4
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

fbaea23322-May-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

tests: Adjust expectations in accordance with -DNDEBUG

If assertions are disabled then `EXPECT_DEATH()` will fail. Guard
`EXPECT_DEATH()` calls with an NDEBUG test, and substitute an
appropriate tes

tests: Adjust expectations in accordance with -DNDEBUG

If assertions are disabled then `EXPECT_DEATH()` will fail. Guard
`EXPECT_DEATH()` calls with an NDEBUG test, and substitute an
appropriate test when it's defined.

Change-Id: I60541762aceb656c2eff03a438f314197b281f77
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

909bf7c203-May-2024 Varsha Kaverappa <vkaverap@in.ibm.com>

msgbuf: Add copy API

pldm_msgbuf_copy API allows copy of data from one msg buffer
to another. This was done earlier with a pldm_msgbuf_extract()
followed by pldm_msgbuf_insert().

Change-Id: I159792

msgbuf: Add copy API

pldm_msgbuf_copy API allows copy of data from one msg buffer
to another. This was done earlier with a pldm_msgbuf_extract()
followed by pldm_msgbuf_insert().

Change-Id: I159792f726916761894aefb0a8795f1f0dc84114
Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>

show more ...

2ff8cf8917-May-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

msgbuf: Remove use of ssize_t for overflow tracking

There are a few concerns with the use of ssize_t in this context:

1. It's defined by POSIX and not C, and I'd prefer we not require POSIX
conc

msgbuf: Remove use of ssize_t for overflow tracking

There are a few concerns with the use of ssize_t in this context:

1. It's defined by POSIX and not C, and I'd prefer we not require POSIX
concepts where we can avoid it
2. ssize_t is defined over [-1, SSIZE_MAX] - it is not defined to have
the range of a regular signed type.

The source of both these statements is The Open Group Base
Specifications Issue 7, 2018 edition. IEEE Std 1003.1-2017 (Revision of
IEEE Std 1003.1-2008)

The second point directly contradicts how I was trying to use ssize_t in
the msgbuf implementation. As a result, switch the type of `remaining`
to intmax_t. Usually intmax_t is a problem child, but it's not used in
any public API, and it has the semantics I wanted by contrast to the
definition of ssize_t.

Note that we add assert() calls where we know the value of remaining
must be negative. Without the addition of the `assert()` calls in the
underflow checks, clang-analyzer gets tripped up by not being able to
prove `INTMAX_MIN + (intmax_t)sizeof(uint16_t) < 0`:

```
../src/platform.c:17:18: error: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult,-warnings-as-errors]
17 | if (ctx->length + sizeof(*ctx) < lower) {
| ^
../src/platform.c:2445:6: note: 'rc' is 0
2445 | if (rc) {
| ^~
../src/platform.c:2445:2: note: Taking false branch
2445 | if (rc) {
| ^
../src/platform.c:2449:7: note: Calling 'pldm_msgbuf_extract_value_pdr_hdr'
2449 | rc = pldm_msgbuf_extract_value_pdr_hdr(buf, &hdr);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/msgbuf/platform.h:17:2: note: Calling 'pldm__msgbuf_extract_uint16'
17 | pldm_msgbuf_extract(ctx, hdr->length);
| ^
../src/msgbuf/../msgbuf.h:517:2: note: expanded from macro 'pldm_msgbuf_extract'
517 | _Generic((dst), \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
518 | uint8_t: pldm__msgbuf_extract_uint8, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
519 | int8_t: pldm__msgbuf_extract_int8, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
520 | uint16_t: pldm__msgbuf_extract_uint16, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
521 | int16_t: pldm__msgbuf_extract_int16, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
522 | uint32_t: pldm__msgbuf_extract_uint32, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
523 | int32_t: pldm__msgbuf_extract_int32, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
524 | real32_t: pldm__msgbuf_extract_real32)(ctx, (void *)&(dst))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/msgbuf/../msgbuf.h:341:7: note: 'ctx' is non-null
341 | if (!ctx || !ctx->cursor || !dst) {
| ^~~
../src/msgbuf/../msgbuf.h:341:6: note: Left side of '||' is false
341 | if (!ctx || !ctx->cursor || !dst) {
| ^
../src/msgbuf/../msgbuf.h:341:20: note: Field 'cursor' is non-null
341 | if (!ctx || !ctx->cursor || !dst) {
| ^
../src/msgbuf/../msgbuf.h:341:6: note: Left side of '||' is false
341 | if (!ctx || !ctx->cursor || !dst) {
| ^
../src/msgbuf/../msgbuf.h:341:31: note: 'dst' is non-null
341 | if (!ctx || !ctx->cursor || !dst) {
| ^~~
../src/msgbuf/../msgbuf.h:341:2: note: Taking false branch
341 | if (!ctx || !ctx->cursor || !dst) {
| ^
../src/msgbuf/../msgbuf.h:347:2: note: Taking true branch
347 | if (ctx->remaining < INTMAX_MIN + (intmax_t)sizeof(ldst)) {
| ^
../src/msgbuf/../msgbuf.h:348:3: note: Returning without writing to '*dst'
348 | return PLDM_ERROR_INVALID_LENGTH;
| ^
../src/msgbuf/platform.h:17:2: note: Returning from 'pldm__msgbuf_extract_uint16'
17 | pldm_msgbuf_extract(ctx, hdr->length);
| ^
../src/msgbuf/../msgbuf.h:517:2: note: expanded from macro 'pldm_msgbuf_extract'
517 | _Generic((dst), \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
518 | uint8_t: pldm__msgbuf_extract_uint8, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
519 | int8_t: pldm__msgbuf_extract_int8, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
520 | uint16_t: pldm__msgbuf_extract_uint16, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
521 | int16_t: pldm__msgbuf_extract_int16, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
522 | uint32_t: pldm__msgbuf_extract_uint32, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
523 | int32_t: pldm__msgbuf_extract_int32, \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
524 | real32_t: pldm__msgbuf_extract_real32)(ctx, (void *)&(dst))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/msgbuf/platform.h:19:2: note: Returning without writing to 'hdr->length'
19 | return pldm_msgbuf_validate(ctx);
| ^
../src/platform.c:2449:7: note: Returning from 'pldm_msgbuf_extract_value_pdr_hdr'
2449 | rc = pldm_msgbuf_extract_value_pdr_hdr(buf, &hdr);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/platform.c:2450:6: note: 'rc' is 0
2450 | if (rc) {
| ^~
../src/platform.c:2450:2: note: Taking false branch
2450 | if (rc) {
| ^
../src/platform.c:2454:7: note: Calling 'pldm_platform_pdr_hdr_validate'
2454 | rc = pldm_platform_pdr_hdr_validate(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2455 | &hdr, PLDM_PDR_NUMERIC_EFFECTER_PDR_MIN_LENGTH,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2456 | pdr_data_length);
| ~~~~~~~~~~~~~~~~
../src/platform.c:17:18: note: The left operand of '+' is a garbage value
17 | if (ctx->length + sizeof(*ctx) < lower) {
| ~~~~~~~~~~~ ^
```

Change-Id: Idbe5a14455ad677a39c8f535eddd9c2ce471c783
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

07febdbb16-May-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

msgbuf: Rework detection of invalid memory regions

From Annex J.2 of N2176 (C17 draft specification):

> Addition or subtraction of a pointer into, or just beyond, an array
> object and an integer t

msgbuf: Rework detection of invalid memory regions

From Annex J.2 of N2176 (C17 draft specification):

> Addition or subtraction of a pointer into, or just beyond, an array
> object and an integer type produces a result that does not point into,
> or just beyond, the same array object (6.5.6).

Instead we can lean on uintptr_t from 7.20.1.4, and from there the
defined behavior of unsigned overflow.

Change-Id: Ia1b47b87efeb9c96057d294a3e38e90bfdba5386
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

32df16c416-May-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

tests: oem: meta: Fix fileio use of msgbuf

After resolving some undefined behavior regarding pointer arithmetic in
pldm_msgbuf_init(), clang-tidy detected the following:

```
clang-tidy-17 -export-f

tests: oem: meta: Fix fileio use of msgbuf

After resolving some undefined behavior regarding pointer arithmetic in
pldm_msgbuf_init(), clang-tidy detected the following:

```
clang-tidy-17 -export-fixes /tmp/tmpmu0oifam/tmpwpj83pgb.yaml -p=/home/andrew/src/openbmc.org/openbmc/libpldm/origin/buildkcgocca3 -quiet /home/andrew/src/openbmc.org/openbmc/libpldm/origin/tests/oem/meta/libpldm_fileio_test.cpp
../src/msgbuf.h:593:14: error: Branch condition evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch,-warnings-as-errors]
593 | if (!ctx || !ctx->cursor) {
| ^
../tests/oem/meta/libpldm_fileio_test.cpp:26:5: note: Calling 'pldm_msgbuf_init'
26 | pldm_msgbuf_init(ctx, 0, &buf[hdrSize], sizeof(buf) - hdrSize);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/msgbuf.h:75:7: note: 'ctx' is non-null
75 | if (!ctx || !buf) {
| ^~~
../src/msgbuf.h:75:6: note: Left side of '||' is false
75 | if (!ctx || !buf) {
| ^
../src/msgbuf.h:75:15: note: 'buf' is non-null
75 | if (!ctx || !buf) {
| ^~~
../src/msgbuf.h:75:2: note: Taking false branch
75 | if (!ctx || !buf) {
| ^
../src/msgbuf.h:79:7: note: 'minsize' is <= 'len'
79 | if ((minsize > len) || (len > SSIZE_MAX)) {
| ^~~~~~~
../src/msgbuf.h:79:6: note: Left side of '||' is false
79 | if ((minsize > len) || (len > SSIZE_MAX)) {
| ^
../src/msgbuf.h:79:26: note: 'len' is <= SSIZE_MAX
79 | if ((minsize > len) || (len > SSIZE_MAX)) {
| ^~~
../src/msgbuf.h:79:2: note: Taking false branch
79 | if ((minsize > len) || (len > SSIZE_MAX)) {
| ^
../src/msgbuf.h:83:6: note: Assuming the condition is true
83 | if ((uintptr_t)buf + len < len) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/msgbuf.h:83:2: note: Taking true branch
83 | if ((uintptr_t)buf + len < len) {
| ^
../src/msgbuf.h:84:3: note: Returning without writing to 'ctx->cursor'
84 | return PLDM_ERROR_INVALID_LENGTH;
| ^
../tests/oem/meta/libpldm_fileio_test.cpp:26:5: note: Returning from 'pldm_msgbuf_init'
26 | pldm_msgbuf_init(ctx, 0, &buf[hdrSize], sizeof(buf) - hdrSize);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/oem/meta/libpldm_fileio_test.cpp:28:5: note: Calling 'pldm_msgbuf_insert_uint8'
28 | pldm_msgbuf_insert_uint8(ctx, fileHandle);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/msgbuf.h:593:7: note: 'ctx' is non-null
593 | if (!ctx || !ctx->cursor) {
| ^~~
../src/msgbuf.h:593:6: note: Left side of '||' is false
593 | if (!ctx || !ctx->cursor) {
| ^
../src/msgbuf.h:593:14: note: Branch condition evaluates to a garbage value
593 | if (!ctx || !ctx->cursor) {
| ^~~~~~~~~~~~
```

Fixes: 22fad3957d36 ("oem: meta: Add decode_oem_meta_file_io_req()")
Change-Id: I99f1d6f8c28a7e812b12f5ef60af5d0f0b0d1866
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

458475a926-Mar-2024 Chris Wang <Chris_Wang@wiwynn.com>

fw_update: Add encode req & decode resp for query_downtream_identifiers

Add support for Query Downstream Identifiers to ask all downstream
devices' Descriptors managed by a endpoint.

The code is de

fw_update: Add encode req & decode resp for query_downtream_identifiers

Add support for Query Downstream Identifiers to ask all downstream
devices' Descriptors managed by a endpoint.

The code is developed based on the definition of
'QueryDownstreamIdentifiers' in DSP0267_1.1.0 Section 10.4

Change-Id: I6282a894c73b78470c147e77d81e5a4ddd6a39a8
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>

show more ...

4c1f2c7221-Mar-2024 Chris Wang <Chris_Wang@wiwynn.com>

fw_update: Add encode req & decode resp for query_downstream_devices

Add support for Query Downstream Devices to ask if a endpoint supports
downstream devices.

The code is developed based on the de

fw_update: Add encode req & decode resp for query_downstream_devices

Add support for Query Downstream Devices to ask if a endpoint supports
downstream devices.

The code is developed based on the definition of
'QueryDownstreamDevices' in DSP0267_1.1.0. Section 10.3

Change-Id: I5925290de5023eb48f675e736429fe9f257170c8
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>

show more ...

d4878cdf08-Nov-2023 Thu Nguyen <thu@os.amperecomputing.com>

pdr: Add decode_numeric_effecter_pdr_data()

Add `decode_numeric_effecter_pdr_data` API to decode the numeric
effecter PDR data in DSP0248_1.2.2 table 87. The API will be used to
retrieve the data fi

pdr: Add decode_numeric_effecter_pdr_data()

Add `decode_numeric_effecter_pdr_data` API to decode the numeric
effecter PDR data in DSP0248_1.2.2 table 87. The API will be used to
retrieve the data fields of numeric effecter from the PDRs in `pldmd`.

Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Change-Id: I323a1288cb0262bd39f4f28701ddc7dbb70c33c8

show more ...

66c7723a23-Apr-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

msgbuf: Enable pldm_msgbuf_extract() into packed members

`pldm_msgbuf_extract()` should work correctly regardless of whether the
`dst` argument is a member of a packed or padded struct.

To get ther

msgbuf: Enable pldm_msgbuf_extract() into packed members

`pldm_msgbuf_extract()` should work correctly regardless of whether the
`dst` argument is a member of a packed or padded struct.

To get there while still achieving type safety we have to jump through
some hoops. Commentary in the patch hopefully captures many of them, but
a side-effect of the hoop-jumping is a couple of changes to ergonomics
of the msgbuf API:

1. `pldm_msgbuf_extract()` no-longer requires that the `dst`
argument be a pointer. Instead, it must be an lvalue, removing all
the `&<lvalue>` noise from the call-sites.

2. However, unfortunately the generic extraction macro has been split in
two. We now have:

2.1 `pldm_msgbuf_extract()`, and
2.2 `pldm_msgbuf_extract_p()`, for when the reference we already have
for the `dst` object is a pointer and not an lvalue.

The split was necessary because I couldn't get GCC and Clang to play
nice with differences required in the assignment expression for lvalue
and pointer type-names in the one macro. Whilst it causes a bunch of
churn it isn't a great concern as the APIs are purely internal to the
library implementation.

Change-Id: Ifc5440a5b838a48bb84c881ec334d9e145365edb
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>

show more ...

dc7d3b5b06-Feb-2024 Pavithra Barithaya <pavithra.b@ibm.com>

libpldm: Change hexadecimal literals to lowercase

As per a comment at [1].

The change was generated with the following:

```
sed -Ei 's/0[xX]([0-9]*[A-F][0-9]*)+/\L\0/g' $(git ls-files)
```

[1]: h

libpldm: Change hexadecimal literals to lowercase

As per a comment at [1].

The change was generated with the following:

```
sed -Ei 's/0[xX]([0-9]*[A-F][0-9]*)+/\L\0/g' $(git ls-files)
```

[1]: https://gerrit.openbmc.org/c/openbmc/libpldm/+/69192

Change-Id: Ib0a41dfaf626aec3167e773262883f9c1de797b2
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...

39eb322417-Nov-2023 Pavithra Barithaya <pavithra.b@ibm.com>

pdr: Assign record_handle in entity_association_pdr_add_children()

The entity_association_pdr_add_children() static API was hard coding
the record handle value to 0 rather than assigning the record_

pdr: Assign record_handle in entity_association_pdr_add_children()

The entity_association_pdr_add_children() static API was hard coding
the record handle value to 0 rather than assigning the record_handle
value provided as a input parameter.

Tested: Unit tested

Fixes: 25ddbccfae0e ("pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle()")
Change-Id: I96b6a340f027abd2ef4009380a2fcf27742531bd
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>

show more ...

22fad39526-Oct-2023 Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>

oem: meta: Add decode_oem_meta_file_io_req()

Support decode_oem_meta_file_io_req() cmd to decode the incoming post
code.

PLDM OEM Meta Write File IO cmd:
Example:
Request:
Byte 0: 0x3F (OEM c

oem: meta: Add decode_oem_meta_file_io_req()

Support decode_oem_meta_file_io_req() cmd to decode the incoming post
code.

PLDM OEM Meta Write File IO cmd:
Example:
Request:
Byte 0: 0x3F (OEM cmd)
Byte 1: 0x02 (FILE IO)
Byte 2: 0x00 (File io type : POST CODE)
Byte 3-6: 0x04 (Data length)
Byte 7-10: 0x93 0xE0 0x00 0xEA (post code)

Response:
Byte 0: 0x00 (success)

Tested:
- Unit Tests passed.

Change-Id: I85437698642dd3cbe6084acf1feada842d206eac
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>

show more ...

1234567