Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 66FA92F25E3 for ; Mon, 20 Oct 2025 22:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761000005; cv=none; b=uf79TfmYdz9QqPsN/eYsXzzctDWrjhKYw3HOV5l87OY9uxDoTCEPmEhI+XKJVg2ylKnkk2lAVTSVU19oiVuYNpCyoEtk6b8/uhC1XtuBgZPCgX8pMcbmuzR9iCWXPa49qt/LllBFejPVvynM1vnRxfnjhQU1DF/2zpOlpvFSzhQ= 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.177 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-f177.google.com with SMTP id d9443c01a7336-27d67abd215so86945ad.0 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=fg5z9TZmK8aVqPkN8x+piDRLsOzk32ffcNHJI52qV2CuWJx+CXClusyp7WY2YW9se1 xCouavHt9+7q/rjwP4i+AZrzFygYJzS3nsxcQNB6GAuzcvLTmz9hwcZDZQQ7DqsahG5D yKwgw6JLInhNVrcPeE8psx8FNfLp3IeWyClwexZPybQ3eS++P+LI0L3VczmJz0M+bNTX F3kmiy60rF/FB+MnOpq9sjFfoT9ziUM+TPeQBhVWXIhh5XJhRnKpG6TTyqVkatc6QlGo 6Sq1x+L2B4nCPg/qHzQfNbbNaPUCCesHuW/BZTFBCuPxMTAtoOJP0l+xnknz7bTF6yNP fwXA== X-Forwarded-Encrypted: i=1; AJvYcCXkHdNdixH4mdGO1hhtPO0wd+ydZzdFc0I5pQmKLLzFrv5CE0vNu6VdL8Ea1G9xrDuMfqY=@vger.kernel.org X-Gm-Message-State: AOJu0YzYc0wO8eu+J4eYCnHC2T2fJU73IdpIlRBKRSFZJNP5mcgCDInD ZNb8e7JcK6oUp7J9ridbE/YXPAYqUOkN6lC7gX8YtKLJbHdzpdIULHuytQ78gn9qlw== X-Gm-Gg: ASbGncvqjNajoo3l3viawnH5vPWUArNfMOqJimEMx47W9yeAk56gPP80wCP9v1/6W1d /1OjAff25B5RaC5DqU9VvAE5BCuKzOYnwRDErKvOTsq12HFYCah9sjKuzuN8mMK1aXjX2zuzxH0 KkHFQ7JTg79F3HTlK15T+26WsJ2pXFJ3r7Zyo81AMUxu52I7Kj7NTPXz9aqNzDpAypgGorTv+o2 L1CuE3N98yMYpEA+Br32LMgtjk5IgZGemJ88y/CWUfBUTBgRJYvqtt3+MpuacKKCUCIblD/oTQx lHjfUTE6ZhTKgZsMvf4h0qZSj+iig0D4cB3Lb8Wn1GMfT94wCDyfEcHx0lGgpmurUyRZpWgLFX/ yfCHSK3VTqpw9RHYv9c4ZOUAk3RaCVTmJfkF0PfQtVyIpZCJK+wEORFEz06UHHNB1muLU2WKeN6 +ina2kKnsGJ6tPm73oSNdE8WB5BD4ZzMd52c/3 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: kvm@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.