* [PATCH] x86/hvm: determine shared info format earlier
@ 2007-05-14 15:23 Jan Beulich
2007-05-15 6:59 ` Keir Fraser
0 siblings, 1 reply; 13+ messages in thread
From: Jan Beulich @ 2007-05-14 15:23 UTC (permalink / raw)
To: xen-devel
Latch guest shared info format when hypercall page is being set up rather
than during an arbitrarily selected hypercall.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: 2007-05-14/xen/arch/x86/hvm/hvm.c
===================================================================
--- 2007-05-14.orig/xen/arch/x86/hvm/hvm.c 2007-05-14 08:28:38.000000000 +0200
+++ 2007-05-14/xen/arch/x86/hvm/hvm.c 2007-05-14 13:47:02.000000000 +0200
@@ -824,6 +824,15 @@ void hvm_update_guest_cr3(struct vcpu *v
void hvm_hypercall_page_initialise(struct domain *d,
void *hypercall_page)
{
+#ifdef __x86_64__
+ /*
+ * Since this operation is one of the very first executed by PV drivers
+ * on initialisation or after save/restore, it is a sensible point at
+ * which to sample the execution mode of the guest and latch 32- or 64-
+ * bit format for shared state.
+ */
+ d->arch.has_32bit_shinfo = (hvm_guest_x86_mode(current) != 8);
+#endif
hvm_funcs.init_hypercall_page(d, hypercall_page);
}
@@ -1053,13 +1062,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
break;
case HVM_PARAM_CALLBACK_IRQ:
hvm_set_callback_via(d, a.value);
- /*
- * Since this operation is one of the very first executed
- * by PV drivers on initialisation or after save/restore, it
- * is a sensible point at which to sample the execution mode of
- * the guest and latch 32- or 64-bit format for shared state.
- */
- d->arch.has_32bit_shinfo = (hvm_guest_x86_mode(current) != 8);
break;
}
d->arch.hvm_domain.params[a.index] = a.value;
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH] x86/hvm: determine shared info format earlier
2007-05-14 15:23 [PATCH] x86/hvm: determine shared info format earlier Jan Beulich
@ 2007-05-15 6:59 ` Keir Fraser
2007-05-15 7:13 ` Jan Beulich
2007-05-18 19:20 ` [PATCH] calling zap_low_mappings breaks xen boot on the es7000 Subrahmanian, Raj
0 siblings, 2 replies; 13+ messages in thread
From: Keir Fraser @ 2007-05-15 6:59 UTC (permalink / raw)
To: Jan Beulich, xen-devel
On 14/5/07 16:23, "Jan Beulich" <jbeulich@novell.com> wrote:
> Latch guest shared info format when hypercall page is being set up rather
> than during an arbitrarily selected hypercall.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
I don't think this works since the PV drivers don't re-create the hypercall
page after save/restore (bad us!).
We could sample the execution mode in *both* places (new and old)?
-- Keir
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] x86/hvm: determine shared info format earlier
2007-05-15 6:59 ` Keir Fraser
@ 2007-05-15 7:13 ` Jan Beulich
2007-05-15 7:16 ` Keir Fraser
2007-05-18 19:20 ` [PATCH] calling zap_low_mappings breaks xen boot on the es7000 Subrahmanian, Raj
1 sibling, 1 reply; 13+ messages in thread
From: Jan Beulich @ 2007-05-15 7:13 UTC (permalink / raw)
To: Keir Fraser, xen-devel
>>> Keir Fraser <Keir.Fraser@cl.cam.ac.uk> 15.05.07 08:59 >>>
>On 14/5/07 16:23, "Jan Beulich" <jbeulich@novell.com> wrote:
>
>> Latch guest shared info format when hypercall page is being set up rather
>> than during an arbitrarily selected hypercall.
>>
>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>
>I don't think this works since the PV drivers don't re-create the hypercall
>page after save/restore (bad us!).
This must be fixed then. I don't think it's appropriate for them to assume
the hypercall page doesn't change its layout across suspend.
>We could sample the execution mode in *both* places (new and old)?
Even if it gets fixed in the drivers?
Jan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] x86/hvm: determine shared info format earlier
2007-05-15 7:13 ` Jan Beulich
@ 2007-05-15 7:16 ` Keir Fraser
2007-05-15 7:24 ` Jan Beulich
0 siblings, 1 reply; 13+ messages in thread
From: Keir Fraser @ 2007-05-15 7:16 UTC (permalink / raw)
To: Jan Beulich, xen-devel
On 15/5/07 08:13, "Jan Beulich" <jbeulich@novell.com> wrote:
>> I don't think this works since the PV drivers don't re-create the hypercall
>> page after save/restore (bad us!).
>
> This must be fixed then. I don't think it's appropriate for them to assume
> the hypercall page doesn't change its layout across suspend.
I agree.
>> We could sample the execution mode in *both* places (new and old)?
>
> Even if it gets fixed in the drivers?
Is that unreasonable?
-- Keir
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] calling zap_low_mappings breaks xen boot on the es7000
2007-05-15 6:59 ` Keir Fraser
2007-05-15 7:13 ` Jan Beulich
@ 2007-05-18 19:20 ` Subrahmanian, Raj
2007-05-19 8:19 ` Keir Fraser
1 sibling, 1 reply; 13+ messages in thread
From: Subrahmanian, Raj @ 2007-05-18 19:20 UTC (permalink / raw)
To: Keir Fraser, xen-devel
[-- Attachment #1: Type: text/plain, Size: 358 bytes --]
All,
Changeset 15044 fixes zap_low_mappings, and calls it from setup.c if on
a x86_64 box.
This zaps some of the memory the ES7000 uses to talk to the Server
Control (to setup APICs, for instance).
This patch executes the zap_low_mappings only if not on an ES7000.
Signed-off-by: Rajagopalan Subrahmanian <raj.subrahmanian@unisys.com>
Thanks
Raj
[-- Attachment #2: nozapes7000.patch --]
[-- Type: application/octet-stream, Size: 975 bytes --]
# HG changeset patch
# User root@m0075-p0.site
# Node ID 30b90beeb7d16e7134336abb07170ad07e765647
# Parent 089696e0c60379e2bb9cfcc988d35aa1bdc261de
Changeset 15044 fixes zap_low_mappings, and calls it from setup.c if on a x86_64 box.
This zaps some of the memory the ES7000 uses to talk to the Server Control (to setup APICs, for instance).
This patch executes the zap_low_mappings only if not on an ES7000.
Signed-off-by: Rajagopalan Subrahmanian <raj.subrahmanian@unisys.com>
diff -r 089696e0c603 -r 30b90beeb7d1 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c Thu May 17 11:42:46 2007 +0100
+++ b/xen/arch/x86/setup.c Fri May 18 14:48:32 2007 -0400
@@ -781,7 +781,7 @@ void __init __start_xen(multiboot_info_t
#ifdef CONFIG_X86_64
/* Low mappings were only needed for some BIOS table parsing. */
- zap_low_mappings();
+ if(!es7000_plat) zap_low_mappings();/* ES7000 needs some of these mappings*/
#endif
init_apic_mappings();
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH] calling zap_low_mappings breaks xen boot on the es7000
2007-05-18 19:20 ` [PATCH] calling zap_low_mappings breaks xen boot on the es7000 Subrahmanian, Raj
@ 2007-05-19 8:19 ` Keir Fraser
2007-05-23 21:16 ` Subrahmanian, Raj
0 siblings, 1 reply; 13+ messages in thread
From: Keir Fraser @ 2007-05-19 8:19 UTC (permalink / raw)
To: Subrahmanian, Raj, xen-devel
Either we should just delay the zap_low_mappings() call, or fix your code to
map_domain_page()/unmap_domain_page(). How late in boot do you need the low
mappings?
-- Keir
On 18/5/07 20:20, "Subrahmanian, Raj" <raj.subrahmanian@unisys.com> wrote:
> All,
> Changeset 15044 fixes zap_low_mappings, and calls it from setup.c if on
> a x86_64 box.
> This zaps some of the memory the ES7000 uses to talk to the Server
> Control (to setup APICs, for instance).
> This patch executes the zap_low_mappings only if not on an ES7000.
> Signed-off-by: Rajagopalan Subrahmanian <raj.subrahmanian@unisys.com>
>
> Thanks
> Raj
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH] calling zap_low_mappings breaks xen boot on the es7000
2007-05-19 8:19 ` Keir Fraser
@ 2007-05-23 21:16 ` Subrahmanian, Raj
2007-05-24 9:04 ` Keir Fraser
0 siblings, 1 reply; 13+ messages in thread
From: Subrahmanian, Raj @ 2007-05-23 21:16 UTC (permalink / raw)
To: Keir Fraser, xen-devel
[-- Attachment #1: Type: text/plain, Size: 996 bytes --]
>-----Original Message-----
>From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk]
>Sent: Saturday, May 19, 2007 4:20 AM
>To: Subrahmanian, Raj; xen-devel@lists.xensource.com
>Subject: Re: [PATCH] calling zap_low_mappings breaks xen boot
>on the es7000
>> All,
>> Changeset 15044 fixes zap_low_mappings, and calls it from setup.c if
>> on a x86_64 box.
>> This zaps some of the memory the ES7000 uses to talk to the Server
>> Control (to setup APICs, for instance).
>> This patch executes the zap_low_mappings only if not on an ES7000.
>> Signed-off-by: Rajagopalan Subrahmanian <raj.subrahmanian@unisys.com>
>>
>> Thanks
>> Raj
>Either we should just delay the zap_low_mappings() call, or
>fix your code to map_domain_page()/unmap_domain_page(). How
>late in boot do you need the low mappings?
Keir.
This patch delays the zap_low_mappings() call until after the
smp_prepare_cpus call. With this patch, I am able to run Xen on the
ES7000 and a Dell SC 1430.
Raj
[-- Attachment #2: delayzap.patch --]
[-- Type: application/octet-stream, Size: 1377 bytes --]
# HG changeset patch
# User root@Musashi.Miyamoto
# Date 1179926604 14400
# Node ID 0d8b1ec0486e36ae7029edeb65e9e3e8a9e40691
# Parent 089696e0c60379e2bb9cfcc988d35aa1bdc261de
Changeset 15044 fixes zap_low_mappings and calls it from setup.c. This zaps some of the low memory that the ES7000 uses to talk to server control. This patch postpones the calling of zap_low_mappings when xen will no longer need to talk to server control.
Signed-off-by: Rajagopalan Subrahmanian <raj.subrahmanian@unisys.com>
diff -r 089696e0c603 -r 0d8b1ec0486e xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c Thu May 17 11:42:46 2007 +0100
+++ b/xen/arch/x86/setup.c Wed May 23 09:23:24 2007 -0400
@@ -779,11 +779,6 @@ void __init __start_xen(multiboot_info_t
if ( smp_found_config )
get_smp_config();
-#ifdef CONFIG_X86_64
- /* Low mappings were only needed for some BIOS table parsing. */
- zap_low_mappings();
-#endif
-
init_apic_mappings();
init_IRQ();
@@ -812,7 +807,10 @@ void __init __start_xen(multiboot_info_t
max_cpus = 0;
smp_prepare_cpus(max_cpus);
-
+#ifdef CONFIG_X86_64
+ /* Low mappings were only needed for some BIOS table parsing. */
+ zap_low_mappings();
+#endif
/*
* Initialise higher-level timer functions. We do this fairly late
* (post-SMP) because the time bases and scale factors need to be updated
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH] calling zap_low_mappings breaks xen boot on the es7000
2007-05-23 21:16 ` Subrahmanian, Raj
@ 2007-05-24 9:04 ` Keir Fraser
2007-05-25 12:24 ` Subrahmanian, Raj
2007-06-14 17:58 ` Subrahmanian, Raj
0 siblings, 2 replies; 13+ messages in thread
From: Keir Fraser @ 2007-05-24 9:04 UTC (permalink / raw)
To: Subrahmanian, Raj, xen-devel
On 23/5/07 22:16, "Subrahmanian, Raj" <raj.subrahmanian@unisys.com> wrote:
>> Either we should just delay the zap_low_mappings() call, or
>> fix your code to map_domain_page()/unmap_domain_page(). How
>> late in boot do you need the low mappings?
>
> This patch delays the zap_low_mappings() call until after the
> smp_prepare_cpus call. With this patch, I am able to run Xen on the
> ES7000 and a Dell SC 1430.
So where is the late low-memory access happening? There's not that much
es7000-specific code. It can't be hard to fix properly. If the physical
pointer is known to be below 1MB you can just __va() it. If not you may need
to use a fixmap, or acpi_map_table, or just __va() only on x86_64. I'd like
to keep the zap as early as possible to catch truly erroneous low pointers.
-- Keir
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH] calling zap_low_mappings breaks xen boot on the es7000
2007-05-24 9:04 ` Keir Fraser
@ 2007-05-25 12:24 ` Subrahmanian, Raj
2007-05-25 12:39 ` Keir Fraser
2007-06-14 17:58 ` Subrahmanian, Raj
1 sibling, 1 reply; 13+ messages in thread
From: Subrahmanian, Raj @ 2007-05-25 12:24 UTC (permalink / raw)
To: Keir Fraser, xen-devel
Keir,
>>> Either we should just delay the zap_low_mappings() call, or
>fix your
>>> code to map_domain_page()/unmap_domain_page(). How late in boot do
>>> you need the low mappings?
>>
>> This patch delays the zap_low_mappings() call until after the
>> smp_prepare_cpus call. With this patch, I am able to run Xen on the
>> ES7000 and a Dell SC 1430.
>
>So where is the late low-memory access happening? There's not
>that much es7000-specific code. It can't be hard to fix
>properly. If the physical pointer is known to be below 1MB you
>can just __va() it. If not you may need to use a fixmap, or
>acpi_map_table, or just __va() only on x86_64. I'd like to
>keep the zap as early as possible to catch truly erroneous low
>pointers.
I will look into that code and fix it.
If you don't mind me asking, what exactly does zap_low_mappings do? I am
not able to figure it out looking at the code.
Thanks
Raj
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: RE: [PATCH] calling zap_low_mappings breaks xen boot on the es7000
2007-05-25 12:24 ` Subrahmanian, Raj
@ 2007-05-25 12:39 ` Keir Fraser
0 siblings, 0 replies; 13+ messages in thread
From: Keir Fraser @ 2007-05-25 12:39 UTC (permalink / raw)
To: Subrahmanian, Raj, xen-devel
On 25/5/07 13:24, "Subrahmanian, Raj" <raj.subrahmanian@unisys.com> wrote:
>> So where is the late low-memory access happening? There's not
>> that much es7000-specific code. It can't be hard to fix
>> properly. If the physical pointer is known to be below 1MB you
>> can just __va() it. If not you may need to use a fixmap, or
>> acpi_map_table, or just __va() only on x86_64. I'd like to
>> keep the zap as early as possible to catch truly erroneous low
>> pointers.
> I will look into that code and fix it.
> If you don't mind me asking, what exactly does zap_low_mappings do? I am
> not able to figure it out looking at the code.
It removes the 1:1 mapping of physical memory at virtual address 0x0.
-- Keir
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH] calling zap_low_mappings breaks xen boot on the es7000
2007-05-24 9:04 ` Keir Fraser
2007-05-25 12:24 ` Subrahmanian, Raj
@ 2007-06-14 17:58 ` Subrahmanian, Raj
2007-06-14 18:12 ` Keir Fraser
1 sibling, 1 reply; 13+ messages in thread
From: Subrahmanian, Raj @ 2007-06-14 17:58 UTC (permalink / raw)
To: Keir Fraser, xen-devel
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
This patch tries to switch into APIC mode only on classic ES7000s. This
is not required on the ES7000 Zorros.
With this patch, I can once again boot Xen on an ES7000, on the unstable
tip.
Raj
[-- Attachment #2: es7000.patch --]
[-- Type: application/octet-stream, Size: 1051 bytes --]
# HG changeset patch
# User root@Musashi.Miyamoto
# Date 1181813822 14400
# Node ID 7bbb7b45a91cef067d3804615ff3c6e2f193d4b0
# Parent 93f77a5a8437df0b34919a6987f48e84342b4a43
This patch cleans up some of the ES7000 specific APIC code.
Signed-off-by: Raj Subrahmanian <raj.subrahmanian@unisys.com>
diff -r 93f77a5a8437 -r 7bbb7b45a91c xen/arch/x86/genapic/es7000plat.c
--- a/xen/arch/x86/genapic/es7000plat.c Sun Jun 10 19:58:22 2007 +0100
+++ b/xen/arch/x86/genapic/es7000plat.c Thu Jun 14 05:37:02 2007 -0400
@@ -298,13 +298,13 @@ es7000_stop_cpu(int cpu)
void __init
es7000_sw_apic()
-{
- if (es7000_plat) {
+{
+ if ((es7000_plat)&&es7000_plat!=ES7000_ZORRO) {
int mip_status;
struct mip_reg es7000_mip_reg;
printk("ES7000: Enabling APIC mode.\n");
- memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
+ memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
es7000_mip_reg.off_0 = MIP_SW_APIC;
es7000_mip_reg.off_38 = (MIP_VALID);
while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: RE: [PATCH] calling zap_low_mappings breaks xen boot on the es7000
2007-06-14 17:58 ` Subrahmanian, Raj
@ 2007-06-14 18:12 ` Keir Fraser
0 siblings, 0 replies; 13+ messages in thread
From: Keir Fraser @ 2007-06-14 18:12 UTC (permalink / raw)
To: Subrahmanian, Raj, xen-devel
On 14/6/07 18:58, "Subrahmanian, Raj" <raj.subrahmanian@unisys.com> wrote:
> This patch tries to switch into APIC mode only on classic ES7000s. This
> is not required on the ES7000 Zorros.
> With this patch, I can once again boot Xen on an ES7000, on the unstable
> tip.
Does this leave unstable tip broken on the older ES7000 though?
The proper fix would seem to be to find out which access is faulting, and to
obtain the required virtual address by __va() or by map_domain_page() rather
than relying on the phys==virt mapping. Or is the problem more tricky than
that?
-- Keir
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-06-14 18:12 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-14 15:23 [PATCH] x86/hvm: determine shared info format earlier Jan Beulich
2007-05-15 6:59 ` Keir Fraser
2007-05-15 7:13 ` Jan Beulich
2007-05-15 7:16 ` Keir Fraser
2007-05-15 7:24 ` Jan Beulich
2007-05-18 19:20 ` [PATCH] calling zap_low_mappings breaks xen boot on the es7000 Subrahmanian, Raj
2007-05-19 8:19 ` Keir Fraser
2007-05-23 21:16 ` Subrahmanian, Raj
2007-05-24 9:04 ` Keir Fraser
2007-05-25 12:24 ` Subrahmanian, Raj
2007-05-25 12:39 ` Keir Fraser
2007-06-14 17:58 ` Subrahmanian, Raj
2007-06-14 18:12 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.