From nobody Sun May 19 03:38:10 2024 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578563038; cv=none; d=zohomail.com; s=zohoarc; b=cWg8BiHqkD2KLRuqciXq+q/fXTvi9Oy0naRQ3WCOU38lDe7UuZ7rw/EH0iJDGQw5a2+975cu6sTJyTgtkNSzf78R+GX+IcMLhStrASSAR27S92FuGPMJBuGDMoKhom4CP2BB9Ln+RGcS7IB+mAoqe4SJh6Gc3kanh6NPrgTjl6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578563038; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=9HunfxuiwkdWwxS85akSuSigAnmPoWzb6MKVNjBibIE=; b=XQuAQA+kUjFk1uyGgF5Gl5A/ebRBiy06Q9nE1uxUAg8f244OateiKcdMRxenlcPQY800108Ll4Hs8lpMX7ckyVx0F1Qg3uJFCID/B0q1FVgK4ELwVGt6Dj8aP37QnuUy9r9Y0vOZY6RqoFXzN29uenroirNa75mWtaZpKJwyc2M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1578563038669747.6924178517507; Thu, 9 Jan 2020 01:43:58 -0800 (PST) Received: from localhost ([::1]:57478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipUM9-00019Y-Gw for importer@patchew.org; Thu, 09 Jan 2020 04:43:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37149) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipUJe-0005qs-0Q for qemu-devel@nongnu.org; Thu, 09 Jan 2020 04:41:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipUJc-0006Ht-Hz for qemu-devel@nongnu.org; Thu, 09 Jan 2020 04:41:21 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:38436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipUJc-0006CL-81 for qemu-devel@nongnu.org; Thu, 09 Jan 2020 04:41:20 -0500 Received: by mail-wr1-x441.google.com with SMTP id y17so6646785wrh.5 for ; Thu, 09 Jan 2020 01:41:20 -0800 (PST) Received: from donizetti.lan ([2001:b07:6468:f312:c6d:4079:b74c:e329]) by smtp.gmail.com with ESMTPSA id g18sm2138894wmh.48.2020.01.09.01.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 01:41:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9HunfxuiwkdWwxS85akSuSigAnmPoWzb6MKVNjBibIE=; b=lz5hzgJoz17g6ofXpwEcgGRNKmxBEV9tTyzyJGxDgcjwSa3p7q1jn4nug2dmC6liZx 5cKnInOwVmqOQmTptccEXbwENisO0YLhi/A7WDT6wx+VbAOLMb/RNR0pe04Qb2iut8SR +SRX2jl77/zdDGuRxOkC8JgHeA9/3fUJPsXAtF8KNlo5fXuXh6M9xKnAyqgjp1FClwAd bO1PHX1849MW9/bGirGDIiMsrar48C/jj1Fcro6qU4dzcNQJl0A2+5GvG6kkhFMjUFqd x6CsxbJpY7rSUg77yVISn9uyCCSIfaGuNy7uezIf/WYgh43zMZva/filRuA94DlsI8px u6gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=9HunfxuiwkdWwxS85akSuSigAnmPoWzb6MKVNjBibIE=; b=It640TUp+SVCFoxcesdxx5SMWcKXztU+Qp1O+EKV+FME7VkaRAmXTOSEbZU/YXUSua Z9Pg5ahJWmUUEu/eXkBHvMXdDUU3Q+m1Xsl0EGfB6nRz1UJq0MjhvP4WEj2MnOR3/Xhy qPdRXQfw29r9KdDc2HjaTz4nsCqROdsGVSEsGuw+2K1ewD351y6cvpleWOHscaxEk016 Dzt3wbNvo6QIC4mu2db0KqsCDTD3oTBc3I2xROTFlgX9xL0rJw2q2eEWJc4vowrs2Ian hGmRFsKjFnrD+6EovCSH4kHw61bxDqUjsC43sQl68QVZuvROzBHwMFS09agKeLlhUVgY 3yIg== X-Gm-Message-State: APjAAAUcimDdPuqrO5OMAdAHVRY7i2h9+KM20Uryg9q+y9mvSkB2sMbx 7TO32vXCxnnoxivOWcZw1Yt2FQ3M X-Google-Smtp-Source: APXvYqymkDPuSU4unKcsEyWcbrZ0Vai0lakR6LfKnPkhDENri8RQoutbcvsC4fDc+CWh2esHP47RbA== X-Received: by 2002:a05:6000:1142:: with SMTP id d2mr9266107wrx.253.1578562878555; Thu, 09 Jan 2020 01:41:18 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH] hyperv: set priority for SynIC pages Date: Thu, 9 Jan 2020 10:41:17 +0100 Message-Id: <20200109094117.16237-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 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: Vitaly Kuznetsov , "Dr . David Alan Gilbert" , Roman Kagan Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" On PC systems, system memory is organized like this: - priority -1 is the PCI BARs - priority 0 is the RAM - priority 1 pokes holes in RAM whenever PCI BARs should appear instead (for example due to SMRAM or PAM configuration), plus it contains RAM regions in RAM mode (again toggled by PAM configuration). (SMRAM for CPUs in SMM has "infinite" priority since it is added in a completely different address space). SynIC memory regions are overlaid on top of memory, so they should have the highest priority except for SMRAM. Implement this by giving them priority 2. Cc: Dr. David Alan Gilbert Cc: Vitaly Kuznetsov Cc: Roman Kagan Signed-off-by: Paolo Bonzini --- hw/hyperv/hyperv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/hyperv/hyperv.c b/hw/hyperv/hyperv.c index da8ce82725..dc8d3b31c3 100644 --- a/hw/hyperv/hyperv.c +++ b/hw/hyperv/hyperv.c @@ -53,8 +53,8 @@ static void synic_update(SynICState *synic, bool enable, &synic->msg_page_mr); } if (msg_page_addr) { - memory_region_add_subregion(get_system_memory(), msg_page_addr, - &synic->msg_page_mr); + memory_region_add_subregion_overlap(get_system_memory(), msg_p= age_addr, + &synic->msg_page_mr, 2); } synic->msg_page_addr =3D msg_page_addr; } @@ -64,8 +64,8 @@ static void synic_update(SynICState *synic, bool enable, &synic->event_page_mr); } if (event_page_addr) { - memory_region_add_subregion(get_system_memory(), event_page_ad= dr, - &synic->event_page_mr); + memory_region_add_subregion_overlap(get_system_memory(), event= _page_addr, + &synic->event_page_mr, 2); } synic->event_page_addr =3D event_page_addr; } --=20 2.21.0