From patchwork Thu Jun 5 14:22:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 356452 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1589E14008F for ; Fri, 6 Jun 2014 00:31:29 +1000 (EST) Received: from localhost ([::1]:41671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsYhS-0002RP-Fl for incoming@patchwork.ozlabs.org; Thu, 05 Jun 2014 10:31:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsYZI-0007Bz-JB for qemu-devel@nongnu.org; Thu, 05 Jun 2014 10:23:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsYZ8-00005X-N5 for qemu-devel@nongnu.org; Thu, 05 Jun 2014 10:23:00 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:61475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsYZ8-00005B-EA for qemu-devel@nongnu.org; Thu, 05 Jun 2014 10:22:50 -0400 Received: by mail-wi0-f175.google.com with SMTP id f8so10607153wiw.2 for ; Thu, 05 Jun 2014 07:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=vvo6rwy/0l3HkZtcT5OPza/NEP9rwNTQcp6gsT8cMac=; b=YTDdIVFGUZ0+n+kj9jnwSej/Cl6W9UXMJBJEWPJ/jgXzwcHufZXn/hGxULwXeABV0f bw2PpX1/odaUPpIb1XL/7uKy/6pqtDOdauJRt/+HTIhOUTRQQIqJr/qwWEBbEFMNIaWB YF6kM6P0IM39oGOL3+KOIp0itQ1QzZ7CPhhPBMAQlLUdwb+LBrC48OSBifamdn0HNKmx ffaiVZP/pkKt2ygPXrtr1ix86B7bqVClWDNf4tZK65m84auynMI/tkqlxfMO1vMMWkVI vkb4fcPQHQ4w4jITLKDA7KZsF0kGAXCOjaaGrkDRSqwdLknmxUYi9KPsf87OQXa0aahW aopA== X-Received: by 10.15.54.66 with SMTP id s42mr532880eew.38.1401978168367; Thu, 05 Jun 2014 07:22:48 -0700 (PDT) Received: from playground.station (net-37-117-132-7.cust.vodafonedsl.it. [37.117.132.7]) by mx.google.com with ESMTPSA id p9sm14884136eeg.32.2014.06.05.07.22.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jun 2014 07:22:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 5 Jun 2014 16:22:04 +0200 Message-Id: <1401978143-11896-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1401978143-11896-1-git-send-email-pbonzini@redhat.com> References: <1401978143-11896-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22f Subject: [Qemu-devel] [PULL 14/33] target-i386: rename KSMAP to KNOSMAP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is the mode where SMAP is overridden, put "NO" in its name. Signed-off-by: Paolo Bonzini --- target-i386/cpu.h | 6 +++--- target-i386/helper.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index e9cbdab..f88b675 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -1155,15 +1155,15 @@ static inline CPUX86State *cpu_init(const char *cpu_model) /* MMU modes definitions */ #define MMU_MODE0_SUFFIX _kernel #define MMU_MODE1_SUFFIX _user -#define MMU_MODE2_SUFFIX _ksmap /* Kernel with SMAP override */ +#define MMU_MODE2_SUFFIX _knosmap /* SMAP disabled or CPL<3 && AC=1 */ #define MMU_KERNEL_IDX 0 #define MMU_USER_IDX 1 -#define MMU_KSMAP_IDX 2 +#define MMU_KNOSMAP_IDX 2 static inline int cpu_mmu_index (CPUX86State *env) { return (env->hflags & HF_CPL_MASK) == 3 ? MMU_USER_IDX : ((env->hflags & HF_SMAP_MASK) && (env->eflags & AC_MASK)) - ? MMU_KSMAP_IDX : MMU_KERNEL_IDX; + ? MMU_KNOSMAP_IDX : MMU_KERNEL_IDX; } #define CC_DST (env->cc_dst) diff --git a/target-i386/helper.c b/target-i386/helper.c index 46d20e4..88bbe65 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -654,7 +654,7 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, goto do_fault_protect; } /* fall through */ - case MMU_KSMAP_IDX: + case MMU_KNOSMAP_IDX: if (is_write1 == 2 && (env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK)) { goto do_fault_protect; @@ -716,7 +716,7 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, goto do_fault_protect; } /* fall through */ - case MMU_KSMAP_IDX: + case MMU_KNOSMAP_IDX: if (is_write1 == 2 && (env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK)) { goto do_fault_protect; @@ -771,7 +771,7 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, goto do_fault_protect; } /* fall through */ - case MMU_KSMAP_IDX: + case MMU_KNOSMAP_IDX: if (is_write1 == 2 && (env->cr[4] & CR4_SMEP_MASK) && (pde & PG_USER_MASK)) { goto do_fault_protect; @@ -828,7 +828,7 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, goto do_fault_protect; } /* fall through */ - case MMU_KSMAP_IDX: + case MMU_KNOSMAP_IDX: if (is_write1 == 2 && (env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK)) { goto do_fault_protect;