On Tue, Oct 05 2021 at 13:41, Kuppuswamy Sathyanarayanan wrote:
\Instead of adding an extra check, can you please replace that
static inline void outs##bwl(int port, const void *addr, unsigned long count) \
{ \
- if (sev_key_active()) { \
+ if (sev_key_active() || \
+ cc_platform_has(CC_ATTR_GUEST_UNROLL_STRING_IO)) { \
sev_key_active() with cc_platform_has() completely?
+/*Fancy. The compiler can evaluate sev_key_active() and
+ * tdx_handle_early_io() cannot be re-used in #VE handler for handling
+ * I/O because the way of handling string I/O is different between
+ * normal and early I/O case. Also, once trace support is enabled,
+ * tdx_handle_io() will be extended to use trace calls which is also
+ * not valid for early I/O cases.
+ */
+static void tdx_handle_io(struct pt_regs *regs, u32 exit_qual)
+{
+ struct tdx_hypercall_output outh;
+ int out, size, port, ret;
+ bool string;
+ u64 mask;
+
+ string = VE_IS_IO_STRING(exit_qual);
+
+ /* I/O strings ops are unrolled at build time. */
cc_platform_has() at build time?
Thanks,
tglx