Commit 978bff4e authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Michael Ellerman

powerpc/pseries/svm: Allow IOMMU to work in SVM

H_PUT_TCE_INDIRECT uses a shared page to send up to 512 TCE to
a hypervisor in a single hypercall. This does not work for secure VMs
as the page needs to be shared or the VM should use H_PUT_TCE instead.

This disables H_PUT_TCE_INDIRECT by clearing the FW_FEATURE_PUT_TCE_IND
feature bit so SVMs will map TCEs using H_PUT_TCE.

This is not a part of init_svm() as it is called too late after FW
patching is done and may result in a warning like this:

[    3.727716] Firmware features changed after feature patching!
[    3.727965] WARNING: CPU: 0 PID: 1 at (...)arch/powerpc/lib/feature-fixups.c:466 check_features+0xa4/0xc0
Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: default avatarThiago Jung Bauermann <bauerman@linux.ibm.com>
Tested-by: default avatarThiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191216041924.42318-5-aik@ozlabs.ru
parent 17a0364c
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <asm/firmware.h> #include <asm/firmware.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/udbg.h> #include <asm/udbg.h>
#include <asm/svm.h>
#include "pseries.h" #include "pseries.h"
...@@ -101,6 +102,12 @@ static void __init fw_hypertas_feature_init(const char *hypertas, ...@@ -101,6 +102,12 @@ static void __init fw_hypertas_feature_init(const char *hypertas,
} }
} }
if (is_secure_guest() &&
(powerpc_firmware_features & FW_FEATURE_PUT_TCE_IND)) {
powerpc_firmware_features &= ~FW_FEATURE_PUT_TCE_IND;
pr_debug("SVM: disabling PUT_TCE_IND firmware feature\n");
}
pr_debug(" <- fw_hypertas_feature_init()\n"); pr_debug(" <- fw_hypertas_feature_init()\n");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment