From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH RFC] pvh: clearly specify used parameters in vcpu_guest_context Date: Sat, 16 Nov 2013 09:02:36 +0100 Message-ID: <5287269C.6020404@citrix.com> References: <1384530622-31703-1-git-send-email-roger.pau@citrix.com> <52865AC60200007800103AAE@nat28.tlf.novell.com> <52864E97.9020402@eu.citrix.com> <52865DCB0200007800103AD8@nat28.tlf.novell.com> <20131115135654.52e52bd4@mantra.us.oracle.com> <20131115155652.3201414a@mantra.us.oracle.com> <20131115171227.5c2797d2@mantra.us.oracle.com> <20131115175625.73aabac0@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vhaq0-0007A0-3W for xen-devel@lists.xenproject.org; Sat, 16 Nov 2013 08:02:40 +0000 In-Reply-To: <20131115175625.73aabac0@mantra.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor Cc: Keir Fraser , George Dunlap , Tim Deegan , Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 16/11/13 02:56, Mukesh Rathor wrote: > On Fri, 15 Nov 2013 17:12:27 -0800 > Mukesh Rathor wrote: > >> On Fri, 15 Nov 2013 15:56:52 -0800 >> Mukesh Rathor wrote: >> >>> On Fri, 15 Nov 2013 13:56:54 -0800 >>> Mukesh Rathor wrote: >>> >>>> On Fri, 15 Nov 2013 16:45:47 +0000 >>>> "Jan Beulich" wrote: >>>> >> ........ >>>> >>>> We had talked about this while ago, but upon boot, the first thing >>>> a vcpu needs is access to kernel data structure. (A secondary vcpu >>>> is bootstrapped way up into the kernel). It would be possible to >>>> get rid of gs_base_kernel, but will take some work on the linux >>>> side. I can try and test it out, and let you guys know. >>> >>> Ok, looking at this more, I can hack cpu_bringup_and_idle() in >>> linux to include a static variable for cpuid, which is the least a >>> vcpu needs to know first thing. But, I think that would not work >>> when vcpu hotplug support is added. Another option would be to pass >>> cpuid in one of the registers, say rdi. Thus, rdi == cpuid will be >>> passed to VCPUOP_initialise. In bringup function, the booting vcpu >>> can then load it's own gs based on the cpuid. If linux folks, >>> konrad (CCd), is OK with this, we can remove gs_base_kernel. >>> Otherwise, it's such a small thing, hopefually it can stay. >> >> Konrad, >> >> Here's the changes needed on linux side to remove gs_base_kernel. >> Since, I imagine vcpu hotplug would go thru the same path, it would >> work there also. If this looks OK to everybody, we can remove >> gs_base_kernel from the VCPUOP_initialise call. >> >> thanks, >> Mukesh >> >> >> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c >> index aa89bbf..54d1022 100644 >> --- a/arch/x86/xen/smp.c >> +++ b/arch/x86/xen/smp.c >> @@ -99,14 +99,8 @@ static void cpu_bringup(void) >> wmb(); /* make sure everything is out > > Rats, just realized this is not going to make sense because you > don't have the earlier patch: > "PVH: simplify cpu_initialize_context. add pvh_set_bringup_context()" > > So, just look for it at: > > https://oss.oracle.com/git/mrathor/linux.git/ in branch tmp2. > > In a nutshell, for PVH we only need to pass eip, rsp, cr3, and > gs_base_kernel. If we pass cpuid in rdi for context setting, we can get > rid of gs_base_kernel. > > Since, PVH is now merged, Konrad I'll officially send you the > patches you see in my above tree after the merge to v3.12. I'll do > that next week, lmk what tree the patches should be based on for > submission. I think we should wait to have a stable AP bringup interface before committing anything to Linux. I'm going to rework this patch in order to also check and load cr0/cr4 (as suggested by Tim).