From nobody Thu May 2 18:45:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; spf=pass (zoho.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=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1561539028; cv=none; d=zoho.com; s=zohoarc; b=M6ordIa6Rog3ugJXNehpSDEUmGe0wXm47MfR/wefhtTLOEv/pTFcg+XW1BlBjevwsOnZsL/o5kXa/uEn0MpFJ4jVuyttc+lych3ER2G0gkk8xrPvNWHLMiq5x2VY1+opKngdbdKPq04qegQ/7AsajhGyS9I3xfCJaTu0kPZem6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561539028; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=BGDTovCJUgBGw0ILShAPMcO5QMVyZJFuaYn5f6Kuxh4=; b=BemYBwxME8H3TygMWuDEkfUAh+b4AFz4LWneBoWBx5u69SN2WYNScHmRYxpMSgOGG54IqzDw0uKNSMK5jQEnaIN3oPs0KTatuEQ4wYi++LZOLVsw+6Cey2nS6u+PhosOLe8OghDxhSPpIi1xF9cnAMIvN68oMy64eS4W+7mXpcA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1561539028191106.0906801107111; Wed, 26 Jun 2019 01:50:28 -0700 (PDT) Received: from localhost ([::1]:37716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hg3dL-0004nz-AA for importer@patchew.org; Wed, 26 Jun 2019 04:50:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42488) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hg18U-0002Wi-Hb for qemu-devel@nongnu.org; Wed, 26 Jun 2019 02:10:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hg18Q-0005LD-18 for qemu-devel@nongnu.org; Wed, 26 Jun 2019 02:10:24 -0400 Received: from mga07.intel.com ([134.134.136.100]:34941) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hg18M-0004wF-1z for qemu-devel@nongnu.org; Wed, 26 Jun 2019 02:10:20 -0400 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2019 23:10:03 -0700 Received: from henry-optiplex-7050.bj.intel.com ([10.238.156.132]) by orsmga005.jf.intel.com with ESMTP; 25 Jun 2019 23:10:02 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,418,1557212400"; d="scan'208";a="337098619" From: hang.yuan@linux.intel.com To: qemu-devel@nongnu.org Date: Wed, 26 Jun 2019 14:00:15 +0800 Message-Id: <1561528815-4912-1-git-send-email-hang.yuan@linux.intel.com> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.100 X-Mailman-Approved-At: Wed, 26 Jun 2019 04:46:31 -0400 Subject: [Qemu-devel] [PATCH] target/i386: HAX: Enable ROM/ROM device memory region support 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: Hang Yuan Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Hang Yuan Add ROM and ROM device memory region support in HAX. Their memory region is read only and write access will generate EPT violation. The violation will be handled in the HAX kernel with the following patch. https://github.com/intel/haxm/commit/33ceea09a1655fca12c47f1e112b1d269357ff= 28 Signed-off-by: Hang Yuan --- target/i386/hax-mem.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/i386/hax-mem.c b/target/i386/hax-mem.c index 6bb5a24917..685e88cb45 100644 --- a/target/i386/hax-mem.c +++ b/target/i386/hax-mem.c @@ -175,15 +175,11 @@ static void hax_process_section(MemoryRegionSection *= section, uint8_t flags) uint64_t host_va; uint32_t max_mapping_size; =20 - /* We only care about RAM and ROM regions */ - if (!memory_region_is_ram(mr)) { - if (memory_region_is_romd(mr)) { - /* HAXM kernel module does not support ROMD yet */ - warn_report("Ignoring ROMD region 0x%016" PRIx64 "->0x%016" PR= Ix64, - start_pa, start_pa + size); - } + /* We only care about RAM/ROM regions and ROM device */ + if (memory_region_is_rom(mr) || (memory_region_is_romd(mr))) + flags |=3D HAX_RAM_INFO_ROM; + else if (!memory_region_is_ram(mr)) return; - } =20 /* Adjust start_pa and size so that they are page-aligned. (Cf * kvm_set_phys_mem() in kvm-all.c). --=20 2.21.0