[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ff41dda010796585400828e6db12f875bfd8d00a.camel@intel.com>
Date: Fri, 30 Jun 2023 11:05:32 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "peterz@...radead.org" <peterz@...radead.org>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Raj, Ashok" <ashok.raj@...el.com>,
"Luck, Tony" <tony.luck@...el.com>,
"david@...hat.com" <david@...hat.com>,
"bagasdotme@...il.com" <bagasdotme@...il.com>,
"Hansen, Dave" <dave.hansen@...el.com>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"Chatre, Reinette" <reinette.chatre@...el.com>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>,
"nik.borisov@...e.com" <nik.borisov@...e.com>,
"hpa@...or.com" <hpa@...or.com>, "Shahar, Sagi" <sagis@...gle.com>,
"imammedo@...hat.com" <imammedo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>, "Gao, Chao" <chao.gao@...el.com>,
"Brown, Len" <len.brown@...el.com>,
"sathyanarayanan.kuppuswamy@...ux.intel.com"
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
"Huang, Ying" <ying.huang@...el.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v12 20/22] x86/virt/tdx: Allow SEAMCALL to handle #UD and
#GP
On Fri, 2023-06-30 at 12:21 +0200, Peter Zijlstra wrote:
> On Fri, Jun 30, 2023 at 12:07:00PM +0200, Peter Zijlstra wrote:
> > On Thu, Jun 29, 2023 at 10:33:38AM +0000, Huang, Kai wrote:
>
> > > Looking at the later versions of TDX spec (with TD live migration, etc), it
> > > seems they are already using R12-R13 as SEAMCALL output:
> > >
> > > https://cdrdv2.intel.com/v1/dl/getContent/733579
> >
> > Urgh.. I think I read an older versio because I got bleeding eyes from
> > all this colour coded crap.
> >
> > All this red is unreadable :-( Have they been told about the glories of
> > TeX and diff ?
> >
> > > E.g., 6.3.15. NEW: TDH.IMPORT.MEM Leaf
> > >
> > > It uses R12 and R13 as input.
> >
> > 12 and 14. They skipped 13 for some mysterious raisin.
>
> Things like TDH.SERVTD.BIND do use R13.
>
> > But also, 10,11 are frequently used as input with this new stuff, which
> > already suggests the setup from your patches is not tenable.
>
>
> TDG.SERVTD.RD *why* can't they pass that TD_UUID as a pointer? Using *4*
> registers like that is quite insane.
I can ask TDX module team whether they can change to use a buffer instead of 4
registers.
>
> TDG.VP.ENTER :-(((( that has b,15,si,di as additional output.
>
> That means there's not a single register left unused. Can we still get
> this changed, please?!?
>
I assume it's TDH.VP.ENTER.
TDH.VP.ENTER is a special SEAMCALL because it goes into TDX guest to run. KVM
should be the only place that handles it. And KVM won't use the __seamcall()
here to handle it but will have it's own assembly.
For normal VMX guests, since most GPRs are not saved/restored by hardware, KVM
already has sufficient code to save/restore relevant GPRs during VMENTER/VMEXIT.
Handling TDX can just follow that pattern.
So looks fine to me.
Powered by blists - more mailing lists