Remove an unused data structure
PATCH 1/1 Remove an unused data structure
Remove an unused data structure from TPM frontend. Some more code style changes.
--- xen-unstable.hg/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c | 2 - xen-unstable.hg/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h | 13 ------- xen-unstable.hg/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c | 18 ---------- 3 files changed, 1 insertion(+), 32 deletions(-)
xen-unstable.hg/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c +0 -2
@@ -504,7 +504,6 @@ static struct tpm_vendor_specific tpm_vt };struct tpm_chip *init_vtpm (struct device *dev, -struct tpm_virtual_device *tvd,struct tpm_private *tp) {long rc;
@@ -516,7 +515,6 @@ struct tpm_chip *init_vtpm(struct devicereturn ERR_PTR (-ENOMEM );vtpm_state_init (vtpms); - vtpms->tpmvd = tvd; vtpms->tpm_private = tp; chip =tpm_register_hardware (dev, &tpm_vtpm);
xen-unstable.hg/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h +0 -13
@@ -4,16 +4,6 @@struct tpm_chip ;struct tpm_private ; -struct tpm_virtual_device { -/* -* This field indicates the maximum size the driver can -* transfer in one chunk. It is filled in by the front-end -* driver and should be propagated to the generic tpm driver -* for allocation of buffers. -*/ -unsigned int max_tx_size; -}; -struct vtpm_state {struct transmission *current_request;spinlock_t req_list_lock;
@@ -30,8 +20,6 @@ struct vtpm_state {unsigned long disconnect_time; -struct tpm_virtual_device *tpmvd; -/* * The following is a private structure of the underlying * driver. It is passed as parameter in the send function.
@@ -51,7 +39,6 @@ int vtpm_vd_send(struct tpm_private * tp/* these functions are offered by tpm_vtpm.c */ struct tpm_chip *init_vtpm (struct device *, -struct tpm_virtual_device *,struct tpm_private *);void cleanup_vtpm (struct device *); int vtpm_vd_recv(const struct tpm_chip* chip,
xen-unstable.hg/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c +3 -25
@@ -369,10 +369,6 @@ static void backend_changed(struct xenbu } } -struct tpm_virtual_device tvd = { - .max_tx_size =PAGE_SIZE *TPMIF_TX_RING_SIZE , -}; -static int tpmfront_probe (struct xenbus_device *dev,const struct xenbus_device_id *id) {
@@ -383,7 +379,7 @@ static int tpmfront_probe(struct xenbus_if (!tp)return -ENOMEM ; - tp->chip =init_vtpm (&dev->dev, &tvd, tp); + tp->chip =init_vtpm (&dev->dev, tp);if (IS_ERR (tp->chip))return PTR_ERR (tp->chip);
@@ -500,11 +496,6 @@ static void __init init_tpm_xenbus(void)xenbus_register_frontend (&tpmfront); } -static void __exit exit_tpm_xenbus(void) -{ -xenbus_unregister_driver (&tpmfront); -} -static int tpmif_allocate_tx_buffers (struct tpm_private *tp) {unsigned int i;
@@ -530,13 +521,11 @@ static void tpmif_free_tx_buffers(structstatic void tpmif_rx_action (unsigned long priv) {struct tpm_private *tp = (struct tpm_private *)priv; -int i =0 ;unsigned int received;unsigned int offset =0 ;u8 *buffer; -tpmif_tx_request_t *tx; - tx = &tp->tx->ring[i].req; +tpmif_tx_request_t *tx = &tp->tx->ring[i].req;atomic_set (&tp->tx_busy,0 );wake_up_interruptible (&tp->wait_q);
@@ -545,7 +534,7 @@ static void tpmif_rx_action(unsigned lon buffer =kmalloc (received,GFP_ATOMIC );if (!buffer) - goto exit; +return ;for (i =0 ; i <TPMIF_TX_RING_SIZE && offset < received; i++) {struct tx_buffer *txb = tp->tx_buffers[i];
@@ -566,10 +555,6 @@ static void tpmif_rx_action(unsigned lonvtpm_vd_recv (tp->chip, buffer, received, tp->tx_remember);kfree (buffer); - -exit: - -return ; }
@@ -730,13 +715,6 @@ static int __init tpmif_init(void) } -void __exit tpmif_exit(void) -{ -exit_tpm_xenbus (); -tpm_private_put (); -gnttab_free_grant_references (gref_head); -} -module_init (tpmif_init);MODULE_LICENSE ("Dual BSD/GPL" );
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/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?
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
RE: question about the guestOS boot
Quoted 14 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of tgh
Sent: 09 March 2007 08:17
To: xen-devel
Subject: [Xen-devel] question about the guestOS boothi
I try to understand the code about vm create
and now I am confused about which code does the guestOS start with to run ?
Quoted 7 lines
xen domain0 uses the function
xc_domain_creat()andxc_linux_build()to
prepare the necessary struct such asvcpu_guest_contextand 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.
Quoted 4 lines
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
Quoted 14 lines
could you help me
Thanks in advance
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: 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
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
Quoted 69 lines · Mats
Quoted 13 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of tgh
Sent: 09 March 2007 08:17
To: xen-devel
Subject: [Xen-devel] question about the guestOS boothi
I try to understand the code about vm create
and now I am confused about which code does the guestOS start with to run ?Quoted 6 lines
xen domain0 uses the function
xc_domain_creat()andxc_linux_build()to prepare the necessary struct such asvcpu_guest_contextand 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.
Quoted 3 lines
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).
--
MatsQuoted 13 lines
could you help me
Thanks in advance
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
RE: question about the guestOS boot
Quoted 17 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of tgh
Sent: 09 March 2007 10:13
To: Petersson, Mats
Cc: xen-devel
Subject: Re: [Xen-devel] question about the guestOS bootThank 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
Quoted 7 lines
and when dom0 boots a vm ,it does prepare the vm
vcpu_guest_contextfor
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.
Quoted 4 lines
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
Quoted 97 lines
Thanks in advance
Quoted 15 lines · Mats
Quoted 15 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of tgh
Sent: 09 March 2007 08:17
To: xen-devel
Subject: [Xen-devel] question about the guestOS boothi
I try to understand the code about vm create
and now I am confused about which code does the guestOS start with to run ?Quoted 5 lines
Quoted 5 lines
xen domain0 uses the function
xc_domain_creat()andxc_linux_build()to
prepare the necessary struct such asvcpu_guest_contextand other things
for vm guestOS to bootup , in the xc_linux_build(),theinitrd is also
Quoted 4 lines
Quoted 3 lines
loaded in,is it right?
then guestOS does not run the regular bootloader ,is it right?Quoted 8 lines
That is correct.
Quoted 4 lines
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
Quoted 5 lines
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
Quoted 3 lines
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"
Quoted 1 line
question to ask a mechanic is "How do I replace my
punctured tyre with
Quoted 3 lines
the spare wheel?").
Asking the overall question you're trying to solve will
give you a more
Quoted 2 lines
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
Quoted 21 lines
overall problem at all).
--
MatsQuoted 13 lines
could you help me
Thanks in advance
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develQuoted 7 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: 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?
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
Quoted 166 lines · Mats
Quoted 17 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of tgh
Sent: 09 March 2007 10:13
To: Petersson, Mats
Cc: xen-devel
Subject: Re: [Xen-devel] question about the guestOS bootThank 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 guestOSQuoted 8 lines
and when dom0 boots a vm ,it does prepare the vm
vcpu_guest_contextfor
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.
Quoted 4 lines
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
--
MatsQuoted 113 lines
Thanks in advance
Quoted 16 lines · Mats
Quoted 16 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of tgh
Sent: 09 March 2007 08:17
To: xen-devel
Subject: [Xen-devel] question about the guestOS boothi
I try to understand the code about vm create
and now I am confused about which code does the guestOS start with to run ?Quoted 6 lines
Quoted 6 lines
xen domain0 uses the function
xc_domain_creat()andxc_linux_build()to
prepare the necessary struct such asvcpu_guest_contextand other things
for vm guestOS to bootup , in the xc_linux_build(),theinitrd is also
Quoted 7 lines
Quoted 4 lines
loaded in,is it right?
then guestOS does not run the regular bootloader ,is it right?That is correct.
Quoted 7 lines
Quoted 5 lines
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
Quoted 6 lines
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
Quoted 4 lines
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"
Quoted 2 lines
question to ask a mechanic is "How do I replace my
punctured tyre with
Quoted 4 lines
the spare wheel?").
Asking the overall question you're trying to solve will
give you a more
Quoted 3 lines
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
Quoted 21 lines
overall problem at all).
--
MatsQuoted 14 lines
could you help me
Thanks in advance
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develQuoted 8 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
RE: question about the guestOS boot
Quoted 9 lines
-----Original Message-----
From: tgh [mailto:[email protected]]
Sent: 09 March 2007 12:10
To: Petersson, Mats
Cc: xen-devel
Subject: Re: [Xen-devel] question about the guestOS boot
Quoted 5 lines
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]
Re: 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
RE: question about the guestOS boot
Quoted 7 lines
-----Original Message-----
From: tgh [mailto:[email protected]]
Sent: 09 March 2007 12:35
To: Petersson, Mats
Cc: xen-devel
Subject: Re: [Xen-devel] question about the guestOS boot
Quoted 7 lines
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
Quoted 5 lines
Re: question about the guestOS boot
Thank you for your patient and detail reply
Thank you
Quoted 32 lines · Mats
Quoted 11 lines
-----Original Message-----
From: tgh [mailto:[email protected]] Sent: 09 March 2007 12:35
To: Petersson, Mats
Cc: xen-devel
Subject: Re: [Xen-devel] question about the guestOS bootThank 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 thevcpu_struct.--
MatsQuoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: question about the guestOS boot
In reply to Petersson, MatsQuoted 4 lines
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
Quoted 104 lines
Quoted 3 lines
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
--
MatsQuoted 85 lines
Thanks in advance
Quoted 12 lines · Mats
Quoted 12 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of tgh
Sent: 09 March 2007 08:17
To: xen-devel
Subject: [Xen-devel] question about the guestOS boothi
I try to understand the code about vm create
and now I am confused about which code does the guestOS start with to run ?Quoted 5 lines
Quoted 5 lines
xen domain0 uses the function
xc_domain_creat()andxc_linux_build()to
prepare the necessary struct such asvcpu_guest_contextand other things
for vm guestOS to bootup , in the xc_linux_build(),theinitrd is also
Quoted 10 lines
Quoted 2 lines
loaded in,is it right?
then guestOS does not run the regular bootloader ,is it right?That is correct.
Quoted 3 lines
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
Quoted 5 lines
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
Quoted 3 lines
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"
Quoted 1 line
question to ask a mechanic is "How do I replace my
punctured tyre with
Quoted 3 lines
the spare wheel?").
Asking the overall question you're trying to solve will
give you a more
Quoted 2 lines
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
Quoted 15 lines
overall problem at all).
--
MatsQuoted 9 lines
could you help me
Thanks in advance
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develQuoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develQuoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 4 lines
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!