Re: [RFC PATCH V3 01/11] x86/HV: Initialize GHCB page in Isolation VM

From
Christoph Hellwig <hch@lst.de>
Date
2021-06-07 06:41:54
Also in
linux-hyperv, linux-iommu, linux-scsi, lkml, netdev, xen-devel
Reply to
Tianyu Lan, 2021-05-30
On Sun, May 30, 2021 at 11:06:18AM -0400, Tianyu Lan wrote:
quoted hunk ↗ jump to hunk
+	if (ms_hyperv.ghcb_base) {
+		rdmsrl(MSR_AMD64_SEV_ES_GHCB, ghcb_gpa);
+
+		ghcb_va = ioremap_cache(ghcb_gpa, HV_HYP_PAGE_SIZE);
+		if (!ghcb_va)
+			return -ENOMEM;
Can you explain this a bit more?  We've very much deprecated
ioremap_cache in favor of memremap.  Why yo you need a __iomem address
here?  Why do we need the remap here at all?

Does the data structure at this address not have any types that we
could use a struct for?
quoted hunk ↗ jump to hunk
+
+		rdmsrl(MSR_AMD64_SEV_ES_GHCB, ghcb_gpa);
+		ghcb_va = ioremap_cache(ghcb_gpa, HV_HYP_PAGE_SIZE);
+		if (!ghcb_va) {
This seems to duplicate the above code.
quoted hunk ↗ jump to hunk
+bool hv_isolation_type_snp(void)
+{
+	return static_branch_unlikely(&isolation_type_snp);
+}
+EXPORT_SYMBOL_GPL(hv_isolation_type_snp);
This probably wants a kerneldoc explaining when it should be used.
Thread (49 messages) 49 messages, 8 authors, last reply 2021-07-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help