On Fri, Apr 19, 2024, vsntk18@xxxxxxxxx wrote: > From: Vasant Karasulli <vkarasulli@xxxxxxx> > > Using Linux's IOIO #VC processing logic. > > Signed-off-by: Varad Gautam <varad.gautam@xxxxxxxx> > Signed-off-by: Vasant Karasulli <vkarasulli@xxxxxxx> > Reviewed-by: Marc Orr <marcorr@xxxxxxxxxx> > --- > lib/x86/amd_sev_vc.c | 169 +++++++++++++++++++++++++++++++++++++++++++ > lib/x86/processor.h | 7 ++ > 2 files changed, 176 insertions(+) > > diff --git a/lib/x86/amd_sev_vc.c b/lib/x86/amd_sev_vc.c > index 6238f1ec..2a553db1 100644 > --- a/lib/x86/amd_sev_vc.c > +++ b/lib/x86/amd_sev_vc.c > @@ -177,6 +177,172 @@ static enum es_result vc_handle_msr(struct ghcb *ghcb, struct es_em_ctxt *ctxt) > return ret; > } > > +#define IOIO_TYPE_STR BIT(2) > +#define IOIO_TYPE_IN 1 > +#define IOIO_TYPE_INS (IOIO_TYPE_IN | IOIO_TYPE_STR) > +#define IOIO_TYPE_OUT 0 > +#define IOIO_TYPE_OUTS (IOIO_TYPE_OUT | IOIO_TYPE_STR) > + > +#define IOIO_REP BIT(3) > + > +#define IOIO_ADDR_64 BIT(9) > +#define IOIO_ADDR_32 BIT(8) > +#define IOIO_ADDR_16 BIT(7) > + > +#define IOIO_DATA_32 BIT(6) > +#define IOIO_DATA_16 BIT(5) > +#define IOIO_DATA_8 BIT(4) > + > +#define IOIO_SEG_ES (0 << 10) > +#define IOIO_SEG_DS (3 << 10) I assume these are architectural? I.e. belong in a common header?