From patchwork Tue Oct 4 13:01:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 612269 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp206116pvb; Tue, 4 Oct 2022 07:18:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4YB0f3exah2+grNslbgVCAyDobZLfwZuToufwpe1GzsIgaEDGe34Tm0PDOnQt43STTVnjV X-Received: by 2002:a05:6214:21a9:b0:4ac:afb4:1cf3 with SMTP id t9-20020a05621421a900b004acafb41cf3mr19637589qvc.93.1664893105437; Tue, 04 Oct 2022 07:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664893105; cv=none; d=google.com; s=arc-20160816; b=lWeBE8EtotOatdPHy3LbbPtzhfdIm3cmQ5/D2rgMR+wNYKQpF8oogDBTgD4r6eFvp3 D8wLoE+GWo2j0BljpKQfi6nilAY4cs2BaaGnXsz/dj8bgNK1KrDL4z39VmRk2s0GS4S2 e+A1fZl6lP3pDXfWV9MTFlVBO8Md8vClhs2+5EvxWynvS9nYhe4qJVBfDxJQCd61ROlx n5kzDnQuGoX2t4hnyFk1MaNxlYDD4D4/Mvm1UmZ7I7tlQKKROPRJqQCiGv2jFx3AkDVj 60CwNy5hqw7A3qAjG9aKDB2CVOQNPBKbGhAK5W4rT0OCYmsYC09vAcliCkOFqwdXrMbx nbkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b0sEFTUmJhxsrwZtNY2dwzSSYrDaPd1jMbAkb2SEAj0=; b=NVBYMYuWzSQlDpZj5JltU4NdcJo189Q2stQTjK//0JJJl4ApBhTKmlgBN38anD6UoB m/hYIbMLduUUb6H9iKEFOZkz6cdY89qOaEg3U0Cu/QI90tLBGtlYMhyYbZiGa9zU9NLP TqEdUatXk5or9rurdzxC3ZSuWuGg1hMqdNHg127+7mDA3HP/elW33nbQItQ/Ohxsd2bb 6Gstn5Iy+wG7gwTh1BkKf4AVhD+xcDlDrnO/oNU2lrO4JpjsmbCplFXTdufUAMv3EEki lad/3VxzoZA0LzevaDqOfGU2a7/o0lWb5KRcllbwQqB6+SPRvKfVeBXmgdp6IB1d8e3S W6eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vIu7p2D4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d12-20020ac8060c000000b00340bca2089bsi4628058qth.543.2022.10.04.07.18.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Oct 2022 07:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vIu7p2D4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofika-0001iB-SF for patch@linaro.org; Tue, 04 Oct 2022 10:18:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofhq7-0001JP-Ty for qemu-devel@nongnu.org; Tue, 04 Oct 2022 09:20:06 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:45617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofhq3-0001pn-7B for qemu-devel@nongnu.org; Tue, 04 Oct 2022 09:20:02 -0400 Received: by mail-wr1-x435.google.com with SMTP id a10so8947329wrm.12 for ; Tue, 04 Oct 2022 06:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=b0sEFTUmJhxsrwZtNY2dwzSSYrDaPd1jMbAkb2SEAj0=; b=vIu7p2D4/PA+O48mA3YTJjk3rwfNYUqK0kafegq6m8TaT3o7XQFOyP0Tinz7SLTV1y 0lQjyHkjAJKcnrULbAEMUhB1W3vHkz5YlSyHjHGMrykMNSTZULApTT3cRPTIPslkajAt H3CS15n8h6ORbA05inrC5PEnPEDk5bsD+1nFQW5h/nq88j19yeyk1Qt98LWLScg8RLje z8XKqXfvT77rSY92NxULi8wq+BqrQ7GAhZyysyhCBJh1zMcPOX+B00Ii298DZ09WgQal IC12YbM/cv1vh+jkTkB8pkaZc9s3BYknWgmEw84jn1BNTfNKPgb81zUenqLxoNXuhM8e UiTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=b0sEFTUmJhxsrwZtNY2dwzSSYrDaPd1jMbAkb2SEAj0=; b=v2t3Kmv+JccywGzMFv9BfQb2aV1fSPQt2l4iXQKzT6KIMl+wGau56UT0ibecHhGFK3 wTMwc7snoCKrnBNBNllxjPhdOlSZdctUwtBfAmvSmeJkFlNy1HpyjMVkgNXvufAhx08U mJW01N6NoH3qutMQqqjp7ZCxFKOLdmaPTWEI6eQma2rsRDYCHs4jhNJh2fZBAfYrCq73 /HFVt3HcUnRA7MCTdU/ICBQJtWbM/hH7Fl9WYKhBp24y/GfEGUUiPliLMqFjqKUHKZQW e1LaYbRQutBheAnsNcyho1N53yXkYJp87OnoRKsbQsYIvynfpPNKXQyylsPzD84j4r2a nw3Q== X-Gm-Message-State: ACrzQf2iNu7CvqOBFSNOAzOcYorV3IeKO8OF3dB1EMfhInN9+8a85Spy L++23QKgdX6msNSIlzFE2304Kg== X-Received: by 2002:a5d:47c2:0:b0:22e:4911:6925 with SMTP id o2-20020a5d47c2000000b0022e49116925mr3277651wrc.403.1664889596606; Tue, 04 Oct 2022 06:19:56 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id a22-20020a05600c349600b003b33de17577sm14808748wmq.13.2022.10.04.06.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 06:19:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B07E61FFE1; Tue, 4 Oct 2022 14:01:43 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , kvm@vger.kernel.org (open list:Overall KVM CPUs) Subject: [PULL 46/54] accel/kvm: move kvm_update_guest_debug to inline stub Date: Tue, 4 Oct 2022 14:01:30 +0100 Message-Id: <20221004130138.2299307-47-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004130138.2299307-1-alex.bennee@linaro.org> References: <20221004130138.2299307-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20220929114231.583801-47-alex.bennee@linaro.org> diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 6e1bd01725..790d35ef78 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -247,7 +247,23 @@ int kvm_on_sigbus(int code, void *addr); void kvm_flush_coalesced_mmio_buffer(void); +/** + * kvm_update_guest_debug(): ensure KVM debug structures updated + * @cs: the CPUState for this cpu + * @reinject_trap: KVM trap injection control + * + * There are usually per-arch specifics which will be handled by + * calling down to kvm_arch_update_guest_debug after the generic + * fields have been set. + */ +#ifdef KVM_CAP_SET_GUEST_DEBUG int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap); +#else +static inline int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap) +{ + return -EINVAL; +} +#endif /* internal API */ diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 6ebff6e5a6..423fb1936f 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3395,12 +3395,6 @@ void kvm_remove_all_breakpoints(CPUState *cpu) } } -#else /* !KVM_CAP_SET_GUEST_DEBUG */ - -static int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap) -{ - return -EINVAL; -} #endif /* !KVM_CAP_SET_GUEST_DEBUG */ static int kvm_set_signal_mask(CPUState *cpu, const sigset_t *sigset) diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index 2d79333143..5d2dd8f351 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -46,11 +46,6 @@ int kvm_has_many_ioeventfds(void) return 0; } -int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap) -{ - return -ENOSYS; -} - int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr) { return 1;