From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.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 25A8819309C for ; Tue, 23 Dec 2025 23:14:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766531672; cv=none; b=eVICB6tROBCsjVy6fXQsapyOAXww/gRXvRtKVuiNSOFJd6dGp5CXpjd4I1wTdEhmQwGqKygqxaIqMvO6IRGT3WzFkGxke69BLsbJnUVsi7ZF3MKeDTJZoCOP/96Yxa7/5EMpsZGcJNl0r8DXwQFf/+Q+OUtzdIXA/xvn/ZNSKg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766531672; c=relaxed/simple; bh=UrsIwKhUPBhmvmWc3UQpPHhueBpLXUS35lBbM53gH4M=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=bq+goX1qILSES7iJ0iwmFsJrNcZlXOSzE2anwlD8+uyd4F441GM7+xNAxjjet0U1DqoK/OqOVSyNMHAxf13HsurEZK3njbLjUug0h/xbkBkQqOOim1fo1AAPNKTxcEQuK/pr/eKwYZ1vZaBHGPB3CbJcdRuNucxl6vEUFXZj7Xo= 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=QaIM1bfD; arc=none smtp.client-ip=209.85.210.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="QaIM1bfD" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-7c240728e2aso11580873b3a.3 for ; Tue, 23 Dec 2025 15:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1766531670; x=1767136470; 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=0XtFRCy5e+ZCbCj52LzETs4Ka0dGCXxZoU50vkAKruY=; b=QaIM1bfDkTAAso7rcCuPvburrleEGhNJuVaMUpZz1C+siJamLZxJfmXbzQ6BQ7IQVc fewN27od9fUMEcP5suZulZ2XUgO4DhT7T3nK/717wGT6IAFBWDrdPCw/2AbaZ0AdQUU3 dO1XKlSNvwHcA7nWxFDwY5yHUqMObPKyCFg/JYsX54v11ExJiiN93stuiBpxtVEOUq4e ZN2wwGfmL8yPrCmB9eOlYqNnkNRu0+0JrirA6azvSaEgj2TxvmVEGW4WZIvdPaXuNo46 tQyJAWO6R/StRNp1yPuM3xzvGsjjXB51ffrWRyqr+lRHwgMumQ6t4uKqgJXQV9jTtl8h 39uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766531670; x=1767136470; 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=0XtFRCy5e+ZCbCj52LzETs4Ka0dGCXxZoU50vkAKruY=; b=tSz0l6kMC71U9wywLBdSSQnOZiaMJq4E/Ge3v1ayQHPjRvQgCie846Q2mTMzvMgZXR ObcqxPhOdLNtTNJ4DL+/Zs1iJdmLwoegw5n9JN5FYRpvdwiq80OzlS2ObyQq9DUP1i63 XH8BIAv40UDPu4LtIWn5//bZgip4yKPj/qvEkl5b6N7AM5NkIGn5yp9QjFpmhiYuH1jG fcm4aNiXrhj3w+/8iSpKfEz7TuZEURoolD2Fbt1fpzz25Ch7GQbXUBl8sFWZYqPKqb6X GNTWeh9BfDCPaavef3vVoUyJNQHGu43l4xMgf4QkuKVMCMwNY7MknRyaVpZlRIuttpZN rdxg== X-Forwarded-Encrypted: i=1; AJvYcCVR9NHruB0yC2S2BlUkUQICZBEfXStnShX0LRFmewgdRnPM0H3ff03zE2vyl3SSdoK9NjuAxSvadHOwQtg=@vger.kernel.org X-Gm-Message-State: AOJu0YxE+5IiaxMW2oH9N4UzSnSKaT1CY9qoAx6dPhPsSFqvvMaNGugm briuerHycc8bgB0KzenBtI7Z0tp5QV8eaieKxLKQmVs+SB8t8EqeNsX8i4U9x0+EGkzMemN5AnA vwvYz2Q== X-Google-Smtp-Source: AGHT+IE72KL7Fs4kH8TAJsRritpRi4P6A23yuo5MirvNZPXXN7oVXycrHTxEf12GMrJMdS3t0+q52Idg3nE= X-Received: from pfbgo25.prod.google.com ([2002:a05:6a00:3b19:b0:7fc:5185:dd1c]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4307:b0:7e8:4398:b35c with SMTP id d2e1a72fcca58-7ff66672928mr13349683b3a.47.1766531670383; Tue, 23 Dec 2025 15:14:30 -0800 (PST) Date: Tue, 23 Dec 2025 15:14:28 -0800 In-Reply-To: <20251127013440.3324671-11-yosry.ahmed@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251127013440.3324671-1-yosry.ahmed@linux.dev> <20251127013440.3324671-11-yosry.ahmed@linux.dev> Message-ID: Subject: Re: [PATCH v3 10/16] KVM: selftests: Reuse virt mapping functions for nested EPTs From: Sean Christopherson To: Yosry Ahmed Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, Nov 27, 2025, Yosry Ahmed wrote: > + /* > + * EPTs do not have 'present' or 'user' bits, instead bit 0 is the > + * 'readable' bit. In some cases, EPTs can be execute-only and an entry > + * is present but not readable. However, for the purposes of testing we > + * assume 'present' == 'user' == 'readable' for simplicity. > + */ > + pte_masks = (struct pte_masks){ > + .present = BIT_ULL(0), > + .user = BIT_ULL(0), > + .writable = BIT_ULL(1), > + .x = BIT_ULL(2), > + .accessed = BIT_ULL(5), > + .dirty = BIT_ULL(6), Almost forgot, the Accessed and Dirty bits are wrong. They are bits 8 and 9 respectively, not 5 and 6. Amusingly (well, it's amusing *now*, it wasn't so amusing at the time), I found that out when I couldn't get KVM to create a writable SPTE on a read fault in the nested dirty log test :-)