Message ID | 20210818191920.390759-11-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp970989jab; Wed, 18 Aug 2021 12:31:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJximiGtSGKlAN7hY+O3PCfn10AUVjW6HdNAkFSmpnZHdr5MWIHL8UmP4Q9h6sLViELwRsk+ X-Received: by 2002:a17:906:a382:: with SMTP id k2mr11315943ejz.454.1629315070461; Wed, 18 Aug 2021 12:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629315070; cv=none; d=google.com; s=arc-20160816; b=YxhbwIYL7EfJBplxuJjAzPaz155JKT+0RSfmdiIkbWDf8U8XQHqZupWrqWjdQ0Ko+Y 63bxoFxLge9UVfmXlUe2d1BDSySXxmH5WaICZDkK4v2iuXDcAhVBcGkAt1tKpemZ7nrf 3w2+aiIJupXyANpeL0YY9nrHh89/XFeo/LcDvpYNBK5cytMQAKK4J1olf4O5qwuxZE4z ZqzjHzWtwqTDCbQ+iLiojoz33Shz4XjlLpglWr+eyuNkod+0tqUjBI6GPcwZK82H4N3b QNQmzvEvZL8aH2eusR35sts9Ioy+r2fM9i7GkHZQOLG7ovES9yRnm4v5wxgnqgmeC9J0 4/Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/Z52jqMahW7nYTfuwDqraaBizHHqXiMT/VaDEwV5Efo=; b=z8pR4gUktOEP4hLEzVc/PIHxYaksuN4HNJsEZ1EHGpcaZqjhclyWIuPiEiJKWAp/wA NKjXYmZ1bGXtMsbsEZ7LW/krOWDXm7vp+OySKVq1rGT2HM46Hi9Oi4+WuzJEiV1ZciEt OOdyRgh+akcSf5s42W81slK597GW9zeXHIrlaje71PLh740pXSjVrZGxwUvi0KIyXtcV qRlHrED1ozrgNG2lc7T/0my2033JtiKZg8f7Q5Fu0m0POqki7XR0Hh4iYAwFh9CGUreD HRE/xPxjGSd1ynh0TI0PdWTzlDSt3bG49ExjJf6nDCzysRNCTei9aG3xOr/WaI+mElo1 yOQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xbIrwcNJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l17si777840ejn.343.2021.08.18.12.31.10 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Aug 2021 12:31:10 -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=pass header.i=@linaro.org header.s=google header.b=xbIrwcNJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1mGRHJ-0006Gh-Av for patch@linaro.org; Wed, 18 Aug 2021 15:31:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1mGR6B-0000GG-HS for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:19:39 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:33386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1mGR68-0008Qb-Oy for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:19:39 -0400 Received: by mail-pg1-x529.google.com with SMTP id c17so3316914pgc.0 for <qemu-devel@nongnu.org>; Wed, 18 Aug 2021 12:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/Z52jqMahW7nYTfuwDqraaBizHHqXiMT/VaDEwV5Efo=; b=xbIrwcNJ1V/kEMd7kGaQls5ij5Jln7gfOszv5nuiGbAE5X/352ozSaPvP22YvcyFWu Rp2hLZbT+rFrRHetLioIdcsAQ0f4VBvCUuTkNqO0ytkMC98L6NHQm9F/BmrHlZ6cf9/D jvejx92Jve+d5Vgb9Ll0nQQh7L0VHAmZE04D40ash/NY/BCoT82uwlrQ4OQ4RBBQI9e+ ltLgS+jPrpy0oPIDZ+nzaFkth8SJ1yGAVPNfgULYNzTss4i+4WL8/wYC2JWTl47MqTM5 xU01WMIU4w7iWqahIZRV47ijIgBcYBxyvm5RZ+1XHpvR9yeXzD+suXk9IT9eaYmd/mD8 nzNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Z52jqMahW7nYTfuwDqraaBizHHqXiMT/VaDEwV5Efo=; b=NPQzHUvPwKQByw4lOXcvDbhnkSks0Md9dJcvdVSjvLCtxCYwu38JBZXtSZgOhvZ39T YB+3iD5cJ+KXe3tC1qW4wEWY8eTiIYikES8S24C38PE5RdKuEIm76gjlzI/QqC8/h/G6 749CrqUI9ex5xrRkKB1GMzYO4TdXK2gouQog+mmy4JDjoQVzxh/nNe4X8qSj8vgnvqC+ yNdAMa2Wzq+kdkv2oyH2x/V4/R8566khY8OVjbiHJBziqlt3AKNaNVAHmJT87Hu2HVX6 K/9esu7BZTS1NyRh+5zcxET8oVIoOfYDLSxWL/AFus02M2vUyb3QkPmHRorj2NKzibxw veaA== X-Gm-Message-State: AOAM531G/GHeqy0tpBh5cBCSKgUX6hW4sG3BrXsH/LsaotL2hanT82LY wEKKDvsGWmdZc+09gKFLbXnuKbJ5k00mTw== X-Received: by 2002:a65:51c8:: with SMTP id i8mr6625299pgq.451.1629314375410; Wed, 18 Aug 2021 12:19:35 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id a6sm524108pjs.40.2021.08.18.12.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 12:19:35 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH v3 10/66] target/ppc: Set fault address in ppc_cpu_do_unaligned_access Date: Wed, 18 Aug 2021 09:18:24 -1000 Message-Id: <20210818191920.390759-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818191920.390759-1-richard.henderson@linaro.org> References: <20210818191920.390759-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: qemu-ppc@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
Unaligned access for user-only
|
expand
|
On Wed, 18 Aug 2021 at 20:33, Richard Henderson <richard.henderson@linaro.org> wrote: > > We ought to have been recording the virtual address for reporting > to the guest trap handler. > > Cc: qemu-ppc@nongnu.org > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > target/ppc/excp_helper.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c > index 0df358f93f..d7743704ac 100644 > --- a/target/ppc/excp_helper.c > +++ b/target/ppc/excp_helper.c > @@ -1504,6 +1504,20 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, > { > CPUPPCState *env = cs->env_ptr; > > + switch (env->mmu_model) { > + case POWERPC_MMU_SOFT_4xx: > + case POWERPC_MMU_SOFT_4xx_Z: > + env->spr[SPR_40x_DEAR] = vaddr; > + break; > + case POWERPC_MMU_BOOKE: > + case POWERPC_MMU_BOOKE206: > + env->spr[SPR_BOOKE_DEAR] = vaddr; > + break; > + default: > + env->spr[SPR_DAR] = vaddr; > + break; > + } > + > cs->exception_index = POWERPC_EXCP_ALIGN; > env->error_code = 0; > cpu_loop_exit_restore(cs, retaddr); > -- Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 0df358f93f..d7743704ac 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1504,6 +1504,20 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, { CPUPPCState *env = cs->env_ptr; + switch (env->mmu_model) { + case POWERPC_MMU_SOFT_4xx: + case POWERPC_MMU_SOFT_4xx_Z: + env->spr[SPR_40x_DEAR] = vaddr; + break; + case POWERPC_MMU_BOOKE: + case POWERPC_MMU_BOOKE206: + env->spr[SPR_BOOKE_DEAR] = vaddr; + break; + default: + env->spr[SPR_DAR] = vaddr; + break; + } + cs->exception_index = POWERPC_EXCP_ALIGN; env->error_code = 0; cpu_loop_exit_restore(cs, retaddr);
We ought to have been recording the virtual address for reporting to the guest trap handler. Cc: qemu-ppc@nongnu.org Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/ppc/excp_helper.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.25.1