From nobody Sat May 18 04:30:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587579772; cv=none; d=zohomail.com; s=zohoarc; b=gXA2MYlxu0jJ1Be7ZhF7S7I46SjcGjZJie9CkMIZFteL0cTtUjS70EVwSLEeIL7NVM0WYtID+eVNy/Z8IkqCMq4XIg+z5M/2lNty92jvGQsUFKmJm/hv2XFSajO69Smdd1GR/H8NTuNaEqvdgNb1qE67IcFhe6W6bYZsUvhhz6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587579772; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XWQH+WqkRfp4wJIRuWJ29KttjuuuSpzbvrw8QWn/fPk=; b=JkhNKrkuU/X4YyXF9y4g+IbAmVczChfKQ+5iFrY2JqPuG9n8PjnTYsYy+AU9G8TyMMFE6QFUAXIVA645Rij3zD9OrZYdi0p6t7K26oqzmB0t+h/gjKc0XuOtV9N748K32NRLIkOWXXSt055+8Ev7zn/pz3gwpvtimoEwi55uqxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587579772398715.9175075093608; Wed, 22 Apr 2020 11:22:52 -0700 (PDT) Received: from localhost ([::1]:55698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRK1L-0006Gt-0Q for importer@patchew.org; Wed, 22 Apr 2020 14:22:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50842) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJzb-0004zl-RR for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJza-0002AY-Ka for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:03 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:36345) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRJza-00025w-6m for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:02 -0400 Received: by mail-qk1-x743.google.com with SMTP id l25so3486329qkk.3 for ; Wed, 22 Apr 2020 11:21:01 -0700 (PDT) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id q32sm641qta.13.2020.04.22.11.20.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 11:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=XWQH+WqkRfp4wJIRuWJ29KttjuuuSpzbvrw8QWn/fPk=; b=rcTRMDXv+Yo4EYEAA4g+HOSJ0dnv6q0ciFXJ+MQ644VjZpT6QypWAuOY/+wgT97N7N Yp8dKW9oMDjS/5yBbcLLxEbti1AqK3vzZHpe1XjS/ypuh+n5o8HP3uUrUeS0j2HwDS8Y EycTrHVXfhs4DSdZmoE0E7u6K1ObKRNadh1VcrYwV3pli6h6sndfoKs3oT7HY1nyBBJ5 XBd/Fa0DXMVsSCKMp+samnM84RSglmCPW56E5Y0k63zmpjy03uK2kgomWCQldVpeEh7R zaVbAoEFIBxyHJIyrWEtPBtJ183OYCChkhq6fYBKkxFOIfPVudRgfsYVEV5ZAuP/dL4j Hi8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=XWQH+WqkRfp4wJIRuWJ29KttjuuuSpzbvrw8QWn/fPk=; b=S2u2NwwA3CuRAegr7CnXLWLgo++WnWw9TkB+s685FQLfluhf/V2mohzN+G31aNssFA x1HZkqZwv8lfrLaFFpPknq997FrBvCACTVtDhtYVyYDSkLULNcY91PTdtWkvmaAyr6Oj MEh5pA0AWNiTR1FmLhW8xE7ZGo5SOui6QlxDM36Pg+v6wlV5XxsyWzqAYhSBXgelY7Mb MzfvHc/cAqbzDJbi+Xyvx5uzuoPM3txJ3ER96REDQkcgm2lTlLASXtWq2V2ZzYWTY62H 3yX1LPq/EAGaZCO+mOpPeXBgFVHMelMbfy0Jp1fAXbmCuNETnQ+SnJB7F+XA/PRbV5vR P0TQ== X-Gm-Message-State: AGi0PuY/eJ8c+CihHRHjJSAMbv8tMTvvZY2YnBwMXqHKKFalfOvGUXDM cf+9DZor6bBVNSw9i2TjUFo= X-Google-Smtp-Source: APiQypLqZngDSorZDDTmxZtWNAI+yVErrNWqoVWfjNQIlpiRc2olxCnd4Vf0ssdFKfdX9vkd1dX/PQ== X-Received: by 2002:a37:6393:: with SMTP id x141mr26288222qkb.179.1587579661122; Wed, 22 Apr 2020 11:21:01 -0700 (PDT) Subject: [PATCH v21 QEMU 1/5] linux-headers: Update to allow renaming of free_page_report_cmd_id From: Alexander Duyck To: david@redhat.com, mst@redhat.com Date: Wed, 22 Apr 2020 11:20:58 -0700 Message-ID: <20200422182058.12258.52009.stgit@localhost.localdomain> In-Reply-To: <20200422181649.12258.37077.stgit@localhost.localdomain> References: <20200422181649.12258.37077.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=alexander.duyck@gmail.com; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::743 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) From: Alexander Duyck Sync to the latest upstream changes for free page hinting. To be replaced by a full linux header sync. Signed-off-by: Alexander Duyck --- include/standard-headers/linux/virtio_balloon.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/stan= dard-headers/linux/virtio_balloon.h index 9375ca2a70de..af0a6b59dab2 100644 --- a/include/standard-headers/linux/virtio_balloon.h +++ b/include/standard-headers/linux/virtio_balloon.h @@ -47,8 +47,15 @@ struct virtio_balloon_config { uint32_t num_pages; /* Number of pages we've actually got in balloon. */ uint32_t actual; - /* Free page report command id, readonly by guest */ - uint32_t free_page_report_cmd_id; + /* + * Free page hint command id, readonly by guest. + * Was previously name free_page_report_cmd_id so we + * need to carry that name for legacy support. + */ + union { + uint32_t free_page_hint_cmd_id; + uint32_t free_page_report_cmd_id; /* deprecated */ + }; /* Stores PAGE_POISON if page poisoning is in use */ uint32_t poison_val; }; From nobody Sat May 18 04:30:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587579860; cv=none; d=zohomail.com; s=zohoarc; b=UEIkgCv1/o71Hth80P5675SbV/B5/vez1JEAX5plVVeOIcJnq5Z6a9bZPMSWfbZ9utOuWFY9RmWegNHUzOByrUCvTeofyy3J5ql6py/9+z+WnojN3OTBZuRJnMaKF2MsML8Fu22uNsONC9osIbsbJNyKILUFLm26Sazg3qCe9eA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587579860; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r3DmuhsjF9XmFz6gfXOOjELEtTu/H+9BPOkgH77BTws=; b=WLAzlnVtexZLsGt5n51QJxgMFMK9Wj4nwRfAbCNjQ7kV2xMKTlkuqJOV5dwdDChSLw0gDU0iYfRLLct4/fS0cNFYcNYFiWAPVU7pVDxOrzSe8kmEE1II9OCn1hlG08Qh0cB6o2hFohuvZGFP7+RAyueVE6sBixnKWJLJ5InrK34= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587579860071957.8867227205769; Wed, 22 Apr 2020 11:24:20 -0700 (PDT) Received: from localhost ([::1]:55724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRK2k-0000Xc-SG for importer@patchew.org; Wed, 22 Apr 2020 14:24:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50912) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJzk-000515-1y for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJzj-0002cK-Jc for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:11 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:45357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRJzh-0002OW-Jw for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:09 -0400 Received: by mail-qk1-x744.google.com with SMTP id m67so3408633qke.12 for ; Wed, 22 Apr 2020 11:21:09 -0700 (PDT) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id 60sm4460499qtb.95.2020.04.22.11.21.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 11:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=r3DmuhsjF9XmFz6gfXOOjELEtTu/H+9BPOkgH77BTws=; b=LsdWUXHeOCv6U+GBDHwljJ6mvIk5lxR4xVsOEtIWPNz+D4ZiQ77ZuUvPJtLbFgn2UF ReKtV7zJE8wBtNubvuRZ7dEd8O9EyGmMTfwCG3GM1fB9/lWakHoMtrSQKDndAJCo2mNK gEGU+vcUClC+4EpnBMzEL+I0P2KW/OsiCKmQGU1cl/yH5Y67vVueLycSmvogES9jm15y ic/gClC+LoC220bdCt397kSMtatBdcwfdjWvH6vfNw5+e6uFlCz5+vCSP8jq6adyb9Ni 8pAo4VjbbI+OeMrvYtgI50FaR3BUQFsohyEzxSMv07FjqwBGlRZUG95SIhdvKAL2uYMc dF8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=r3DmuhsjF9XmFz6gfXOOjELEtTu/H+9BPOkgH77BTws=; b=W/yeCXGZwNca2l3v/ONhbDFReM3Yqtk3+pdiep71UuQWKNi2Wdqdwv1Y9uTBWC2j44 4e9Dj2/W3YfOpfYnQR6wGXCRsmo6DYEuxQ35PwJ4IVNWmFLAE7/w1DX53DWiEvKMAISp tWWO0dLhmO1OE05UDqqYUFODDV7ae8OI8FfsVwoPpexD7TWqXVVbpcBp6YGihcwfNCvo UFuhU6UTuP3pKe+Hrfib8zqnAfJCd/Fs6Wq7smiPw9MWYWsJh6sHAQ5XI15zWtDGopG4 TqDpU+QOeune66kq7FExeGoDRWYIL00GrywXFj/lwnsFnzAmW1UJx5SGpeOEXLU2am9g gfmw== X-Gm-Message-State: AGi0PuZBwp6FpyoWHL5J0lwWJqMuIQlodnYu/S03cebsiIOY9UzIwk4J tkWFw5fngLT2SXAa2tEcAiqaACEm1/E= X-Google-Smtp-Source: APiQypLWRMl5VLgsxPSxxQlLUOs9gHLc9Js+TPE2aDdys6oe9LdYq9QUa54y0nGVnjTffUqdakUL6w== X-Received: by 2002:a37:881:: with SMTP id 123mr28207659qki.185.1587579668130; Wed, 22 Apr 2020 11:21:08 -0700 (PDT) Subject: [PATCH v21 QEMU 2/5] linux-headers: update to contain virito-balloon free page reporting From: Alexander Duyck To: david@redhat.com, mst@redhat.com Date: Wed, 22 Apr 2020 11:21:06 -0700 Message-ID: <20200422182106.12258.53215.stgit@localhost.localdomain> In-Reply-To: <20200422181649.12258.37077.stgit@localhost.localdomain> References: <20200422181649.12258.37077.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::744; envelope-from=alexander.duyck@gmail.com; helo=mail-qk1-x744.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::744 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) From: Alexander Duyck Sync the latest upstream changes for free page reporting. To be replaced by a full linux header sync. Signed-off-by: Alexander Duyck --- include/standard-headers/linux/virtio_balloon.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/stan= dard-headers/linux/virtio_balloon.h index af0a6b59dab2..af3b7a1fa263 100644 --- a/include/standard-headers/linux/virtio_balloon.h +++ b/include/standard-headers/linux/virtio_balloon.h @@ -36,6 +36,7 @@ #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ #define VIRTIO_BALLOON_F_FREE_PAGE_HINT 3 /* VQ to report free pages */ #define VIRTIO_BALLOON_F_PAGE_POISON 4 /* Guest is using page poisoning */ +#define VIRTIO_BALLOON_F_REPORTING 5 /* Page reporting virtqueue */ =20 /* Size of a PFN in the balloon interface. */ #define VIRTIO_BALLOON_PFN_SHIFT 12 From nobody Sat May 18 04:30:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587579778; cv=none; d=zohomail.com; s=zohoarc; b=fZqbcztge/Ce9pSs+hXJEY2C2f4GnxTH3+oqZgKHB9mOW8PTgUPR3wJn+sYRctagvJSRrmQ9AffDh+LPlTCFxsj4HOygNphCyRkSl5TBTEEE2+pqQrUk2jM3ufxwp/jMPrGRtIxPU6J2k2qKJkHm3iQmkTKzScu3XGiIku42+wI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587579778; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YJd/5+rwmU7jV4Cc2a5A8ynsedgtcoLuxNlkQDArthc=; b=PdW8j2bWR5Qxr75zDTPFQbLfwL/tdWip1BT4QgEESjx4YVS0Kk4WeEdDRrVrd3GtBZlUWVAyrDO8GH3rY7lILMBLaCiVgtJChxgT1UH627Optd6Oid2WHaZDQzhLccamFTMJUrxJ5eT+rVQ9EBD7AN+NT2EB0X2etCy2EMJdiaE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158757977839414.057794070926775; Wed, 22 Apr 2020 11:22:58 -0700 (PDT) Received: from localhost ([::1]:55702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRK1R-0006X0-2a for importer@patchew.org; Wed, 22 Apr 2020 14:22:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50980) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJzq-00058b-OA for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJzp-0002vf-SD for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:18 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:33285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRJzp-0002m9-Bh for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:17 -0400 Received: by mail-qk1-x743.google.com with SMTP id s188so2671560qkf.0 for ; Wed, 22 Apr 2020 11:21:16 -0700 (PDT) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id i5sm4443308qtw.97.2020.04.22.11.21.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 11:21:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=YJd/5+rwmU7jV4Cc2a5A8ynsedgtcoLuxNlkQDArthc=; b=cLHSk9phlsrCc3SC/AoTmw7xWKfmYUUn5osAApzuuJjaagtSvfCCtf9tfapty+PDJ6 6pTultScRo78UmB7OyzK1NGe6BbYVkYWkJDTws2KEYVgO05Qa9hm88yxo0DLhKXqbcPo PlDJdVQ65gcQBhd3aqY/FOIF+PDpe5czayQtJO5mUPxZnz1b/JMH+wQXnQ2CaFETP8uz AADNVE83gi5MAMBQuq6jf1Z45UUS7JxI46uS5vPAvMf7D9Le3x1Iy1eahfy7Ze+asrdO nox4W8auyhDG6TqbZijFfMBepX91T90dyzRlsSxNOUEvEqaOseM7YEg0dbVYhRrZ+nT6 +qAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=YJd/5+rwmU7jV4Cc2a5A8ynsedgtcoLuxNlkQDArthc=; b=I6dNH46AF0d1n/531FKq8lfnObRaIqBeOK4qSNQWnARZ8nQYmqwz8i/EmxN4dGhqSu L5t5P/O9AG3RDOTjqSqG6sGe0Pi9iud6ioU/k4lki61SOy+IEzklaOwXZobXgUP5N9+f 04Tj1NZoavFFVxIC8iFV56CvRol2OQM4P4kfA/BuJDzBrJv0Xt6OQik8ZQf6CpRYjvK/ wtM1xfubqoyIA4Dq2VN3vE5u0JNzKC0Y/fkPl7yTOXUvsQj7rnR9gX+uoGY4Z7FsEJgd 8elXPBSflhEJw5fSAIpVba3JaJc8p711mmAh1igeNOTGFizRdTgvih0aT0lu04MBK34P V0UA== X-Gm-Message-State: AGi0PuYja24MilvhpuFGwu884aqOvj69iMn1AyN9eanPWAKOn3Yo3HJG sAmKy/hhdrt1MT5RytkQhSk= X-Google-Smtp-Source: APiQypKiBty5CpIpfGztv4nVNxYPHE26i8fDnz5Ytl7Qs6ZtBCPZPKb0pA9yY8qIqcuBo0z5CjCFkQ== X-Received: by 2002:a37:a8c7:: with SMTP id r190mr28703945qke.65.1587579675085; Wed, 22 Apr 2020 11:21:15 -0700 (PDT) Subject: [PATCH v21 QEMU 3/5] virtio-balloon: Replace free page hinting references to 'report' with 'hint' From: Alexander Duyck To: david@redhat.com, mst@redhat.com Date: Wed, 22 Apr 2020 11:21:13 -0700 Message-ID: <20200422182113.12258.56556.stgit@localhost.localdomain> In-Reply-To: <20200422181649.12258.37077.stgit@localhost.localdomain> References: <20200422181649.12258.37077.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=alexander.duyck@gmail.com; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::743 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) From: Alexander Duyck In an upcoming patch a feature named Free Page Reporting is about to be added. In order to avoid any confusion we should drop the use of the word 'report' when referring to Free Page Hinting. So what this patch does is go through and replace all instances of 'report' with 'hint" when we are referring to free page hinting. Signed-off-by: Alexander Duyck Acked-by: David Hildenbrand --- hw/virtio/virtio-balloon.c | 74 ++++++++++++++++++--------------= ---- include/hw/virtio/virtio-balloon.h | 20 +++++----- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a4729f7fc930..a1d6fb52c876 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -466,21 +466,21 @@ static bool get_free_page_hints(VirtIOBalloon *dev) ret =3D false; goto out; } - if (id =3D=3D dev->free_page_report_cmd_id) { - dev->free_page_report_status =3D FREE_PAGE_REPORT_S_START; + if (id =3D=3D dev->free_page_hint_cmd_id) { + dev->free_page_hint_status =3D FREE_PAGE_HINT_S_START; } else { /* * Stop the optimization only when it has started. This * avoids a stale stop sign for the previous command. */ - if (dev->free_page_report_status =3D=3D FREE_PAGE_REPORT_S_STA= RT) { - dev->free_page_report_status =3D FREE_PAGE_REPORT_S_STOP; + if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_START) { + dev->free_page_hint_status =3D FREE_PAGE_HINT_S_STOP; } } } =20 if (elem->in_num) { - if (dev->free_page_report_status =3D=3D FREE_PAGE_REPORT_S_START) { + if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_START) { qemu_guest_free_page_hint(elem->in_sg[0].iov_base, elem->in_sg[0].iov_len); } @@ -506,11 +506,11 @@ static void virtio_ballloon_get_free_page_hints(void = *opaque) qemu_mutex_unlock(&dev->free_page_lock); virtio_notify(vdev, vq); /* - * Start to poll the vq once the reporting started. Otherwise, conti= nue + * Start to poll the vq once the hinting started. Otherwise, continue * only when there are entries on the vq, which need to be given bac= k. */ } while (continue_to_get_hints || - dev->free_page_report_status =3D=3D FREE_PAGE_REPORT_S_START); + dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_START); virtio_queue_set_notification(vq, 1); } =20 @@ -531,14 +531,14 @@ static void virtio_balloon_free_page_start(VirtIOBall= oon *s) return; } =20 - if (s->free_page_report_cmd_id =3D=3D UINT_MAX) { - s->free_page_report_cmd_id =3D - VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN; + if (s->free_page_hint_cmd_id =3D=3D UINT_MAX) { + s->free_page_hint_cmd_id =3D + VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; } else { - s->free_page_report_cmd_id++; + s->free_page_hint_cmd_id++; } =20 - s->free_page_report_status =3D FREE_PAGE_REPORT_S_REQUESTED; + s->free_page_hint_status =3D FREE_PAGE_HINT_S_REQUESTED; virtio_notify_config(vdev); } =20 @@ -546,18 +546,18 @@ static void virtio_balloon_free_page_stop(VirtIOBallo= on *s) { VirtIODevice *vdev =3D VIRTIO_DEVICE(s); =20 - if (s->free_page_report_status !=3D FREE_PAGE_REPORT_S_STOP) { + if (s->free_page_hint_status !=3D FREE_PAGE_HINT_S_STOP) { /* * The lock also guarantees us that the * virtio_ballloon_get_free_page_hints exits after the - * free_page_report_status is set to S_STOP. + * free_page_hint_status is set to S_STOP. */ qemu_mutex_lock(&s->free_page_lock); /* * The guest hasn't done the reporting, so host sends a notificati= on * to the guest to actively stop the reporting. */ - s->free_page_report_status =3D FREE_PAGE_REPORT_S_STOP; + s->free_page_hint_status =3D FREE_PAGE_HINT_S_STOP; qemu_mutex_unlock(&s->free_page_lock); virtio_notify_config(vdev); } @@ -567,15 +567,15 @@ static void virtio_balloon_free_page_done(VirtIOBallo= on *s) { VirtIODevice *vdev =3D VIRTIO_DEVICE(s); =20 - s->free_page_report_status =3D FREE_PAGE_REPORT_S_DONE; + s->free_page_hint_status =3D FREE_PAGE_HINT_S_DONE; virtio_notify_config(vdev); } =20 static int -virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data) +virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data) { VirtIOBalloon *dev =3D container_of(n, VirtIOBalloon, - free_page_report_notify); + free_page_hint_notify); VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); PrecopyNotifyData *pnd =3D data; =20 @@ -624,7 +624,7 @@ static size_t virtio_balloon_config_size(VirtIOBalloon = *s) if (virtio_has_feature(features, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) { return offsetof(struct virtio_balloon_config, poison_val); } - return offsetof(struct virtio_balloon_config, free_page_report_cmd_id); + return offsetof(struct virtio_balloon_config, free_page_hint_cmd_id); } =20 static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_= data) @@ -635,14 +635,14 @@ static void virtio_balloon_get_config(VirtIODevice *v= dev, uint8_t *config_data) config.num_pages =3D cpu_to_le32(dev->num_pages); config.actual =3D cpu_to_le32(dev->actual); =20 - if (dev->free_page_report_status =3D=3D FREE_PAGE_REPORT_S_REQUESTED) { - config.free_page_report_cmd_id =3D - cpu_to_le32(dev->free_page_report_cmd_id); - } else if (dev->free_page_report_status =3D=3D FREE_PAGE_REPORT_S_STOP= ) { - config.free_page_report_cmd_id =3D + if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_REQUESTED) { + config.free_page_hint_cmd_id =3D + cpu_to_le32(dev->free_page_hint_cmd_id); + } else if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_STOP) { + config.free_page_hint_cmd_id =3D cpu_to_le32(VIRTIO_BALLOON_CMD_ID_STOP); - } else if (dev->free_page_report_status =3D=3D FREE_PAGE_REPORT_S_DONE= ) { - config.free_page_report_cmd_id =3D + } else if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_DONE) { + config.free_page_hint_cmd_id =3D cpu_to_le32(VIRTIO_BALLOON_CMD_ID_DONE); } =20 @@ -743,14 +743,14 @@ static int virtio_balloon_post_load_device(void *opaq= ue, int version_id) return 0; } =20 -static const VMStateDescription vmstate_virtio_balloon_free_page_report = =3D { +static const VMStateDescription vmstate_virtio_balloon_free_page_hint =3D { .name =3D "virtio-balloon-device/free-page-report", .version_id =3D 1, .minimum_version_id =3D 1, .needed =3D virtio_balloon_free_page_support, .fields =3D (VMStateField[]) { - VMSTATE_UINT32(free_page_report_cmd_id, VirtIOBalloon), - VMSTATE_UINT32(free_page_report_status, VirtIOBalloon), + VMSTATE_UINT32(free_page_hint_cmd_id, VirtIOBalloon), + VMSTATE_UINT32(free_page_hint_status, VirtIOBalloon), VMSTATE_END_OF_LIST() } }; @@ -766,7 +766,7 @@ static const VMStateDescription vmstate_virtio_balloon_= device =3D { VMSTATE_END_OF_LIST() }, .subsections =3D (const VMStateDescription * []) { - &vmstate_virtio_balloon_free_page_report, + &vmstate_virtio_balloon_free_page_hint, NULL } }; @@ -797,12 +797,12 @@ static void virtio_balloon_device_realize(DeviceState= *dev, Error **errp) VIRTIO_BALLOON_F_FREE_PAGE_HINT)) { s->free_page_vq =3D virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE, virtio_balloon_handle_free_page= _vq); - s->free_page_report_status =3D FREE_PAGE_REPORT_S_STOP; - s->free_page_report_cmd_id =3D - VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN; - s->free_page_report_notify.notify =3D - virtio_balloon_free_page_report_not= ify; - precopy_add_notifier(&s->free_page_report_notify); + s->free_page_hint_status =3D FREE_PAGE_HINT_S_STOP; + s->free_page_hint_cmd_id =3D + VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; + s->free_page_hint_notify.notify =3D + virtio_balloon_free_page_hint_notif= y; + precopy_add_notifier(&s->free_page_hint_notify); if (s->iothread) { object_ref(OBJECT(s->iothread)); s->free_page_bh =3D aio_bh_new(iothread_get_aio_context(s->iot= hread), @@ -827,7 +827,7 @@ static void virtio_balloon_device_unrealize(DeviceState= *dev, Error **errp) if (virtio_balloon_free_page_support(s)) { qemu_bh_delete(s->free_page_bh); virtio_balloon_free_page_stop(s); - precopy_remove_notifier(&s->free_page_report_notify); + precopy_remove_notifier(&s->free_page_hint_notify); } balloon_stats_destroy_timer(s); qemu_remove_balloon_handler(s); diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-= balloon.h index d1c968d2376e..108cff97e71a 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -23,7 +23,7 @@ #define VIRTIO_BALLOON(obj) \ OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON) =20 -#define VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN 0x80000000 +#define VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN 0x80000000 =20 typedef struct virtio_balloon_stat VirtIOBalloonStat; =20 @@ -33,20 +33,20 @@ typedef struct virtio_balloon_stat_modern { uint64_t val; } VirtIOBalloonStatModern; =20 -enum virtio_balloon_free_page_report_status { - FREE_PAGE_REPORT_S_STOP =3D 0, - FREE_PAGE_REPORT_S_REQUESTED =3D 1, - FREE_PAGE_REPORT_S_START =3D 2, - FREE_PAGE_REPORT_S_DONE =3D 3, +enum virtio_balloon_free_page_hint_status { + FREE_PAGE_HINT_S_STOP =3D 0, + FREE_PAGE_HINT_S_REQUESTED =3D 1, + FREE_PAGE_HINT_S_START =3D 2, + FREE_PAGE_HINT_S_DONE =3D 3, }; =20 typedef struct VirtIOBalloon { VirtIODevice parent_obj; VirtQueue *ivq, *dvq, *svq, *free_page_vq; - uint32_t free_page_report_status; + uint32_t free_page_hint_status; uint32_t num_pages; uint32_t actual; - uint32_t free_page_report_cmd_id; + uint32_t free_page_hint_cmd_id; uint64_t stats[VIRTIO_BALLOON_S_NR]; VirtQueueElement *stats_vq_elem; size_t stats_vq_offset; @@ -55,7 +55,7 @@ typedef struct VirtIOBalloon { QEMUBH *free_page_bh; /* * Lock to synchronize threads to access the free page reporting relat= ed - * fields (e.g. free_page_report_status). + * fields (e.g. free_page_hint_status). */ QemuMutex free_page_lock; QemuCond free_page_cond; @@ -64,7 +64,7 @@ typedef struct VirtIOBalloon { * stopped. */ bool block_iothread; - NotifierWithReturn free_page_report_notify; + NotifierWithReturn free_page_hint_notify; int64_t stats_last_update; int64_t stats_poll_interval; uint32_t host_features; From nobody Sat May 18 04:30:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587579846; cv=none; d=zohomail.com; s=zohoarc; b=HvYcEjAD2ul1jmFXSi0F6YkpMGn8qUNi7389/dpbd2rc1x4uvJXoc2DKWsSXiNjW6x8D8hrTtvMqNyyKwYTxznA/G/MrFT4SnEiU646xIuBQkMp3s7FaU/M4qGDTFlGClL6jR6ZntIwbq+Tb9k5pByXa4iktB3GL0IOn/rcARaY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587579846; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3XHy8cPDC058ii5Kpvd4Vd9LUQpAYLHDshsvadW2rYw=; b=K8v2OW7NzAMj/7rMKFtzc2sLrLkm0TJwg6pDTgYnUrmLrRBHEZgy8iwKSYpjt3bFuFMoMg5O/GrspQqA/HdKdpgC4HNffHPj9vLCRIjugmATZev9Z2xGn9Ghpb5l8aFY5+RPpxB0c+sBPeeRFblkUsKwJ5yugc1T4yfchW9kHdo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587579846211236.7641660136686; Wed, 22 Apr 2020 11:24:06 -0700 (PDT) Received: from localhost ([::1]:55722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRK2W-0000Gl-W7 for importer@patchew.org; Wed, 22 Apr 2020 14:24:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51050) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJzw-0005Ij-O1 for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJzw-0003Fw-4n for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:24 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:44625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRJzv-0003DD-Mc for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:23 -0400 Received: by mail-qt1-x843.google.com with SMTP id c23so1969123qtp.11 for ; Wed, 22 Apr 2020 11:21:22 -0700 (PDT) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id b126sm4422623qkc.119.2020.04.22.11.21.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 11:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=3XHy8cPDC058ii5Kpvd4Vd9LUQpAYLHDshsvadW2rYw=; b=Ca2j8IaF63I//mpvBhD/h3tEVSMmXmgLy/mXrU7Tp6Pi9R+8OtFo+d25sd16Sa4RKq yXPqCIOkFzQcvPhGQ4Hr6wAy5F7v89XuXVAmq/mmUwwL0/lHgr6tMUF9ahcPv94/hW6l ukVmUZ0m8SNE79ZsfCv4wGtGfiZbWD/fEfN/B+4GSDKVeJF3fL51YHtS/Sx46WDr1Agd lAY9bzdBalIZrDV2F2mQMRyAf0zSL38b9EPcL8HEJMRfjjFNQ+OPaGRk6OyM9WJtkwog nybF5sfEYN2sAZm3pzxqzglf/IgkwZr9zpunWP1E8a+NBaeoylJ2qeJkjq6HkG1FH13i o09g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=3XHy8cPDC058ii5Kpvd4Vd9LUQpAYLHDshsvadW2rYw=; b=tmP33geFfCJ10ht0sFD9eG/q+bxsodad6ttfDtPmgfMELHjZMU0vf+SCYgmBXXiWVp hA6oW+r8HZFfp9vmOpCY2TVkXfJd5Pwq1QVohvf+gDsMNxqQBcPHD6QdHGKPdQwf5Utj AYEzjeWdY3qZVlkKSEzup3rwqpJiPid6qYWMMpvJGAngkMpW04kC1SbZJGvz2/Z4DDsl FiWBZOvqUjGJAQXQRkLUjfhlDc+tdqDDATkXhQLGX2bmukVHFMOiCOst+k8wqjxoiiL9 sGJ2OIw8idjt7Mb1YL+Yda7IvnbMAhVNnb/sFs4Ix30V81DXjsNHIzjxPnVmkcJyYjqX 11pA== X-Gm-Message-State: AGi0PuZWbQugJNLY/ASez5KhPrG0fAWtpMsuI6BSuA/P9QoNA0xske1x CM8M7nznX7Ue6EB123YV9SA= X-Google-Smtp-Source: APiQypLWDF3f0qFxa+6+HGzJSoHVxo0zSUHkDxEs+y+v/RaMyA7Av1wfNmeeECPfsezr0A8LOESxQw== X-Received: by 2002:ac8:3254:: with SMTP id y20mr28002535qta.67.1587579682135; Wed, 22 Apr 2020 11:21:22 -0700 (PDT) Subject: [PATCH v21 QEMU 4/5] virtio-balloon: Implement support for page poison tracking feature From: Alexander Duyck To: david@redhat.com, mst@redhat.com Date: Wed, 22 Apr 2020 11:21:20 -0700 Message-ID: <20200422182120.12258.67417.stgit@localhost.localdomain> In-Reply-To: <20200422181649.12258.37077.stgit@localhost.localdomain> References: <20200422181649.12258.37077.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::843; envelope-from=alexander.duyck@gmail.com; helo=mail-qt1-x843.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) From: Alexander Duyck We need to make certain to advertise support for page poison tracking if we want to actually get data on if the guest will be poisoning pages. Add a value for tracking the poison value being used if page poisoning is enabled. With this we can determine if we will need to skip page reporting when it is enabled in the future. Signed-off-by: Alexander Duyck --- hw/virtio/virtio-balloon.c | 7 +++++++ include/hw/virtio/virtio-balloon.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a1d6fb52c876..5effc8b4653b 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -634,6 +634,7 @@ static void virtio_balloon_get_config(VirtIODevice *vde= v, uint8_t *config_data) =20 config.num_pages =3D cpu_to_le32(dev->num_pages); config.actual =3D cpu_to_le32(dev->actual); + config.poison_val =3D cpu_to_le32(dev->poison_val); =20 if (dev->free_page_hint_status =3D=3D FREE_PAGE_HINT_S_REQUESTED) { config.free_page_hint_cmd_id =3D @@ -697,6 +698,10 @@ static void virtio_balloon_set_config(VirtIODevice *vd= ev, qapi_event_send_balloon_change(vm_ram_size - ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SH= IFT)); } + dev->poison_val =3D 0; + if (virtio_vdev_has_feature(vdev, VIRTIO_BALLOON_F_PAGE_POISON)) { + dev->poison_val =3D le32_to_cpu(config.poison_val); + } trace_virtio_balloon_set_config(dev->actual, oldactual); } =20 @@ -854,6 +859,8 @@ static void virtio_balloon_device_reset(VirtIODevice *v= dev) g_free(s->stats_vq_elem); s->stats_vq_elem =3D NULL; } + + s->poison_val =3D 0; } =20 static void virtio_balloon_set_status(VirtIODevice *vdev, uint8_t status) diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-= balloon.h index 108cff97e71a..3ca2a78e1aca 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -70,6 +70,7 @@ typedef struct VirtIOBalloon { uint32_t host_features; =20 bool qemu_4_0_config_size; + uint32_t poison_val; } VirtIOBalloon; =20 #endif From nobody Sat May 18 04:30:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587579868; cv=none; d=zohomail.com; s=zohoarc; b=d++unkCjiva0xDmIEZHQEQtjnzIGuiLCa/4r7or1lHb4ItAAcMynkfO28mTtLuto6/DkCTG77tTzlr1iZ3rdDxv3PTGyiT0vM5pWt0ll+JHYJilayac+S7HA0fFo4m8M30D7ECjR2mQ6wI+2Qx4kfM7eYXXhTHuX/7RuTs2zuV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587579868; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SH/65jIkrtSeeW/mAEjdDz+ENo/q+X4g5sfgY/LNkF8=; b=iyCCxQVGSOK65+zeHQ/Jviy7hOqwwyUpVu64RF1xJYQ7Q+QFLq1HhehXtDQWrx+pyAP40j9tD0sNalq9Mp3i5OtswrR+SI+IP4sjEd3XyZJ9Ln7eoyxiA5BbZlv0YVMxXg6ItjxJ4otS6xehE5lyseR4+A1Lq4dhqayIPGqrSFE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587579868890641.3879055831047; Wed, 22 Apr 2020 11:24:28 -0700 (PDT) Received: from localhost ([::1]:55726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRK2t-0000lx-Lk for importer@patchew.org; Wed, 22 Apr 2020 14:24:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRK03-0005TQ-QT for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRK02-0003ZD-OF for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:31 -0400 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]:35713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRK02-0003WI-9f for qemu-devel@nongnu.org; Wed, 22 Apr 2020 14:21:30 -0400 Received: by mail-qv1-xf32.google.com with SMTP id v10so1401231qvr.2 for ; Wed, 22 Apr 2020 11:21:29 -0700 (PDT) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id f130sm4397937qke.22.2020.04.22.11.21.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 11:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=SH/65jIkrtSeeW/mAEjdDz+ENo/q+X4g5sfgY/LNkF8=; b=o+8GWSOHmbU20SpYCo6cG5qDyEn618Ub2pWbnxpl9VOimJ4keG2iNhuxuN6EOl9z0g 6sMyoEqyMPm24tfSgVqlbgSxMF/qnYdensEqTa0nYuoxVC4aMf8r3OQVI9x1UN9igIuh ln/tcmJGUKxU5AuKodXh11qCQ4uZT5h5UbA85pFbR7RVzE0B1COyaLU7+UQNQLZWeMQs G5wb946Eg1t7Z/iHZKqu6UqylcQ5kbPHImRb0UJQwdtmtmOQ1rH+C8OW9MrE57wImh3V OBvAMtcbQ5hr9qT1VVyO4r6/Rg6bFc50JN2+ipFVgZcPnVZQngyZ5AH2NDPgJZfoGgyT 1SSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=SH/65jIkrtSeeW/mAEjdDz+ENo/q+X4g5sfgY/LNkF8=; b=Fo5uU21p7XXyv4yctBTWzGBZSb+UI6WTXg+hOcAnFFonljXSXOxewYgd6Qb1a9CYAr d7tMR7oLMHbur9sPty4CBtKq4rtI2PHHvCAd2v7Mn9c0N3yMY44Tr37dozZOj+XPG1Yx 4KWi+8SiMp+dOQuvuns9J/si0ys7S3Mxy/AtDVh+js4XI9tHEHHWL878xG7l/F6dJUXK 42blVAvppGVHxkg0zn6negGyTYoLDHUMuahGlKGuaa15ffYhy/px6kJmQEn11AStfOGU k1d+ABXrMD1oIE8W5e5EIFwVER3bRZYvDTVp1JmLVtKWHs/XdcZE25aGnYcEdJPotM3U ce7w== X-Gm-Message-State: AGi0Pua7rMYs4eUBHsPV3Cpgbtq20THEVR7tSP93JS+9dNFAaB53BXFS 6vouB2zi1CpZJV6PP0K/nYQIPsvBTUs= X-Google-Smtp-Source: APiQypILZzG2AF6qSMFleXJPZPIwp9FqAM9MYhXU03tP1UBo9fl5/OaSf4KPQNy9pPbXCDUI69VVgQ== X-Received: by 2002:a0c:e8c2:: with SMTP id m2mr247175qvo.24.1587579689243; Wed, 22 Apr 2020 11:21:29 -0700 (PDT) Subject: [PATCH v21 QEMU 5/5] virtio-balloon: Provide an interface for free page reporting From: Alexander Duyck To: david@redhat.com, mst@redhat.com Date: Wed, 22 Apr 2020 11:21:27 -0700 Message-ID: <20200422182127.12258.26300.stgit@localhost.localdomain> In-Reply-To: <20200422181649.12258.37077.stgit@localhost.localdomain> References: <20200422181649.12258.37077.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::f32; envelope-from=alexander.duyck@gmail.com; helo=mail-qv1-xf32.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::f32 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) From: Alexander Duyck Add support for free page reporting. The idea is to function very similar to how the balloon works in that we basically end up madvising the page as not being used. However we don't really need to bother with any deflate type logic since the page will be faulted back into the guest when it is read or written to. This provides a new way of letting the guest proactively report free pages to the hypervisor, so the hypervisor can reuse them. In contrast to inflate/deflate that is triggered via the hypervisor explicitly. Signed-off-by: Alexander Duyck --- hw/virtio/virtio-balloon.c | 70 ++++++++++++++++++++++++++++++++= ++++ include/hw/virtio/virtio-balloon.h | 2 + 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 5effc8b4653b..b473ff7f4b88 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -321,6 +321,60 @@ static void balloon_stats_set_poll_interval(Object *ob= j, Visitor *v, balloon_stats_change_timer(s, 0); } =20 +static void virtio_balloon_handle_report(VirtIODevice *vdev, VirtQueue *vq) +{ + VirtIOBalloon *dev =3D VIRTIO_BALLOON(vdev); + VirtQueueElement *elem; + + while ((elem =3D virtqueue_pop(vq, sizeof(VirtQueueElement)))) { + unsigned int i; + + if (qemu_balloon_is_inhibited() || dev->poison_val) { + goto skip_element; + } + + for (i =3D 0; i < elem->in_num; i++) { + void *addr =3D elem->in_sg[i].iov_base; + size_t size =3D elem->in_sg[i].iov_len; + ram_addr_t ram_offset; + RAMBlock *rb; + + /* + * There is no need to check the memory section to see if + * it is ram/readonly/romd like there is for handle_output + * below. If the region is not meant to be written to then + * address_space_map will have allocated a bounce buffer + * and it will be freed in address_space_unmap and trigger + * and unassigned_mem_write before failing to copy over the + * buffer. If more than one bad descriptor is provided it + * will return NULL after the first bounce buffer and fail + * to map any resources. + */ + rb =3D qemu_ram_block_from_host(addr, false, &ram_offset); + if (!rb) { + trace_virtio_balloon_bad_addr(elem->in_addr[i]); + continue; + } + + /* + * For now we will simply ignore unaligned memory regions, or + * regions that overrun the end of the RAMBlock. + */ + if (!QEMU_IS_ALIGNED(ram_offset | size, qemu_ram_pagesize(rb))= || + (ram_offset + size) > qemu_ram_get_used_length(rb)) { + continue; + } + + ram_block_discard_range(rb, ram_offset, size); + } + +skip_element: + virtqueue_push(vq, elem, 0); + virtio_notify(vdev, vq); + g_free(elem); + } +} + static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq) { VirtIOBalloon *s =3D VIRTIO_BALLOON(vdev); @@ -782,6 +836,16 @@ static void virtio_balloon_device_realize(DeviceState = *dev, Error **errp) VirtIOBalloon *s =3D VIRTIO_BALLOON(dev); int ret; =20 + /* + * Page reporting is dependant on page poison to make sure we can + * report a page without changing the state of the internal data. + * We need to set the flag before we call virtio_init as it will + * affect the config size of the vdev. + */ + if (virtio_has_feature(s->host_features, VIRTIO_BALLOON_F_REPORTING)) { + s->host_features |=3D 1 << VIRTIO_BALLOON_F_PAGE_POISON; + } + virtio_init(vdev, "virtio-balloon", VIRTIO_ID_BALLOON, virtio_balloon_config_size(s)); =20 @@ -798,6 +862,10 @@ static void virtio_balloon_device_realize(DeviceState = *dev, Error **errp) s->dvq =3D virtio_add_queue(vdev, 128, virtio_balloon_handle_output); s->svq =3D virtio_add_queue(vdev, 128, virtio_balloon_receive_stats); =20 + if (virtio_has_feature(s->host_features, VIRTIO_BALLOON_F_REPORTING)) { + s->rvq =3D virtio_add_queue(vdev, 32, virtio_balloon_handle_report= ); + } + if (virtio_has_feature(s->host_features, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) { s->free_page_vq =3D virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE, @@ -923,6 +991,8 @@ static Property virtio_balloon_properties[] =3D { VIRTIO_BALLOON_F_DEFLATE_ON_OOM, false), DEFINE_PROP_BIT("free-page-hint", VirtIOBalloon, host_features, VIRTIO_BALLOON_F_FREE_PAGE_HINT, false), + DEFINE_PROP_BIT("free-page-reporting", VirtIOBalloon, host_features, + VIRTIO_BALLOON_F_REPORTING, true), /* QEMU 4.0 accidentally changed the config size even when free-page-h= int * is disabled, resulting in QEMU 3.1 migration incompatibility. This * property retains this quirk for QEMU 4.1 machine types. diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-= balloon.h index 3ca2a78e1aca..ac4013d51010 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -42,7 +42,7 @@ enum virtio_balloon_free_page_hint_status { =20 typedef struct VirtIOBalloon { VirtIODevice parent_obj; - VirtQueue *ivq, *dvq, *svq, *free_page_vq; + VirtQueue *ivq, *dvq, *svq, *free_page_vq, *rvq; uint32_t free_page_hint_status; uint32_t num_pages; uint32_t actual;