From nobody Sun May 12 09:21:34 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=1561976812; cv=none; d=zoho.com; s=zohoarc; b=cJ6GAuEk+7PSfJAcv2JOABKgqBQAAjvD2b/Y9CWaMrMCrR0snImXFpBaibBHbut87JawklmbPi+J//Z3/991kBNCzX/qoJgoasrndMWHP97+aUjoErwvnVIZPhWFNOzCz1kTVaV3opEjK8tII9cOemdFPmCknkmN9EdjIwRr8t4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561976812; 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=C9fICkXZqMS0TLH2klnQFrCD1iIo8lmzIPyw2QKyb8M=; b=PiEQi6jZHbtzHW7kf0v8dFVYXg9lxEzO9E1ZgflqEM6SOAsQt669++P89D9IEIG+Iz1ko4NcefxJ1N8q9wgM0PodgXC3iHEJlhqjOZG6TkTaKv3MQPz4M/9UZpj1PJ0JGMXRSVqcJibFQ0+02RO4itGDLA3/DTzSh8q4hypodcE= 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 1561976812116964.3586024841431; Mon, 1 Jul 2019 03:26:52 -0700 (PDT) Received: from localhost ([::1]:56864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhtWM-0001cK-LY for importer@patchew.org; Mon, 01 Jul 2019 06:26:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33195) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhtV2-0000sz-Ct for qemu-devel@nongnu.org; Mon, 01 Jul 2019 06:25:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhtV1-0006Ow-AM for qemu-devel@nongnu.org; Mon, 01 Jul 2019 06:25:28 -0400 Received: from mga04.intel.com ([192.55.52.120]:65182) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hhtUx-0006JA-LQ for qemu-devel@nongnu.org; Mon, 01 Jul 2019 06:25:25 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jul 2019 03:25:17 -0700 Received: from henry-optiplex-7050.bj.intel.com ([10.238.156.132]) by fmsmga001.fm.intel.com with ESMTP; 01 Jul 2019 03:25:16 -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,439,1557212400"; d="scan'208";a="184222137" From: hang.yuan@linux.intel.com To: qemu-devel@nongnu.org Date: Mon, 1 Jul 2019 18:15:29 +0800 Message-Id: <1561976129-31086-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: 192.55.52.120 Subject: [Qemu-devel] [PATCH v2] 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 v2: fix coding style problems Signed-off-by: Hang Yuan --- target/i386/hax-mem.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/target/i386/hax-mem.c b/target/i386/hax-mem.c index 6bb5a24917..a8bfd37977 100644 --- a/target/i386/hax-mem.c +++ b/target/i386/hax-mem.c @@ -175,13 +175,10 @@ 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 --=20 2.21.0