mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH] x86: Preserve ACPI memory area during hibernation
Date: Tue, 15 Feb 2022 13:22:12 +0100	[thread overview]
Message-ID: <f6e5f716-f191-c126-cc81-cf872ad4e750@linux.intel.com> (raw)
In-Reply-To: <59ef4cd5-5703-2356-c893-9858985f91e0@intel.com>

On 2/14/2022 8:34 PM, Rafael J. Wysocki wrote:
> On 1/21/2022 11:39 AM, Amadeusz Sławiński wrote:
>> When overriding NHLT ACPI-table tests show that on some platforms
>> there is problem that NHLT contains garbage after hibernation/resume
>> cycle.
>>
>> Problem stems from the fact that ACPI override performs early memory
>> allocation using memblock_phys_alloc_range() in
>> memblock_phys_alloc_range(). This memory block is later being marked as
>> ACPI memory block in arch_reserve_mem_area(). Later when memory areas
>> are considered for hibernation it is being marked as nosave in
>> e820__register_nosave_regions().
>>
>> Fix this by skipping ACPI memory area altogether when considering areas
>> to mark as nosave.
> 
> This patch looks correct to me and I'm going to apply it as 5.18 
> material unless there are any objections or concerns (in which case 
> please let me know).
> 
> 

Well, what do you know? I've checked with validation team to make sure 
that it works as expected and while it causes no problem on almost all 
platforms and fixes problem with NHLT ACPI-table override, there is this 
one platform where it causes oops on hibernation which of course is gone 
after reverting the patch.

  ? set_direct_map_default_noflush+0x130/0x130
  ? memory_bm_test_bit+0x29/0x60
  saveable_page+0xce/0xf2
  count_data_pages+0x50/0x76
  hibernate_preallocate_memory+0x9c/0x377
  ? __mutex_lock_slowpath+0x20/0x20
  hibernation_snapshot+0x1cf/0x610
  snapshot_ioctl+0x3d2/0x690
  ? snapshot_release+0xd0/0xd0
  ? new_sync_write+0x36b/0x390
  __x64_sys_ioctl+0x6dc/0xe20
  ? vfs_fileattr_set+0x520/0x520
  ? _raw_read_unlock+0x2a/0x50
  ? __kasan_check_read+0x11/0x20
  ? vfs_write+0x131/0x3d0
  ? ksys_write+0x13b/0x170
  ? debug_smp_processor_id+0x17/0x20
  ? fpregs_assert_state_consistent+0x5f/0x70
  ? exit_to_user_mode_prepare+0x3e/0x170
  do_syscall_64+0x43/0x90
  entry_SYSCALL_64_after_hwframe+0x44/0xae

Above trace points at functions using pfn, so I suspect there may be 
need for some additional checks, but I will need to investigate.
I guess you can skip this patch for now, until I figure what exactly is 
going on.

  reply	other threads:[~2022-02-15 12:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21 10:39 Amadeusz Sławiński
2022-02-14 19:34 ` Rafael J. Wysocki
2022-02-15 12:22   ` Amadeusz Sławiński [this message]
2022-02-15 14:10     ` Rafael J. Wysocki

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=f6e5f716-f191-c126-cc81-cf872ad4e750@linux.intel.com \
    --to=amadeuszx.slawinski@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=cezary.rojewski@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®