Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UDW+iUMV" Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B10C8BD for ; Fri, 8 Dec 2023 13:01:32 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5ddd64f83a4so24909047b3.0 for ; Fri, 08 Dec 2023 13:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702069292; x=1702674092; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:in-reply-to:date:from:to :cc:subject:date:message-id:reply-to; bh=cPvsp4vtrotIomPKqq2ImuA44XLC/C4iYoGwJqvn3h8=; b=UDW+iUMVMguW/5APKTGnpwqQEGXA9rMUhhODvl6ZNvdIXpV/NOv2sUDlaXMKbX6eGU 7dYqiKfqlQn63lMGHIw7/a/tg/qcCE7NDLsn2Y4RhXKb2FwrCJH9estbG7Akxe4qnR74 BVA8i0yuZ8pVdadPTx4oCdD2Lhe8TWhw/+72ysG/rcSIvJC9cdTqHhxh52DDfH6rIWCI +QTztE/xpFZPROxbwD2OvbEK08/ZalKqB1LPa4hMmcWNABrqKkY/bOxuLsgdIaQN8Xts ZQdmsIcD0CXFLuazhTa8P51TeSY9x9bjLYQ4IUp8n17Z2MXUFqGUcEGf9XFOkqCcI+NA PU8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702069292; x=1702674092; h=cc:to:from:subject:message-id:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cPvsp4vtrotIomPKqq2ImuA44XLC/C4iYoGwJqvn3h8=; b=Iccq76kre8HJreo5zilWqcqwIZPiwX2d7V0onZ6WqHcr4i+kuoEAvYpLORO1rZi2hD EgXaq0I1p2mV6JLXkxuSE2MqYIM+KQww4OdQPLC0R56yzIV7Ffg8xSXfbCxzSSnL1FLL hnN8Le/RXsu3Rw26wRuJAvRI9HBg1BPVCsSZ1oxZWAzX6Ot4V8CuljmdCGAAZ221a95H p+fVIzjJmNJrCHU2jEgVnDh7LdhhU2sXNFkLM2uHOPQXeeH5uq0bycEc+cqwDTmwk8bj tKxz6ATdf817PBfJYkpqaCAvV3qeoRbjcbDquSlF9pDJjwNLJa75uK7eHDkSusqlAu1C 235Q== X-Gm-Message-State: AOJu0YyQWPTi1Av+PLrUAFYTPSFNU2yIrjsP4FPVRqBmAkUUSnPnDFj7 bhhjEAhIv4XqWjDzBsTdrqhcOXL4YVkT6aGTXw== X-Google-Smtp-Source: AGHT+IE2+v2iURbPda/UkDDifecJeozbvSa31F1K3eqBpsYJtjPo/blaA3H9UAXge83pUxWRcqNIFPEBrorUs01B8g== X-Received: from coltonlewis-kvm.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:14ce]) (user=coltonlewis job=sendgmr) by 2002:a25:b94e:0:b0:db4:4df:8c0d with SMTP id s14-20020a25b94e000000b00db404df8c0dmr4660ybm.11.1702069291893; Fri, 08 Dec 2023 13:01:31 -0800 (PST) Date: Fri, 08 Dec 2023 21:01:30 +0000 In-Reply-To: (message from Oliver Upton on Wed, 22 Nov 2023 17:43:55 +0000) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Message-ID: Subject: Re: [PATCH v3 1/3] KVM: arm64: selftests: Standardize GIC base addresses From: Colton Lewis To: Oliver Upton Cc: kvm@vger.kernel.org, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, ricarkol@google.com, kvmarm@lists.linux.dev Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes Oliver Upton writes: > On Fri, Nov 03, 2023 at 07:29:13PM +0000, Colton Lewis wrote: >> Use default values during GIC initialization and setup to avoid >> multiple tests needing to decide and declare base addresses for GICD >> and GICR. Remove the repeated definitions of these addresses across >> tests. >> Signed-off-by: Colton Lewis > >> -void gic_init(enum gic_type type, unsigned int nr_cpus, >> +void _gic_init(enum gic_type type, unsigned int nr_cpus, >> void *dist_base, void *redist_base) >> { >> uint32_t cpu = guest_get_vcpuid(); >> @@ -63,6 +63,11 @@ void gic_init(enum gic_type type, unsigned int >> nr_cpus, >> gic_cpu_init(cpu, redist_base); >> } >> +void gic_init(enum gic_type type, unsigned int nr_cpus) >> +{ >> + _gic_init(type, nr_cpus, (void *)GICD_BASE_GPA, (void *)GICR_BASE_GPA); >> +} >> + > >> -int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t >> nr_irqs, >> +int _vgic_v3_setup(struct kvm_vm *vm, uint32_t nr_vcpus, uint32_t >> nr_irqs, >> uint64_t gicd_base_gpa, uint64_t gicr_base_gpa) >> { >> int gic_fd; >> @@ -79,6 +79,11 @@ int vgic_v3_setup(struct kvm_vm *vm, unsigned int >> nr_vcpus, uint32_t nr_irqs, >> return gic_fd; >> } >> +int vgic_v3_setup(struct kvm_vm *vm, uint32_t nr_vcpus, uint32_t >> nr_irqs) >> +{ >> + return _vgic_v3_setup(vm, nr_vcpus, nr_irqs, GICD_BASE_GPA, >> GICR_BASE_GPA); >> +} >> + > What's the point of having the internal implementations of these > functions that still take addresses? If we're standardizing GIC > placement then there's no need for allowing the caller to provide > different addresses. I wasn't sure if there might be a reason for that allowance I was unaware of since that's what the original interface was so I erred on the side of flexibility. I'll delete it.