All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng, Lv <lv.zheng at intel.com>
To: devel@acpica.org
Subject: Re: [Devel] [PATCH] handle Linux systems without /dev/mem
Date: Tue, 16 Jun 2015 00:33:54 +0000	[thread overview]
Message-ID: <1AE640813FDE7649BE1B193DEA596E8802731DEA@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: 557F46C2.10904@redhat.com

[-- Attachment #1: Type: text/plain, Size: 6330 bytes --]

Hi,

> From: Al Stone [mailto:ahs3(a)redhat.com]
> Sent: Tuesday, June 16, 2015 5:42 AM
> 
> On 06/14/2015 07:13 PM, Zheng, Lv wrote:
> > Hi,
> >
> >> From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Zheng, Lv
> >> Sent: Monday, June 15, 2015 8:49 AM
> >>
> >> Hi,
> >>
> >>> From: Zheng, Lv
> >>> Sent: Monday, June 15, 2015 8:40 AM
> >>>
> >>> Hi,
> >>>
> >>>> From: Al Stone [mailto:ahs3(a)redhat.com]
> >>>> Sent: Saturday, June 13, 2015 6:00 AM
> >>>>
> >>>> On 06/09/2015 12:16 AM, Zheng, Lv wrote:
> >>>>> Hi,
> >>>>>
> >>>>> The patch is wrong.
> >>>>> If we want to dump tables without accessing /dev/mem, we have acpidump -c.
> >>>>> The only problem here is:
> >>>>> There is a bug that even with -c specified, acpidump cannot work without accessing /dev/mem.
> >>>>> So we shouldn't introduce a new portable acpidump OSL but should fix the very problem.
> >>>>>
> >>>>> We've noticed the similar issue in handling this kernel bug:
> >>>>> https://bugzilla.kernel.org/show_bug.cgi?id=87971
> >>>>> The fix for this issue can be found here:
> >>>>> https://github.com/acpica/acpica/pull/77
> >>>>>
> >>>>> Thanks and best regards
> >>>>> -Lv
> >>>>
> >>>> The problem I have with this fix for the issue is that this command:
> >>>>
> >>>> 	# acpidump -n APIC
> >>>>
> >>>> will work on x86 but fail on arm64.  Getting the -c option to work properly
> >>>> is a good thing, and should be done regardless.  But, this means we have to
> >>>> use "acpidump -c -n APIC" on systems without /dev/mem.  For my part:
> >>>>
> >>>>    (a) these are not really customized tables, but the standard ACPI tables
> >>>>        used to boot the system, so using -c is a little confusing, and
> >>>>
> >>>>    (b) we now have to use different commands on different architectures to
> >>>>        get the same result.
> >>>>
> >>>> My preference would be that the same command has the same behavior everywhere,
> >>>> which is why I patched it the way I did.
> >>>
> >>> This is not our preference, though...
> >>> I've been in the trouble of being easily confused by the bug reporters.
> >>> And I cannot distinguish if the table has been customized or root cause the bugs if the reporter did what I asked for but hid what
> he
> >>> silently did.
> >>> If we cannot distinguish the BIOS provided tables and the user customized tables from users' output, we'll likely lose the capability
> of
> >>> taking evidence...
> >>>
> >>>>
> >>>> This happens to be very useful on arm64 where /dev/mem is not reliable, but it
> >>>> could also be usable on any system that does not want to expose /dev/mem for
> >>>> some reason.  I think the advantage of the patch sent is that the user command
> >>>> stays the same no matter what the situation.
> >>>
> >>> My suggestion would be to support this via kernel.
> >>> Let the kernel exposes 2 kind of tables (customized or not customized) into the /sys/firmware/acpi/tables.
> >>> Which can meet both of the requirements.
> >>
> >> Or we currently can make the "-c" mode the default behavior and add a new option for dumping the BIOS tables.
> >
> > And you can check if this commit is acceptable:
> > https://github.com/acpica/acpica/pull/80
> 
> Hrm.  I guess if we have to have the -c option, I would prefer the first patch
> where we just get rid of the dependence on /dev/mem.  I think it is easier to
> explain that -c must always be used rather than trying to explain how to use
> the -c on/off options.

We can switch this option back when the support is ready.

> 
> I think the path I would like to see long term is to split up /sys as you
> suggested so that there is a run-time version of the ACPI tables, and a copy
> of the tables from UEFI.  That way, no one has to rely on /dev/mem at all,
> and acpidump can go back to parameters operating exactly the same way on all
> possible platforms.

Removing the dependency of /dev/mem and exporting BIOS table via /sys or even better - making all acpidump functionalities a part of the kernel.
I think we need to add one more pointer in acpi_table_desc first.

Thanks and best regards
-Lv

> 
> > Thanks and best regards
> > -Lv
> >
> >>
> >> Thanks and best regards
> >> -Lv
> >>
> >>
> >>>
> >>> Thanks and best regards
> >>> -Lv
> >>>
> >>>>
> >>>>>> From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Al Stone
> >>>>>> Sent: Thursday, June 04, 2015 8:43 AM
> >>>>>>
> >>>>>> On arm64 systems in particular, the use of /dev/mem is not recommended.  The
> >>>>>> contents may or may not be valid depending on the memory map being used, since
> >>>>>> they are not standardized.
> >>>>>>
> >>>>>> The attached patch will cause arm64 (aka ARMv8 or AArch64) Linux systems to
> >>>>>> use a new file called source/os_specific/service_layers/oslinuxtbl_nodevmem.c
> >>>>>> (a subset of the oslinuxtbl.c code) that allows acpidump to read all ACPI
> >>>>>> tables from /sys/firmware/acpi instead of from /dev/mem.  This will help ensure
> >>>>>> that the tables retrieved are the ones actually being used and that their
> >>>>>> content is correct.
> >>>>>>
> >>>>>> This patch applies on top of the 20150515 version, and I have included it in
> >>>>>> the 20150515-2 versions of the Fedora and Debian packages.  I've tried the
> >>>>>> resulting acpidump on x86, x86_64 and arm64 systems and it seems to work well.
> >>>>>>
> >>>>>> Signed-off-by: Al Stone <ahs3(a)redhat.com>
> >>>>>>
> >>>>>> --
> >>>>>> ciao,
> >>>>>> al
> >>>>>> -----------------------------------
> >>>>>> Al Stone
> >>>>>> Software Engineer
> >>>>>> Red Hat, Inc.
> >>>>>> ahs3(a)redhat.com
> >>>>>> -----------------------------------
> >>>>
> >>>>
> >>>> --
> >>>> ciao,
> >>>> al
> >>>> -----------------------------------
> >>>> Al Stone
> >>>> Software Engineer
> >>>> Red Hat, Inc.
> >>>> ahs3(a)redhat.com
> >>>> -----------------------------------
> >> _______________________________________________
> >> Devel mailing list
> >> Devel(a)acpica.org
> >> https://lists.acpica.org/mailman/listinfo/devel
> 
> 
> --
> ciao,
> al
> -----------------------------------
> Al Stone
> Software Engineer
> Red Hat, Inc.
> ahs3(a)redhat.com
> -----------------------------------

             reply	other threads:[~2015-06-16  0:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16  0:33 Zheng, Lv [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-16  0:41 [Devel] [PATCH] handle Linux systems without /dev/mem Zheng, Lv
2015-06-15 21:42 Al Stone
2015-06-15 21:36 Al Stone
2015-06-15  1:13 Zheng, Lv
2015-06-15  0:48 Zheng, Lv
2015-06-15  0:39 Zheng, Lv
2015-06-12 22:00 Al Stone
2015-06-09  6:16 Zheng, Lv
2015-06-04  0:43 Al Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1AE640813FDE7649BE1B193DEA596E8802731DEA@SHSMSX101.ccr.corp.intel.com \
    --to=devel@acpica.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.