From nobody Fri Nov 18 18:26:43 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NDQGr0xRcz4d87s; Fri, 18 Nov 2022 18:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NDQGq75N0z4JDW; Fri, 18 Nov 2022 18:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668796004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dZu63A82NGFZA3P4RBF0ZifS0v86ogmfc1ta/IFTrPQ=; b=uc7ZIfTH4gXQUocUX/j2n3KBzuFvwarSgwGY+bOV6sy5WXMsy5L27jt+2kgpe1w7In7uaS 6UQZANm5cGsIxm7+aJ/MuJLRPfmXiNaJHcgCmRBBLWOrkirAkhlLcLSRiqGfCRlRpzxUhL MiDnt7vLr6WoXU4dOMMYzessSS+LmJTf28917qmQs/yM6FwdvkNSnNh8bmE9kfcgq9B42p hgQO2OnQLluPNqTKoLyzru7FQgtRz8lUFyPZbRp4JdIM6wrXeWjJAlc04mD7aOgyBDUtZv aFKupP3HoRZccBsOnGMwoTawtH2MeBDqIGQ6KUfUXLpw5EdTa5J09613x/FFNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668796004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dZu63A82NGFZA3P4RBF0ZifS0v86ogmfc1ta/IFTrPQ=; b=Iy3UsCfpfhqtKQR+7hSP08mzwSHsN+1dbU7NjQioWDSi8Dx+SGp66k/J1siBhQEFtZvIUq nucmN6MbM8JmWHdFZdk4KLUMRNmiWwQEeE1hJs6zFF/XsUkr9JkVfyZtiyRsAg8A1rn/f+ k5IaveXKITdJJFeMW3i8nQcsX4EtwJUOOm376W0izeNfxR0whFWwiSkWn29Rz8a4nyGSld V46zTOAMtKJCDZdl1O4Qou4MKQS2/CZ+E1vZ4C7/jBFABY7AMqwNTC8EKrfI6MyAT6EAG8 QpMIP1iuXyVVEW/HnANyUZ1Xy8unxdwRaMXy5CgIlNR2MKID6OhuP14I0040LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668796004; a=rsa-sha256; cv=none; b=uI+CIqmZp0e2LBOBxJqyM563oUaafr0ZPIrES6j/fzuXH5MtJCuoXipBy+65/rO6Ev0sWn MkhhUWajVm5HA+ynk0u6KP8NTfwFQtTCL8NM3/j3O9AhWY1oFYtNIYlTrsNwPtCWbl9yqB t8+G37399csGCwcZmaoGWy32xOQiyBBnxgDwHXlvl5zfDvFM0XkLlEN9mz2ePehFkCL68u 5sFwuwrUdAsznhLlocewx1wOVpF6k0rYDeXi3JYaNH3QqdT+LGaJWQ4dxH8dRBmpm21o9y ftlnrOIierSk3nWzegqsf1htFDTMrYYXvHBi04Yno31Jp7RCyfreTrYUAUcOZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NDQGq5mngzFYS; Fri, 18 Nov 2022 18:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AIIQhw8030431; Fri, 18 Nov 2022 18:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AIIQhIN030430; Fri, 18 Nov 2022 18:26:43 GMT (envelope-from git) Date: Fri, 18 Nov 2022 18:26:43 GMT Message-Id: <202211181826.2AIIQhIN030430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 949f0f47a4e7 - main - vmm: Remove support for vm_rendezvous with a cpuid of -1. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 949f0f47a4e774fea7222923440851c612a3f6fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=949f0f47a4e774fea7222923440851c612a3f6fa commit 949f0f47a4e774fea7222923440851c612a3f6fa Author: John Baldwin AuthorDate: 2022-11-18 18:03:23 +0000 Commit: John Baldwin CommitDate: 2022-11-18 18:25:37 +0000 vmm: Remove support for vm_rendezvous with a cpuid of -1. This is not currently used. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37164 --- sys/amd64/vmm/vmm.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 5329d207c77b..cb1a5b62e4f4 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -1319,21 +1319,13 @@ vcpu_require_state_locked(struct vm *vm, int vcpuid, enum vcpu_state newstate) panic("Error %d setting state to %d", error, newstate); } -#define RENDEZVOUS_CTR0(vm, vcpuid, fmt) \ - do { \ - if (vcpuid >= 0) \ - VCPU_CTR0(vm, vcpuid, fmt); \ - else \ - VM_CTR0(vm, fmt); \ - } while (0) - static int vm_handle_rendezvous(struct vm *vm, int vcpuid) { struct thread *td; int error; - KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < vm->maxcpus), + KASSERT(vcpuid >= 0 && vcpuid < vm->maxcpus, ("vm_handle_rendezvous: invalid vcpuid %d", vcpuid)); error = 0; @@ -1343,8 +1335,7 @@ vm_handle_rendezvous(struct vm *vm, int vcpuid) /* 'rendezvous_req_cpus' must be a subset of 'active_cpus' */ CPU_AND(&vm->rendezvous_req_cpus, &vm->rendezvous_req_cpus, &vm->active_cpus); - if (vcpuid != -1 && - CPU_ISSET(vcpuid, &vm->rendezvous_req_cpus) && + if (CPU_ISSET(vcpuid, &vm->rendezvous_req_cpus) && !CPU_ISSET(vcpuid, &vm->rendezvous_done_cpus)) { VCPU_CTR0(vm, vcpuid, "Calling rendezvous func"); (*vm->rendezvous_func)(vm, vcpuid, vm->rendezvous_arg); @@ -1357,7 +1348,7 @@ vm_handle_rendezvous(struct vm *vm, int vcpuid) wakeup(&vm->rendezvous_func); break; } - RENDEZVOUS_CTR0(vm, vcpuid, "Wait for rendezvous completion"); + VCPU_CTR0(vm, vcpuid, "Wait for rendezvous completion"); mtx_sleep(&vm->rendezvous_func, &vm->rendezvous_mtx, 0, "vmrndv", hz); if (td_ast_pending(td, TDA_SUSPEND)) { @@ -2582,7 +2573,7 @@ vm_smp_rendezvous(struct vm *vm, int vcpuid, cpuset_t dest, * Enforce that this function is called without any locks */ WITNESS_WARN(WARN_PANIC, NULL, "vm_smp_rendezvous"); - KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < vm->maxcpus), + KASSERT(vcpuid >= 0 && vcpuid < vm->maxcpus, ("vm_smp_rendezvous: invalid vcpuid %d", vcpuid)); restart: @@ -2593,7 +2584,7 @@ restart: * call the rendezvous handler in case this 'vcpuid' is one * of the targets of the rendezvous. */ - RENDEZVOUS_CTR0(vm, vcpuid, "Rendezvous already in progress"); + VCPU_CTR0(vm, vcpuid, "Rendezvous already in progress"); mtx_unlock(&vm->rendezvous_mtx); error = vm_handle_rendezvous(vm, vcpuid); if (error != 0) @@ -2603,7 +2594,7 @@ restart: KASSERT(vm->rendezvous_func == NULL, ("vm_smp_rendezvous: previous " "rendezvous is still in progress")); - RENDEZVOUS_CTR0(vm, vcpuid, "Initiating rendezvous"); + VCPU_CTR0(vm, vcpuid, "Initiating rendezvous"); vm->rendezvous_req_cpus = dest; CPU_ZERO(&vm->rendezvous_done_cpus); vm->rendezvous_arg = arg;