Skip to contentSkip to conversation

platform/x86/amd/hsmp: Fix iomem handling

PATCH In review Armin Wolf 2 participants 2 messages Oct 19, 2023 – Oct 25, 2023 x86 platform drivers

lore
Share & tools
lore

Armin Wolf

author
#0 lore raw

PATCH 1/1 platform/x86/amd/hsmp: Fix iomem handling

Since the metrics table is marked as io memory,
use memcpy_fromio() when copying its contents.

Compile-tested only.

Fixes 5150542b8ec5 ("platform/x86/amd/hsmp: add support for metrics tbl")
---
 drivers/platform/x86/amd/hsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/amd/hsmp.c +1 -1
index b056a5c8654a..b55d80e29139 100644
@@ -362,7 +362,7 @@ static ssize_t hsmp_metric_tbl_read(struct file *filp, struct kobject *kobj,
 	ret = hsmp_send_message(&msg);
 	if (ret)
 		return ret;
-	memcpy(buf, sock->metric_tbl_addr, bin_attr->size);
+	memcpy_fromio(buf, sock->metric_tbl_addr, bin_attr->size);
 
 	return bin_attr->size;
 }

--
2.39.2

maintainer
#1 lore raw
Quoted 6 lines · Armin Wolf

Since the metrics table is marked as io memory,
use memcpy_fromio() when copying its contents.

Compile-tested only.

Thank you for your contribution, it has been applied to my local review-ilpo branch. Note it will show up in the public platform-drivers-x86/review-ilpo branch only once I've pushed my local branch there, which might take a while.

Once I've run some tests on the review-ilpo branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

The list of commits applied:
[1/1] platform/x86/amd/hsmp: Fix iomem handling

      commit: 02a258ac3ebf8a530d340ec24a694c13ac9d25c0

--
i.