Stefan Berger
2007-Mar-08 16:23 UTC
[Xen-devel] [PATCH] [TPM] Remove an unused data structure
Remove an unused data structure from TPM frontend. Some more code style changes. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
hi I try to understand the code about vm create and now I am confused about which code does the guestOS start with to run ? xen domain0 uses the function xc_domain_creat() and xc_linux_build() to prepare the necessary struct such as vcpu_guest_context and other things for vm guestOS to bootup , in the xc_linux_build(),the initrd is also loaded in,is it right? then guestOS does not run the regular bootloader ,is it right? then I am confused about which function or which lines of the code does the guestOS start with ? could you help me Thanks in advance _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of tgh > Sent: 09 March 2007 08:17 > To: xen-devel > Subject: [Xen-devel] question about the guestOS boot > > hi > I try to understand the code about vm create > and now I am confused about which code does the guestOS start > with to run ? > > xen domain0 uses the function xc_domain_creat() and > xc_linux_build() to > prepare the necessary struct such as vcpu_guest_context and > other things > for vm guestOS to bootup , in the xc_linux_build(),the initrd is also > loaded in,is it right? > then guestOS does not run the regular bootloader ,is it right?That is correct.> > then I am confused about which function or which lines of the > code does > the guestOS start with ?Can you explain your confusion a bit more - I''m not entirely sure what you''re asking, and it''s very hard to answer questions when you don''t know the actual question. Also, it''s much better if you explain a little bit about what you''re trying to achieve (I''ve previously used the example of someone having a puncture, going to ask the mechanic how to loosen a wheel-nut, then going to ask how to jack up the car, then asking how to tighten the wheel-nut, when the actual problem is a punctured tyre, and the "right" question to ask a mechanic is "How do I replace my punctured tyre with the spare wheel?"). Asking the overall question you''re trying to solve will give you a more complete answer to what you''re trying to do, rather than a detailed answer on the point where you''re at (and that may actually not help your overall problem at all). -- Mats> > > could you help me > > Thanks in advance > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thank you for your reply and guide I try to understand how does the xen provide a virtual platform for guestOS to run dom0 provides hardware abstract struct as well as software struct for guestOS and when dom0 boots a vm ,it does prepare the vm vcpu_guest_context for guestOS to run so when VM starts ( the same as our PC resets) ,its vcpu isnot an empty context like the regular ones without virtualization ,so it doesnot start from the regular point or function or firmware then I do not know where does the guestOS start with in the code could you told me where or which function does the guestOS start with ? Thanks in advance Petersson, Mats 写道:> > > >> -----Original Message----- >> From: xen-devel-bounces@lists.xensource.com >> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of tgh >> Sent: 09 March 2007 08:17 >> To: xen-devel >> Subject: [Xen-devel] question about the guestOS boot >> >> hi >> I try to understand the code about vm create >> and now I am confused about which code does the guestOS start >> with to run ? >> >> xen domain0 uses the function xc_domain_creat() and >> xc_linux_build() to >> prepare the necessary struct such as vcpu_guest_context and >> other things >> for vm guestOS to bootup , in the xc_linux_build(),the initrd is also >> loaded in,is it right? >> then guestOS does not run the regular bootloader ,is it right? >> > > That is correct. > >> then I am confused about which function or which lines of the >> code does >> the guestOS start with ? >> > > Can you explain your confusion a bit more - I''m not entirely sure what > you''re asking, and it''s very hard to answer questions when you don''t > know the actual question. > > Also, it''s much better if you explain a little bit about what you''re > trying to achieve (I''ve previously used the example of someone having a > puncture, going to ask the mechanic how to loosen a wheel-nut, then > going to ask how to jack up the car, then asking how to tighten the > wheel-nut, when the actual problem is a punctured tyre, and the "right" > question to ask a mechanic is "How do I replace my punctured tyre with > the spare wheel?"). > > Asking the overall question you''re trying to solve will give you a more > complete answer to what you''re trying to do, rather than a detailed > answer on the point where you''re at (and that may actually not help your > overall problem at all). > > -- > Mats > >> could you help me >> >> Thanks in advance >> >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >> >> >> >> > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of tgh > Sent: 09 March 2007 10:13 > To: Petersson, Mats > Cc: xen-devel > Subject: Re: [Xen-devel] question about the guestOS boot > > Thank you for your reply and guide > I try to understand how does the xen provide a virtual platform for > guestOS to run > dom0 provides hardware abstract struct as well as software struct for > guestOS > > and when dom0 boots a vm ,it does prepare the vm > vcpu_guest_context for > guestOS to run > so when VM starts ( the same as our PC resets) ,its vcpu > isnot an empty > context like the regular ones without virtualization ,so it doesnot > start from the regular point or function or firmwareEhm, ok, lets debunk the first point, which is that the processor is "CPU is empty" when the processor comes out of reset. That is not at all true - yes, most registers are zero, but they still have a DEFINED value out of reset, which may or may not be zero. But more to the point of "booting" a virtual machine. Of course, we have to NOT reset the processor to boot a virtual machine, as that would loose the original Xen + Dom0 that is already loaded. So Xen has to perform the load/initialize function. But this is no different from what is done in grub or whatever boot-loader you use. It loads the code into memory and sets up some basic start-values in the registers, then jumps to a starting point somewhere. In the case of a Xenified kernel, it''s at the beginning of the "text" segment, that is, the label _start. The rIP of the VCPU is set to point to this address, and the other registers are set to some sensible values (such as a pointer to any kernel arguments and perhaps some environmental values in other registers that make sense - I haven''t looked very closely at it). There is a difference in Xen-linux start and a regular linux start, and that is that Xen-linux starts in 32-bit protected mode (but Paging is not yet enabled), whereas the regular Linux starts with real-mode (16-bit mode), and does a few instructions before it gets into 32-bit mode.> > then I do not know where does the guestOS start with in the code > could you told me where or which function does the guestOS > start with ?As above. The actual code that the Xen kernel starts at is in .../linux-<ver>-xen/arch/<mach>/kernel/head-xen.S -- Mats> > Thanks in advance > > > > > Petersson, Mats 写道: > > > > > > > >> -----Original Message----- > >> From: xen-devel-bounces@lists.xensource.com > >> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of tgh > >> Sent: 09 March 2007 08:17 > >> To: xen-devel > >> Subject: [Xen-devel] question about the guestOS boot > >> > >> hi > >> I try to understand the code about vm create > >> and now I am confused about which code does the guestOS start > >> with to run ? > >> > >> xen domain0 uses the function xc_domain_creat() and > >> xc_linux_build() to > >> prepare the necessary struct such as vcpu_guest_context and > >> other things > >> for vm guestOS to bootup , in the xc_linux_build(),the > initrd is also > >> loaded in,is it right? > >> then guestOS does not run the regular bootloader ,is it right? > >> > > > > That is correct. > > > >> then I am confused about which function or which lines of the > >> code does > >> the guestOS start with ? > >> > > > > Can you explain your confusion a bit more - I''m not > entirely sure what > > you''re asking, and it''s very hard to answer questions when you don''t > > know the actual question. > > > > Also, it''s much better if you explain a little bit about what you''re > > trying to achieve (I''ve previously used the example of > someone having a > > puncture, going to ask the mechanic how to loosen a wheel-nut, then > > going to ask how to jack up the car, then asking how to tighten the > > wheel-nut, when the actual problem is a punctured tyre, and > the "right" > > question to ask a mechanic is "How do I replace my > punctured tyre with > > the spare wheel?"). > > > > Asking the overall question you''re trying to solve will > give you a more > > complete answer to what you''re trying to do, rather than a detailed > > answer on the point where you''re at (and that may actually > not help your > > overall problem at all). > > > > -- > > Mats > > > >> could you help me > >> > >> Thanks in advance > >> > >> > >> _______________________________________________ > >> Xen-devel mailing list > >> Xen-devel@lists.xensource.com > >> http://lists.xensource.com/xen-devel > >> > >> > >> > >> > > > > > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > > > > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thank you for your reply And dom0 xc_linux_build() function play a bootloader role in booting VM ,is it right? or xc_linux_build() does only a part of bootloader''s role and guestOS does the rest of bootloader''s role? or something else? I am not sure about it could you help me Thanks in advance Petersson, Mats 写道:> > > >> -----Original Message----- >> From: xen-devel-bounces@lists.xensource.com >> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of tgh >> Sent: 09 March 2007 10:13 >> To: Petersson, Mats >> Cc: xen-devel >> Subject: Re: [Xen-devel] question about the guestOS boot >> >> Thank you for your reply and guide >> I try to understand how does the xen provide a virtual platform for >> guestOS to run >> dom0 provides hardware abstract struct as well as software struct for >> guestOS >> >> and when dom0 boots a vm ,it does prepare the vm >> vcpu_guest_context for >> guestOS to run >> so when VM starts ( the same as our PC resets) ,its vcpu >> isnot an empty >> context like the regular ones without virtualization ,so it doesnot >> start from the regular point or function or firmware >> > > Ehm, ok, lets debunk the first point, which is that the processor is "CPU is empty" when the processor comes out of reset. That is not at all true - yes, most registers are zero, but they still have a DEFINED value out of reset, which may or may not be zero. > > But more to the point of "booting" a virtual machine. Of course, we have to NOT reset the processor to boot a virtual machine, as that would loose the original Xen + Dom0 that is already loaded. So Xen has to perform the load/initialize function. > > But this is no different from what is done in grub or whatever boot-loader you use. It loads the code into memory and sets up some basic start-values in the registers, then jumps to a starting point somewhere. > > In the case of a Xenified kernel, it''s at the beginning of the "text" segment, that is, the label _start. The rIP of the VCPU is set to point to this address, and the other registers are set to some sensible values (such as a pointer to any kernel arguments and perhaps some environmental values in other registers that make sense - I haven''t looked very closely at it). > > There is a difference in Xen-linux start and a regular linux start, and that is that Xen-linux starts in 32-bit protected mode (but Paging is not yet enabled), whereas the regular Linux starts with real-mode (16-bit mode), and does a few instructions before it gets into 32-bit mode. > > > >> then I do not know where does the guestOS start with in the code >> could you told me where or which function does the guestOS >> start with ? >> > > As above. The actual code that the Xen kernel starts at is in .../linux-<ver>-xen/arch/<mach>/kernel/head-xen.S > > -- > Mats > >> Thanks in advance >> >> >> >> >> Petersson, Mats 写道: >> >>> >>> >>> >>> >>>> -----Original Message----- >>>> From: xen-devel-bounces@lists.xensource.com >>>> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of tgh >>>> Sent: 09 March 2007 08:17 >>>> To: xen-devel >>>> Subject: [Xen-devel] question about the guestOS boot >>>> >>>> hi >>>> I try to understand the code about vm create >>>> and now I am confused about which code does the guestOS start >>>> with to run ? >>>> >>>> xen domain0 uses the function xc_domain_creat() and >>>> xc_linux_build() to >>>> prepare the necessary struct such as vcpu_guest_context and >>>> other things >>>> for vm guestOS to bootup , in the xc_linux_build(),the >>>> >> initrd is also >> >>>> loaded in,is it right? >>>> then guestOS does not run the regular bootloader ,is it right? >>>> >>>> >>> That is correct. >>> >>> >>>> then I am confused about which function or which lines of the >>>> code does >>>> the guestOS start with ? >>>> >>>> >>> Can you explain your confusion a bit more - I''m not >>> >> entirely sure what >> >>> you''re asking, and it''s very hard to answer questions when you don''t >>> know the actual question. >>> >>> Also, it''s much better if you explain a little bit about what you''re >>> trying to achieve (I''ve previously used the example of >>> >> someone having a >> >>> puncture, going to ask the mechanic how to loosen a wheel-nut, then >>> going to ask how to jack up the car, then asking how to tighten the >>> wheel-nut, when the actual problem is a punctured tyre, and >>> >> the "right" >> >>> question to ask a mechanic is "How do I replace my >>> >> punctured tyre with >> >>> the spare wheel?"). >>> >>> Asking the overall question you''re trying to solve will >>> >> give you a more >> >>> complete answer to what you''re trying to do, rather than a detailed >>> answer on the point where you''re at (and that may actually >>> >> not help your >> >>> overall problem at all). >>> >>> -- >>> Mats >>> >>> >>>> could you help me >>>> >>>> Thanks in advance >>>> >>>> >>>> _______________________________________________ >>>> Xen-devel mailing list >>>> Xen-devel@lists.xensource.com >>>> http://lists.xensource.com/xen-devel >>>> >>>> >>>> >>>> >>>> >>> >>> _______________________________________________ >>> Xen-devel mailing list >>> Xen-devel@lists.xensource.com >>> http://lists.xensource.com/xen-devel >>> >>> >>> >>> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >> >> >> >> > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: tgh [mailto:tianguanhua@ncic.ac.cn] > Sent: 09 March 2007 12:10 > To: Petersson, Mats > Cc: xen-devel > Subject: Re: [Xen-devel] question about the guestOS boot > > Thank you for your reply > > And dom0 xc_linux_build() function play a bootloader role in > booting VM > ,is it right?Yes, it''s responsible for loading and setting up initial environment to be able to start the kernel. The actual load is done by xc_dom_kernel_file(), which in turn uses xc_dom_malloc_filemap(). -- Mats [snip] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thank you for your reply and" In the case of a Xenified kernel, it''s at the beginning of the "text" segment, that is, the label _start. The rIP of the VCPU is set to point to this address " I do not find rIP of the vcpu ,are you sure it is _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: tgh [mailto:tianguanhua@ncic.ac.cn] > Sent: 09 March 2007 12:35 > To: Petersson, Mats > Cc: xen-devel > Subject: Re: [Xen-devel] question about the guestOS boot > > Thank you for your reply > > and" In the case of a Xenified kernel, it''s at the beginning of the > "text" segment, that is, the label _start. The rIP of the > VCPU is set to > point to this address " > I do not find rIP of the vcpu ,are you sure it isThe name rIP is a short for for "RIP or EIP", and there is an "eip" in the cpu_user_regs, which is part of the vcpu_struct. -- Mats> > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thank you for your patient and detail reply Thank you Petersson, Mats 写道:>> -----Original Message----- >> From: tgh [mailto:tianguanhua@ncic.ac.cn] >> Sent: 09 March 2007 12:35 >> To: Petersson, Mats >> Cc: xen-devel >> Subject: Re: [Xen-devel] question about the guestOS boot >> >> Thank you for your reply >> >> and" In the case of a Xenified kernel, it''s at the beginning of the >> "text" segment, that is, the label _start. The rIP of the >> VCPU is set to >> point to this address " >> I do not find rIP of the vcpu ,are you sure it is >> > > The name rIP is a short for for "RIP or EIP", and there is an "eip" in > the cpu_user_regs, which is part of the vcpu_struct. > > -- > Mats > >> >> >> >> > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> There is a difference in Xen-linux start and a regular linux start, and > that is that Xen-linux starts in 32-bit protected mode (but Paging is not > yet enabled), whereas the regular Linux starts with real-mode (16-bit > mode), and does a few instructions before it gets into 32-bit mode.AFAIK paging is enabled for a Xen paravirtualised guest; there is a set of bootstrap pagetables put in place by the domain builder, which map enough memory to get the domain started. Cheers, Mark> > then I do not know where does the guestOS start with in the code > > could you told me where or which function does the guestOS > > start with ? > > As above. The actual code that the Xen kernel starts at is in > .../linux-<ver>-xen/arch/<mach>/kernel/head-xen.S > > -- > Mats > > > Thanks in advance > > > > Petersson, Mats 写道: > > >> -----Original Message----- > > >> From: xen-devel-bounces@lists.xensource.com > > >> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of tgh > > >> Sent: 09 March 2007 08:17 > > >> To: xen-devel > > >> Subject: [Xen-devel] question about the guestOS boot > > >> > > >> hi > > >> I try to understand the code about vm create > > >> and now I am confused about which code does the guestOS start > > >> with to run ? > > >> > > >> xen domain0 uses the function xc_domain_creat() and > > >> xc_linux_build() to > > >> prepare the necessary struct such as vcpu_guest_context and > > >> other things > > >> for vm guestOS to bootup , in the xc_linux_build(),the > > > > initrd is also > > > > >> loaded in,is it right? > > >> then guestOS does not run the regular bootloader ,is it right? > > > > > > That is correct. > > > > > >> then I am confused about which function or which lines of the > > >> code does > > >> the guestOS start with ? > > > > > > Can you explain your confusion a bit more - I''m not > > > > entirely sure what > > > > > you''re asking, and it''s very hard to answer questions when you don''t > > > know the actual question. > > > > > > Also, it''s much better if you explain a little bit about what you''re > > > trying to achieve (I''ve previously used the example of > > > > someone having a > > > > > puncture, going to ask the mechanic how to loosen a wheel-nut, then > > > going to ask how to jack up the car, then asking how to tighten the > > > wheel-nut, when the actual problem is a punctured tyre, and > > > > the "right" > > > > > question to ask a mechanic is "How do I replace my > > > > punctured tyre with > > > > > the spare wheel?"). > > > > > > Asking the overall question you''re trying to solve will > > > > give you a more > > > > > complete answer to what you''re trying to do, rather than a detailed > > > answer on the point where you''re at (and that may actually > > > > not help your > > > > > overall problem at all). > > > > > > -- > > > Mats > > > > > >> could you help me > > >> > > >> Thanks in advance > > >> > > >> > > >> _______________________________________________ > > >> Xen-devel mailing list > > >> Xen-devel@lists.xensource.com > > >> http://lists.xensource.com/xen-devel > > > > > > _______________________________________________ > > > Xen-devel mailing list > > > Xen-devel@lists.xensource.com > > > http://lists.xensource.com/xen-devel > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel