[edk2-devel] [edk2-redfish-client][PATCH 2/2] Tools: Add more Redfish resource
Add more Redfish resource for EDK2 Redfish development. - Add two more systems to profile. - Add BIOS, Memory and Log service to profile. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy --- .../redfish/v1/$metadata/index.xml| 6 +- .../index.json| 16 ++ .../redfish/v1/Registries/index.json | 14 ++ .../2M220100SL/Bios/Settings/index.json | 31 +++ .../v1/Systems/2M220100SL/Bios/index.json | 202 ++ .../v1/Systems/2M220100SL/Memory/1/index.json | 56 + .../v1/Systems/2M220100SL/Memory/2/index.json | 46 .../v1/Systems/2M220100SL/Memory/3/index.json | 46 .../v1/Systems/2M220100SL/Memory/4/index.json | 46 .../v1/Systems/2M220100SL/Memory/index.json | 22 ++ .../redfish/v1/Systems/2M220100SL/index.json | 10 +- .../2M220101SL/Bios/Settings/index.json | 13 ++ .../v1/Systems/2M220101SL/Bios/index.json | 17 ++ .../Systems/2M220101SL/BootOptions/index.json | 10 + .../LogServices/SEL/Entries/1/index.json | 28 +++ .../LogServices/SEL/Entries/2/index.json | 28 +++ .../LogServices/SEL/Entries/index.json| 64 ++ .../2M220101SL/LogServices/SEL/index.json | 27 +++ .../Systems/2M220101SL/LogServices/index.json | 15 ++ .../2M220101SL/Memory/_backup/1/index.json| 56 + .../2M220101SL/Memory/_backup/2/index.json| 46 .../2M220101SL/Memory/_backup/3/index.json| 46 .../2M220101SL/Memory/_backup/4/index.json| 46 .../2M220101SL/Memory/_backup/index.json | 22 ++ .../v1/Systems/2M220101SL/Memory/index.json | 10 + .../redfish/v1/Systems/2M220101SL/index.json | 82 +++ .../2M220102SL/Bios/Settings/index.json | 31 +++ .../v1/Systems/2M220102SL/Bios/index.json | 202 ++ .../LogServices/SEL/Entries/1/index.json | 28 +++ .../LogServices/SEL/Entries/2/index.json | 28 +++ .../LogServices/SEL/Entries/index.json| 64 ++ .../2M220102SL/LogServices/SEL/index.json | 27 +++ .../Systems/2M220102SL/LogServices/index.json | 15 ++ .../v1/Systems/2M220102SL/Memory/1/index.json | 56 + .../v1/Systems/2M220102SL/Memory/2/index.json | 46 .../v1/Systems/2M220102SL/Memory/3/index.json | 46 .../v1/Systems/2M220102SL/Memory/4/index.json | 46 .../v1/Systems/2M220102SL/Memory/index.json | 22 ++ .../redfish/v1/Systems/2M220102SL/index.json | 76 +++ .../redfish/v1/Systems/index.json | 10 +- .../SimpleOcpServerV1/redfish/v1/index.json | 7 +- 41 files changed, 1702 insertions(+), 7 deletions(-) create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Registries/BiosAttributeRegistryUefiKeyword.v1_0_0/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Registries/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Bios/Settings/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Bios/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/1/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/2/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/3/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/4/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Bios/Settings/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Bios/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/BootOptions/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/1/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/2/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/index.json create mode 100644 Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/index.json create mode 100644 Tools/Redfish-Profile-S
Re: [edk2-devel] [edk2-redfish-client][PATCH 1/2] Tools: Initial commit of Redfish Profile Simulator
I just give RB for this because it was already reviewed before. Reviewed-by: Abner Chang < abner.ch...@amd.com > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103839): https://edk2.groups.io/g/devel/message/103839 Mute This Topic: https://groups.io/mt/98633902/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-redfish-client][PATCH 2/2] Tools: Add more Redfish resource
I just give RB for this because it was already reviewed before. Reviewed-by: Abner Chang < abner.ch...@amd.com > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103840): https://edk2.groups.io/g/devel/message/103840 Mute This Topic: https://groups.io/mt/98633905/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-redfish-client][PATCH] Update README.md
Add Redfish-Profile-Simulator license information in README.md Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy --- README.md | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4dfa2c6..478f319 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,10 @@ UEFI Redfish EDK2 implementation. # License The majority of the content in the EDK Redfish Client open source project uses a -[BSD-2-Clause Plus Patent License](LICENSE). +[BSD-2-Clause Plus Patent License](LICENSE). The EDKII Redfish client open source project contains the following +components that are covered by additional licenses: + + - [Tools/Redfish-Profile-Simulator](Tools/Redfish-Profile-Simulator/LICENSE.md) # Maintainers -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103841): https://edk2.groups.io/g/devel/message/103841 Mute This Topic: https://groups.io/mt/98634081/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-redfish-client][PATCH 1/4] Redfish-Profile-Simulator: Add more features
- Add HTTPs support - Add ETAG support - Change default credential to admin/pwd123456 - Add HTTP methods on BIOS managed resource. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy --- .../redfishProfileSimulator.py| 92 -- .../v1sim/redfishURIs.py | 161 -- .../v1sim/registry.py | 14 ++ .../v1sim/resource.py | 27 ++- .../v1sim/systems.py | 85 - 5 files changed, 311 insertions(+), 68 deletions(-) create mode 100644 Tools/Redfish-Profile-Simulator/v1sim/registry.py diff --git a/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py b/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py index 24be52b..91c792a 100644 --- a/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py +++ b/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py @@ -1,4 +1,9 @@ # Copyright Notice: +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# Copyright Notice: # Copyright 2016 Distributed Management Task Force, Inc. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md @@ -9,13 +14,16 @@ import sys import getopt import os +import functools +import flask +import werkzeug rfVersion = "0.9.6" rfProgram1 = "redfishProfileSimulator" rfProgram2 = "" rfUsage1 = "[-Vh] [--Version][--help]" -rfUsage2 = "[-H] [-P] [-p]" -rfUsage3 = "[--Host=] [--Port=] [--profile_path=]" +rfUsage2 = "[-H] [-P] [-C] [-K] [-p]" +rfUsage3 = "[--Host=] [--Port=] [--Cert=] [--Key=] [--profile_path=]" def rf_usage(): @@ -27,18 +35,19 @@ def rf_usage(): def rf_help(): print(rfProgram1,"implements a simulation of a redfish service for the \"Simple OCP Server V1\" Mockup.") -print(" The simulation includes an http server, RestEngine, and dynamic Redfish datamodel.") +print(" The simulation includes an http/https server, RestEngine, and dynamic Redfish datamodel.") print(" You can GET, PATHCH,... to the service just like a real Redfish service.") print(" Both Basic and Redfish Session/Token authentication is supported (for a single user/passwd and token") print("the user/passwd is: root/password123456.The authToken is: 123456SESSIONauthcode") print("these can be changed by editing the redfishURIs.py file. will make dynamic later.") -print(" The http service and Rest engine is built on Flask, and all code is Python 3.4+") +print(" The http/https service and Rest engine is built on Flask, and all code is Python 3.4+") print(" The data model resources are \"initialized\" from the SPMF \"SimpleOcpServerV1\" Mockup.") print(" and stored as python dictionaries--then the dictionaries are updated with patches, posts, deletes.") print(" The program can be extended to support other mockup \"profiles\".") print("") -print(" By default, the simulation runs on localhost (127.0.0.1), on port 5000.") -print(" These can be changed with CLI options: -P -H | --port= --host=") +print(" By default, the simulation runs over http, on localhost (127.0.0.1), on port 5000.") +print(" These can be changed with CLI options: -P -C -K -H | --port= --Cert= --Key= --host=") +print(" -C -K | --Cert= --Key= options must be used together with port 443 to enable https session.") print("") print("Version: ", rfVersion) rf_usage() @@ -47,19 +56,69 @@ def rf_help(): print(" -h, --help, --- help") print(" -H, --Host= --- host IP address. dflt=127.0.0.1") print(" -P,--Port=--- the port to use. dflt=5000") +print(" -C,--Cert=--- Server certificate.") +print(" -K, --Key= --- Server key.") print(" -p, --profile=--- the path to the Redfish profile to use. " "dflt=\"./MockupData/SimpleOcpServerV1\" ") +# Conditional Requests with ETags +# http://flask.pocoo.org/snippets/95/ +def conditional(func): +'''Start conditional method execution for this resource''' +@functools.wraps(func) +def wrapper(*args, **kwargs): +flask.g.condtnl_etags_start = True +return func(*args, **kwargs) +return wrapper + +class NotModified(werkzeug.exceptions.HTTPException): +code = 304 +def get_response(self, environment): +return flask.Response(status=304) + +class PreconditionRequired(werkzeug.exceptions.HTTPException): +code = 428 +description = ('This request is required to be ' + 'conditional; try using "If-Match".') +
[edk2-devel] [edk2-redfish-client][PATCH 0/4] Redfish-Profile-Simulator: Enhancement
This is to add several features to Redfish-Profile-Simulator for EDK2 Redfish client development. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Nickle Wang (4): Redfish-Profile-Simulator: Add more features Redfish-Profile-Simulator: HTTP methods on Memory Collection Redfish-Profile-Simulator: Add ETAG on memory resource Redfish-Profile-Simulator: Add requirements .../redfishProfileSimulator.py| 92 - .../requirements.txt | 2 + .../v1sim/redfishURIs.py | 186 +- .../v1sim/registry.py | 14 ++ .../v1sim/resource.py | 27 ++- .../v1sim/systems.py | 141 - 6 files changed, 394 insertions(+), 68 deletions(-) create mode 100644 Tools/Redfish-Profile-Simulator/requirements.txt create mode 100644 Tools/Redfish-Profile-Simulator/v1sim/registry.py -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103843): https://edk2.groups.io/g/devel/message/103843 Mute This Topic: https://groups.io/mt/98634203/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-redfish-client][PATCH 2/4] Redfish-Profile-Simulator: HTTP methods on Memory Collection
Add POST and PATCH methods on Memory collection and resource. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy --- .../v1sim/redfishURIs.py | 25 +++ .../v1sim/systems.py | 43 +++ 2 files changed, 68 insertions(+) diff --git a/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py b/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py index 3c912f7..35d3794 100644 --- a/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py +++ b/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py @@ -1,6 +1,7 @@ # # Copyright Notice: # Copyright (c) 2019, Intel Corporation. All rights reserved. +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP # SPDX-License-Identifier: BSD-2-Clause-Patent # # Copyright Notice: @@ -308,6 +309,30 @@ def rfApi_SimpleServer(root, versions, host="127.0.0.1", port=5000, cert="", key else: return err_string, status_code +@app.route("/redfish/v1/Systems//Memory", methods=['POST']) +@auth.rfAuthRequired +def rf_computer_memory_post(system_id): +print ("in POST memory collection") +rdata = json.loads(request.data,object_pairs_hook=OrderedDict) +print("rdata:{}".format(rdata)) +rc, status_code, err_string, resp = root.components['Systems'].get_element(system_id).components['Memory'].post_resource(rdata) +if rc == 0: +return resp, status_code +else: +return err_string, status_code + + @app.route("/redfish/v1/Systems//Memory/", methods=['PATCH']) +@auth.rfAuthRequired +def rf_computer_memory_patch(system_id, MemoryIdx): +print ("in PATCH memory[%s] resource" % MemoryIdx) +rdata = json.loads(request.data,object_pairs_hook=OrderedDict) +print("rdata:{}".format(rdata)) +rc, status_code, err_string, resp = root.components['Systems'].get_element(system_id).components['Memory'].patch_memory(MemoryIdx, rdata) +if rc == 0: +return resp, status_code +else: +return err_string, status_code + def resolve_path(service, path): parts = path.split('/') result = service diff --git a/Tools/Redfish-Profile-Simulator/v1sim/systems.py b/Tools/Redfish-Profile-Simulator/v1sim/systems.py index b8b3788..690101f 100644 --- a/Tools/Redfish-Profile-Simulator/v1sim/systems.py +++ b/Tools/Redfish-Profile-Simulator/v1sim/systems.py @@ -2,6 +2,7 @@ # Copyright Notice: # # Copyright (c) 2019, Intel Corporation. All rights reserved. +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP # SPDX-License-Identifier: BSD-2-Clause-Patent # # Copyright Notice: @@ -123,9 +124,50 @@ class RfSystemObj(RfResource): # subclass Logs Collection class RfMemoryCollection(RfCollection): +def final_init_processing(self, base_path, rel_path): +self.maxIdx = self.res_data["Members@odata.count"] + def element_type(self): return RfMemory +def post_resource(self, post_data): + print("Members@odata.count:{}".format(self.res_data["Members@odata.count"])) +print("Members:{}".format(self.res_data["Members"])) +print("post_data:{}".format(post_data)) + +self.res_data["Members@odata.count"] = self.res_data["Members@odata.count"] + 1 +self.maxIdx = self.maxIdx + 1 +newMemoryIdx = self.maxIdx +newMemoryUrl = self.res_data["@odata.id"] + "/" + str(newMemoryIdx) +self.res_data["Members"].append({"@odata.id":newMemoryUrl}) + +post_data["@odata.id"] = newMemoryUrl +self.elements[str(newMemoryIdx)] = post_data + +resp = flask.Response(json.dumps(post_data,indent=4)) +resp.headers["Location"] = newMemoryUrl +return 0, 200, None, resp + +def patch_memory(self, Idx, patch_data): +self.elements[str(Idx)] = {**self.elements[str(Idx)], **patch_data} +resp = flask.Response(json.dumps(self.elements[str(Idx)],indent=4)) +return 0, 200, None, resp + +def get_memory(self, Idx): +return json.dumps(self.elements[Idx],indent=4) + +def delete_memory(self, Idx): +print("in delete_memory") + +resp = flask.Response(json.dumps(self.elements[Idx],indent=4)) + +self.elements.pop(Idx) +self.res_data["Members@odata.count"] = self.res_data["Members@odata.count"] - 1 + +newMemoryUrl = self.res_data["@odata.id"] + "/" + str(Idx) +self.res_data["Members"].remove({"@odata.id":newMemoryUrl}) +return 0, 200, None, resp + class RfMemory(RfResource): pass @@ -267,3 +309,4 @@ class RfBootOptionCollection(RfCollection): return 0, 200, None, resp class RfBootOption(RfResource): +pass -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103844): https://edk2.groups.io/g/devel/message/103844 Mute This Topic: https://groups.io/mt/98634205
[edk2-devel] [edk2-redfish-client][PATCH 3/4] Redfish-Profile-Simulator: Add ETAG on memory resource
Add ETAG support on Memory resource. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy --- Tools/Redfish-Profile-Simulator/v1sim/systems.py | 13 + 1 file changed, 13 insertions(+) diff --git a/Tools/Redfish-Profile-Simulator/v1sim/systems.py b/Tools/Redfish-Profile-Simulator/v1sim/systems.py index 690101f..de4b839 100644 --- a/Tools/Redfish-Profile-Simulator/v1sim/systems.py +++ b/Tools/Redfish-Profile-Simulator/v1sim/systems.py @@ -18,6 +18,7 @@ from .resource import RfResource, RfCollection from .storage import RfSimpleStorageCollection, RfSmartStorage import flask import json +import hashlib from collections import OrderedDict class RfSystemsCollection(RfCollection): @@ -142,13 +143,25 @@ class RfMemoryCollection(RfCollection): self.res_data["Members"].append({"@odata.id":newMemoryUrl}) post_data["@odata.id"] = newMemoryUrl + +md5 = hashlib.md5() +md5.update(json.dumps(post_data).encode("utf-8")) +etag_str = 'W/"' + md5.hexdigest() + '"' +post_data["@odata.etag"] = etag_str self.elements[str(newMemoryIdx)] = post_data resp = flask.Response(json.dumps(post_data,indent=4)) resp.headers["Location"] = newMemoryUrl +resp.headers["ETag"] = etag_str + return 0, 200, None, resp def patch_memory(self, Idx, patch_data): +md5 = hashlib.md5() +md5.update(json.dumps(patch_data).encode("utf-8")) +etag_str = 'W/"' + md5.hexdigest() + '"' +patch_data["@odata.etag"] = etag_str + self.elements[str(Idx)] = {**self.elements[str(Idx)], **patch_data} resp = flask.Response(json.dumps(self.elements[str(Idx)],indent=4)) return 0, 200, None, resp -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103845): https://edk2.groups.io/g/devel/message/103845 Mute This Topic: https://groups.io/mt/98634208/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-redfish-client][PATCH 4/4] Redfish-Profile-Simulator: Add requirements
Add requirements.txt for the required python module Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy --- Tools/Redfish-Profile-Simulator/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Tools/Redfish-Profile-Simulator/requirements.txt diff --git a/Tools/Redfish-Profile-Simulator/requirements.txt b/Tools/Redfish-Profile-Simulator/requirements.txt new file mode 100644 index 000..88807d8 --- /dev/null +++ b/Tools/Redfish-Profile-Simulator/requirements.txt @@ -0,0 +1,2 @@ +flask==1.1.1 +pyOpenSSL -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103846): https://edk2.groups.io/g/devel/message/103846 Mute This Topic: https://groups.io/mt/98634209/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-redfish-client][PATCH] Update README.md
[AMD Official Use Only - General] Reviewed-by: Abner Chang > -Original Message- > From: Nickle Wang > Sent: Tuesday, May 2, 2023 3:36 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > > Subject: [edk2-redfish-client][PATCH] Update README.md > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > Add Redfish-Profile-Simulator license information in README.md > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > --- > README.md | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/README.md b/README.md > index 4dfa2c6..478f319 100644 > --- a/README.md > +++ b/README.md > @@ -7,7 +7,10 @@ UEFI Redfish EDK2 implementation. > > # License > The majority of the content in the EDK Redfish Client open source project > uses a -[BSD-2-Clause Plus Patent License](LICENSE). > +[BSD-2-Clause Plus Patent License](LICENSE). The EDKII Redfish client > +open source project contains the following components that are covered by > additional licenses: > + > + - > + [Tools/Redfish-Profile-Simulator](Tools/Redfish-Profile-Simulator/LICE > + NSE.md) > > # Maintainers > > -- > 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103847): https://edk2.groups.io/g/devel/message/103847 Mute This Topic: https://groups.io/mt/98634081/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-redfish-client][PATCH 0/4] Redfish-Profile-Simulator: Enhancement
[AMD Official Use Only - General] I have no more comments on this patch set as we already reviewed it on edk2-staging. For whole patch set. Reviewed-by: Abner Chang > -Original Message- > From: Nickle Wang > Sent: Tuesday, May 2, 2023 3:51 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > > Subject: [edk2-redfish-client][PATCH 0/4] Redfish-Profile-Simulator: > Enhancement > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > This is to add several features to Redfish-Profile-Simulator for > EDK2 Redfish client development. > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > > Nickle Wang (4): > Redfish-Profile-Simulator: Add more features > Redfish-Profile-Simulator: HTTP methods on Memory Collection > Redfish-Profile-Simulator: Add ETAG on memory resource > Redfish-Profile-Simulator: Add requirements > > .../redfishProfileSimulator.py| 92 - > .../requirements.txt | 2 + > .../v1sim/redfishURIs.py | 186 +- > .../v1sim/registry.py | 14 ++ > .../v1sim/resource.py | 27 ++- > .../v1sim/systems.py | 141 - > 6 files changed, 394 insertions(+), 68 deletions(-) create mode 100644 > Tools/Redfish-Profile-Simulator/requirements.txt > create mode 100644 Tools/Redfish-Profile-Simulator/v1sim/registry.py > > -- > 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103848): https://edk2.groups.io/g/devel/message/103848 Mute This Topic: https://groups.io/mt/98634203/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 0/2] Add IPMI SSIF definitions
Hi Abner, Sorry, but I don't have a tianocore bugzilla account. Please help me to file it on BZ. Thanks, - Tinh On 29/04/2023 10:35, Chang, Abner wrote: [AMD Official Use Only - General] Hi Tinh, Could you please also create a BZ ticket for tracking this? Thus this information will be also covered by edk2 stable release note. Thanks Abner -Original Message- From: Tinh Nguyen Sent: Friday, April 28, 2023 12:00 PM To: devel@edk2.groups.io Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; gaolim...@byosoft.com.cn; zhiguang@intel.com; Chang, Abner ; Tinh Nguyen Subject: [PATCH 0/2] Add IPMI SSIF definitions Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. The first of a series of patches for IPMI SSIF support. Tinh Nguyen (2): MdePkg/IndustryStandard: Adds definitions for IPMI SSIF MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions MdePkg/MdePkg.dec | 26 ++ MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31 +++ MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 3 files changed, 155 insertions(+) create mode 100644 MdePkg/Include/IndustryStandard/IpmiSsif.h -- 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103849): https://edk2.groups.io/g/devel/message/103849 Mute This Topic: https://groups.io/mt/98552183/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
Hi Abner, On 29/04/2023 10:22, Chang, Abner wrote: [AMD Official Use Only - General] Hi Tinh, Below is my comments, -Original Message- From: Tinh Nguyen Sent: Friday, April 28, 2023 12:00 PM To: devel@edk2.groups.io Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; gaolim...@byosoft.com.cn; zhiguang@intel.com; Chang, Abner ; Tinh Nguyen Subject: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. Specification reference: https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/i pmi-second-gen-interface-spec-v2-rev1-1.html Signed-off-by: Tinh Nguyen --- MdePkg/MdePkg.dec | 26 ++ MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 2 files changed, 124 insertions(+) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 7488ccda7a00..518e4200e9af 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -10,6 +10,7 @@ # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved. # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved. # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -2353,6 +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule] # @Prompt IPMI KCS Interface I/O Base Address gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00 31 + ## This is SMBus slave address for the SSIF to the BMC. + # The recommended value defined by IPMI specification is 0x20 (section 12.12). + # @Prompt IPMI SSIF SMBus slave address + gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x0 032 + + ## This is the maximum number of IPMI SSIF request retries. + # The IPMI specification specified min value is 5 (section 12.17). + # @Prompt Number of IPMI SSIF request retries. + + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0 x000 + 00033 + + ## This is the required interval for each IPMI request retry. + # The IPMI specification specified a time range of 60ms to 250ms (section 12.17). + # The default setting is min. + # @Prompt Time between IPMI SSIF request retries. + + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|6|UINT3 2| + 0x0034 Please give the unit to PCD name, for example PcdIpmiSsifRequestRetryIntervalMicrosecond that looks more clear to readers. Yeah, it looks good when adding this + + ## This value is the maximum retries of an IPMI SSIF response # + @Prompt Number of IPMI SSIF response retries. + + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0 x000 + 00035 Is 250 times of retry defined in spec? Seems to me it is too many? The specification does not define this value. But the current SSIF driver into Linux is using 250. We should use the same value with Linux; it helps BMC handle the retry from the host easier. + + ## This is the required interval for each IPMI response retry. + # The IPMI specification specified min value is 60ms (section 12.17). + # @Prompt Time-out for a response, internal + + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|6|UINT 32 + |0x0036 + [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## This value is used to set the base address of PCI express hierarchy. # @Prompt PCI Express Base Address. diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h b/MdePkg/Include/IndustryStandard/IpmiSsif.h new file mode 100644 index ..4a97438109a9 --- /dev/null +++ b/MdePkg/Include/IndustryStandard/IpmiSsif.h @@ -0,0 +1,98 @@ +/** @file + IPMI SSIF Definitions + + Copyright (c) 2023, Ampere Computing LLC. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: +- IPMI Specification + Version 2.0, Rev. 1.1 + + +https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ ipmi +-second-gen-interface-spec-v2-rev1-1.html +**/ + +#ifndef IPMI_SSIF_H_ +#define IPMI_SSIF_H_ An additional whitespace between "#define" and "IPMI_SSIF_H_". will add in v2 + +/// +/// Definitions for SMBUS Commands for SSIF /// Table 12 - Summary of +SMBUS Commands for SSIF /// + +// Write block Please have a consist comment format "///". thanks for remind - Tinh +#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_WRITE0x02 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_START 0x06 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_MIDDLE 0x07 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_END 0x08 + +// Read block Please have a consist comment format "///". Thanks Abner +#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_READ0x03 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_START 0x03 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_MIDDLE 0x09 +#defi
Re: [edk2-devel] [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
[AMD Official Use Only - General] > -Original Message- > From: Tinh Nguyen > Sent: Tuesday, May 2, 2023 4:10 PM > To: Chang, Abner ; Tinh Nguyen > ; devel@edk2.groups.io > Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > gaolim...@byosoft.com.cn; zhiguang@intel.com > Subject: Re: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for > IPMI SSIF > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > Hi Abner, > > On 29/04/2023 10:22, Chang, Abner wrote: > > [AMD Official Use Only - General] > > > > > > Hi Tinh, > > Below is my comments, > > > >> -Original Message- > >> From: Tinh Nguyen > >> Sent: Friday, April 28, 2023 12:00 PM > >> To: devel@edk2.groups.io > >> Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > >> gaolim...@byosoft.com.cn; zhiguang@intel.com; Chang, Abner > >> ; Tinh Nguyen > >> > >> Subject: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for > >> IPMI SSIF > >> > >> Caution: This message originated from an External Source. Use proper > >> caution when opening attachments, clicking links, or responding. > >> > >> > >> Specification reference: > >> > https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/i > >> pmi-second-gen-interface-spec-v2-rev1-1.html > >> > >> Signed-off-by: Tinh Nguyen > >> --- > >> MdePkg/MdePkg.dec | 26 ++ > >> MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 > >> > >> 2 files changed, 124 insertions(+) > >> > >> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index > >> 7488ccda7a00..518e4200e9af 100644 > >> --- a/MdePkg/MdePkg.dec > >> +++ b/MdePkg/MdePkg.dec > >> @@ -10,6 +10,7 @@ > >> # Copyright (c) 2022, Loongson Technology Corporation Limited. All > >> rights reserved. # Copyright (c) 2021 - 2022, Arm Limited. All > >> rights reserved. # Copyright (C) 2023 Advanced Micro Devices, > >> Inc. All rights reserved. > >> +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved. > >> # > >> # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -2353,6 > >> +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule] > >> # @Prompt IPMI KCS Interface I/O Base Address > >> > >> > gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00 > >> 31 > >> > >> + ## This is SMBus slave address for the SSIF to the BMC. > >> + # The recommended value defined by IPMI specification is 0x20 > >> + (section > >> 12.12). > >> + # @Prompt IPMI SSIF SMBus slave address > >> + > >> > gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x0 > >> 032 > >> + > >> + ## This is the maximum number of IPMI SSIF request retries. > >> + # The IPMI specification specified min value is 5 (section 12.17). > >> + # @Prompt Number of IPMI SSIF request retries. > >> + > >> + > >> > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0 > >> x000 > >> + 00033 > >> + > >> + ## This is the required interval for each IPMI request retry. > >> + # The IPMI specification specified a time range of 60ms to 250ms > >> + (section > >> 12.17). > >> + # The default setting is min. > >> + # @Prompt Time between IPMI SSIF request retries. > >> + > >> + > >> > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|6|UINT3 > >> 2| > >> + 0x0034 > > Please give the unit to PCD name, for example > PcdIpmiSsifRequestRetryIntervalMicrosecond that looks more clear to > readers. > > > Yeah, it looks good when adding this > >> + > >> + ## This value is the maximum retries of an IPMI SSIF response # > >> + @Prompt Number of IPMI SSIF response retries. > >> + > >> + > >> > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0 > >> x000 > >> + 00035 > > Is 250 times of retry defined in spec? Seems to me it is too many? > > The specification does not define this value. But the current SSIF driver into > Linux is using 250. > We should use the same value with Linux; it helps BMC handle the retry from > the host easier. Ok, I got it. Thanks Abner > > > > >> + > >> + ## This is the required interval for each IPMI response retry. > >> + # The IPMI specification specified min value is 60ms (section 12.17). > >> + # @Prompt Time-out for a response, internal > >> + > >> + > >> > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|6|UINT > >> 32 > >> + |0x0036 > >> + > >> [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, > PcdsDynamicEx] > >> ## This value is used to set the base address of PCI express hierarchy. > >> # @Prompt PCI Express Base Address. > >> diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h > >> b/MdePkg/Include/IndustryStandard/IpmiSsif.h > >> new file mode 100644 > >> index ..4a97438109a9 > >> --- /dev/null > >> +++ b/MdePkg/Include/IndustryStandard/IpmiSsif.h > >> @@ -0,0 +1,98 @@ > >> +/** @file > >> + IPMI SSIF Definitions > >> + > >> + Copyright
Re: [edk2-devel] [PATCH 0/2] Add IPMI SSIF definitions
[AMD Official Use Only - General] Ok, here it is. Please put BZ# 4344 in the commit message. https://bugzilla.tianocore.org/show_bug.cgi?id=4434 Regards, Abner > -Original Message- > From: Tinh Nguyen > Sent: Tuesday, May 2, 2023 4:09 PM > To: Chang, Abner ; Tinh Nguyen > ; devel@edk2.groups.io > Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > gaolim...@byosoft.com.cn; zhiguang@intel.com > Subject: Re: [PATCH 0/2] Add IPMI SSIF definitions > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > Hi Abner, > > Sorry, but I don't have a tianocore bugzilla account. > > Please help me to file it on BZ. > > Thanks, > > - Tinh > > > > On 29/04/2023 10:35, Chang, Abner wrote: > > [AMD Official Use Only - General] > > > > Hi Tinh, > > Could you please also create a BZ ticket for tracking this? Thus this > information will be also covered by edk2 stable release note. > > Thanks > > Abner > > > > > >> -Original Message- > >> From: Tinh Nguyen > >> Sent: Friday, April 28, 2023 12:00 PM > >> To: devel@edk2.groups.io > >> Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > >> gaolim...@byosoft.com.cn; zhiguang@intel.com; Chang, Abner > >> ; Tinh Nguyen > >> > >> Subject: [PATCH 0/2] Add IPMI SSIF definitions > >> > >> Caution: This message originated from an External Source. Use proper > >> caution when opening attachments, clicking links, or responding. > >> > >> > >> The first of a series of patches for IPMI SSIF support. > >> > >> Tinh Nguyen (2): > >>MdePkg/IndustryStandard: Adds definitions for IPMI SSIF > >>MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions > >> > >> MdePkg/MdePkg.dec | 26 ++ > >> MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31 +++ > >> MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 > >> > >> 3 files changed, 155 insertions(+) > >> create mode 100644 MdePkg/Include/IndustryStandard/IpmiSsif.h > >> > >> -- > >> 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103852): https://edk2.groups.io/g/devel/message/103852 Mute This Topic: https://groups.io/mt/98552183/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 0/2] Bug fix for RemoteDdrSize calculation
V2 delta changes: Split the patch in two for Platform/ARM/N1Sdp and Silicon/ARM/NeoverseN1Soc sahil (2): Platform/ARM/N1Sdp: Fix RemoteDdrSize cast Silicon/ARM/NeoverseN1Soc: Fix RemoteDdrSize cast Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 2 +- Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103853): https://edk2.groups.io/g/devel/message/103853 Mute This Topic: https://groups.io/mt/98634522/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 1/2] Platform/ARM/N1Sdp: Fix RemoteDdrSize cast
RemoteDdrSize calculation wraps around when booting N1Sdp in multichip mode. Casting it to UINT64 to fix the issue. Signed-off-by: sahil Change-Id: Ic51269a8d67669684a5f056701cfbef6beb23da2 --- Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c index a6b4cb0ef482..fa6408a7dd1e 100644 --- a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c +++ b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c @@ -1254,7 +1254,7 @@ InitializePlatformRepository ( PlatRepoInfo->MemAffInfo[LOCAL_DDR_REGION2].Length = Dram2Size; if (PlatInfo->MultichipMode == 1) { -RemoteDdrSize = ((PlatInfo->RemoteDdrSize - 2) * SIZE_1GB); +RemoteDdrSize = ((UINT64)(PlatInfo->RemoteDdrSize - 2) * SIZE_1GB); // Update Remote DDR Region1 PlatRepoInfo->MemAffInfo[REMOTE_DDR_REGION1].ProximityDomain = 1; -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103854): https://edk2.groups.io/g/devel/message/103854 Mute This Topic: https://groups.io/mt/98634523/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 2/2] Silicon/ARM/NeoverseN1Soc: Fix RemoteDdrSize cast
RemoteDdrSize calculation wraps around when booting N1Sdp in multichip mode. Casting it to UINT64 to fix the issue. Signed-off-by: sahil --- Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c index 339fa07b3217..9e8a1efc557d 100644 --- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c +++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c @@ -58,7 +58,7 @@ ArmPlatformGetVirtualMemoryMap ( DramBlock2Size); if (PlatInfo->MultichipMode == 1) { -RemoteDdrSize = ((PlatInfo->RemoteDdrSize - 2) * SIZE_1GB); +RemoteDdrSize = ((UINT64)(PlatInfo->RemoteDdrSize - 2) * SIZE_1GB); BuildResourceDescriptorHob ( EFI_RESOURCE_SYSTEM_MEMORY, -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103855): https://edk2.groups.io/g/devel/message/103855 Mute This Topic: https://groups.io/mt/98634524/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH V2 0/2] Bug fix for RemoteDdrSize calculation
Hi Sahil, Thank you for this fix. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 02/05/2023 09:32 am, sahil wrote: V2 delta changes: Split the patch in two for Platform/ARM/N1Sdp and Silicon/ARM/NeoverseN1Soc sahil (2): Platform/ARM/N1Sdp: Fix RemoteDdrSize cast Silicon/ARM/NeoverseN1Soc: Fix RemoteDdrSize cast Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 2 +- Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103856): https://edk2.groups.io/g/devel/message/103856 Mute This Topic: https://groups.io/mt/98634522/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH V2 0/2] Bug fix for RemoteDdrSize calculation
Merged as d39c665fe302..35a84b1838ba Thanks. Sami Mujawar On 02/05/2023 09:32 am, sahil wrote: V2 delta changes: Split the patch in two for Platform/ARM/N1Sdp and Silicon/ARM/NeoverseN1Soc sahil (2): Platform/ARM/N1Sdp: Fix RemoteDdrSize cast Silicon/ARM/NeoverseN1Soc: Fix RemoteDdrSize cast Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 2 +- Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103857): https://edk2.groups.io/g/devel/message/103857 Mute This Topic: https://groups.io/mt/98634522/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library.
Hi Chasel, Apologies, spent last week at Linaro Connect with little time to follow the list. If we're seeing this purely as a wrapper on libfdt, then it shouldn't need to provide additional functionality on top of what it provides. My initial impression was that this library was attempting to do more, but then I mostly skimmed it, and that appears to have been incorrect. What I *really* don't want is mixing abstractions. I.e. if we're getting the pointers through libfdt calls, we should be using the libfdt accessor functions to extract the data correctly. And expose the cpu_to_fdt*/fdt*_to_cpu accessors through the library. Presumably as Fdt*ToCpu/CpuToFdt*. Regards, Leif On 2023-05-01 17:31, Chiu, Chasel wrote: Hi Leif, Would you please share your ideas and respond Mike's question too? Thanks, Chasel -Original Message- From: devel@edk2.groups.io On Behalf Of Chiu, Chasel Sent: Tuesday, April 25, 2023 10:22 PM To: devel@edk2.groups.io; Kinney, Michael D ; Leif Lindholm Cc: Lin, Benny ; Leif Lindholm ; Gao, Liming ; Liu, Zhiguang ; Pedro Falcato Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. Hello, Since platform may also define other FDT structures, this EDK2 library may not be able to convert all the FDT structures to little endian. We might define a generic MACRO in library like CONVERT_FDT_DATA_TO_LITTLE_ENDIAN which can be used for all structure data, but it will be almost like calling SwapBytes** directly. Any other suggestion? Thanks, Chasel -Original Message- From: devel@edk2.groups.io On Behalf Of Michael D Kinney Sent: Monday, April 24, 2023 10:41 AM To: Leif Lindholm ; devel@edk2.groups.io Cc: Lin, Benny ; Leif Lindholm ; Gao, Liming ; Liu, Zhiguang ; Pedro Falcato ; Kinney, Michael D Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. Hi Leif, Do you have a proposal or small example on what you want to see in the library? Mike -Original Message- From: Leif Lindholm Sent: Monday, April 24, 2023 10:29 AM To: devel@edk2.groups.io; Kinney, Michael D Cc: Lin, Benny ; Leif Lindholm ; Gao, Liming ; Liu, Zhiguang ; Pedro Falcato Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. Apologies, I was refactoring a git tree and switched off the world :) Well, being a bit late to the party ... my view is it would be preferable if we put the byteswapping in the library. The DT format is *defined* to be big-endian, 32-bit cells. So frankly, I have no problems with pushing responsibility onto individual platforms if they have decided to be "clever" by ignoring that - if that gets rid of a bunch of boilerplate for sensibly behaving platforms. Maybe another excuse for getting https://github.com/tianocore/edk2- platforms/blob/master/Silicon/NXP/Library/IoAccessLib/IoAccessLib.c into MdePkg? / Leif On Thu, Apr 20, 2023 at 16:44:03 +, Michael D Kinney wrote: Hi Leif, What is your opinion on FDT being big endian. Do we want the lib to help with that aspect, or leave it up to the consumer of the lib to convert as needed? Seems like an area that could be very error prone if we are not careful. Mike -Original Message- From: Lin, Benny Sent: Wednesday, April 19, 2023 9:25 PM To: Kinney, Michael D ; devel@edk2.groups.io Cc: Gao, Liming ; Liu, Zhiguang ; Pedro Falcato Subject: RE: [PATCH v3 2/3] MdePkg: Support FDT library. -Original Message- From: Kinney, Michael D Sent: Thursday, April 20, 2023 5:04 AM To: Lin, Benny ; devel@edk2.groups.io Cc: Gao, Liming ; Liu, Zhiguang ; Pedro Falcato ; Kinney, Michael D Subject: RE: [PATCH v3 2/3] MdePkg: Support FDT library. Responses below Mike -Original Message- From: Lin, Benny Sent: Wednesday, April 19, 2023 10:12 AM To: Kinney, Michael D ; devel@edk2.groups.io Cc: Gao, Liming ; Liu, Zhiguang ; Pedro Falcato Subject: RE: [PATCH v3 2/3] MdePkg: Support FDT library. Please find my feedback below. We can remove FDT_RESERVE_ENTRY but keep FDT_NODE_HEADER, what do you think? QQQ Benny -Original Message- From: Kinney, Michael D Sent: Wednesday, April 19, 2023 11:54 PM To: Lin, Benny ; devel@edk2.groups.io Cc: Gao, Liming ; Liu, Zhiguang ; Pedro Falcato ; Kinney, Michael D Subject: RE: [PATCH v3 2/3] MdePkg: Support FDT library. A few comments below. Mike -Original Message- From: Lin, Benny Sent: Sunday, April 16, 2023 10:35 PM To: devel@edk2.groups.io Cc: Lin, Benny ; Kinney, Michael D ; Gao, Liming ; Liu, Zhiguang ; Pedro Falcato Subject: [PATCH v3 2/3] MdePkg: Support FDT library. From: Benny Lin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4392 Add FDT support in EDK2 by submodule 3rd party libfdt (https://github.com/devicetree-org/pylibfdt/tree/main/libfdt) and refer to LibcLib implementation by Pedro. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Acked-by: Pedro Falcato Signed-off-by: Benny Lin --- MdePkg/Inclu
Re: [edk2-devel] [PATCH v6 08/16] Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages
On 5/2/23 00:35, Yao, Jiewen wrote: Have you evaluated size impact with this new compiler option? Especially crypto library. Bigger? Smaller? The increase in size when we disable LTO doesn't seem too bad: With LTO: -rwxrwxr-x 1 bcran bcran 13M May 2 08:11 CryptoDxe_41A491D1-A972-468B-A299-DABF415A43B7.debug -rwxrwxr-x 1 bcran bcran 13M May 2 08:11 CryptoDxe_AA83B296-F6EA-447F-B013-E80E98629CF8.debug -rwxrwxr-x 1 bcran bcran 11M May 2 08:11 CryptoDxe_9FBDAD27-910C-4229-9EFF-A93BB5FE18C6.debug -rwxrwxr-x 1 bcran bcran 11M May 2 08:11 CryptoDxe_ADD6D05A-52A2-437B-98E7-DBFDA89352CD.debug -rwxrwxr-x 1 bcran bcran 8.5M May 2 08:11 CryptoSmm_C1760694-AB3A-4532-8C6D-52D8F86EB1AA.debug -rwxrwxr-x 1 bcran bcran 8.3M May 2 08:11 CryptoSmm_1930CE7E-6598-48ED-8AB1-EBE7E85EC254.debug -rwxrwxr-x 1 bcran bcran 8.0M May 2 08:11 CryptoPei_A10827AD-7598-4955-B661-52EE2B62B057.debug -rwxrwxr-x 1 bcran bcran 7.8M May 2 08:11 CryptoPei_D51FCE59-6860-49C0-9B35-984470735D17.debug -rwxrwxr-x 1 bcran bcran 7.0M May 2 08:11 BaseCryptLibUnitTestShell.debug -rwxrwxr-x 1 bcran bcran 7.0M May 2 08:11 CryptoSmm_828959D3-CEA6-4B79-B1FC-5AFA0D7F2144.debug -rwxrwxr-x 1 bcran bcran 6.9M May 2 08:11 CryptoDxe_31C17C54-325D-47D5-8622-888098F10E44.debug -rwxrwxr-x 1 bcran bcran 6.7M May 2 08:11 CryptoSmm_E4D7D1E3-E886-4412-A442-EFD6F2502DD3.debug -rwxrwxr-x 1 bcran bcran 6.7M May 2 08:11 CryptoSmm_1A1C9E13-5722-4636-AB73-31328EDE8BAF.debug -rwxrwxr-x 1 bcran bcran 6.5M May 2 08:11 CryptoPei_DCC9CB49-7BE2-47C6-864E-6DCC932360F9.debug -rwxrwxr-x 1 bcran bcran 6.2M May 2 08:11 CryptoPei_EBD49F5C-6D8B-40D1-A56D-9AFA485A8661.debug -rwxrwxr-x 1 bcran bcran 6.2M May 2 08:11 CryptoPei_C693A250-6B36-49B9-B7F3-7283F8136A72.debug -rw-rw-r-- 1 bcran bcran 1005K May 2 08:11 CryptoDxe_41A491D1-A972-468B-A299-DABF415A43B7.efi -rw-rw-r-- 1 bcran bcran 903K May 2 08:11 CryptoDxe_AA83B296-F6EA-447F-B013-E80E98629CF8.efi -rw-rw-r-- 1 bcran bcran 811K May 2 08:11 CryptoDxe_9FBDAD27-910C-4229-9EFF-A93BB5FE18C6.efi -rw-rw-r-- 1 bcran bcran 755K May 2 08:11 CryptoSmm_C1760694-AB3A-4532-8C6D-52D8F86EB1AA.efi -rw-rw-r-- 1 bcran bcran 724K May 2 08:11 CryptoPei_A10827AD-7598-4955-B661-52EE2B62B057.efi -rw-rw-r-- 1 bcran bcran 710K May 2 08:11 CryptoDxe_ADD6D05A-52A2-437B-98E7-DBFDA89352CD.efi -rw-rw-r-- 1 bcran bcran 654K May 2 08:11 CryptoSmm_1930CE7E-6598-48ED-8AB1-EBE7E85EC254.efi -rw-rw-r-- 1 bcran bcran 623K May 2 08:11 CryptoPei_D51FCE59-6860-49C0-9B35-984470735D17.efi -rw-rw-r-- 1 bcran bcran 585K May 2 08:11 CryptoSmm_828959D3-CEA6-4B79-B1FC-5AFA0D7F2144.efi -rw-rw-r-- 1 bcran bcran 560K May 2 08:11 BaseCryptLibUnitTestShell.efi -rw-rw-r-- 1 bcran bcran 555K May 2 08:11 CryptoPei_DCC9CB49-7BE2-47C6-864E-6DCC932360F9.efi -rw-rw-r-- 1 bcran bcran 500K May 2 08:11 CryptoDxe_31C17C54-325D-47D5-8622-888098F10E44.efi -rw-rw-r-- 1 bcran bcran 485K May 2 08:11 CryptoSmm_1A1C9E13-5722-4636-AB73-31328EDE8BAF.efi -rw-rw-r-- 1 bcran bcran 485K May 2 08:11 CryptoSmm_E4D7D1E3-E886-4412-A442-EFD6F2502DD3.efi -rw-rw-r-- 1 bcran bcran 454K May 2 08:11 CryptoPei_C693A250-6B36-49B9-B7F3-7283F8136A72.efi -rw-rw-r-- 1 bcran bcran 454K May 2 08:11 CryptoPei_EBD49F5C-6D8B-40D1-A56D-9AFA485A8661.efi Without LTO: -rwxrwxr-x 1 bcran bcran 14M May 2 08:13 CryptoDxe_41A491D1-A972-468B-A299-DABF415A43B7.debug -rwxrwxr-x 1 bcran bcran 14M May 2 08:13 CryptoDxe_AA83B296-F6EA-447F-B013-E80E98629CF8.debug -rwxrwxr-x 1 bcran bcran 12M May 2 08:13 CryptoDxe_9FBDAD27-910C-4229-9EFF-A93BB5FE18C6.debug -rwxrwxr-x 1 bcran bcran 12M May 2 08:13 CryptoDxe_ADD6D05A-52A2-437B-98E7-DBFDA89352CD.debug -rwxrwxr-x 1 bcran bcran 9.5M May 2 08:13 CryptoSmm_C1760694-AB3A-4532-8C6D-52D8F86EB1AA.debug -rwxrwxr-x 1 bcran bcran 9.2M May 2 08:13 CryptoSmm_1930CE7E-6598-48ED-8AB1-EBE7E85EC254.debug -rwxrwxr-x 1 bcran bcran 8.9M May 2 08:13 CryptoPei_A10827AD-7598-4955-B661-52EE2B62B057.debug -rwxrwxr-x 1 bcran bcran 8.7M May 2 08:13 CryptoPei_D51FCE59-6860-49C0-9B35-984470735D17.debug -rwxrwxr-x 1 bcran bcran 8.0M May 2 08:13 CryptoSmm_828959D3-CEA6-4B79-B1FC-5AFA0D7F2144.debug -rwxrwxr-x 1 bcran bcran 7.9M May 2 08:13 BaseCryptLibUnitTestShell.debug -rwxrwxr-x 1 bcran bcran 7.9M May 2 08:12 CryptoDxe_31C17C54-325D-47D5-8622-888098F10E44.debug -rwxrwxr-x 1 bcran bcran 7.7M May 2 08:12 CryptoSmm_1A1C9E13-5722-4636-AB73-31328EDE8BAF.debug -rwxrwxr-x 1 bcran bcran 7.7M May 2 08:13 CryptoSmm_E4D7D1E3-E886-4412-A442-EFD6F2502DD3.debug -rwxrwxr-x 1 bcran bcran 7.4M May 2 08:13 CryptoPei_DCC9CB49-7BE2-47C6-864E-6DCC932360F9.debug -rwxrwxr-x 1 bcran bcran 7.2M May 2 08:12 CryptoPei_C693A250-6B36-49B9-B7F3-7283F8136A72.debug -rwxrwxr-x 1 bcran bcran 7.2M May 2 08:13 CryptoPei_EBD49F5C-6D8B-40D1-A56D-9AFA485A8661.debug -rw-rw-r-- 1 bcran bcran 1.1M May 2 08:13 CryptoDxe_41A491D1-A972-468B-A299-DABF415A43B7.efi -rw-rw-r-- 1 bcran bcran 1011K May 2 08:13 CryptoDxe_AA
Re: [edk2-devel] [PATCH 0/2] SecurityPkg: add TIS sanity check
Merged https://github.com/tianocore/edk2/pull/4325 > -Original Message- > From: devel@edk2.groups.io On Behalf Of Gerd > Hoffmann > Sent: Thursday, April 27, 2023 12:24 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Pawel Polawski > ; Oliver Steffen ; Yao, > Jiewen ; Gerd Hoffmann > Subject: [edk2-devel] [PATCH 0/2] SecurityPkg: add TIS sanity check > > > > Gerd Hoffmann (2): > SecurityPkg: add TIS sanity check (tpm2) > SecurityPkg: add TIS sanity check (tpm12) > > SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c | 6 +- > SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c | 6 +- > 2 files changed, 10 insertions(+), 2 deletions(-) > > -- > 2.40.0 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103860): https://edk2.groups.io/g/devel/message/103860 Mute This Topic: https://groups.io/mt/98518596/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy
Thanks. The patch loos good to me. Would you please share with us, how you validate the patch? > -Original Message- > From: Liu, Linus > Sent: Tuesday, April 11, 2023 5:55 PM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; FST-FIR-PRC p...@intel.com>; FST FIR Server ; Chu, Maggie > > Subject: [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit to > use Variable Policy > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4408 > > Change-Id: I3c4b466ef318766d6d70c9f73e36b94b5f10832c > Cc: Jiewen Yao > Cc: FST-FIR-PRC > Cc: FST FIR Server C > Cc: Maggie Chu > Signed-off-by: Linus Liu > --- > SecurityPkg/HddPassword/HddPasswordDxe.c | 16 +++- > SecurityPkg/HddPassword/HddPasswordDxe.h | 1 - > SecurityPkg/HddPassword/HddPasswordDxe.inf | 3 ++- > SecurityPkg/SecurityPkg.dsc| 1 + > 4 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c > b/SecurityPkg/HddPassword/HddPasswordDxe.c > index a1a63b67a4..c20fdbe83f 100644 > --- a/SecurityPkg/HddPassword/HddPasswordDxe.c > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c > @@ -9,6 +9,7 @@ > **/ > > > > #include "HddPasswordDxe.h" > > +#include > > > > EFI_GUIDmHddPasswordVendorGuid = > HDD_PASSWORD_CONFIG_GUID; > > CHAR16 mHddPasswordVendorStorageName[] = > L"HDD_PASSWORD_CONFIG"; > > @@ -2822,7 +2823,7 @@ HddPasswordDxeInit ( >HDD_PASSWORD_DXE_PRIVATE_DATA *Private; > >VOID *Registration; > >EFI_EVENT EndOfDxeEvent; > > - EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock; > > + EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; > > > >Private = NULL; > > > > @@ -2858,12 +2859,17 @@ HddPasswordDxeInit ( >// > >// Make HDD_PASSWORD_VARIABLE_NAME variable read-only. > >// > > - Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, > (VOID **)&VariableLock); > > + Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, NULL, > (VOID **)&VariablePolicy); > >if (!EFI_ERROR (Status)) { > > -Status = VariableLock->RequestToLock ( > > - VariableLock, > > +Status = RegisterBasicVariablePolicy ( > > + VariablePolicy, > > + &mHddPasswordVendorGuid, > > HDD_PASSWORD_VARIABLE_NAME, > > - &mHddPasswordVendorGuid > > + VARIABLE_POLICY_NO_MIN_SIZE, > > + VARIABLE_POLICY_NO_MAX_SIZE, > > + VARIABLE_POLICY_NO_MUST_ATTR, > > + VARIABLE_POLICY_NO_CANT_ATTR, > > + VARIABLE_POLICY_TYPE_LOCK_NOW > > ); > > DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", __FUNCTION__, > HDD_PASSWORD_VARIABLE_NAME, Status)); > > ASSERT_EFI_ERROR (Status); > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.h > b/SecurityPkg/HddPassword/HddPasswordDxe.h > index 231533e737..049a208794 100644 > --- a/SecurityPkg/HddPassword/HddPasswordDxe.h > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.h > @@ -17,7 +17,6 @@ > #include > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.inf > b/SecurityPkg/HddPassword/HddPasswordDxe.inf > index 06e8755ffc..2c0ebbcc78 100644 > --- a/SecurityPkg/HddPassword/HddPasswordDxe.inf > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.inf > @@ -50,6 +50,7 @@ >PrintLib > >UefiLib > >LockBoxLib > > + VariablePolicyHelperLib > >S3BootScriptLib > >PciLib > >BaseCryptLib > > @@ -63,7 +64,7 @@ >gEfiHiiConfigAccessProtocolGuid ## PRODUCES > >gEfiAtaPassThruProtocolGuid ## CONSUMES > >gEfiPciIoProtocolGuid ## CONSUMES > > - gEdkiiVariableLockProtocolGuid## CONSUMES > > + gEdkiiVariablePolicyProtocolGuid ## CONSUMES > > > > [Pcd] > >gEfiSecurityPkgTokenSpaceGuid.PcdSkipHddPasswordPrompt ## > CONSUMES > > diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc > index 3bad5375c0..3c62205162 100644 > --- a/SecurityPkg/SecurityPkg.dsc > +++ b/SecurityPkg/SecurityPkg.dsc > @@ -74,6 +74,7 @@ > > PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPo > licy/PlatformPKProtectionLibVarPolicy.inf > > > SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariablePro > visionLib/SecureBootVariableProvisionLib.inf > >TdxLib|MdePkg/Library/TdxLib/TdxLib.inf > > + > VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var > iablePolicyHelperLib.inf > > > > [LibraryClasses.ARM, LibraryClasses.AARCH64] > ># > > -- > 2.33.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all mess
[edk2-devel] [PATCH v2 0/3] Add IPMI SSIF definitions
Change from v1: - Separate the commit for the IPMI SSIF header and IPMI SSIF PCDs - Correct some indent and comment style. - Change the PCDs name for a more readable. - Support KCS/SMIC Interface Capabilities too. Tinh Nguyen (3): MdePkg/IndustryStandard: Add definitions for IPMI SSIF MdePkg: Add new PCDs for IPMI SSIF MdePkg/IndustryStandard: Add Interface Capabilities definitions MdePkg/MdePkg.dec | 26 ++ MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 46 + MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 3 files changed, 170 insertions(+) create mode 100644 MdePkg/Include/IndustryStandard/IpmiSsif.h -- 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103862): https://edk2.groups.io/g/devel/message/103862 Mute This Topic: https://groups.io/mt/98644351/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 1/3] MdePkg/IndustryStandard: Add definitions for IPMI SSIF
Specification reference: https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html Signed-off-by: Tinh Nguyen --- MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 1 file changed, 98 insertions(+) diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h b/MdePkg/Include/IndustryStandard/IpmiSsif.h new file mode 100644 index ..a5bfa14a9dfa --- /dev/null +++ b/MdePkg/Include/IndustryStandard/IpmiSsif.h @@ -0,0 +1,98 @@ +/** @file + IPMI SSIF Definitions + + Copyright (c) 2023, Ampere Computing LLC. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: +- IPMI Specification + Version 2.0, Rev. 1.1 + + https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html +**/ + +#ifndef IPMI_SSIF_H_ +#define IPMI_SSIF_H_ + +/// +/// Definitions for SMBUS Commands for SSIF +/// Table 12 - Summary of SMBUS Commands for SSIF +/// + +/// Write block +#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_WRITE0x02 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_START 0x06 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_MIDDLE 0x07 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_END 0x08 + +/// Read block +#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_READ0x03 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_START 0x03 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_MIDDLE 0x09 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_END 0x09 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_RETRY 0x0A + +/// +/// Definitions for Multi-Part Read Transactions +/// Section 12.5 +/// +#define IPMI_SSIF_MULTI_PART_READ_START_SIZE 0x1E +#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN1 0x00 +#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN2 0x01 +#define IPMI_SSIF_MULTI_PART_READ_END_PATTERN 0xFF + +/// +/// IPMI SSIF maximum message size +/// +#define IPMI_SSIF_INPUT_MESSAGE_SIZE_MAX 0xFF +#define IPMI_SSIF_OUTPUT_MESSAGE_SIZE_MAX 0xFF + +/// +/// IPMI SMBus system interface maximum packet size in byte +/// +#define IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES 0x20 + +typedef enum { + IpmiSsifPacketStart = 0, + IpmiSsifPacketMiddle, + IpmiSsifPacketEnd, + IpmiSsifPacketSingle, + IpmiSsifPacketMax +} IPMI_SSIF_PACKET_ATTRIBUTE; + +#pragma pack (1) +/// +/// IPMI SSIF Interface Request Format +/// Section 12.2 and 12.3 +/// +typedef struct { + UINT8NetFunc; + UINT8Command; +} IPMI_SSIF_REQUEST_HEADER; + +/// +/// IPMI SSIF Interface Response Format +/// Section 12.4 and 12.5 +/// +typedef struct { + UINT8StartPattern[2]; + UINT8NetFunc; + UINT8Command; +} IPMI_SSIF_RESPONSE_PACKET_START; + +typedef struct { + UINT8BlockNumber; +} IPMI_SSIF_RESPONSE_PACKET_MIDDLE; + +typedef struct { + UINT8EndPattern; +} IPMI_SSIF_RESPONSE_PACKET_END; + +typedef struct { + UINT8NetFunc; + UINT8Command; +} IPMI_SSIF_RESPONSE_SINGLE_PACKET; + +#pragma pack () + +#endif /* IPMI_SSIF_H_ */ -- 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103863): https://edk2.groups.io/g/devel/message/103863 Mute This Topic: https://groups.io/mt/98644354/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 2/3] MdePkg: Add new PCDs for IPMI SSIF
This change adds new PCDs for IPMI SSIF. Specification reference: https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html Signed-off-by: Tinh Nguyen --- MdePkg/MdePkg.dec | 26 1 file changed, 26 insertions(+) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 7488ccda7a00..b840092382cb 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -10,6 +10,7 @@ # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved. # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved. # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -2353,6 +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule] # @Prompt IPMI KCS Interface I/O Base Address gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x0031 + ## This is SMBus slave address for the SSIF to the BMC. + # The recommended value defined by IPMI specification is 0x20 (section 12.12). + # @Prompt IPMI SSIF SMBus slave address + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifSmbusSlaveAddr|0x20|UINT8|0x0032 + + ## This is the maximum number of IPMI SSIF request retries. + # The IPMI specification specified min value is 5 (section 12.17). + # @Prompt Number of IPMI SSIF request retries. + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0x0033 + + ## This is the required interval for each IPMI request retry. + # The IPMI specification specified a time range of 60ms to 250ms (section 12.17). + # The default setting is min. + # @Prompt Time between IPMI SSIF request retries. + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryIntervalMicrosecond|6|UINT32|0x0034 + + ## This value is the maximum retries of an IPMI SSIF response + # @Prompt Number of IPMI SSIF response retries. + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0x0035 + + ## This is the required interval for each IPMI response retry. + # The IPMI specification specified min value is 60ms (section 12.17). + # @Prompt Time-out for a response, internal + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryIntervalMicrosecond|6|UINT32|0x0036 + [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## This value is used to set the base address of PCI express hierarchy. # @Prompt PCI Express Base Address. -- 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103864): https://edk2.groups.io/g/devel/message/103864 Mute This Topic: https://groups.io/mt/98644587/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 3/3] MdePkg/IndustryStandard: Add Interface Capabilities definitions
This adds more definitions for the IPMI Get System Interface Capabilities command. Signed-off-by: Tinh Nguyen Reviewed-by: Abner Chang --- MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 46 1 file changed, 46 insertions(+) diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h index a5835ba08c00..b6bc91f46c2d 100644 --- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h @@ -13,6 +13,7 @@ Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved. Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. + Copyright (c) 2023, Ampere Computing LLC. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -1046,6 +1047,51 @@ typedef struct { // Constants and Structure definitions for "Get System Interface Capabilities" command to follow here // +#define IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SSIF 0x0 +#define IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_KCS 0x1 +#define IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SMIC 0x2 + +typedef union { + struct { +UINT8InterfaceType : 4; +UINT8Reserved : 4; + } Bits; + UINT8Uint8; +} IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_REQUEST; + +typedef union { + struct { +UINT8Version: 3; +UINT8PecSupport : 1; +UINT8Reserved : 2; +UINT8TransactionSupport : 2; + } Bits; + UINT8Uint8; +} IPMI_SYSTEM_INTERFACE_SSIF_CAPABILITIES; + +typedef union { + struct { +UINT8SystemInterfaceVersion : 3; +UINT8Reserved : 5; + } Bits; + UINT8Uint8; +} IPMI_SYSTEM_INTERFACE_KCS_SMIC_CAPABILITIES; + +typedef struct { + UINT8 CompletionCode; + UINT8 Reserved; + IPMI_SYSTEM_INTERFACE_SSIF_CAPABILITIESInterfaceCap; + UINT8 InputMsgSize; + UINT8 OutputMsgSize; +} IPMI_GET_SYSTEM_INTERFACE_SSIF_CAPABILITIES_RESPONSE; + +typedef struct { + UINT8 CompletionCode; + UINT8 Reserved; + IPMI_SYSTEM_INTERFACE_KCS_SMIC_CAPABILITIESInterfaceCap; + UINT8 InputMaxMsgSize; +} IPMI_GET_SYSTEM_INTERFACE_KCS_SMIC_CAPABILITIES_RESPONSE; + // // Definitions for Get System Interface Capabilities command SSIF transaction support // -- 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103865): https://edk2.groups.io/g/devel/message/103865 Mute This Topic: https://groups.io/mt/98644588/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/DSC: Restore AdvancedFeatures
Reviewed-by: Chasel Chiu Thanks, Chasel > -Original Message- > From: Oram, Isaac W > Sent: Tuesday, March 7, 2023 4:16 PM > To: devel@edk2.groups.io > Cc: Oram, Isaac W ; Desimone, Nathaniel L > ; Chiu, Chasel > Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1] > WhitleyOpenBoardPkg/DSC: Restore AdvancedFeatures > > Include for building Advanced Features was mistakenly removed in an earlier > commit. > > Cc: Nate DeSimone > Cc: Chasel Chiu > Signed-off-by: Isaac Oram > --- > Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > index c784df0144..9452867edb 100644 > --- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > +++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > @@ -59,6 +59,11 @@ > [PcdsFixedAtBuild] >gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1 > > +# > +# Include AdvancedFeatures > +# > +!include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc > + ># ># Platform On/Off features are defined here ># > -- > 2.39.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103866): https://edk2.groups.io/g/devel/message/103866 Mute This Topic: https://groups.io/mt/97462761/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Build: Add standalone MM build rules
Reviewed-by: Chasel Chiu Thanks, Chasel > -Original Message- > From: Oram, Isaac W > Sent: Wednesday, March 15, 2023 6:18 AM > To: devel@edk2.groups.io > Cc: Oram, Isaac W ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Liming ; > Dong, Eric > Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Build: > Add standalone MM build rules > > Adds MM_STANDALONE_CORE and MM_STANDALONE FFS file construction > rules. > > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao > Cc: Eric Dong > Signed-off-by: Isaac Oram > --- > .../MinPlatformPkg/Include/Fdf/RuleInclude.fdf| 15 +++ > 1 file changed, 15 insertions(+) > > diff --git a/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf > b/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf > index 85e6f773df..a737465d04 100644 > --- a/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf > +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf > @@ -241,3 +241,18 @@ >FILE FV_IMAGE = $(NAMED_GUID) { > FV_IMAGE FV |.fv >} > + > +[Rule.Common.MM_CORE_STANDALONE] > + FILE MM_CORE_STANDALONE = $(NAMED_GUID) { > +PE32 PE32$(INF_OUTPUT)/$(MODULE_NAME).efi > +UI STRING="$(MODULE_NAME)" Optional > +VERSION STRING="$(INF_VERSION)" Optional > BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.MM_STANDALONE] > + FILE MM_STANDALONE = $(NAMED_GUID) { > +SMM_DEPEXSMM_DEPEX Optional > $(INF_OUTPUT)/$(MODULE_NAME).depex > +PE32 PE32$(INF_OUTPUT)/$(MODULE_NAME).efi > +UI STRING="$(MODULE_NAME)" Optional > +VERSION STRING="$(INF_VERSION)" Optional > BUILD_NUM=$(BUILD_NUMBER) > + } > -- > 2.39.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103867): https://edk2.groups.io/g/devel/message/103867 Mute This Topic: https://groups.io/mt/97627030/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy
Hi Jiewen I add this patch into MTLS platform and collect the log. The below is before adding patch and after adding patch. There is no warring message. Before InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B 67E4C490 InstallProtocolInterface: 330D4706-F2A0-4E4F-A369-B66FA8D54385 68180030 !!! DEPRECATED INTERFACE !!! VariableLockRequestToLock() will go away soon! !!! DEPRECATED INTERFACE !!! Please move to use Variable Policy! !!! DEPRECATED INTERFACE !!! Variable: 737CDED7-448B-4801-B57D-B19483EC606F HddPassword HddPasswordDxeInit(): Lock HddPassword variable (Success) After InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B 67EA1370 InstallProtocolInterface: 330D4706-F2A0-4E4F-A369-B66FA8D54385 68153DB0 HddPasswordDxeInit(): Lock HddPassword variable (Success) Thanks -Original Message- From: Yao, Jiewen Sent: Wednesday, May 3, 2023 12:11 AM To: Liu, Linus ; devel@edk2.groups.io Cc: FST-FIR-PRC ; FST FIR Server ; Chu, Maggie Subject: RE: [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy Thanks. The patch loos good to me. Would you please share with us, how you validate the patch? > -Original Message- > From: Liu, Linus > Sent: Tuesday, April 11, 2023 5:55 PM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; FST-FIR-PRC p...@intel.com>; FST FIR Server ; Chu, Maggie > > Subject: [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit to > use Variable Policy > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4408 > > Change-Id: I3c4b466ef318766d6d70c9f73e36b94b5f10832c > Cc: Jiewen Yao > Cc: FST-FIR-PRC > Cc: FST FIR Server C > Cc: Maggie Chu > Signed-off-by: Linus Liu > --- > SecurityPkg/HddPassword/HddPasswordDxe.c | 16 +++- > SecurityPkg/HddPassword/HddPasswordDxe.h | 1 - > SecurityPkg/HddPassword/HddPasswordDxe.inf | 3 ++- > SecurityPkg/SecurityPkg.dsc| 1 + > 4 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c > b/SecurityPkg/HddPassword/HddPasswordDxe.c > index a1a63b67a4..c20fdbe83f 100644 > --- a/SecurityPkg/HddPassword/HddPasswordDxe.c > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c > @@ -9,6 +9,7 @@ > **/ > > > > #include "HddPasswordDxe.h" > > +#include > > > > EFI_GUIDmHddPasswordVendorGuid = > HDD_PASSWORD_CONFIG_GUID; > > CHAR16 mHddPasswordVendorStorageName[] = > L"HDD_PASSWORD_CONFIG"; > > @@ -2822,7 +2823,7 @@ HddPasswordDxeInit ( >HDD_PASSWORD_DXE_PRIVATE_DATA *Private; > >VOID *Registration; > >EFI_EVENT EndOfDxeEvent; > > - EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock; > > + EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; > > > >Private = NULL; > > > > @@ -2858,12 +2859,17 @@ HddPasswordDxeInit ( >// > >// Make HDD_PASSWORD_VARIABLE_NAME variable read-only. > >// > > - Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, > NULL, (VOID **)&VariableLock); > > + Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, > + NULL, > (VOID **)&VariablePolicy); > >if (!EFI_ERROR (Status)) { > > -Status = VariableLock->RequestToLock ( > > - VariableLock, > > +Status = RegisterBasicVariablePolicy ( > > + VariablePolicy, > > + &mHddPasswordVendorGuid, > > HDD_PASSWORD_VARIABLE_NAME, > > - &mHddPasswordVendorGuid > > + VARIABLE_POLICY_NO_MIN_SIZE, > > + VARIABLE_POLICY_NO_MAX_SIZE, > > + VARIABLE_POLICY_NO_MUST_ATTR, > > + VARIABLE_POLICY_NO_CANT_ATTR, > > + VARIABLE_POLICY_TYPE_LOCK_NOW > > ); > > DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", > __FUNCTION__, HDD_PASSWORD_VARIABLE_NAME, Status)); > > ASSERT_EFI_ERROR (Status); > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.h > b/SecurityPkg/HddPassword/HddPasswordDxe.h > index 231533e737..049a208794 100644 > --- a/SecurityPkg/HddPassword/HddPasswordDxe.h > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.h > @@ -17,7 +17,6 @@ > #include > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.inf > b/SecurityPkg/HddPassword/HddPasswordDxe.inf > index 06e8755ffc..2c0ebbcc78 100644 > --- a/SecurityPkg/HddPassword/HddPasswordDxe.inf > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.inf > @@ -50,6 +50,7 @@ >PrintLib > >UefiLib > >LockBoxLib > > + VariablePolicyHelperLib > >S3BootScriptLib > >PciLib > >BaseCryptLib > > @@ -63,7 +64,7 @@ >gEfiHiiConfigAccessProtocolGuid ## PRODUCES > >gEfiAtaPassThruProtocolGu
Re: [edk2-devel] [PATCH v2 1/3] MdePkg/IndustryStandard: Add definitions for IPMI SSIF
[AMD Official Use Only - General] Reviewed-by: Abner Chang BTW, I don't see maintainers are CCed in the commit message. Not sure if this is acceptable as usually we can see who are the maintainers in the commit message (either in patch email or git commit history) instead of looking at Cc in email. Abner > -Original Message- > From: Tinh Nguyen > Sent: Wednesday, May 3, 2023 1:40 AM > To: devel@edk2.groups.io > Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > gaolim...@byosoft.com.cn; zhiguang@intel.com; Chang, Abner > ; Tinh Nguyen > > Subject: [PATCH v2 1/3] MdePkg/IndustryStandard: Add definitions for IPMI > SSIF > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > Specification reference: > https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/i > pmi-second-gen-interface-spec-v2-rev1-1.html > > Signed-off-by: Tinh Nguyen > --- > MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 > > 1 file changed, 98 insertions(+) > > diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h > b/MdePkg/Include/IndustryStandard/IpmiSsif.h > new file mode 100644 > index ..a5bfa14a9dfa > --- /dev/null > +++ b/MdePkg/Include/IndustryStandard/IpmiSsif.h > @@ -0,0 +1,98 @@ > +/** @file > + IPMI SSIF Definitions > + > + Copyright (c) 2023, Ampere Computing LLC. All rights reserved. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Revision Reference: > +- IPMI Specification > + Version 2.0, Rev. 1.1 > + > + > +https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ > ipmi > +-second-gen-interface-spec-v2-rev1-1.html > +**/ > + > +#ifndef IPMI_SSIF_H_ > +#define IPMI_SSIF_H_ > + > +/// > +/// Definitions for SMBUS Commands for SSIF /// Table 12 - Summary of > +SMBUS Commands for SSIF /// > + > +/// Write block > +#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_WRITE0x02 > +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_START 0x06 > +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_MIDDLE 0x07 > +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_END 0x08 > + > +/// Read block > +#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_READ0x03 > +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_START 0x03 > +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_MIDDLE 0x09 > +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_END 0x09 > +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_RETRY 0x0A > + > +/// > +/// Definitions for Multi-Part Read Transactions /// Section 12.5 /// > +#define IPMI_SSIF_MULTI_PART_READ_START_SIZE 0x1E > +#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN1 0x00 #define > +IPMI_SSIF_MULTI_PART_READ_START_PATTERN2 0x01 > +#define IPMI_SSIF_MULTI_PART_READ_END_PATTERN 0xFF > + > +/// > +/// IPMI SSIF maximum message size > +/// > +#define IPMI_SSIF_INPUT_MESSAGE_SIZE_MAX 0xFF > +#define IPMI_SSIF_OUTPUT_MESSAGE_SIZE_MAX 0xFF > + > +/// > +/// IPMI SMBus system interface maximum packet size in byte /// #define > +IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES 0x20 > + > +typedef enum { > + IpmiSsifPacketStart = 0, > + IpmiSsifPacketMiddle, > + IpmiSsifPacketEnd, > + IpmiSsifPacketSingle, > + IpmiSsifPacketMax > +} IPMI_SSIF_PACKET_ATTRIBUTE; > + > +#pragma pack (1) > +/// > +/// IPMI SSIF Interface Request Format > +/// Section 12.2 and 12.3 > +/// > +typedef struct { > + UINT8NetFunc; > + UINT8Command; > +} IPMI_SSIF_REQUEST_HEADER; > + > +/// > +/// IPMI SSIF Interface Response Format /// Section 12.4 and 12.5 /// > +typedef struct { > + UINT8StartPattern[2]; > + UINT8NetFunc; > + UINT8Command; > +} IPMI_SSIF_RESPONSE_PACKET_START; > + > +typedef struct { > + UINT8BlockNumber; > +} IPMI_SSIF_RESPONSE_PACKET_MIDDLE; > + > +typedef struct { > + UINT8EndPattern; > +} IPMI_SSIF_RESPONSE_PACKET_END; > + > +typedef struct { > + UINT8NetFunc; > + UINT8Command; > +} IPMI_SSIF_RESPONSE_SINGLE_PACKET; > + > +#pragma pack () > + > +#endif /* IPMI_SSIF_H_ */ > -- > 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103869): https://edk2.groups.io/g/devel/message/103869 Mute This Topic: https://groups.io/mt/98644354/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 2/3] MdePkg: Add new PCDs for IPMI SSIF
[AMD Official Use Only - General] Acked-by: Abner Chang > -Original Message- > From: Tinh Nguyen > Sent: Wednesday, May 3, 2023 1:49 AM > To: devel@edk2.groups.io > Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > gaolim...@byosoft.com.cn; zhiguang@intel.com; Chang, Abner > ; Tinh Nguyen > > Subject: [PATCH v2 2/3] MdePkg: Add new PCDs for IPMI SSIF > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > This change adds new PCDs for IPMI SSIF. > > Specification reference: > https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/i > pmi-second-gen-interface-spec-v2-rev1-1.html > > Signed-off-by: Tinh Nguyen > --- > MdePkg/MdePkg.dec | 26 > 1 file changed, 26 insertions(+) > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index > 7488ccda7a00..b840092382cb 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -10,6 +10,7 @@ > # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights > reserved. # Copyright (c) 2021 - 2022, Arm Limited. All rights > reserved. # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights > reserved. > +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -2353,6 +2354,31 @@ > [PcdsFixedAtBuild,PcdsPatchableInModule] ># @Prompt IPMI KCS Interface I/O Base Address > > gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00 > 31 > > + ## This is SMBus slave address for the SSIF to the BMC. > + # The recommended value defined by IPMI specification is 0x20 (section > 12.12). > + # @Prompt IPMI SSIF SMBus slave address > + > + > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifSmbusSlaveAddr|0x20|UINT8|0x00 > > + 32 > + > + ## This is the maximum number of IPMI SSIF request retries. > + # The IPMI specification specified min value is 5 (section 12.17). > + # @Prompt Number of IPMI SSIF request retries. > + > + > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0 > x000 > + 00033 > + > + ## This is the required interval for each IPMI request retry. > + # The IPMI specification specified a time range of 60ms to 250ms (section > 12.17). > + # The default setting is min. > + # @Prompt Time between IPMI SSIF request retries. > + > + > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryIntervalMicrosecond| > 60 > + 000|UINT32|0x0034 > + > + ## This value is the maximum retries of an IPMI SSIF response # > + @Prompt Number of IPMI SSIF response retries. > + > + > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0 > x000 > + 00035 > + > + ## This is the required interval for each IPMI response retry. > + # The IPMI specification specified min value is 60ms (section 12.17). > + # @Prompt Time-out for a response, internal > + > + > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryIntervalMicrosecond > |6 > + |UINT32|0x0036 > + > [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] >## This value is used to set the base address of PCI express hierarchy. ># @Prompt PCI Express Base Address. > -- > 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103870): https://edk2.groups.io/g/devel/message/103870 Mute This Topic: https://groups.io/mt/98644587/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy
That only proves that you did change the interface. But that cannot prove you change it right. Have you done any function test? For example: 1) The HDD password feature still works? 2) The variable is really locked? > -Original Message- > From: Liu, Linus > Sent: Wednesday, May 3, 2023 8:40 AM > To: Yao, Jiewen ; devel@edk2.groups.io > Cc: FST-FIR-PRC ; FST FIR Server > ; Chu, Maggie > Subject: RE: [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit > to use Variable Policy > > Hi Jiewen > I add this patch into MTLS platform and collect the log. > The below is before adding patch and after adding patch. There is no warring > message. > > > Before > > InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B > 67E4C490 > InstallProtocolInterface: 330D4706-F2A0-4E4F-A369-B66FA8D54385 > 68180030 > !!! DEPRECATED INTERFACE !!! VariableLockRequestToLock() will go away > soon! > !!! DEPRECATED INTERFACE !!! Please move to use Variable Policy! > !!! DEPRECATED INTERFACE !!! Variable: 737CDED7-448B-4801-B57D- > B19483EC606F HddPassword > HddPasswordDxeInit(): Lock HddPassword variable (Success) > > > After > > InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B > 67EA1370 > InstallProtocolInterface: 330D4706-F2A0-4E4F-A369-B66FA8D54385 > 68153DB0 > HddPasswordDxeInit(): Lock HddPassword variable (Success) > > > Thanks > > > > -Original Message- > From: Yao, Jiewen > Sent: Wednesday, May 3, 2023 12:11 AM > To: Liu, Linus ; devel@edk2.groups.io > Cc: FST-FIR-PRC ; FST FIR Server > ; Chu, Maggie > Subject: RE: [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit > to use Variable Policy > > Thanks. The patch loos good to me. > > Would you please share with us, how you validate the patch? > > > > > -Original Message- > > From: Liu, Linus > > Sent: Tuesday, April 11, 2023 5:55 PM > > To: devel@edk2.groups.io > > Cc: Yao, Jiewen ; FST-FIR-PRC > p...@intel.com>; FST FIR Server ; Chu, Maggie > > > > Subject: [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit > to > > use Variable Policy > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4408 > > > > Change-Id: I3c4b466ef318766d6d70c9f73e36b94b5f10832c > > Cc: Jiewen Yao > > Cc: FST-FIR-PRC > > Cc: FST FIR Server C > > Cc: Maggie Chu > > Signed-off-by: Linus Liu > > --- > > SecurityPkg/HddPassword/HddPasswordDxe.c | 16 +++- > > SecurityPkg/HddPassword/HddPasswordDxe.h | 1 - > > SecurityPkg/HddPassword/HddPasswordDxe.inf | 3 ++- > > SecurityPkg/SecurityPkg.dsc| 1 + > > 4 files changed, 14 insertions(+), 7 deletions(-) > > > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c > > b/SecurityPkg/HddPassword/HddPasswordDxe.c > > index a1a63b67a4..c20fdbe83f 100644 > > --- a/SecurityPkg/HddPassword/HddPasswordDxe.c > > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c > > @@ -9,6 +9,7 @@ > > **/ > > > > > > > > #include "HddPasswordDxe.h" > > > > +#include > > > > > > > > EFI_GUIDmHddPasswordVendorGuid = > > HDD_PASSWORD_CONFIG_GUID; > > > > CHAR16 mHddPasswordVendorStorageName[] = > > L"HDD_PASSWORD_CONFIG"; > > > > @@ -2822,7 +2823,7 @@ HddPasswordDxeInit ( > >HDD_PASSWORD_DXE_PRIVATE_DATA *Private; > > > >VOID *Registration; > > > >EFI_EVENT EndOfDxeEvent; > > > > - EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock; > > > > + EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; > > > > > > > >Private = NULL; > > > > > > > > @@ -2858,12 +2859,17 @@ HddPasswordDxeInit ( > >// > > > >// Make HDD_PASSWORD_VARIABLE_NAME variable read-only. > > > >// > > > > - Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, > > NULL, (VOID **)&VariableLock); > > > > + Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, > > + NULL, > > (VOID **)&VariablePolicy); > > > >if (!EFI_ERROR (Status)) { > > > > -Status = VariableLock->RequestToLock ( > > > > - VariableLock, > > > > +Status = RegisterBasicVariablePolicy ( > > > > + VariablePolicy, > > > > + &mHddPasswordVendorGuid, > > > > HDD_PASSWORD_VARIABLE_NAME, > > > > - &mHddPasswordVendorGuid > > > > + VARIABLE_POLICY_NO_MIN_SIZE, > > > > + VARIABLE_POLICY_NO_MAX_SIZE, > > > > + VARIABLE_POLICY_NO_MUST_ATTR, > > > > + VARIABLE_POLICY_NO_CANT_ATTR, > > > > + VARIABLE_POLICY_TYPE_LOCK_NOW > > > > ); > > > > DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", > > __FUNCTION__, HDD_PASSWORD_VARIABLE_NAME, Status)); > > > > ASSERT_EFI_ERROR (Status); > > > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.h > > b/SecurityPkg/HddPassword/HddPasswordDxe.h > > index
Re: [edk2-devel] [PATCH v2 2/3] MdePkg: Add new PCDs for IPMI SSIF
[AMD Official Use Only - General] Ah sorry, one thing I missed. Please check feedback below. > -Original Message- > From: Chang, Abner > Sent: Wednesday, May 3, 2023 9:13 AM > To: Tinh Nguyen ; > devel@edk2.groups.io > Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > gaolim...@byosoft.com.cn; zhiguang@intel.com > Subject: RE: [PATCH v2 2/3] MdePkg: Add new PCDs for IPMI SSIF > > [AMD Official Use Only - General] > > Acked-by: Abner Chang > > > -Original Message- > > From: Tinh Nguyen > > Sent: Wednesday, May 3, 2023 1:49 AM > > To: devel@edk2.groups.io > > Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > > gaolim...@byosoft.com.cn; zhiguang@intel.com; Chang, Abner > > ; Tinh Nguyen > > > Subject: [PATCH v2 2/3] MdePkg: Add new PCDs for IPMI SSIF > > > > Caution: This message originated from an External Source. Use proper > > caution when opening attachments, clicking links, or responding. > > > > > > This change adds new PCDs for IPMI SSIF. > > > > Specification reference: > > > https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/i > > pmi-second-gen-interface-spec-v2-rev1-1.html > > > > Signed-off-by: Tinh Nguyen > > --- > > MdePkg/MdePkg.dec | 26 > > 1 file changed, 26 insertions(+) > > > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index > > 7488ccda7a00..b840092382cb 100644 > > --- a/MdePkg/MdePkg.dec > > +++ b/MdePkg/MdePkg.dec > > @@ -10,6 +10,7 @@ > > # Copyright (c) 2022, Loongson Technology Corporation Limited. All > > rights reserved. # Copyright (c) 2021 - 2022, Arm Limited. All > > rights reserved. # Copyright (C) 2023 Advanced Micro Devices, > > Inc. All rights reserved. > > +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved. > > # > > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -2353,6 +2354,31 > > @@ [PcdsFixedAtBuild,PcdsPatchableInModule] > ># @Prompt IPMI KCS Interface I/O Base Address > > > > > gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00 > > 31 > > > > + ## This is SMBus slave address for the SSIF to the BMC. > > + # The recommended value defined by IPMI specification is 0x20 > > + (section > > 12.12). > > + # @Prompt IPMI SSIF SMBus slave address > > + > > + > > > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifSmbusSlaveAddr|0x20|UINT8|0x00 > > > > + 32 > > + > > + ## This is the maximum number of IPMI SSIF request retries. > > + # The IPMI specification specified min value is 5 (section 12.17). > > + # @Prompt Number of IPMI SSIF request retries. > > + > > + > > > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0 > > x000 > > + 00033 > > + > > + ## This is the required interval for each IPMI request retry. > > + # The IPMI specification specified a time range of 60ms to 250ms > > + (section > > 12.17). > > + # The default setting is min. > > + # @Prompt Time between IPMI SSIF request retries. > > + > > + > > > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryIntervalMicrosecond| > > 60 > > + 000|UINT32|0x0034 > > + > > + ## This value is the maximum retries of an IPMI SSIF response # > > + @Prompt Number of IPMI SSIF response retries. Please also mention that the value of PcdIpmiSsifResponseRetryCount refers to Linux driver. Thanks Abner > > + > > + > > > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0 > > x000 > > + 00035 > > + > > + ## This is the required interval for each IPMI response retry. > > + # The IPMI specification specified min value is 60ms (section 12.17). > > + # @Prompt Time-out for a response, internal > > + > > + > > > gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryIntervalMicrosecond > > |6 > > + |UINT32|0x0036 > > + > > [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] > >## This value is used to set the base address of PCI express hierarchy. > ># @Prompt PCI Express Base Address. > > -- > > 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103872): https://edk2.groups.io/g/devel/message/103872 Mute This Topic: https://groups.io/mt/98644587/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 0/3] Add IPMI SSIF definitions
[AMD Official Use Only - General] Hi Tinh, Thanks for this effort. I have no problem with this patch set but you still have to get R-B from maintainers. Two feedbacks here, - Please put BZ # in commit message in the patch 1/3-3/3. Ex: BZ#: 4434 - Add IPMI SSIF definitions - As the feedback I gave to patch 1/3. I think we better have maintainers Cc in the commit message. Thanks Abner > -Original Message- > From: Tinh Nguyen > Sent: Wednesday, May 3, 2023 1:40 AM > To: devel@edk2.groups.io > Cc: patc...@amperecomputing.com; michael.d.kin...@intel.com; > gaolim...@byosoft.com.cn; zhiguang@intel.com; Chang, Abner > ; Tinh Nguyen > > Subject: [PATCH v2 0/3] Add IPMI SSIF definitions > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > Change from v1: > - Separate the commit for the IPMI SSIF header and IPMI SSIF PCDs > - Correct some indent and comment style. > - Change the PCDs name for a more readable. > - Support KCS/SMIC Interface Capabilities too. > > Tinh Nguyen (3): > MdePkg/IndustryStandard: Add definitions for IPMI SSIF > MdePkg: Add new PCDs for IPMI SSIF > MdePkg/IndustryStandard: Add Interface Capabilities definitions > > MdePkg/MdePkg.dec | 26 ++ > MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 46 + > MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 > > 3 files changed, 170 insertions(+) > create mode 100644 MdePkg/Include/IndustryStandard/IpmiSsif.h > > -- > 2.40.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103873): https://edk2.groups.io/g/devel/message/103873 Mute This Topic: https://groups.io/mt/98644351/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/1] OvmfPkg/BhyveBhf: install bhyve's ACPI tables
I applied the patch and tested it. The UEFI Shell command "acpiview" reports an error. I enabled the "acpiview" command with the patch: diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index d0d2712c5662..0c04e4834cf7 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -785,6 +785,7 @@ [Components] NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf !if $(NETWORK_IP6_ENABLE) == TRUE NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf !endif The bhyve command I used is: bhyve -AHP -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,./guest.img -s 4:0,ahci-cd,/home/bcran/FreeBSD-14.0-CURRENT-amd64-20230427-60167184abd5-262599-disc1.iso -c 4 -m 1G -s 29,fbuf,tcp=0.0.0.0:5900,w=1280,h=1024,wait -s 30,xhci,tablet -l bootrom,/home/bcran/src/uefi/edk2/Build/BhyveX64/DEBUG_GCC5/FV/BHYVE_CODE.fd,/home/bcran/src/uefi/edk2/Build/BhyveX64/DEBUG_GCC5/FV/BHYVE_VARS.fd -l com1,stdio guest MADT : Signature : APIC Length : 114 Revision : 1 Checksum : 0x66 Oem ID : BHYVE Oem Table ID : BVAPIC Oem Revision : 0x1 Creator ID : BASL Creator Revision : 0x20220504 Local Interrupt Controller Address : 0xFEE0 Flags : 0x1 PROCESSOR LOCAL APIC : Type : 0x0 Length : 8 ACPI Processor UID : 0x0 APIC ID : 0x0 Flags : 0x1 Enabled : 1 Online Capable : 0 Reserved : 0 PROCESSOR LOCAL APIC : Type : 0x0 Length : 8 ACPI Processor UID : 0x1 APIC ID : 0x1 Flags : 0x1 Enabled : 1 Online Capable : 0 Reserved : 0 PROCESSOR LOCAL APIC : Type : 0x0 Length : 8 ACPI Processor UID : 0x2 APIC ID : 0x2 Flags : 0x1 Enabled : 1 Online Capable : 0 Reserved : 0 PROCESSOR LOCAL APIC : Type : 0x0 Length : 8 ACPI Processor UID : 0x3 APIC ID : 0x3 Flags : 0x1 Enabled : 1 Online Capable : 0 Reserved : 0 IO APIC : Type : 0x1 Length : 12 I/O APIC ID : 0x0 Reserved : 0x0 I/O APIC Address : 0xFEC0 Global System Interrupt Base : 0x0 INTERRUPT SOURCE OVERRIDE : Type : 0x2 Length : 10 Bus : 0x0 Source : 0x0 Global System Interrupt : 0x2 Flags : 0x5 INTERRUPT SOURCE OVERRIDE : Type : 0x2 Length : 10 Bus : 0x0 Source : 0x9 Global System Interrupt : 0x9 Flags : 0xF ERROR: Unknown Interrupt Controller Structure, Type = 4, Length = 6 -- Rebecca Cran On 4/17/23 05:53, Rebecca Cran wrote: On 4/17/23 5:46 AM, Corvin Köhne wrote: + +/** + Get the address of bhyve's ACPI Root System Description Pointer (RSDP). + + @param RsdpPtr Return pointer to RSDP. + + @return EFI_SUCCESS Bhyve's RSDP successfully found. + @return EFI_NOT_FOUND Couldn't find bhyve's RSDP. + @return EFI_UNSUPPORTED Revision is lower than 2. + @return EFI_PROTOCOL_ERROR Invalid RSDP found. I think these should be @retval instead of @return ? + if (Rsdp->Revision < 2) { + DEBUG ((DEBUG_INFO, "%a: unsupported RSDP found\n", __FUNCTION__)); You missed converting this __FUNCTION__ to __func__. + // + // For ACP
Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg/BhyveBhf: install bhyve's ACPI tables
Reviewed-by: Rebecca Cran On 4/17/23 06:11, Corvin Köhne wrote: It's much easier to create configuration dependend ACPI tables for bhyve than for OVMF. For this reason, don't use the statically created ACPI tables provided by OVMF. Instead prefer the dynamically created ACPI tables of bhyve. If bhyve provides no ACPI tables or we are unable to detect those, fall back to OVMF tables. Ideally, we use the qemu fwcfg interface to pass the ACPI tables from bhyve to OVMF. bhyve will support this in the future. However, current bhyve executables don't support passing ACPI tables by the qemu fwcfg interface. They just copy the ACPI into main memory. For that reason, pick up the ACPI tables from main memory. Implementation is similar to OvmfPkg/XenAcpiPlatformDxe/Xen.c. Signed-off-by: Corvin Köhne Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Rebecca Cran Cc: Peter Grehan --- MdePkg/Include/Uefi/UefiBaseType.h | 2 + OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h | 6 + OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c | 17 ++ OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c| 258 +++ 4 files changed, 283 insertions(+) diff --git a/MdePkg/Include/Uefi/UefiBaseType.h b/MdePkg/Include/Uefi/UefiBaseType.h index 83975a08eb4c..b18a0760ee61 100644 --- a/MdePkg/Include/Uefi/UefiBaseType.h +++ b/MdePkg/Include/Uefi/UefiBaseType.h @@ -54,6 +54,8 @@ typedef UINT64 EFI_PHYSICAL_ADDRESS; /// typedef UINT64 EFI_VIRTUAL_ADDRESS; +#define NUMERIC_VALUE_AS_POINTER(Type, Value) ((Type *) ((UINTN)(Value))) + /// /// EFI Time Abstraction: /// Year: 1900 - diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h index 54d1af073eab..b2724135d09f 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h @@ -46,6 +46,12 @@ BhyveInstallAcpiTable ( OUT UINTN*TableKey ); +EFI_STATUS +EFIAPI +InstallBhyveTables ( + IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol + ); + EFI_STATUS EFIAPI InstallXenTables ( diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c index 999e9f151ebb..6077d4d313a3 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c @@ -243,6 +243,23 @@ InstallAcpiTables ( { EFI_STATUS Status; + Status = InstallBhyveTables (AcpiTable); + if (!EFI_ERROR (Status)) { +return EFI_SUCCESS; + } + + if (Status != EFI_NOT_FOUND) { +DEBUG ( + ( + DEBUG_WARN, + "%a: unable to install bhyve's ACPI tables (%r)\n", + __func__, + Status + ) + ); +return Status; + } + Status = InstallOvmfFvTables (AcpiTable); return Status; diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c b/OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c index e216a21bfaed..fa5e79bfe3b4 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c @@ -13,6 +13,18 @@ #include #include // QemuFwCfgFindFile() +#define BHYVE_ACPI_PHYSICAL_ADDRESS ((UINTN)0x000F2400) +#define BHYVE_BIOS_PHYSICAL_END ((UINTN)0x0010) + +#pragma pack (1) + +typedef struct { + EFI_ACPI_DESCRIPTION_HEADERHeader; + UINT64 Tables[0]; +} EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE; + +#pragma pack () + STATIC EFI_STATUS EFIAPI @@ -164,3 +176,249 @@ BhyveInstallAcpiTable ( TableKey ); } + +/** + Get the address of bhyve's ACPI Root System Description Pointer (RSDP). + + @param RsdpPtr Return pointer to RSDP. + + @retval EFI_SUCCESS Bhyve's RSDP successfully found. + @retval EFI_NOT_FOUND Couldn't find bhyve's RSDP. + @retval EFI_UNSUPPORTED Revision is lower than 2. + @retval EFI_PROTOCOL_ERROR Invalid RSDP found. + +**/ +EFI_STATUS +EFIAPI +BhyveGetAcpiRsdp ( + OUT EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER **RsdpPtr + ) +{ + UINTN RsdpAddress; + EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; + UINT8 Sum; + + if (RsdpPtr == NULL) { +return EFI_INVALID_PARAMETER; + } + + // + // Detect the RSDP + // + for (RsdpAddress = BHYVE_ACPI_PHYSICAL_ADDRESS; + RsdpAddress < BHYVE_BIOS_PHYSICAL_END; + RsdpAddress += 0x10) + { +Rsdp = NUMERIC_VALUE_AS_POINTER ( + EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER, + RsdpAddress + ); +if (Rsdp->Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE) { + continue; +} + +if (Rsdp->Revision < 2) { + DEBUG ((DEBUG_WARN, "%a: unsupported RSDP found\n", __func__)); + return EFI_UNSUPPORTED; +} + +// +// For ACPI 1.0/2.0/3.0 the checksum of first
Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library.
Thanks Leif! To align with your suggestion I think we can define below MACROs in FdtLib.h. Library consumers can use those MACROs to convert structure data between Big endian and Little endian. (better readability) Mike, what do you think? Thanks, Chasel // // Definitions for transferring FDT structure data between big-endian (FDT) and little-endian (CPU) // #define CPU_TO_FDT16(x) SwapBytes16 (x) #define FDT16_TO_CPU(x) SwapBytes16 (x) #define CPU_TO_FDT32(x) SwapBytes32 (x) #define FDT32_TO_CPU(x) SwapBytes32 (x) #define CPU_TO_FDT64(x) SwapBytes64 (x) #define FDT64_TO_CPU(x) SwapBytes64 (x) > -Original Message- > From: devel@edk2.groups.io On Behalf Of Leif > Lindholm > Sent: Tuesday, May 2, 2023 4:42 AM > To: devel@edk2.groups.io; Chiu, Chasel ; Kinney, > Michael D > Cc: Lin, Benny ; Gao, Liming > ; Liu, Zhiguang ; Pedro > Falcato > Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. > > Hi Chasel, > > Apologies, spent last week at Linaro Connect with little time to follow > the list. > > If we're seeing this purely as a wrapper on libfdt, then it shouldn't > need to provide additional functionality on top of what it provides. > My initial impression was that this library was attempting to do more, > but then I mostly skimmed it, and that appears to have been incorrect. > > What I *really* don't want is mixing abstractions. I.e. if we're getting > the pointers through libfdt calls, we should be using the libfdt > accessor functions to extract the data correctly. And expose the > cpu_to_fdt*/fdt*_to_cpu accessors through the library. Presumably as > Fdt*ToCpu/CpuToFdt*. > > Regards, > > Leif > > > On 2023-05-01 17:31, Chiu, Chasel wrote: > > > > Hi Leif, > > > > Would you please share your ideas and respond Mike's question too? > > > > Thanks, > > Chasel > > > > > > > >> -Original Message- > >> From: devel@edk2.groups.io On Behalf Of Chiu, > Chasel > >> Sent: Tuesday, April 25, 2023 10:22 PM > >> To: devel@edk2.groups.io; Kinney, Michael D ; > >> Leif Lindholm > >> Cc: Lin, Benny ; Leif Lindholm > >> ; Gao, Liming ; > Liu, > >> Zhiguang ; Pedro Falcato > > >> Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. > >> > >> > >> Hello, > >> > >> Since platform may also define other FDT structures, this EDK2 library may > not > >> be able to convert all the FDT structures to little endian. > >> We might define a generic MACRO in library like > >> CONVERT_FDT_DATA_TO_LITTLE_ENDIAN which can be used for all > structure > >> data, but it will be almost like calling SwapBytes** directly. > >> Any other suggestion? > >> > >> Thanks, > >> Chasel > >> > >> > >>> -Original Message- > >>> From: devel@edk2.groups.io On Behalf Of Michael > D > >>> Kinney > >>> Sent: Monday, April 24, 2023 10:41 AM > >>> To: Leif Lindholm ; devel@edk2.groups.io > >>> Cc: Lin, Benny ; Leif Lindholm > >>> ; Gao, Liming ; > >> Liu, > >>> Zhiguang ; Pedro Falcato > >> ; > >>> Kinney, Michael D > >>> Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. > >>> > >>> Hi Leif, > >>> > >>> Do you have a proposal or small example on what you want to see > >>> in the library? > >>> > >>> Mike > >>> > -Original Message- > From: Leif Lindholm > Sent: Monday, April 24, 2023 10:29 AM > To: devel@edk2.groups.io; Kinney, Michael D > > Cc: Lin, Benny ; Leif Lindholm > >>> ; Gao, Liming ; > >> Liu, > Zhiguang ; Pedro Falcato > >>> > Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. > > Apologies, I was refactoring a git tree and switched off the world :) > > Well, being a bit late to the party ... my view is it would be > preferable if we put the byteswapping in the library. > > The DT format is *defined* to be big-endian, 32-bit cells. So frankly, > I have no problems with pushing responsibility onto individual > platforms if they have decided to be "clever" by ignoring that - > if that gets rid of a bunch of boilerplate for sensibly behaving > platforms. > > Maybe another excuse for getting > https://github.com/tianocore/edk2- > >>> platforms/blob/master/Silicon/NXP/Library/IoAccessLib/IoAccessLib.c > into MdePkg? > > / > Leif > > On Thu, Apr 20, 2023 at 16:44:03 +, Michael D Kinney wrote: > > Hi Leif, > > > > What is your opinion on FDT being big endian. > > > > Do we want the lib to help with that aspect, or leave it up to the > consumer > >> of > >>> the lib to > > convert as needed? Seems like an area that could be very error prone if > we > >>> are not > > careful. > > > > Mike > > > >> -Original Message- > >> From: Lin, Benny > >> Sent: Wednesday, April 19, 2023 9:25 PM > >> To: Kinney, Michael D ; > >>> devel@edk2.groups.io > >> Cc: Gao, Liming ; Liu, Zhiguang > >>> ; Pedro Falcato > >> Sub
[edk2-devel] [PATCH v5] MinPlatformPkg: Update HWSignature filed in FACS
From: VincentX Ke REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4428 Calculating CRC based on each ACPI table. Update HWSignature filed in FACS based on CRC while ACPI table changed. Change-Id: Ic0ca66ff10cda0fbcd0683020fab1bc9aea9b78c Signed-off-by: VincentX Ke Cc: Chasel Chiu Cc: Nate DeSimone Cc: Isaac Oram Cc: Liming Gao Cc: Eric Dong Signed-off-by: VincentX Ke --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 182 +--- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf | 1 + 2 files changed, 118 insertions(+), 65 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index e967031a3b..a940424ced 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -1191,98 +1191,150 @@ PlatformUpdateTables ( } /** - This function calculates RCR based on PCI Device ID and Vendor ID from the devices - available on the platform. - It also includes other instances of BIOS change to calculate CRC and provides as - HWSignature filed in FADT table. + This function calculates CRC based on each offset in the ACPI table. + + @param[in] Table The pointer to ACPI table that +required to calculate CRC. + + @retval CRC A pointer to allocate UINT32 that +contains the CRC32 data. +**/ +UINT32 +AcpiTableCrcCalculator ( + IN VOID *Table + ) +{ + UINT32 CRC; + + CRC = 0; + + // + // Calculate CRC value. + // + if (((EFI_ACPI_6_5_COMMON_HEADER *)(UINTN)Table)->Signature == EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) { +// +// Zero HardwareSignature field before Calculating FACS CRC +// +do { + ((EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Table)->HardwareSignature = 0; +} while (((EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Table)->HardwareSignature); + +gBS->CalculateCrc32 ((UINT8 *)Table, (UINTN)((EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Table)->Length, &CRC); + } else { +gBS->CalculateCrc32 ((UINT8 *)Table, (UINTN)((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Table)->Length, &CRC); + } + + return CRC; +} + +/** + This function calculates CRC based on each ACPI table. + It also calculates CRC and provides as HWSignature filed in FACS. **/ VOID -IsHardwareChange ( +IsAcpiTableChange ( VOID ) { - EFI_STATUSStatus; - UINTN Index; - UINTN HandleCount; - EFI_HANDLE*HandleBuffer; - EFI_PCI_IO_PROTOCOL *PciIo; - UINT32CRC; - UINT32*HWChange; - UINTN HWChangeSize; - UINT32PciId; - UINTN Handle; - EFI_ACPI_6_3_FIRMWARE_ACPI_CONTROL_STRUCTURE *FacsPtr; - EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE*pFADT; - - HandleCount = 0; - HandleBuffer = NULL; - - Status = gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiPciIoProtocolGuid, - NULL, - &HandleCount, - &HandleBuffer - ); - if (EFI_ERROR (Status)) { -return; // PciIO protocol not installed yet! + EFI_STATUSStatus; + UINTN Index; + UINTN AcpiTableCount; + UINT32Table; + UINT32HWSignature; + UINT32*AcpiTableCrc; + EFI_ACPI_6_5_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; + EFI_ACPI_DESCRIPTION_HEADER *Rsdt; + EFI_ACPI_DESCRIPTION_HEADER *Xsdt; + EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE *FacsPtr; + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE *pFADT; + + AcpiTableCount = 0; + AcpiTableCrc = NULL; + Rsdp = NULL; + Rsdt = NULL; + Xsdt = NULL; + FacsPtr= NULL; + pFADT = NULL; + + DEBUG ((DEBUG_INFO, "%a() - Start\n", __FUNCTION__)); + + Status = EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, (VOID **)&Rsdp); + if (EFI_ERROR (Status) || (Rsdp == NULL)) { +return; } // - // Allocate memory for HWChange and add additional entrie for - // pFADT->XDsdt + // ACPI table count starts with 2 as RSDT and XSDT are already located. + // Then add ACPI tables found by XSDT and FADT. // - HWChangeSize = HandleCount + 1; - HWChange = AllocateZeroPool (sizeof(UINT32) * HWChangeSize); - ASSERT(HWChange != NULL); + Rsdt= (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Rsdp->RsdtAddress; + Xsdt= (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Rsdp->XsdtAddress; + AcpiTableCou
Re: [edk2-devel] [PATCH v3] MinPlatformPkg: Update HWSignature filed in FADT
Hi, Ray Update patch and fix your concern in the patch v5. Please let me know if there is any suggestion. Thanks. [Patch v5] https://edk2.groups.io/g/devel/message/103877 BR, Vincent -Original Message- From: Ni, Ray Sent: Friday, April 28, 2023 11:55 AM To: Ke, VincentX ; devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Oram, Isaac W ; Gao, Liming ; Dong, Eric Subject: RE: [edk2-devel] [PATCH v3] MinPlatformPkg: Update HWSignature filed in FADT RSDP points to RSDT or XSDT. RSDT/XSDT contains multiple tables, one of which is FADT, others are SSDTs. FADT contains two pointers, one pointing to FACS, the other pointing to DSDT. So: 1. Your code assume if Table->Checksum is not changed, the Table is not changed. I don't think it's a valid assumption. 2. Your code "measures" the DSDT change which is good. (still only reading Checksum is not good.) 3. FACS table is not "measured". Thanks, Ray > -Original Message- > From: Ke, VincentX > Sent: Friday, April 28, 2023 11:30 AM > To: Ni, Ray ; devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Oram, Isaac W > ; Gao, Liming ; > Dong, Eric > Subject: RE: [edk2-devel] [PATCH v3] MinPlatformPkg: Update > HWSignature filed in FADT > > Hi, Ray > > Based on ACPI Spec 6.5, "Hardware Signature" filed changed the description. > > Here is the new description. > "The only thing that determines the hardware signature is the ACPI tables. > If any content or structure of the ACPI tables has changed, including > adding or removing of tables, then the hardware signature must > change." > > I keep version 6.3 only for Intel code base test. It should be updated to 6.4. > Thanks for the reminder. > > BR, > Vincent > -Original Message- > From: Ni, Ray > Sent: Friday, April 28, 2023 11:08 AM > To: devel@edk2.groups.io; Ke, VincentX > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Oram, Isaac W > ; Gao, Liming ; > Dong, Eric > Subject: RE: [edk2-devel] [PATCH v3] MinPlatformPkg: Update > HWSignature filed in FADT > > Vincent, > It's an interesting patch. > > The original logic is to use the HardwareSignature field to indicate > any changes in adding/removing PCI devices. > Your new logic is to expand this field to indicate any changes in any > tables when FADT version is > 6.3. > > Why? > > > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of > > VincentX Ke > > Sent: Friday, April 28, 2023 10:57 AM > > To: devel@edk2.groups.io > > Cc: Ke, VincentX ; Chiu, Chasel > > ; Desimone, Nathaniel L > > ; Oram, Isaac W > > ; Gao, Liming ; > > Dong, Eric > > Subject: [edk2-devel] [PATCH v3] MinPlatformPkg: Update HWSignature > > filed in FADT > > > > From: VincentX Ke > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4428 > > > > Calculating CRC based on checksum from all ACPI tables. > > Update HWSignature filed in FADT based on CRC while ACPI table changed. > > > > Signed-off-by: VincentX Ke > > Cc: Chasel Chiu > > Cc: Nate DeSimone > > Cc: Isaac Oram > > Cc: Liming Gao > > Cc: Eric Dong > > --- > > Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 110 > > +++- > > Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf | 1 + > > 2 files changed, 110 insertions(+), 1 deletion(-) > > > > diff --git > > a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > > index e967031a3b..d84c1d4f6d 100644 > > --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > > @@ -1285,6 +1285,108 @@ IsHardwareChange ( > >FreePool (HWChange); > > > > } > > > > > > > > +/** > > > > + This function calculates RCR based on Checksum from all ACPI tables. > > > > + It also calculates CRC and provides as HWSignature filed in FADT table. > > > > +**/ > > > > +VOID > > > > +IsAcpiTableChange ( > > > > + VOID > > > > + ) > > > > +{ > > > > + EFI_STATUSStatus; > > > > + UINTN Index; > > > > + UINTN AcpiTableCount; > > > > + UINT32Table; > > > > + UINT32CRC; > > > > + UINT32*AcpiTable; > > > > + EFI_ACPI_6_5_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; > > > > + EFI_ACPI_DESCRIPTION_HEADER *Rsdt; > > > > + EFI_ACPI_DESCRIPTION_HEADER *Xsdt; > > > > + EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE *FacsPtr; > > > > + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE *pFADT; > > > > + > > > > + AcpiTableCount = 0; > > > > + AcpiTable = NULL; > > > > + Rsdp = NULL; > > > > + Rsdt = NULL; > > > > + Xsdt = NULL; > > > > + FacsPtr= NULL; > > > > + pFADT = NULL; > >
Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library.
I don't think the macros that are identical to BaseLib functions help. My preference if for caller of FdtLib to know use SwapBytesxx() as needed. Mike > -Original Message- > From: Chiu, Chasel > Sent: Tuesday, May 2, 2023 7:35 PM > To: devel@edk2.groups.io; quic_llind...@quicinc.com; Kinney, Michael D > > Cc: Lin, Benny ; Gao, Liming > ; Liu, Zhiguang ; > Pedro Falcato > Subject: RE: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. > > > Thanks Leif! > To align with your suggestion I think we can define below MACROs in > FdtLib.h. > Library consumers can use those MACROs to convert structure data between > Big endian and Little endian. (better readability) > > Mike, what do you think? > > Thanks, > Chasel > > > > // > // Definitions for transferring FDT structure data between big-endian (FDT) > and little-endian (CPU) > // > #define CPU_TO_FDT16(x) SwapBytes16 (x) > #define FDT16_TO_CPU(x) SwapBytes16 (x) > > #define CPU_TO_FDT32(x) SwapBytes32 (x) > #define FDT32_TO_CPU(x) SwapBytes32 (x) > > #define CPU_TO_FDT64(x) SwapBytes64 (x) > #define FDT64_TO_CPU(x) SwapBytes64 (x) > > > > > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of Leif > > Lindholm > > Sent: Tuesday, May 2, 2023 4:42 AM > > To: devel@edk2.groups.io; Chiu, Chasel ; Kinney, > > Michael D > > Cc: Lin, Benny ; Gao, Liming > > ; Liu, Zhiguang ; > Pedro > > Falcato > > Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. > > > > Hi Chasel, > > > > Apologies, spent last week at Linaro Connect with little time to follow > > the list. > > > > If we're seeing this purely as a wrapper on libfdt, then it shouldn't > > need to provide additional functionality on top of what it provides. > > My initial impression was that this library was attempting to do more, > > but then I mostly skimmed it, and that appears to have been incorrect. > > > > What I *really* don't want is mixing abstractions. I.e. if we're getting > > the pointers through libfdt calls, we should be using the libfdt > > accessor functions to extract the data correctly. And expose the > > cpu_to_fdt*/fdt*_to_cpu accessors through the library. Presumably as > > Fdt*ToCpu/CpuToFdt*. > > > > Regards, > > > > Leif > > > > > > On 2023-05-01 17:31, Chiu, Chasel wrote: > > > > > > Hi Leif, > > > > > > Would you please share your ideas and respond Mike's question too? > > > > > > Thanks, > > > Chasel > > > > > > > > > > > >> -Original Message- > > >> From: devel@edk2.groups.io On Behalf Of > Chiu, > > Chasel > > >> Sent: Tuesday, April 25, 2023 10:22 PM > > >> To: devel@edk2.groups.io; Kinney, Michael D > ; > > >> Leif Lindholm > > >> Cc: Lin, Benny ; Leif Lindholm > > >> ; Gao, Liming > ; > > Liu, > > >> Zhiguang ; Pedro Falcato > > > > >> Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. > > >> > > >> > > >> Hello, > > >> > > >> Since platform may also define other FDT structures, this EDK2 library > may > > not > > >> be able to convert all the FDT structures to little endian. > > >> We might define a generic MACRO in library like > > >> CONVERT_FDT_DATA_TO_LITTLE_ENDIAN which can be used for all > > structure > > >> data, but it will be almost like calling SwapBytes** directly. > > >> Any other suggestion? > > >> > > >> Thanks, > > >> Chasel > > >> > > >> > > >>> -Original Message- > > >>> From: devel@edk2.groups.io On Behalf Of > Michael > > D > > >>> Kinney > > >>> Sent: Monday, April 24, 2023 10:41 AM > > >>> To: Leif Lindholm ; devel@edk2.groups.io > > >>> Cc: Lin, Benny ; Leif Lindholm > > >>> ; Gao, Liming > ; > > >> Liu, > > >>> Zhiguang ; Pedro Falcato > > >> ; > > >>> Kinney, Michael D > > >>> Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library. > > >>> > > >>> Hi Leif, > > >>> > > >>> Do you have a proposal or small example on what you want to see > > >>> in the library? > > >>> > > >>> Mike > > >>> > > -Original Message- > > From: Leif Lindholm > > Sent: Monday, April 24, 2023 10:29 AM > > To: devel@edk2.groups.io; Kinney, Michael D > > > > Cc: Lin, Benny ; Leif Lindholm > > >>> ; Gao, Liming > ; > > >> Liu, > > Zhiguang ; Pedro Falcato > > >>> > > Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT > library. > > > > Apologies, I was refactoring a git tree and switched off the world :) > > > > Well, being a bit late to the party ... my view is it would be > > preferable if we put the byteswapping in the library. > > > > The DT format is *defined* to be big-endian, 32-bit cells. So frankly, > > I have no problems with pushing responsibility onto individual > > platforms if they have decided to be "clever" by ignoring that - > > if that gets rid of a bunch of boilerplate for sensibly behaving > platforms. > > > > Maybe another excuse for getting > > https://github.com/tianocore/edk2- > > >>> platforms/blob/master/Silicon/NX
Re: [edk2-devel] [PATCH 1/1] OvmfPkg/NestedInterruptTplLib: replace ASSERT() with a warning logged.
On Fri, Apr 28, 2023 at 02:50:04PM +, Michael Brown wrote: > On 28/04/2023 14:38, Gerd Hoffmann wrote: > > I suspect the windows boot loader does something fishy here, but I can't > > proof it, I have not yet pinned down the exact location where interrupts > > get enabled while running at IPL=TPL_HIGH_LEVEL (which is what I suspect > > is happening, but of course this is not the only possible theory how > > that ASSERT got triggered). > > > > Not fully sure how to best continue debugging this, I don't think gdb > > can set an watchpoint on eflags.if ... > > In the absence of any better ideas, I'd be tempted to run QEMU via TCG > instead of KVM, and hack the STI instruction definition to check the > location in guest memory where gEfiCurrentTpl gets stored in your test > build. (It's brute force debugging, but it should find the culprit.) Not so easy as tcg generates code for cli+sti, so there isn't a function I could add logging hacks to. > From a quick check of the implementation, I'm pretty sure this will be the > case. However, the logic is already (necessarily) pretty complex and so I > am not 100% sure of this. The reasoning behind the logic in > NestedInterruptTplLib relies on certain axioms and invariants (e.g. that > there are a finite number of distinct TPLs, and that there are certain > places within the code that further interrupts provably cannot occur), and > so it gets very difficult to reason about when one of those invariants is > violated, as it seems to be in this situation. > > If it seems to work, It seems to work, and the warning is printed exactly once during boot. > with a warning message, and to return with InterruptedTPL unmodified. But > I'd prefer to understand how this invariant violation arises in the first > place. Root cause not found yet, but all debugging so far didn't found any problems in edk2/ovmf, so my theory still is that windows does something fishy here. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103880): https://edk2.groups.io/g/devel/message/103880 Mute This Topic: https://groups.io/mt/98554842/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-