All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi: Switch to dynamic mapping at SYS_STATE_boot
@ 2017-01-30 18:26 Boris Ostrovsky
  2017-01-31 11:01 ` Jan Beulich
  0 siblings, 1 reply; 6+ messages in thread
From: Boris Ostrovsky @ 2017-01-30 18:26 UTC (permalink / raw
  To: xen-devel; +Cc: andrew.cooper3, Boris Ostrovsky, alex.thorlton, jbeulich

We can switch ACPI from using fixmap to dynamic mapping as soon as
the system enters SYS_STATE_boot. This will allow us, for example,
to map MADT on systems with large number of processors where the
table might not fit into NUM_FIXMAP_ACPI_PAGES (currently set to 4).

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/drivers/acpi/osl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/acpi/osl.c b/xen/drivers/acpi/osl.c
index 3616dfd..7199047 100644
--- a/xen/drivers/acpi/osl.c
+++ b/xen/drivers/acpi/osl.c
@@ -89,7 +89,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
 void __iomem *
 acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
 {
-	if (system_state >= SYS_STATE_active) {
+	if (system_state >= SYS_STATE_boot) {
 		mfn_t mfn = _mfn(PFN_DOWN(phys));
 		unsigned int offs = phys & (PAGE_SIZE - 1);
 
@@ -104,7 +104,7 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
 
 void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
 {
-	if (system_state >= SYS_STATE_active)
+	if (system_state >= SYS_STATE_boot)
 		vunmap((void *)((unsigned long)virt & PAGE_MASK));
 }
 
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] acpi: Switch to dynamic mapping at SYS_STATE_boot
  2017-01-30 18:26 [PATCH] acpi: Switch to dynamic mapping at SYS_STATE_boot Boris Ostrovsky
@ 2017-01-31 11:01 ` Jan Beulich
  2017-01-31 15:52   ` Boris Ostrovsky
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2017-01-31 11:01 UTC (permalink / raw
  To: Boris Ostrovsky; +Cc: andrew.cooper3, alex.thorlton, xen-devel

>>> On 30.01.17 at 19:26, <boris.ostrovsky@oracle.com> wrote:
> We can switch ACPI from using fixmap to dynamic mapping as soon as
> the system enters SYS_STATE_boot. This will allow us, for example,
> to map MADT on systems with large number of processors where the
> table might not fit into NUM_FIXMAP_ACPI_PAGES (currently set to 4).

I think this needs a little more care. While ARM switches to
SYS_STATE_boot after having called vm_init(), that's not the case
on x86. Granted there's no ACPI code being invoked in between,
but this would still be a latent bug (as soon as someone inserts any
code there).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] acpi: Switch to dynamic mapping at SYS_STATE_boot
  2017-01-31 11:01 ` Jan Beulich
@ 2017-01-31 15:52   ` Boris Ostrovsky
  2017-01-31 15:56     ` Jan Beulich
  0 siblings, 1 reply; 6+ messages in thread
From: Boris Ostrovsky @ 2017-01-31 15:52 UTC (permalink / raw
  To: Jan Beulich; +Cc: andrew.cooper3, alex.thorlton, xen-devel

On 01/31/2017 06:01 AM, Jan Beulich wrote:
>>>> On 30.01.17 at 19:26, <boris.ostrovsky@oracle.com> wrote:
>> We can switch ACPI from using fixmap to dynamic mapping as soon as
>> the system enters SYS_STATE_boot. This will allow us, for example,
>> to map MADT on systems with large number of processors where the
>> table might not fit into NUM_FIXMAP_ACPI_PAGES (currently set to 4).
> I think this needs a little more care. While ARM switches to
> SYS_STATE_boot after having called vm_init(), that's not the case
> on x86. Granted there's no ACPI code being invoked in between,
> but this would still be a latent bug (as soon as someone inserts any
> code there).

Then acpi_os_map_memory() shouldn't rely on system_state at all.

How about adding something like

static bool_t vm_ready()
{
    return !!vm_base[VMAP_DEFAULT];
}

-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] acpi: Switch to dynamic mapping at SYS_STATE_boot
  2017-01-31 15:52   ` Boris Ostrovsky
@ 2017-01-31 15:56     ` Jan Beulich
  2017-01-31 16:05       ` Boris Ostrovsky
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2017-01-31 15:56 UTC (permalink / raw
  To: Boris Ostrovsky; +Cc: andrew.cooper3, alex.thorlton, xen-devel

>>> On 31.01.17 at 16:52, <boris.ostrovsky@oracle.com> wrote:
> On 01/31/2017 06:01 AM, Jan Beulich wrote:
>>>>> On 30.01.17 at 19:26, <boris.ostrovsky@oracle.com> wrote:
>>> We can switch ACPI from using fixmap to dynamic mapping as soon as
>>> the system enters SYS_STATE_boot. This will allow us, for example,
>>> to map MADT on systems with large number of processors where the
>>> table might not fit into NUM_FIXMAP_ACPI_PAGES (currently set to 4).
>> I think this needs a little more care. While ARM switches to
>> SYS_STATE_boot after having called vm_init(), that's not the case
>> on x86. Granted there's no ACPI code being invoked in between,
>> but this would still be a latent bug (as soon as someone inserts any
>> code there).
> 
> Then acpi_os_map_memory() shouldn't rely on system_state at all.

Why?

> How about adding something like
> 
> static bool_t vm_ready()
> {
>     return !!vm_base[VMAP_DEFAULT];
> }

What's wrong with just swapping the order of the two things in
x86's setup.c?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] acpi: Switch to dynamic mapping at SYS_STATE_boot
  2017-01-31 15:56     ` Jan Beulich
