From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 2596B2773D3 for ; Thu, 4 Jun 2026 16:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780590418; cv=none; b=SPq6yaaFRYoUknJwfY3ZFSOOut9wLqiL8Q2GZi75Nb5BzkDOZwEj/01AR89SLVsDX92A9L+/laGstzorQZYEGJXWXELR8AfcgrRt50SaT8gyWKiKY3ZpgY6S/xaqIXdJiuKbPmbccsqNDqa6wYvGUnl2K/o77EooBNJHzD8zDRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780590418; c=relaxed/simple; bh=rL8z0sb0aozORlljoVXFqnxfct+9nFDK0ox1JpGznx4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=acLm65PppxT1vVhUxuKxS2lY5koVXTHR4kkz703bgu3xg6SBYEEBTd5qX/xjZkmpuTnVhaYLbH7ZHynS0VzAB7GgT+w5M0CQbb+JZYJK27ZUSiz8ZXtfyxbEf/hD602L2gKYGbeB26oniUflh0XuP0V+sp8Q5UcFO3dyZyBEPsU= 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=wBPLKC+b; arc=none smtp.client-ip=209.85.215.202 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="wBPLKC+b" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c85a298cd62so688762a12.0 for ; Thu, 04 Jun 2026 09:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780590416; x=1781195216; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=b1PAoVWOX5uTiJ2KXbRfOf7Z3sR4S4Ul08plY8Umtbg=; b=wBPLKC+boO33v86ArZBxo7qRsI1IYH8sjCIc5WJWjijZFBbGz7+aHykthQfvCgvaDC WEalyq1LGSwpmXGv+bH3GutgGUsF3VtiBbH2DpjL8JUyOhPA3XqDrRYmIK/NxGX5r0Um duMTEU7lkLztsrislRaihGQCVPU7do3bEEYNfy6ybIMrvB4G5de6loL3Hz/armetLXvf qcpOn9mHx4EGkb0Xy1e1/NCmVF1Sa1bVYKRuJWUJEgccsgEcWT5uv6RImYsmw5cWp7Dm bHCK9a58ab5Jzcc+lmhxXa+l/eqCn6Y+pfq2xdB/I+OpcfsNxBMS881xM/5K6HbnWePL 5ROA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780590416; x=1781195216; h=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; bh=b1PAoVWOX5uTiJ2KXbRfOf7Z3sR4S4Ul08plY8Umtbg=; b=I9G9KcCKmp6B6EVsZPK1F1db2+DCcv2Y8dRBYN07/vsSYmVnICFflwsMVYTyed68ID f9XlEWczgNT0OZLb/DDn6nIXMiFA3fMfb+9sBRg47FexIHjp3mgYzLI/dzN4phNRhX7Z 2fD2iKlErZtR918HOV3S5GbnAtoIgPbDokypPh3fYlW6+7csVZ0U9/OKoZcnsBqCkmZQ O7lDr66cVMs7py9tMgdwA8or5D0Y5R8AWEb5CssbGODVpfNgn96RVwClasXgPZ0p/klB BgUykMitfGhXol/bSg80CODva17mTL9DC0bp4St3BCjmL6Ed7XCPLECrUTfQCBt+eHbi 7ZGQ== X-Forwarded-Encrypted: i=1; AFNElJ9kQVHiqMy7vCkV8YDlevG+bSIi0ovZug3fXxXBobWiA7cGaECm1R54Tb7NMzZca9qBgMSATi2hQYxOpyQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8EyFrBqSQpNIXpKcoDpvq0Nvk/gOYbH62XCJLGvkxZw/cl6s4 J88ftY0VofsckKBQQX1zEDIAueI+qmYc5wZVuBvIygtmT6wbCxeVAOzCHk5o3ydmnL6Knq/kPNG UP7NpVg== X-Received: from pgbbq18.prod.google.com ([2002:a05:6a02:452:b0:c82:295e:3b51]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:6b18:b0:3b4:6dee:a427 with SMTP id adf61e73a8af0-3b4976ba37fmr10251206637.44.1780590416182; Thu, 04 Jun 2026 09:26:56 -0700 (PDT) Date: Thu, 4 Jun 2026 09:26:55 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260604020143.748245-1-jrhilke@google.com> <20260604020143.748245-6-jrhilke@google.com> Message-ID: Subject: Re: [PATCH v5 05/21] KVM: selftests: Add IRQ injection test From: Sean Christopherson To: Josh Hilke Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Alex Williamson Content-Type: text/plain; charset="us-ascii" On Thu, Jun 04, 2026, Sean Christopherson wrote: > On Thu, Jun 04, 2026, Josh Hilke wrote: > > + eventfd_write(eventfd, 1); > > + > > + clock_gettime(CLOCK_MONOTONIC, &start); > > + for (;;) { > > + if (GUEST_RECEIVED_IRQ(vcpu)) > > + break; > > This is a kludgy and confusing way of writing: > > clock_gettime(CLOCK_MONOTONIC, &start); > while (GUEST_RECEIVED_INTERRUPT(vcpu, do_use_nmi) && Heh, "minor" detail: clock_gettime(CLOCK_MONOTONIC, &start); while (!GUEST_RECEIVED_INTERRUPT(vcpu, do_use_nmi) && timespec_to_ns(timespec_elapsed(start)) <= timeout_ns) cpu_relax();