From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 86A6D2236EC for ; Thu, 19 Dec 2024 11:21:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734607308; cv=none; b=MTt20n5ojBS7B4k7bSQFYgwKhZJKyKNGHO7352aeCpHz/vwFfSbNewHEbTCKRMfDMl/mCEklqJV0WGgndZLyyahd/AXBEmv/zOZNzLMgSNDerTBZ3Hi2iA+PHBeQk8Lh3ubCmMMaU1Z4XsaogM2ih09QvOhpBlpjbEppoMANOR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734607308; c=relaxed/simple; bh=l82VQ6MNWoJAziJkHRiYqGJu8wD4XsbM7Tq5GCvOgOs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PS0YhzKpoD4lCi60zO3Lo+0JlosehjxFKnDOAf7+URYNMkkiVoaX5GvCDpQQuKDoV0++R1jjaM4Unf18GSjufP9flmnJxG8gCS2NR/AGs+wO0GEXCUfsFFr/sQvFSYNAAVRwSgVBm4KEFiFbSz6wvAjfmERkRMMypk9+JKmpsKs= 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=MOIFALDo; arc=none smtp.client-ip=209.85.128.42 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="MOIFALDo" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43621d2dd4cso50165e9.0 for ; Thu, 19 Dec 2024 03:21:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734607305; x=1735212105; 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=WGkN0eIRMsbxDqZZzBkMr+wzaFkYCBiUXPyTbRF2MxQ=; b=MOIFALDo4BXLIJX24rYt1Pa6a2rEbBkGu4lAIO9ERq+vZzLe3/oQJ4V2SP1vAlZ3BF M6BmHfeYZ2sCI/XqAqzQ7nmvgiGFZc+c0EF0+Lb7RMdPOa4+w1l5C8VtBIFlhdjKPN55 wqhr1ekns+nafb7fd5r0czmfTf5hkZwIIHwvh78mFNWU+u6hTRZ9qboIgEGVdepaPQci eCgXhVMfRK37IhHTdrV6PBJ5EPugAV2hzCrSOvlyksI3IMxBiYsjtu0QShXP4+4YyPFP ToYs80xJBVKw1vlpHUEP+JGvMrRAljdZkka4PjN1N4opjA4dbaPdAwFCRJIA31EvW+4U mWmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734607305; x=1735212105; 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=WGkN0eIRMsbxDqZZzBkMr+wzaFkYCBiUXPyTbRF2MxQ=; b=jCEM/0OrzJzG4sySjC8wl91lBvYPU3f486oEoB150efVoF4L6H2etWwTCXSPhHnDES Bvx1oUq+arBY8QAXnqrwmQ/c/SmUDc/lkD8VQja3JowlVPypz/6vA+DBYuUOcfaTR0Vj reBepHVpVQdO9i7wre+yyqLmxD88B/UXtkXELZgXggCMjt+S2FWOFTwGVShpiLDzCvBY VCHRj9fv5wFcRc23YWH3K0PUhdigeDRlYM1S9lt5W6t6XDbFJzoQ+7O1+w/1u/qRvFC2 Xg7GxyDc6l3ElE7WVaTXXIRgV55+Kr3tZHa9VVTujAukEvmMfYL1avUbJkhzW25XHqyL NK/w== X-Forwarded-Encrypted: i=1; AJvYcCVFJQDHd43zDunt3WtQi//zMdrmLV/fmetSWG+FrYuVWTRoFEdHqF0LufER0AVez8Afez4lg3HAJL7mrLU=@vger.kernel.org X-Gm-Message-State: AOJu0YwIIe9M/H3qhGdazXTp+jkPLV0g/abO7s/fhN+xdDrmqPrW9zWD IuX3n2xnHVWtV4WLEviaO9rZ6dAXD7K2OKwGcfPeARHkCNIKMIiXVcBucrzRQA== X-Gm-Gg: ASbGncsE3Q1mHan4e01btP8zT+W6XPlaqKgbT3ZJCbONAFnjWVM3N/yI6gpvBK/40S/ dQ3EI3toxs/lTtNTpipZI/+MjxKbyM2iXK8SsTsg7p+KyqTrgFCLouG1YN1ZPlRC38FPrvlSALp SwlSJnLLAw7eCiEzYwZ+HqEEJFEp8W0haRcNmNw3XYNbPCJnFUx1JwXmkDB9cOKzFZIB6nRDRmk vaA8stVfAQxf2oJUboZQF775QcdCz1yV/cv/AOVwAeiM6EHrTi2QRbnUhOO3mvnQhEolZV13nmE En12nOjLQPbFb4uHPas= X-Google-Smtp-Source: AGHT+IH3i8v/BrwemmECFyya82qa5WpmpoQwTNEogOS40Upy0/Fstoyzd3BnWRDUcSAESI7APhWcyQ== X-Received: by 2002:a05:600c:4a01:b0:436:4e4c:7bae with SMTP id 5b1f17b1804b1-4365fca3ba4mr846885e9.1.1734607304693; Thu, 19 Dec 2024 03:21:44 -0800 (PST) Received: from google.com (216.131.76.34.bc.googleusercontent.com. [34.76.131.216]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8bb4bcsm1308850f8f.111.2024.12.19.03.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 03:21:44 -0800 (PST) Date: Thu, 19 Dec 2024 11:21:40 +0000 From: Mostafa Saleh To: Quentin Perret Cc: iommu@lists.linux.dev, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, robdclark@gmail.com, joro@8bytes.org, robin.murphy@arm.com, jean-philippe@linaro.org, jgg@ziepe.ca, nicolinc@nvidia.com, vdonnefort@google.com, tabba@google.com, danielmentz@google.com, tzukui@google.com Subject: Re: [RFC PATCH v2 11/58] KVM: arm64: pkvm: Add pkvm_udelay() Message-ID: References: <20241212180423.1578358-1-smostafa@google.com> <20241212180423.1578358-12-smostafa@google.com> Precedence: bulk X-Mailing-List: linux-kernel@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 Thu, Dec 19, 2024 at 11:14:23AM +0000, Quentin Perret wrote: > On Thursday 12 Dec 2024 at 18:03:35 (+0000), Mostafa Saleh wrote: > > From: Jean-Philippe Brucker > > > > Add a simple delay loop for drivers. > > > > This could use more work. It should be possible to insert a wfe and save > > power, but I haven't studied whether it is safe to do so with the host > > in control of the event stream. The SMMU driver will use wfe anyway for > > frequent waits (provided the implementation can send command queue > > events). > > Mooh, I'm thoroughly hating that we need this -- pKVM is non preemptible > so we better not wait for too long. > > I can surely figure it out from the following patches, but could you > please expand on the use-case? The driver needs to poll some SMMU MMIO, so it needs to measure time in terms of udelay to timeout, at the moment its arbitrary set to 100ms. Thanks, Mostafa > > On a side note I'm not too worried about the power impact of not having > a wfe in there, again we better not be spinning for long enough that > power starts to be noticeable.