From patchwork Sat Mar 23 19:09:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160986 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2195584jan; Sat, 23 Mar 2019 12:44:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyk9Fruqsvw5VXjiNtw8A/GUC3LiPMIrd283EvbL1r1e7sU5ZueobneCDICiNVlDtRfrBcu X-Received: by 2002:a81:99c7:: with SMTP id q190mr13688991ywg.398.1553370255017; Sat, 23 Mar 2019 12:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553370255; cv=none; d=google.com; s=arc-20160816; b=ywTRfHApz09rxDLMwsIvJHkPbBqD9LqzwGuwkRJqfYmJSORzr0dhBBMFwJ1agrRMC6 I+tHPU4N4NMwuEaB6rgfvTKvwVOxQd45uiarfvukFzxpHxmLDwG2Xn047tVq1UznVdx3 +jKaJa8IBVYjFdbgnhVAXXAUUcaB8OD3AKvcp6caM2gOeA9IsfAqhWqa89+LYKDPeM+9 bphEExZw159IbPpDgdl85CCFewYapCEdAvhiydvimy+JlZFL97BjhwS+3EKjG9wMazv/ CaeUT5Ltux8TuBUFVfx1haNmJDD7WrGO9RRVZdIurbA/rBf2oZ8MLFPgt+GF6iCNiBex 1h2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=9N4JQEw/elYxz2Oh0lSdtSn4NJfOrq4X60hEWwPS5Ew=; b=qGnggTcsjbTsNTxGSLhKUAE5fPeXHelt7lv78OAZp1oVQeCCBuU16y495IAmqKLulm OSJ7Ef37Mna8jHm4SNpGFNCEgFEgp+7EMtvnpX0138RM5x6brxYnfuByfk/zu1SFWXJr 30zqcI8R7mGwy0HUpVU6VHK3KUABIufZXuZH2VDXSqdVDUVb5GrznVbpzsiNGeUV29Xz Eb49uDELRH1w6pKTgEOujMEMQJCsOt+nvjCJFhfGzE4h/fxaBCHymK7RvgeGpBusBkTE F4QzjYXuUmQfQnjRdeYJcbS0MHS5QcHICIg2a44reNGQN7EqI0DkTvMqb/ECAQFOxPLC KDJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fWtjMkfC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 63si6410376ybp.293.2019.03.23.12.44.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Mar 2019 12:44:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fWtjMkfC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:47211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7mYw-0007gn-FZ for patch@linaro.org; Sat, 23 Mar 2019 15:44:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7mG8-0007mr-AL for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:24:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7m1Y-0006rm-3j for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:09:45 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:40810) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7m1X-0006r6-RV for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:09:44 -0400 Received: by mail-pg1-x542.google.com with SMTP id u9so3695440pgo.7 for ; Sat, 23 Mar 2019 12:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=9N4JQEw/elYxz2Oh0lSdtSn4NJfOrq4X60hEWwPS5Ew=; b=fWtjMkfCNvE2kcyxfKnzqKxoPYGDvUNhhRIkwn70IOo3oQay2sFR8UJWKrD6jaHgH3 l/8KOErbni1jg0Ov6L5xiqg5wFWZx2bpHWy1uGJzQkRW39pUa/5KTn0MvIFdvbmEpDPz d9rM5SRZ0AlWN0VCnBuQWdlfvYTsEOZcWQdppGRUf2YtN6s2N0gmtRkqFZq9gdsr5TXe V448vPwHNiJwJKBAYOfs6krmSb21Gg2ow7QZGrbc8SamLX4sWmjlWZy+TUEjqWfrQZzn OhLfy5YF1IlpvL4UTzwVUm9Orm0bEU27/yxLhTJgqspZ/FugsVJ3VaPJqJj05FQDuB29 V/dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9N4JQEw/elYxz2Oh0lSdtSn4NJfOrq4X60hEWwPS5Ew=; b=YSSmwYRZIyf0lQHhkk9UabOguB/do6fOKzrV2SuZSabMIfaUg1WRKAPaJeoS9WPuWL SknKklUzGwYPXbmsCqKfJWz+yqj8b7DMp/ITWDV7TPNy/MuXdgcIqqChKQKDmHMGsPaj DtLiGa1Fuaefd/3cp2EBlxRUyVXUxpg0SkSNO0iqaGWrSIofa7HlTyepV+bM2j+/rE3d 3Hp5BXpaFQ06nlPqEgOq0Z7pjUOIeErp6wIGArrZibAOodS5/HeCbNugbhzvdZibIsI2 C1Kc8c68Dk9bGEuSSOttw/HbFpYL0m5O0ezhEMGY+WsCfMsclwPyVxRrw++/5GTqjSl/ aNeg== X-Gm-Message-State: APjAAAVWW09xwR91SG1EIDiowF2b9BTIjR/0aSBWfekhT189ihhe8dRE NaEZyDrEKa1YUSKf5UItyN9ZUzcXJ2Y= X-Received: by 2002:a17:902:274a:: with SMTP id j10mr16217602plg.277.1553368182559; Sat, 23 Mar 2019 12:09:42 -0700 (PDT) Received: from localhost.localdomain (174-21-5-201.tukw.qwest.net. [174.21.5.201]) by smtp.gmail.com with ESMTPSA id h184sm25990703pfc.78.2019.03.23.12.09.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 12:09:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 23 Mar 2019 12:09:01 -0700 Message-Id: <20190323190925.21324-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190323190925.21324-1-richard.henderson@linaro.org> References: <20190323190925.21324-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 Subject: [Qemu-devel] [PATCH 11/35] target/hppa: Use env_cpu, env_archcpu X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Combined uses of CPU(hppa_env_get_cpu()) were failures to use the more proper, ENV_GET_CPU macro, now replaced by env_cpu. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 5 ----- linux-user/hppa/cpu_loop.c | 2 +- target/hppa/helper.c | 3 +-- target/hppa/int_helper.c | 4 ++-- target/hppa/mem_helper.c | 10 ++++------ target/hppa/op_helper.c | 8 +++----- 6 files changed, 11 insertions(+), 21 deletions(-) -- 2.17.1 diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 6ae73e24e4..1387066324 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -222,11 +222,6 @@ struct HPPACPU { QEMUTimer *alarm_timer; }; -static inline HPPACPU *hppa_env_get_cpu(CPUHPPAState *env) -{ - return container_of(env, HPPACPU, env); -} - #define ENV_OFFSET offsetof(HPPACPU, env) typedef CPUHPPAState CPUArchState; diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 880955fdef..9915456a1d 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -105,7 +105,7 @@ static abi_ulong hppa_lws(CPUHPPAState *env) void cpu_loop(CPUHPPAState *env) { - CPUState *cs = CPU(hppa_env_get_cpu(env)); + CPUState *cs = env_cpu(env); target_siginfo_t info; abi_ulong ret; int trapnr; diff --git a/target/hppa/helper.c b/target/hppa/helper.c index ac750b62ef..eb5047037e 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -70,8 +70,7 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) /* If PSW_P changes, it affects how we translate addresses. */ if ((psw ^ old_psw) & PSW_P) { #ifndef CONFIG_USER_ONLY - CPUState *src = CPU(hppa_env_get_cpu(env)); - tlb_flush_by_mmuidx(src, 0xf); + tlb_flush_by_mmuidx(env_cpu(env), 0xf); #endif } } diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index 8d5edd3a20..89241c31e7 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -77,7 +77,7 @@ void HELPER(write_eirr)(CPUHPPAState *env, target_ureg val) { env->cr[CR_EIRR] &= ~val; qemu_mutex_lock_iothread(); - eval_interrupt(hppa_env_get_cpu(env)); + eval_interrupt(env_archcpu(env)); qemu_mutex_unlock_iothread(); } @@ -85,7 +85,7 @@ void HELPER(write_eiem)(CPUHPPAState *env, target_ureg val) { env->cr[CR_EIEM] = val; qemu_mutex_lock_iothread(); - eval_interrupt(hppa_env_get_cpu(env)); + eval_interrupt(env_archcpu(env)); qemu_mutex_unlock_iothread(); } #endif /* !CONFIG_USER_ONLY */ diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index c9b57d07c3..77d5cb6c42 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -55,7 +55,7 @@ static hppa_tlb_entry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) static void hppa_flush_tlb_ent(CPUHPPAState *env, hppa_tlb_entry *ent) { - CPUState *cs = CPU(hppa_env_get_cpu(env)); + CPUState *cs = env_cpu(env); unsigned i, n = 1 << (2 * ent->page_size); uint64_t addr = ent->va_b; @@ -324,7 +324,7 @@ static void ptlb_work(CPUState *cpu, run_on_cpu_data data) void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) { - CPUState *src = CPU(hppa_env_get_cpu(env)); + CPUState *src = env_cpu(env); CPUState *cpu; trace_hppa_tlb_ptlb(env); run_on_cpu_data data = RUN_ON_CPU_TARGET_PTR(addr); @@ -341,17 +341,15 @@ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) number of pages/entries (we choose all), and is local to the cpu. */ void HELPER(ptlbe)(CPUHPPAState *env) { - CPUState *src = CPU(hppa_env_get_cpu(env)); trace_hppa_tlb_ptlbe(env); memset(env->tlb, 0, sizeof(env->tlb)); - tlb_flush_by_mmuidx(src, 0xf); + tlb_flush_by_mmuidx(env_cpu(env), 0xf); } void cpu_hppa_change_prot_id(CPUHPPAState *env) { if (env->psw & PSW_P) { - CPUState *src = CPU(hppa_env_get_cpu(env)); - tlb_flush_by_mmuidx(src, 0xf); + tlb_flush_by_mmuidx(env_cpu(env), 0xf); } } diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 952e97a7d7..04d23c1b22 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -29,8 +29,7 @@ void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp) { - HPPACPU *cpu = hppa_env_get_cpu(env); - CPUState *cs = CPU(cpu); + CPUState *cs = env_cpu(env); cs->exception_index = excp; cpu_loop_exit(cs); @@ -38,8 +37,7 @@ void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp) void QEMU_NORETURN hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t ra) { - HPPACPU *cpu = hppa_env_get_cpu(env); - CPUState *cs = CPU(cpu); + CPUState *cs = env_cpu(env); cs->exception_index = excp; cpu_loop_exit_restore(cs, ra); @@ -630,7 +628,7 @@ target_ureg HELPER(read_interval_timer)(void) #ifndef CONFIG_USER_ONLY void HELPER(write_interval_timer)(CPUHPPAState *env, target_ureg val) { - HPPACPU *cpu = hppa_env_get_cpu(env); + HPPACPU *cpu = env_archcpu(env); uint64_t current = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); uint64_t timeout;