From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 876AA2F1FEC for ; Mon, 20 Oct 2025 22:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761000005; cv=none; b=mgtsCXf7XMjjjeqTasJVqaceoO73lB8gGmFBk7JQ4kqJwmBTs2wNVCi09dOB+yELG2Mu01oWbFmNKwZRPFqyj8lJKIRlVltkYMTfbRJqup/Vynppy+qxeAFXW5qytILwR+YrQxVB/Jl/VzCDeG2/eMvD2ZlB7mNNY+c/V40eGWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761000005; c=relaxed/simple; bh=Tgo1ln9Y6VE+gmfHVXivughYL6jpYIM3N6Z1Efok2No=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TUs1M/C3szWsU5qPamSsX8cDxLX21bejSiSTFPVo8L9ckDoFEOm3SdAZ9s9iRoZPpt2O7z0LtOLvmYevDlfrFwMGgzevWktbE01dQ1zwJC4M9gLI0SDL32S3a493SXXchmfYmKYWmHrxwk5pnoKwBsx4nEGif+D8bvncmFx8MFU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=kHoCQRDC; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kHoCQRDC" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-290da96b37fso46555ad.1 for ; Mon, 20 Oct 2025 15:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1761000003; x=1761604803; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GqANdouNpfXe1TpRYeq8OtUbMCXC+xuGaNpt4ay/34I=; b=kHoCQRDCLAqY+/x0NIU6c3OeceXwFh8uwuWbvIggH0Zz4XqRyglBIM0JiG0JAG8S49 /fX4XT6jB/t9V46/BMVXE0O4vjuefOUJAGgoYk/fh/dgATD0etjtAq/PkL9BqqP9Iz9+ tENviSWhG15OZzlWEyLobHukGWpovdXWTIfIPIIUW9NEW46RWKX+8MF4c8vJkvtHieO2 cO/ESgKvyRynBmu3Yh79rWorIVUxRZhEnYcgy5C/jdrfn3ajv9gc4d+hUBUTvBJqPeRb bwD8saoLyE7Xwb6UpmR5yt39lxS66WE0N7gKLMJ0ireDzuh0lWoTRfHZ4YYTF/ZeVVlA +82w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761000003; x=1761604803; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GqANdouNpfXe1TpRYeq8OtUbMCXC+xuGaNpt4ay/34I=; b=o0GJdV055Mtc+kzqfhxcG+Dc48Qu6gQ2JNYT1N5Ty50MPWomAKouE50dJyacgwO1Ay a8f8U6MK29ZWd2rAL02fahGmf8t6kARPLkkonUEkRiAadlgpHBueZA7ti5V5rZ8nRigo Ue0jP32lg2sQWFEvrSfvBUH5jMox1lmpEmhNvY+qZSW5tJbXAj9RRt+a3fvHPwv6bo/1 WLKeaGs16XzP1O1MkyDJHkXfTj7EN1QQe0LgUJ2QMAuK1+xrC7yn0OGDHEn5wlNT+cOJ gTsdUWyg7GbAR4wKusJBgolWSnFOkpUBWZxox+QrPgpXAfteR368eccdC2eRBY0yxK6j yAPw== X-Forwarded-Encrypted: i=1; AJvYcCUuX/ucpC9F6RPcyyLGHNzHSXF8ONBycr/PNg7g7+ix8/aFrL2xioy+1M6Hna4Awl7Lo90U5opSW4mCzZ4=@vger.kernel.org X-Gm-Message-State: AOJu0YwNuojvqdkYPVST/xelm5dBzk5LQpnvlOecV1g2mi+yS+1FnmKt hjkTk3hq4jgatLb5+9GiSh+VIa71dXQNkq0Ztl0kNcHNv145LDMzGBzszoA8/FL7Eg== X-Gm-Gg: ASbGnctjzZxppqkEvs3PN94TnnM3GjYT3IugE/PcCrQdiHwLEZFPfq/09di36f8gt9o JSvxVatsu+QrbtfxUICr2uORpAxStCxpkmfzxah/0sDnvHVdor72lC4ZojQ0RKiLPsxJidaKf40 wDQCoDm4uPk3gqKmlToazO4v3w9OcyRZrlDnNCHwXnz3NjfhuYJDjNyTyeo/7ctO37Jh9ok7dDU ZdB1eZHNv+lly+j5JnIuUEJa7APLPVSzMVWn088GWSkCiQzadfBm+4qfz9VABnsvJnRbi0q/y1j iYxYBelmX5Ogg6lNwngPUKO5TKl/pBSQVqUDmktjdJTDdyU6VU01Jqk3UiF+BWdbj4Up8/klNKt kkzEtmjX6H6qGKk72oh1otg9h7+g5SufbSZqgBOrKiuzEhVTZ1pIVRBGi2fswzd9QYMrhz/PIwO TPIa0JwtORQ02qq0Yf1dA3Z3r4GzaqnwzJrcuS X-Google-Smtp-Source: AGHT+IEcqTlHp/Qpfza19a+3ciBdyb/icBOnAmIupjsmC3a9l9OFGVEdaUxANAVMTmKc4io99zwLcw== X-Received: by 2002:a17:903:8c7:b0:291:6488:5af5 with SMTP id d9443c01a7336-292de2e477emr479535ad.1.1761000002470; Mon, 20 Oct 2025 15:40:02 -0700 (PDT) Received: from google.com (176.13.105.34.bc.googleusercontent.com. [34.105.13.176]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-292471fdee2sm90693775ad.92.2025.10.20.15.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Oct 2025 15:40:01 -0700 (PDT) Date: Mon, 20 Oct 2025 15:39:57 -0700 From: Vipin Sharma To: David Matlack Cc: bhelgaas@google.com, alex.williamson@redhat.com, pasha.tatashin@soleen.com, jgg@ziepe.ca, graf@amazon.com, pratyush@kernel.org, gregkh@linuxfoundation.org, chrisl@kernel.org, rppt@kernel.org, skhawaja@google.com, parav@nvidia.com, saeedm@nvidia.com, kevin.tian@intel.com, jrhilke@google.com, david@redhat.com, jgowans@amazon.com, dwmw2@infradead.org, epetron@amazon.de, junaids@google.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH 12/21] vfio/pci: Skip clearing bus master on live update restored device Message-ID: <20251020223957.GA610352.vipinsh@google.com> References: <20251018000713.677779-1-vipinsh@google.com> <20251018000713.677779-13-vipinsh@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 2025-10-20 21:29:47, David Matlack wrote: > On 2025-10-17 05:07 PM, Vipin Sharma wrote: > > > @@ -167,6 +173,9 @@ static int vfio_pci_liveupdate_retrieve(struct liveupdate_file_handler *handler, > > */ > > filep->f_mapping = device->inode->i_mapping; > > *file = filep; > > + vdev = container_of(device, struct vfio_pci_core_device, vdev); > > + guard(mutex)(&device->dev_set->lock); > > + vdev->liveupdate_restore = ser; > > FYI, this causes a build failure for me: > > drivers/vfio/pci/vfio_pci_liveupdate.c:381:3: error: cannot jump from this goto statement to its label > 381 | goto err_get_registration; > | ^ > drivers/vfio/pci/vfio_pci_liveupdate.c:394:2: note: jump bypasses initialization of variable with __attribute__((cleanup)) > 394 | guard(mutex)(&device->dev_set->lock); > | ^ > > It seems you cannot jump past a guard(). Replacing the guard with > lock/unlock fixes it, and so does putting the guard into its own inner > statement. I didn't get this error in my builds. I used: make -j$(nproc) bzImage After your email, I tried with clang, using: LLVM=1 make -j$(nproc) bzImage This one indeed fails with the error you mentioned. Thanks for catching it. I wonder why gcc not complaining about it? May be I need to pass some options to enable this build error on gcc.