Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.71 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796322416; b=trZjG0Lr1T5Nq4KS7E57kR/SIftElYicDZ2igUA17sc2wFZK3IyDeuD3gq4m6bSp/BhE 52nqjxdHMpt//MWtT8XI+FHUFqMBRTiJ0ufnvwPOAEpy0BYIHyNHr39xqTe9IrVI01SeV aWv/rwFALUNsYS3hmVo/9OMR+kz5lQ5PfyO0EH+fz19BcXHgY3ib2+tXMRaFVLZzTgz/D 9rFrNgCNJMsXMgo7FbHdflZk6lRSSxYUHoXuodcksj6m+yQ9fls3Mvc3b2lMHrJyL8cL7 omMArocyg/ZVpEFKBbrpUGNc79ksDOyRTJRo0CB+71zcf2ZWCXvPHHA0CG2JmlfsqUg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796322416; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:Message-ID:Subject:From:To:Cc:Content-Type; bh=mvDJ4eBVE2HO8VRrQZnMKX6ipreCNaZ92Ao9d46hd8A=; b=W/eroE1JsPmVF2b5NjM8tQQY21TheuskJ5zuH6ExplhRJzBMEGF5+cYxNSQsjJRMuWxw Eux52u4FMHXeBYEdfKVvH/LUEuSthtzAkp+CMuHrvEY2fkT7BoMwDocNCUC/zCm1x7s3/ RZB2/ukQzF39r5AOagch4IiKcGoMxy/KMECbPL1qpmUch4oLYhDLjhHtJpLBlaO9EWzBr Yh/6PkMU3YdjFEoLiaUgfT6nkab2ENaB4VWJZu8pkdlSLyoEET1ZfHrFTxQUkqf6asC1h YAn3R/X4wNKCuNg3Van0Iy0iqi9vDHh17gZIlyy8DlcU4uLAhor1b1BN8Yn/YVJxNsw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--tarunsahu.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=d34kon+O; arc=none smtp.remote-ip=209.85.221.71 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1093C606A32C for ; Thu, 3 Dec 2026 18:26:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1093C606A32C 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=flex--tarunsahu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=d34kon+O Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48e4d1e29f3so120603f8f.3 for ; Thu, 03 Dec 2026 10:26:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796322414; x=1796927214; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mvDJ4eBVE2HO8VRrQZnMKX6ipreCNaZ92Ao9d46hd8A=; b=d34kon+ObiljkmxELs4jJ8+Tq5wwGsb3t+smWdI0N5SpLWdbNL8y2BUMCO259+V/t4 V+C3v508RbWLcmOnZct6q77egWw3moDDVlEoADs/HxLQQHsF2m6FDMa6O2fsHR8J6oBI PFhxuFRYkcGVWf1d7NGYDFEmlQHZ3n+udSvgxdng8UHxzi+dGcGMsPGTcoURxbOMHRUJ bvUwNMYvD76Jwl+rXaWEksbVYeSiUPjFGh2CB7DDm7L3mm7pvTjEnvq4fQ7gkGFXU13w 2v1fybDSfsS28gJS9YEqs6T4nPHJUnFBY5lkjK4ttoZ10XQQHYObdhVUyCO2Zh/n1RD+ 9c6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796322414; x=1796927214; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mvDJ4eBVE2HO8VRrQZnMKX6ipreCNaZ92Ao9d46hd8A=; b=gVKegt9+/pYAZ+JbEghCDjkr8HLoEcAsmYZGg/UWern1V2Uuc8Uosp4KhBf5Qd378N 7w1zhBhwlzc6AdKQnS4ZH/XrP7fKMfhieGtrYUtKQeT1IqN/HPzi/u5RFUMJ49zP6Ua9 R5/x/nSD9RNB1ppOrtDdegP5Btl9F/hNq90HI1NDFeJjfu6j+KkWgmX1gunHM/WFswEO ZsRRZmAhy6m5yz2cqWET7FF58m6YXaJIb0kp4yvBSuoDCKi734bHf4NBQtFqLzNmLJhR i0JCqi0b0DD0Oepyv36SSc1MHm/NPzlOdP2iYE9nnYGnItuUwN0lOM1+kEmtWRMo4Ycm 5Mcg== X-Forwarded-Encrypted: i=1; AL+hErFueA0HlaU5M8QcpkFguLJPVDmS5ZiLmEo686zI8wtpVReJbUcUScOyL/lFqKsRwzny6gU=@vger.kernel.org X-Gm-Message-State: APuU4Z/sdsfWeats6WXZIAriYQ4O01gC3zU9hHkdDLsaRaQbw0XjRRAM M9E5aQ62qzqGhP3frzIzdpQ5eIpILY3GGzW3P0WVueBoeLLwJajb4cRm4W4ioGrSbW79OTQwPB/ AqxFf6sNWbe49xqVCbA== X-Received: from wrhm4.prod.google.com ([2002:a05:6000:1804:b0:4b8:1610:67ea]) (user=tarunsahu job=prod-delivery.src-stubby-dispatcher) by 2002:adf:e014:0:10b0:48f:bcdf:6f7d with SMTP id ffacd0b85a97d-4abb3c37b20mr66869884f8f.34.1796322414143; Thu, 03 Dec 2026 10:26:54 -0800 (PST) Date: Thu, 03 Dec 2026 18:26:53 +0000 In-Reply-To: <20261115203413.eaa54fcba43adc22@chrisdown.name> X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261110050202.529473-1-tarunsahu@google.com> <20261110050202.529473-15-tarunsahu@google.com> <20261115203413.eaa54fcba43adc22@chrisdown.name> Message-ID: <9huza4mmnrte.fsf@tarunix.c.googlers.com> Subject: Re: [PATCH v4 14/19] liveupdate: Add feature header to struct luo_flb_ser From: tarunsahu@google.com To: Chris Down Cc: Pasha Tatashin , Mike Rapoport , robin.murphy@arm.com, maz@kernel.org, will@kernel.org, David Matlack , Alexander Graf , seanjc@google.com, jgg@nvidia.com, loganodell@google.com, arnd@arndb.de, dwmw2@infradead.org, baolu.lu@linux.intel.com, Bjorn Helgaas , oupton@kernel.org, alex@shazbot.org, gle.com@google.com, pbonzini@redhat.com, Andrew Morton , kevin.tian@intel.com, joro@8bytes.org, kvmarm@lists.linux.dev, linux-pci@vger.kernel.org, Pratyush Yadav , kexec@lists.infradead.org, kvm@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, skhawaja@google.com, sagis@google.com, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Chris Down writes: > Hi Tarun, > > Tarun Sahu writes: >>+ for (u64 i = 0; i < fh->header_ser->count; >>+ i++, fhdr = (void *)fhdr + fhdr->size) { >>+ struct luo_flb_ser *ser; >>+ >>+ err = kho_ser_validate(fhdr, luo_flb_ser); >>+ if (err) >>+ return err; > > I think there's a problem with returning this error as it is. For an > unknown required feature kho_ser_validate() returns -EOPNOTSUPP, but > callers of liveupdate_flb_get_incoming() already take -EOPNOTSUPP to mean > that live update is disabled. pci_liveupdate_flb_get_incoming() returns > NULL for it, so instead of panicking, PCI carries on as if nothing was > preserved, even though those devices may still be doing DMA. That's good point. After looking at the error tabe, Does -EPROTO sounds good when kho_ser_validate fails? > > From a quick test with an outgoing kernel hacked to set an unknown > required bit on its luo_flb_ser entries, that is what happens after the > kexec, in that the PCI FLB is never retrieved and boot carries on. > > Could you validate the entries once in luo_flb_setup_incoming() instead? > They are all written with the same header by luo_flb_serialize(), so > there's no need to check them on every lookup. Going by the code, a > failure there would panic through luo_restore_fail(), like a bad > luo_flb_header_ser already does. If the per-entry headers end up going > away as David suggested, then this check goes away with them, of course. > As per the recent decision, collection entries will not have their own header instead they will rely on their parents header. And this validation per entry will be dropped. Thanks Tarun > Thanks! > > Chris