From nobody Thu Jan 26 22:11:57 2023 X-Original-To: dev-commits-src-branches@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 4P2w0s5Kvjz3c8MR; Thu, 26 Jan 2023 22:11:57 +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 4P2w0s47Drz3w4h; Thu, 26 Jan 2023 22:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674771117; 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=WcF5Tnoa4E6E0ju8aVQlRn+mdzy08RBjiPmck3VOrcE=; b=S3knleoPEyQ6SSI1fpMYiPx+JosDRKdGEOVXaXZMVpWJ63s1aQiLRy7aOaSBcvAM4P8uJC nCsuxNfFYpUmLBSwePX3yuDjcW3hRt3P61rCEZPVwew4G6UJ3u+ouVKPzGLFlJNNs1Niq3 EMRqBpj5sm93z+pilaNTF14WBJLSom/UVRIxfJsJrQ6zwsbeI6tMmqtNnxoYikL3Fph8EG FfPr4/ioe9yCa7I0rw3XYn+4FZ+X+4LRsUpQXbDfPfLVJQM+NChI6JxoUCIur0ZHT/MtiO 5gqh9AO7bPy/FWxpvH5GnIswco7+t5TBF2qib5tKGRhN6223t0Dyu3BSknUrrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674771117; 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=WcF5Tnoa4E6E0ju8aVQlRn+mdzy08RBjiPmck3VOrcE=; b=g2Q0OCJ8ekxBhqhwaiklEZqfK51961g1bv7ckZrTbmjfPMOgZDI528DAiBK/wr62y4ZR2v ZHcIS6cvQa24VOWuWQjbtN4bgs3yb+hMYEvJHs2Mj4kDETE8JSH2FD2Kg6j6AnkB5fRnLs fUbr7cVxJtBz6hmD4fDtJuXss6WalPTf3pfwQ0AYAA7khos+zZjPViUiIjBs7ZLdDHDd9I wUuEL7WdPmL37plhdpIEM4HZhajkx7a56ag4/LkEqFX5LL52HquXgH0SO2u64KMRa96Kv5 uBsIy642/5SLkGdsXA5HZCifJoDpQ3GPqUzsmpDh3Dfqz2WMInxPfvEMANBosg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674771117; a=rsa-sha256; cv=none; b=A4+KgZpP+V+txgL3e6GzpJQh2afckwU8I7TCAQNqzUOXkpsPRctdjRVhbmGlvGCE3KBZ9W i2pV/g7w9F221Bu1LRZxzzHILgTG1M6D66oWylusfrw4iNexjf3NOM2TEJIpRUQyay6zrF Nf7tYj7pL6BcxMSDQj3Fo+juRvWdr7nbfsNxvHv4s/pht0RsHfTjMJIlcuZRGi4lW8MYSM obf0aqntKMcIFz07nZ8gfJFyOigpyStONkLu9icCzIrI3XRgfm0XXsYCfQ2tE6DS0zlHEb x6vmK9+cEpKYiNif8kV4gR1N8Mtt2/1asxTbVF8/Z2DXJiT+CxqHSTQZwFgD8g== 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 4P2w0s2dZJzlmC; Thu, 26 Jan 2023 22:11:57 +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 30QMBv1p022028; Thu, 26 Jan 2023 22:11:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30QMBviG022027; Thu, 26 Jan 2023 22:11:57 GMT (envelope-from git) Date: Thu, 26 Jan 2023 22:11:57 GMT Message-Id: <202301262211.30QMBviG022027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 88c217560ee4 - stable/13 - vmm: Remove vcpuid from I/O port handlers. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 88c217560ee451bdc0b9ade02167cfa50a53012c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=88c217560ee451bdc0b9ade02167cfa50a53012c commit 88c217560ee451bdc0b9ade02167cfa50a53012c Author: John Baldwin AuthorDate: 2022-11-18 18:03:14 +0000 Commit: John Baldwin CommitDate: 2023-01-26 22:01:56 +0000 vmm: Remove vcpuid from I/O port handlers. No I/O ports are vCPU-specific (unlike memory which does have vCPU-specific ranges such as the local APIC). Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37163 (cherry picked from commit 9388bc1e3a58ac17c06e690fb9f46c9f36098f2d) --- sys/amd64/vmm/io/vatpic.c | 6 +++--- sys/amd64/vmm/io/vatpic.h | 10 +++++----- sys/amd64/vmm/io/vatpit.c | 5 ++--- sys/amd64/vmm/io/vatpit.h | 5 ++--- sys/amd64/vmm/io/vpmtmr.c | 3 +-- sys/amd64/vmm/io/vpmtmr.h | 3 +-- sys/amd64/vmm/io/vrtc.c | 18 ++++++++---------- sys/amd64/vmm/io/vrtc.h | 4 ++-- sys/amd64/vmm/vmm_ioport.c | 4 ++-- sys/amd64/vmm/vmm_ioport.h | 2 +- 10 files changed, 27 insertions(+), 33 deletions(-) diff --git a/sys/amd64/vmm/io/vatpic.c b/sys/amd64/vmm/io/vatpic.c index de34b82c0cff..1d4ccfb9d0ca 100644 --- a/sys/amd64/vmm/io/vatpic.c +++ b/sys/amd64/vmm/io/vatpic.c @@ -712,7 +712,7 @@ vatpic_write(struct vatpic *vatpic, struct atpic *atpic, bool in, int port, } int -vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, +vatpic_master_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; @@ -732,7 +732,7 @@ vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, } int -vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, +vatpic_slave_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; @@ -752,7 +752,7 @@ vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, } int -vatpic_elc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, +vatpic_elc_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; diff --git a/sys/amd64/vmm/io/vatpic.h b/sys/amd64/vmm/io/vatpic.h index 8990a2a5fcb0..bf46278f5b0d 100644 --- a/sys/amd64/vmm/io/vatpic.h +++ b/sys/amd64/vmm/io/vatpic.h @@ -41,11 +41,11 @@ struct vm_snapshot_meta; struct vatpic *vatpic_init(struct vm *vm); void vatpic_cleanup(struct vatpic *vatpic); -int vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port, - int bytes, uint32_t *eax); -int vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port, - int bytes, uint32_t *eax); -int vatpic_elc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, +int vatpic_master_handler(struct vm *vm, bool in, int port, int bytes, + uint32_t *eax); +int vatpic_slave_handler(struct vm *vm, bool in, int port, int bytes, + uint32_t *eax); +int vatpic_elc_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *eax); int vatpic_assert_irq(struct vm *vm, int irq); diff --git a/sys/amd64/vmm/io/vatpit.c b/sys/amd64/vmm/io/vatpit.c index 27bbf227cbbb..7626b4dc4cc2 100644 --- a/sys/amd64/vmm/io/vatpit.c +++ b/sys/amd64/vmm/io/vatpit.c @@ -336,8 +336,7 @@ vatpit_update_mode(struct vatpit *vatpit, uint8_t val) } int -vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *eax) +vatpit_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *eax) { struct vatpit *vatpit; struct channel *c; @@ -419,7 +418,7 @@ vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, } int -vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, +vatpit_nmisc_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *eax) { struct vatpit *vatpit; diff --git a/sys/amd64/vmm/io/vatpit.h b/sys/amd64/vmm/io/vatpit.h index 65e06ec9bf58..96ed9c231420 100644 --- a/sys/amd64/vmm/io/vatpit.h +++ b/sys/amd64/vmm/io/vatpit.h @@ -41,10 +41,9 @@ struct vm_snapshot_meta; struct vatpit *vatpit_init(struct vm *vm); void vatpit_cleanup(struct vatpit *vatpit); -int vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, +int vatpit_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *eax); +int vatpit_nmisc_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *eax); -int vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port, - int bytes, uint32_t *eax); #ifdef BHYVE_SNAPSHOT int vatpit_snapshot(struct vatpit *vatpit, struct vm_snapshot_meta *meta); #endif diff --git a/sys/amd64/vmm/io/vpmtmr.c b/sys/amd64/vmm/io/vpmtmr.c index f79e94f6d0fe..825d0151c333 100644 --- a/sys/amd64/vmm/io/vpmtmr.c +++ b/sys/amd64/vmm/io/vpmtmr.c @@ -83,8 +83,7 @@ vpmtmr_cleanup(struct vpmtmr *vpmtmr) } int -vpmtmr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *val) +vpmtmr_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *val) { struct vpmtmr *vpmtmr; sbintime_t now, delta; diff --git a/sys/amd64/vmm/io/vpmtmr.h b/sys/amd64/vmm/io/vpmtmr.h index a10c0b4e8309..4ad5efcf2034 100644 --- a/sys/amd64/vmm/io/vpmtmr.h +++ b/sys/amd64/vmm/io/vpmtmr.h @@ -39,8 +39,7 @@ struct vm_snapshot_meta; struct vpmtmr *vpmtmr_init(struct vm *vm); void vpmtmr_cleanup(struct vpmtmr *pmtmr); -int vpmtmr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *val); +int vpmtmr_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *val); #ifdef BHYVE_SNAPSHOT int vpmtmr_snapshot(struct vpmtmr *vpmtmr, struct vm_snapshot_meta *meta); diff --git a/sys/amd64/vmm/io/vrtc.c b/sys/amd64/vmm/io/vrtc.c index 65b2cd2cb39f..d950bd68ad04 100644 --- a/sys/amd64/vmm/io/vrtc.c +++ b/sys/amd64/vmm/io/vrtc.c @@ -844,8 +844,7 @@ vrtc_nvram_read(struct vm *vm, int offset, uint8_t *retval) } int -vrtc_addr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *val) +vrtc_addr_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *val) { struct vrtc *vrtc; @@ -867,8 +866,7 @@ vrtc_addr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, } int -vrtc_data_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *val) +vrtc_data_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *val) { struct vrtc *vrtc; struct rtcdev *rtc; @@ -915,24 +913,24 @@ vrtc_data_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, } else { *val = *((uint8_t *)rtc + offset); } - VCPU_CTR2(vm, vcpuid, "Read value %#x from RTC offset %#x", + VM_CTR2(vm, "Read value %#x from RTC offset %#x", *val, offset); } else { switch (offset) { case 10: - VCPU_CTR1(vm, vcpuid, "RTC reg_a set to %#x", *val); + VM_CTR1(vm, "RTC reg_a set to %#x", *val); vrtc_set_reg_a(vrtc, *val); break; case 11: - VCPU_CTR1(vm, vcpuid, "RTC reg_b set to %#x", *val); + VM_CTR1(vm, "RTC reg_b set to %#x", *val); error = vrtc_set_reg_b(vrtc, *val); break; case 12: - VCPU_CTR1(vm, vcpuid, "RTC reg_c set to %#x (ignored)", + VM_CTR1(vm, "RTC reg_c set to %#x (ignored)", *val); break; case 13: - VCPU_CTR1(vm, vcpuid, "RTC reg_d set to %#x (ignored)", + VM_CTR1(vm, "RTC reg_d set to %#x (ignored)", *val); break; case 0: @@ -942,7 +940,7 @@ vrtc_data_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, *val &= 0x7f; /* FALLTHRU */ default: - VCPU_CTR2(vm, vcpuid, "RTC offset %#x set to %#x", + VM_CTR2(vm, "RTC offset %#x set to %#x", offset, *val); *((uint8_t *)rtc + offset) = *val; break; diff --git a/sys/amd64/vmm/io/vrtc.h b/sys/amd64/vmm/io/vrtc.h index 791fb7db3e26..0f11b8d5fc53 100644 --- a/sys/amd64/vmm/io/vrtc.h +++ b/sys/amd64/vmm/io/vrtc.h @@ -45,9 +45,9 @@ int vrtc_set_time(struct vm *vm, time_t secs); int vrtc_nvram_write(struct vm *vm, int offset, uint8_t value); int vrtc_nvram_read(struct vm *vm, int offset, uint8_t *retval); -int vrtc_addr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, +int vrtc_addr_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *val); -int vrtc_data_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, +int vrtc_data_handler(struct vm *vm, bool in, int port, int bytes, uint32_t *val); #ifdef BHYVE_SNAPSHOT diff --git a/sys/amd64/vmm/vmm_ioport.c b/sys/amd64/vmm/vmm_ioport.c index 601a2e18f745..50c02378a4c5 100644 --- a/sys/amd64/vmm/vmm_ioport.c +++ b/sys/amd64/vmm/vmm_ioport.c @@ -122,8 +122,8 @@ emulate_inout_port(struct vm *vm, int vcpuid, struct vm_exit *vmexit, val = vmexit->u.inout.eax & mask; } - error = (*handler)(vm, vcpuid, vmexit->u.inout.in, - vmexit->u.inout.port, vmexit->u.inout.bytes, &val); + error = (*handler)(vm, vmexit->u.inout.in, vmexit->u.inout.port, + vmexit->u.inout.bytes, &val); if (error) { /* * The value returned by this function is also the return value diff --git a/sys/amd64/vmm/vmm_ioport.h b/sys/amd64/vmm/vmm_ioport.h index 14e315f400ce..fd20ecfd5e94 100644 --- a/sys/amd64/vmm/vmm_ioport.h +++ b/sys/amd64/vmm/vmm_ioport.h @@ -31,7 +31,7 @@ #ifndef _VMM_IOPORT_H_ #define _VMM_IOPORT_H_ -typedef int (*ioport_handler_func_t)(struct vm *vm, int vcpuid, +typedef int (*ioport_handler_func_t)(struct vm *vm, bool in, int port, int bytes, uint32_t *val); int vm_handle_inout(struct vm *vm, int vcpuid, struct vm_exit *vme, bool *retu);