From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (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 939283B992C for ; Tue, 28 Jul 2026 23:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785279972; cv=none; b=iBprBbD3IFlq1zLkYac2VMDUkdCeZyDBs7LkYRQ0cDn14Rxmz8kWMCtw5QVVxkAXAF5V5tkGvTNJorj2kZYSZiEVWyxHfXJjPY8xq1J6uIy3hi3nI4TM1X2lyVfolnHGpvJeqTdW50gXYcSxCaS1tjoXBYu9dbjNsIkj1kNyL8E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785279972; c=relaxed/simple; bh=DogBQgPNXswuGIoml9u4fiZ1siHOFMK0NYoj1Fcu0ek=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ZgqNlDdrttJZ9eAcbwR3iKr4PTjHjVCFfccxB0kSWNYuhZ+ArUBwbDAUlVU+El+deqkRGl8Qx19Rs41KId8jmXvBsyJdXXd36llJWJ71PMc1nbQpQkatLRBPYSS1ROC6DwcEl7sQl0yU2RjXHdsMCOOKXVL29nL2LBOWUD56Ptw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=XHnP7TLQ; arc=none smtp.client-ip=209.85.215.197 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--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XHnP7TLQ" Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-c9fe4c5eb39so170883a12.1 for ; Tue, 28 Jul 2026 16:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785279971; x=1785884771; 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=kIqmps2dhv8tBsBvZD3H17qhoPMotCZtd+Geu7ae0Wc=; b=XHnP7TLQcqGrUbh4qia9Wr/2HZjShWsF0N076n1po6boeZ6UXtU2NtkpEbfbggHwZF sShCsohlVFZvoAywE37ZQARO2INQQyh6FJ9ptcxqFHHNtHMWK31Nk0eWQpMXS09abnDi YkLWtoWza6Kh6F24bcEqvsiAul5NaG4s7H7OaRYANI8ZBDjRqrPUxBjrl+rxGOeQ5qh9 fzy0CwF1Slb7pivI5QShWDCnyQZfhwZRQCx5ya8S3MSVcYdt6ykHUo0h51zTFLBMRlW6 V0gvIMOYEtvD0bkKD3TsRlMZp4oQ4pjnsqBVt40tuDBSSq9tQaEc0FoF2so/RnHLAMUl kGPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785279971; x=1785884771; 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=kIqmps2dhv8tBsBvZD3H17qhoPMotCZtd+Geu7ae0Wc=; b=GbfleLGveRTsFgg8RUd7WwWDdj6PaPcrZ0bR/2pTZ1vb7rGhGQDC+F36ZlZnYNuM8/ O10/ywiNjYKyfLo51FuO7tUP9JPlqsYO6kOiR1p8W8cvxoqVdS7hAwD8yQ1u0xCdqPGW YqhZwzG4jVd7+WOgj1n1+AQVSY600hQHrHWsCQHIEfhmJGkQABdTGea74uX9w2uVA+98 WD2O95+kQ7HuBzF/9iTNerDCVoOQPRZIiKJaIQLhQcmwZ9E7xT874NKsBywieZe8s26o j9NNT9F3ToT07uKlt84qaF0U6S1IMkv70B1xjaYnvtKbOGgZZBYxeqGHA9x+XE/uGb51 +s5w== X-Forwarded-Encrypted: i=1; AHgh+RraDNqH/6OGVHIWGeVaTbJ1h0V1flzSAHs47lHM6ynUN583mcQ/N32pSHSVXY2EItv0+g9vlZS5v6T0hjY=@vger.kernel.org X-Gm-Message-State: AOJu0YxzwT7xphPMfZIOZc/4yCdoOg4lrXvNExo8qje54mHDCpGPuHL9 r05813Cyef4EAW4VdF5zJUJiFxFHhU7+j2WqJHAuOstgOerpVtt3TtMtmPZIRP5G0Z29dA+YKZI ezRJcrA== X-Received: from pfbig10.prod.google.com ([2002:a05:6a00:8b8a:b0:848:478d:6efb]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:8c5:b0:845:f107:38c8 with SMTP id d2e1a72fcca58-84e9332e63bmr4750014b3a.47.1785279970563; Tue, 28 Jul 2026 16:06:10 -0700 (PDT) Date: Tue, 28 Jul 2026 16:06:09 -0700 In-Reply-To: <20260728144954.355376-6-dwmw2@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260728144954.355376-1-dwmw2@infradead.org> <20260728144954.355376-6-dwmw2@infradead.org> Message-ID: Subject: Re: [PATCH v7 05/36] KVM: x86: Fold __get_kvmclock() into get_kvmclock() From: Sean Christopherson To: David Woodhouse Cc: Paolo Bonzini , Jonathan Corbet , Shuah Khan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Vitaly Kuznetsov , Juergen Gross , Boris Ostrovsky , Paul Durrant , Jonathan Cameron , Sascha Bischoff , Marc Zyngier , Joey Gouly , Jack Allister , Dongli Zhang , joe.jin@oracle.com, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Tue, Jul 28, 2026, David Woodhouse wrote: > From: David Woodhouse > > There is no need for the separate __get_kvmclock() helper; just inline > its body into get_kvmclock() within the seqcount retry loop. Actually, there ends up being quite a bit of value if we rework the inner helper to be all about the master clock mode. If we go that route, then the main loop is pretty self-explanatory, we can use early returns instead of continues and subtle fall-throughs, and the indentation levels go down. do { data->flags = 0; seq = read_seqcount_begin(&ka->pvclock_sc); if (!__get_kvmclock_master_clock(kvm, data)) data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset; } while (read_seqcount_retry(&ka->pvclock_sc, seq));