]> git.dujemihanovic.xyz Git - linux.git/commit
Drivers: hv: Don't remap addresses that are above shared_gpa_boundary
authorMichael Kelley <mikelley@microsoft.com>
Sun, 26 Mar 2023 13:52:06 +0000 (06:52 -0700)
committerWei Liu <wei.liu@kernel.org>
Mon, 17 Apr 2023 19:19:04 +0000 (19:19 +0000)
commit6afd9dc1a4b158456c072580f0851b4dbaaa02f1
treed700c893f89363438948e5013d3722de0c6b3002
parent25727aaed6514b88f98a18862c6f2d65a0b0ec3b
Drivers: hv: Don't remap addresses that are above shared_gpa_boundary

With the vTOM bit now treated as a protection flag and not part of
the physical address, avoid remapping physical addresses with vTOM set
since technically such addresses aren't valid.  Use ioremap_cache()
instead of memremap() to ensure that the mapping provides decrypted
access, which will correctly set the vTOM bit as a protection flag.

While this change is not required for correctness with the current
implementation of memremap(), for general code hygiene it's better to
not depend on the mapping functions doing something reasonable with
a physical address that is out-of-range.

While here, fix typos in two error messages.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Link: https://lore.kernel.org/r/1679838727-87310-12-git-send-email-mikelley@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
arch/x86/hyperv/hv_init.c
drivers/hv/hv.c