From: Brett Creeley <bcreeley@amd.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
Brett Creeley <brett.creeley@amd.com>,
"jgg@ziepe.ca" <jgg@ziepe.ca>,
"yishaih@nvidia.com" <yishaih@nvidia.com>,
"shameerali.kolothum.thodi@huawei.com"
<shameerali.kolothum.thodi@huawei.com>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
"dan.carpenter@linaro.org" <dan.carpenter@linaro.org>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"shannon.nelson@amd.com" <shannon.nelson@amd.com>
Subject: Re: [PATCH v3 vfio 1/3] pds/vfio: Fix spinlock bad magic BUG
Date: Wed, 1 Nov 2023 12:18:29 -0700 [thread overview]
Message-ID: <95851979-fa65-7bf8-2d62-ee3f3797a167@amd.com> (raw)
In-Reply-To: <BN9PR11MB52761611F89F3AF731234E2D8CA0A@BN9PR11MB5276.namprd11.prod.outlook.com>
On 10/30/2023 11:13 PM, Tian, Kevin wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
>> From: Brett Creeley <brett.creeley@amd.com>
>> Sent: Saturday, October 28, 2023 6:37 AM
>>
>> The following BUG was found when running on a kernel with
>> CONFIG_DEBUG_SPINLOCK=y set:
>>
>> BUG: spinlock bad magic on CPU#2, bash/2481
>> lock: 0xffff8d6052a88f50, .magic: 00000000, .owner: <none>/-1, .owner_cpu:
>> 0
>> Call Trace:
>> <TASK>
>> dump_stack_lvl+0x36/0x50
>> do_raw_spin_lock+0x79/0xc0
>> pds_vfio_reset+0x1d/0x60 [pds_vfio_pci]
>> pci_reset_function+0x4b/0x70
>> reset_store+0x5b/0xa0
>> kernfs_fop_write_iter+0x137/0x1d0
>> vfs_write+0x2de/0x410
>> ksys_write+0x5d/0xd0
>> do_syscall_64+0x3b/0x90
>> entry_SYSCALL_64_after_hwframe+0x6e/0xd8
>>
>> As shown, the .magic: 00000000, does not match the expected value. This
>> is because spin_lock_init() is never called for the reset_lock. Fix
>> this by calling spin_lock_init(&pds_vfio->reset_lock) when initializing
>> the device.
>>
>> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
>> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
>
> is this patch still required with patch3?
Good point. It's not required anymore since there is no spinlock.
Thanks,
Brett
next prev parent reply other threads:[~2023-11-01 19:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-27 22:36 [PATCH v3 vfio 0/3] pds/vfio: Fixes for locking bugs Brett Creeley
2023-10-27 22:36 ` [PATCH v3 vfio 1/3] pds/vfio: Fix spinlock bad magic BUG Brett Creeley
2023-10-31 6:13 ` Tian, Kevin
2023-11-01 19:18 ` Brett Creeley [this message]
2023-10-27 22:36 ` [PATCH v3 vfio 2/3] pds/vfio: Fix mutex lock->magic != lock warning Brett Creeley
2023-10-27 22:36 ` [PATCH v3 vfio 3/3] pds/vfio: Fix possible sleep while in atomic context Brett Creeley
2023-10-31 6:14 ` Tian, Kevin
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=95851979-fa65-7bf8-2d62-ee3f3797a167@amd.com \
--to=bcreeley@amd.com \
--cc=alex.williamson@redhat.com \
--cc=brett.creeley@amd.com \
--cc=dan.carpenter@linaro.org \
--cc=jgg@ziepe.ca \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shannon.nelson@amd.com \
--cc=yishaih@nvidia.com \
/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®