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 7345E1A76BC for ; Fri, 1 Nov 2024 14:48:02 +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=1730472484; cv=none; b=t1DErzjcC2k+QVCKvdx+5Tn2DTQHEyIKjddb5qArl/zefzrPVGb/0pVDnVq8wEvQ9E42h439VBOx4ruqIrgL0LIGPED3XWU8nd2Efx49RLNx056kn5LnT5xuhq9wkMmBiw3uGPomSA/IeUBzzg+A7F9KjwkCLStDdBSXkUCMOH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730472484; c=relaxed/simple; bh=/Lo0SSKZxUY4iHjD0LeZv0mV6fASOYVUcG7mLz+tc54=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Z6N1WcCyJT/+ncXGB39ltPj6Rztas/tK91ymaW+oMWLh8Z7D9TKc6dumDfGVvnTs1qJga6zPjl/X7VWZleHT0Jy8/TtIE1QVoSP4pVbPG77ZfziQSaGROl/+og+EKBb8rm6zfFPzwHEcWajQqUIiKRzFvcL/aMB/er0PRIhscjM= 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=cIX6fuKv; 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="cIX6fuKv" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-7edbbc3a9f2so1712039a12.1 for ; Fri, 01 Nov 2024 07:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730472482; x=1731077282; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=G/DE0DbUg8M7Q/DJxS90r+0tog95n4HSr4HfODo/BC0=; b=cIX6fuKv+3yuHboiGIHTTkhC7T3EUaXfQVDxPB+oAiRohNO+puS96HIJ14w+gM4QVJ Qe85l8fGO/H8SSUP0i3EDU6ZHX0GxK42FQ9R4hj23EmYigpyCJrE5Z2c6zeywsSK2YaL mq4nzc9fXVEKHJrcdElI07AhpD/KXsZ0QF1KqcCnunuLUmdfSrBnx1ovgf93KqRbA3IO K6rM9onYyCiXDl2XYaaJygmes06VX3wUS7o7IkOl8sZlISR/PE4XUU4ryLht+AVW5LCU z4K00RjybpXCz1hqUwoVDh/cfGGNGR+V+p+X3DwgSDvnhGwlCOy8CKIokuLSMOnixqEM 5xlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730472482; x=1731077282; h=content-transfer-encoding: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=G/DE0DbUg8M7Q/DJxS90r+0tog95n4HSr4HfODo/BC0=; b=xCjsz8xaqp9lzMNV0teI5kqmGCR3sn4dS7u0GFixAcfM/GI/oJV6Q4pvK4aAlIKu4x x7b3AtG+ps0hERdT+5Dlvxe1wV49RFX+hzmlrHoGg+TDB42ALRR1AAvXCu6ZgWFg6xz3 ZFle0w8ImifJP+3p2+4rBQkhTzikmRJkklHMtQ3uc5/Fioe8doMQWD4grwdiN3BW/Zgn nZH/sPVesIAfSVWXPjZrwuolxevBOflNeah9HUeq+xhIGgJ2a/Mn4759PZmC0U6ZCpiu FE5B8zBlehFZo0F8bIFf20x19VNTDDxMnYMp2QMR7q8pKx8OF2XHWHbzogru2DEKe/xx J61w== X-Forwarded-Encrypted: i=1; AJvYcCVZq4Pe5KPkv6yTemLj5PdS0aJLWy6vo/97IHRHdYHJlaqENBOcV9iSfxJk0iDOHpHEW+bPUjBjoGCG5DM=@vger.kernel.org X-Gm-Message-State: AOJu0YxIyip7MA+tX/bikmgkdYYaXw+oluVcIq4y3H7BZL8+Hp0iys/E FxgU4NZ99kOryYkRMkubDLd+UkeqcAolCLNqWjgwyKrD1SjerRNaoSh/oukU5zzIEK2sZxUg0fA Y+w== X-Google-Smtp-Source: AGHT+IHIf47dwb0nbkXT8QGaJrWq+fHjP6RSYp5sBCxZxmiVg/IHgboRnjvSBKMyLIM+q34Z1vnYxW9f4KA= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a63:fa55:0:b0:7ea:83fc:1f0c with SMTP id 41be03b00d2f7-7edd7c3149dmr31512a12.5.1730472481723; Fri, 01 Nov 2024 07:48:01 -0700 (PDT) Date: Fri, 1 Nov 2024 07:48:00 -0700 In-Reply-To: <39ea24d8-9dae-447a-ae37-e65878c3806f@sirena.org.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241009154953.1073471-1-seanjc@google.com> <20241009154953.1073471-4-seanjc@google.com> <39ea24d8-9dae-447a-ae37-e65878c3806f@sirena.org.uk> Message-ID: Subject: Re: [PATCH v3 03/14] KVM: selftests: Return a value from vcpu_get_reg() instead of using an out-param From: Sean Christopherson To: Mark Brown Cc: Marc Zyngier , Oliver Upton , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Jones , James Houghton , David Woodhouse , linux-next@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 01, 2024, Mark Brown wrote: > On Wed, Oct 09, 2024 at 08:49:42AM -0700, Sean Christopherson wrote: > > Return a uint64_t from vcpu_get_reg() instead of having the caller prov= ide > > a pointer to storage, as none of the vcpu_get_reg() usage in KVM selfte= sts > > accesses a register larger than 64 bits, and vcpu_set_reg() only accept= s a > > 64-bit value. If a use case comes along that needs to get a register t= hat > > is larger than 64 bits, then a utility can be added to assert success a= nd > > take a void pointer, but until then, forcing an out param yields ugly c= ode > > and prevents feeding the output of vcpu_get_reg() into vcpu_set_reg(). >=20 > This commit, which is in today's -next as 5c6c7b71a45c9c, breaks the > build on arm64: >=20 > aarch64/psci_test.c: In function =E2=80=98host_test_system_off2=E2=80=99: > aarch64/psci_test.c:247:9: error: too many arguments to function =E2=80= =98vcpu_get_reg=E2=80=99 > 247 | vcpu_get_reg(target, KVM_REG_ARM_PSCI_VERSION, &psci_vers= ion); > | ^~~~~~~~~~~~ > In file included from aarch64/psci_test.c:18: > include/kvm_util.h:705:24: note: declared here > 705 | static inline uint64_t vcpu_get_reg(struct kvm_vcpu *vcpu, uint64= _t id) > | ^~~~~~~~~~~~ > At top level: > cc1: note: unrecognized command-line option =E2=80=98-Wno-gnu-variable-si= zed-type-not-at > -end=E2=80=99 may have been intended to silence earlier diagnostics >=20 > since the updates done to that file did not take account of 72be5aa6be4 > ("KVM: selftests: Add test for PSCI SYSTEM_OFF2") which has been merged > in the kvm-arm64 tree. Bugger. In hindsight, it's obvious that of course arch selftests would add= usage of vcpu_get_reg(). Unless someone has a better idea, I'll drop the series from kvm-x86, post a= new version that applies on linux-next, and then re-apply the series just befor= e the v6.13 merge window (rinse and repeat as needed if more vcpu_get_reg() users= come along). That would be a good oppurtunity to do the $(ARCH) directory switch[*] too,= e.g. have a "selftests_late" or whatever topic branch. Sorry for the pain Mark, you've been playing janitor for us too much lately= . [*] https://lore.kernel.org/all/20240826190116.145945-1-seanjc@google.com