@ 2017-01-31 16:05       ` Boris Ostrovsky
  2017-01-31 16:27         ` Jan Beulich
  0 siblings, 1 reply; 6+ messages in thread
From: Boris Ostrovsky @ 2017-01-31 16:05 UTC (permalink / raw
  To: Jan Beulich; +Cc: andrew.cooper3, alex.thorlton, xen-devel

On 01/31/2017 10:56 AM, Jan Beulich wrote:
>>>> On 31.01.17 at 16:52, <boris.ostrovsky@oracle.com> wrote:
>> On 01/31/2017 06:01 AM, Jan Beulich wrote:
>>>>>> On 30.01.17 at 19:26, <boris.ostrovsky@oracle.com> wrote:
>>>> We can switch ACPI from using fixmap to dynamic mapping as soon as
>>>> the system enters SYS_STATE_boot. This will allow us, for example,
>>>> to map MADT on systems with large number of processors where the
>>>> table might not fit into NUM_FIXMAP_ACPI_PAGES (currently set to 4).
>>> I think this needs a little more care. While ARM switches to
>>> SYS_STATE_boot after having called vm_init(), that's not the case
>>> on x86. Granted there's no ACPI code being invoked in between,
>>> but this would still be a latent bug (as soon as someone inserts any
>>> code there).
>> Then acpi_os_map_memory() shouldn't rely on system_state at all.
> Why?

Because it really is only interested in whether vm_init() has been
called, nor what the overall system state is (even if vmap status can be
implied from the state).

But I can swap the two if you prefer that.

-boris

>
>> How about adding something like
>>
>> static bool_t vm_ready()
>> {
>>     return !!vm_base[VMAP_DEFAULT];
>> }
> What's wrong with just swapping the order of the two things in
> x86's setup.c?

I


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] acpi: Switch to dynamic mapping at SYS_STATE_boot
  2017-01-31 16:05       ` Boris Ostrovsky
@ 2017-01-31 16:27         ` Jan Beulich
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2017-01-31 16:27 UTC (permalink / raw
  To: Boris Ostrovsky; +Cc: andrew.cooper3, alex.thorlton, xen-devel

>>> On 31.01.17 at 17:05, <boris.ostrovsky@oracle.com> wrote:
> On 01/31/2017 10:56 AM, Jan Beulich wrote:
>>>>> On 31.01.17 at 16:52, <boris.ostrovsky@oracle.com> wrote:
>>> On 01/31/2017 06:01 AM, Jan Beulich wrote:
>>>>>>> On 30.01.17 at 19:26, <boris.ostrovsky@oracle.com> wrote:
>>>>> We can switch ACPI from using fixmap to dynamic mapping as soon as
>>>>> the system enters SYS_STATE_boot. This will allow us, for example,
>>>>> to map MADT on systems with large number of processors where the
>>>>> table might not fit into NUM_FIXMAP_ACPI_PAGES (currently set to 4).
>>>> I think this needs a little more care. While ARM switches to
>>>> SYS_STATE_boot after having called vm_init(), that's not the case
>>>> on x86. Granted there's no ACPI code being invoked in between,
>>>> but this would still be a latent bug (as soon as someone inserts any
>>>> code there).
>>> Then acpi_os_map_memory() shouldn't rely on system_state at all.
>> Why?
> 
> Because it really is only interested in whether vm_init() has been
> called, nor what the overall system state is (even if vmap status can be
> implied from the state).
> 
> But I can swap the two if you prefer that.

Seems better to me than introducing vm_ready(). But perhaps
others are of differing opinion...

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-31 16:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-30 18:26 [PATCH] acpi: Switch to dynamic mapping at SYS_STATE_boot Boris Ostrovsky
2017-01-31 11:01 ` Jan Beulich
2017-01-31 15:52   ` Boris Ostrovsky
2017-01-31 15:56     ` Jan Beulich
2017-01-31 16:05       ` Boris Ostrovsky
2017-01-31 16:27         ` Jan Beulich

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.