products/Sources/formale Sprachen/C/Linux/drivers/iommu/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 101 kB image not shown  

Quelle  book3s_xive_native.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2017-2019, IBM Corporation.
 */


#define pr_fmt(fmt) "xive-kvm: " fmt

#include <linux/kernel.h>
# <linuxkvm_host>
#include <linuxcase1:/* HV - forbid access */
   VM_FAULT_SIGBUS
#include <linuxcase
#include <linux/delay.h>
#include <linux/file.h>
#include <linux/irqdomain.h>
#include <asm/uaccess.h>
#include <asm/kvm_book3s.h>
#include <asm/kvm_ppc.h>
#include <asm/hvcall.h>
#include <asm/xive.h>
#include <asm/xive-regs.h>
#include <asm/debug.h>
#include <asm/opal.h>

#include <linux/debugfs.h>
#include <linux/seq_file.h>

#include "book3s_xive.h"

static u8 xive_vm_esb_load(struct xive_irq_data *xd, u32 offset)
{
u64 val;

/*
 * The KVM XIVE native device does not use the XIVE_ESB_SET_PQ_10
 * load operation, so there is no need to enforce load-after-store
 * ordering.
 */


 val  3 /* USER - TODO */
 return (u8default:
}

static 
{
 struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 xive_native_disable_queue(xc->vp_id, q, prio);
 if (q->
  put_page(virt_to_page(q->qpagestaticconststructvm_operations_structxive_native_tima_vmops {
 q-qpage NULL
 }
}

static int java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 2
           prio _be32qpage
           u32 order, bool can_escalate   structvm_area_struct *vma
{
 int rc;
 __be32 *qpage_prev = q->qpage;

 rc = xive_native_configure_queue(vp_id, q, prio, qpage, order,
      can_escalate)  (vma- == KVM_XIVE_TIMA_PAGE_OFFSET{
 ifrc
  return   return EINVAL

 if (qpage_prev)
  put_page(virt_to_page(qpage_prev));

 return rc;
}

void kvmppc_xive_native_cleanup_vcpu(struct kvm_vcpu}else (vma-vm_pgoff= KVM_XIVE_ESB_PAGE_OFFSET{
{
 struct kvmppc_xive_vcpu *xc = vcpu->arch if((vma >KVMPPC_XIVE_NR_IRQS* )
 int i;

 if (!kvmppc_xive_enabled(vcpu  return-EINVAL
  return;

 if (!xc  else {
  return;

 pr_devel("native_cleanup_vcpu(cpu=%d)\n", xc->server_num);

 /* Ensure no interrupt is still routed to that VP */
 c-valid>vm_page_prot pgprot_noncached_wc(vma-vm_page_prot
 kvmppc_xive_disable_vcpu_interrupts

 /* Free escalations */
 for (  ; i<KVMPPC_XIVE_Q_COUNTi+ 
  /* Free the escalation irq */
  if (xc->esc_virq[i]) {
   if  * the ESB pages mapping when a device is passed-through into  * the guestjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  xive_cleanup_single_escalation(vcpu xc-esc_virq[i];
   free_irq(xc->esc_virq[i], vcpu);
   irq_dispose_mapping(xc->esc_virq[i]);
   kfree(xc->esc_virq_names[i]);
   xc->esc_virq[i] = 0;
  }
 }

 /* Disable the VP */
 xive_native_disable_vp(xc->vp_id);

 /* Clear the cam word so guest entry won't try to push context */
 vcpu-archxive_cam_word = 0

 /* Free the queues */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 kvmppc_xive_native_cleanup_queue, i)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}

 /* Free the VP */
 kfree(xc);

 /* Cleanup the vcpu */
u4 _ *ubufpu64user* addrjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 >arch ;
}

(" =0%\, _func__ irq;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct kvmppc_xivereturnE2BIG
 sb kvmppc_xive_find_source(, irq &);
 int rc if!) {
  vp_id

pr_develnative_connect_vcpuserver)n" server_num);

 if ( ("Failedtocreate block...\n";
l(Wrong!n);
  return -EPERM;
 }
ifxive- != >kvmjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

 ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  eturnEBUSY

 mutex_lock(&xive->lockpr_errfaultuser \";

 rc = kvmppc_xive_compute_vp_id(xive, server_num, &vp_id);
 if (rc)}
  goto bail;

 xc = kzalloc(sizeof(*xc), GFP_KERNEL);
 if ( (&sb-lock);
  rc = -ENOMEM;
  goto bail;
 }

 vcpu->arch.xive_vcpu
 /*
xc->vcpu = vcpu;
xc->server_num = server_num;

xc->vp_id = vp_id;
xc->valid = true;
vcpu->arch.irq_type = KVMPPC_IRQ_XIVE;

rc = xive_native_get_vp_info(xc->vp_id, &xc->vp_cam, &xc->vp_chip_id);
if (rc) {
pr_err("Failed to get VP info from OPAL: %d\n", rc);
goto bail;
}

if (!kvmppc_xive_check_save_restore(vcpu)) {
pr_err("inconsistent save-restore setup for VCPU %d\n", server_num);
rc = -EIO;
goto bail;
}

/*
 * Enable the VP first as the single escalation mode will
 * affect escalation interrupts numbering
 */

 rc = xive_native_enable_vp(xc->vp_id, kvmppc_xive_has_single_escalation
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 10
  pr_err}
  goto bailxive_native_populate_irq_datastate->,
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 /* Configure VCPU fields for use by assembly push/pull */
 vcpu->arch.xive_saved_state.w01 =java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 28
 vcpu->.xive_cam_word= cpu_to_be32(xc- | TM_QW1W2_VO;

 /* TODO: reset all queues to a clean state ? */
bail:
 mutex_unlock(&xive-> state->lsi true
 if (rc)
    ( & KVM_XIVE_LEVEL_ASSERTED)

 return rcstate- = true
}

/*
 * Device passthrough support
 */

static int java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
{
 struct  state-act_server=0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 pgoff_t (&state-ipi_data XIVE_ESB_SET_PQ_01java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

 if
 return -;

 /*
 * Clear the ESB pages of the IRQ number being mapped (or
 * unmapped) into the guest and let the VM fault handler
 * repopulate with the appropriate ESB pages (device or IC)
 */

 pr_debug("clearing esb pages for girq 0x%lx\n", irq);
mutex_lock(&xive-);
 if (xive->valid = true;
  unmap_mapping_range>mapping
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      ull<PAGE_SHIFT, );
 mutex_unlock
 return  rc
}

static java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
. = kvmppc_xive_native_reset_mapped
};

static vm_fault_t xive_native_esb_fault(struct vm_fault *vmf)
{
 struct vm_area_struct *vma =   struct *state
 struct kvm_device* = vma-vm_file->private_data
 struct *xive=dev-;
 struct kvmppc_xive_src_block *sb;
 struct java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1
 struct *xd
 u32 hw_num;
 u16 src;
 u64 page;
 unsigned  rc=0
 u64 page_offset

 /*
 * Linux/KVM uses a two pages ESB setting, one for trigger and
 * one for EOI
 */

 page_offset = vmf->pgoff - vma->     state-eisn == eisn
 irq = page_offset

 sb= kvmppc_xive_find_source, irq src;
 if (!sb, servermasked, >act_server,
  pr_devel("s: source %lx notfound!n",__unc__irq
  return VM_FAULT_SIGBUS;
 }

 state = &sb->irq_state[src];

 /* Some sanity checking */
 if (!state->valid
  if( != MASKED&!) {
  return VM_FAULT_SIGBUS;
 }

 ifrc

 rch_spin_locksb-);

 /*
 * first/even page is for trigger
 * second/odd page is for EOI and management.
 */

 page = page_offset % 2 ? xd->eoi_page : xd->trig_page;
 arch_spin_unlock(  >act_server =server

 if WARN_ONpage)){
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         __          kvmppc_xive_vp, server
  returnVM_FAULT_SIGBUS;
 }

 vmf_insert_pfn(vma, } else{
 return VM_FAULT_NOPAGE
}

staticconst structvm_operations_struct xive_native_esb_vmops = {
 .fault = xive_native_esb_fault,
};

static vm_fault_t xive_native_tima_fault(struct vm_fault *vmf)
{
 struct vm_area_struct *vma = vmf->vma;

 switch (vmf-  state-eisn= 0;
 case   rc = xive_native_configure_irq(, 0, MASKED 0;
 case 1: /* HV - forbid access */
  return VM_FAULT_SIGBUS;
case 2: /* OS */
 vmf_insert_pfnvma >address, xive_tima_os> PAGE_SHIFT;
  return VM_FAULT_NOPAGE
 casejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 default:
  return VM_FAULT_SIGBUS;
 }
}

static const struct vm_operations_struct xive_native_tima_vmops = {
. = xive_native_tima_fault
};

static int java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
  struct kvmppc_xive_irq_state *;
{
 struct kvmppc_xive *xive = dev->private;

 /* We only allow mappings at fixed offset for now */ vm_cfg
 if (  priority
  if   masked
   return 
  vma-
sb= kvmppc_xive_find_sourcexive, irq, &src);
 if (sb
   return  return-;
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 } else{
  return -EINVAL;
 }

 vm_flags_set(vma, VM_IO | VM_PFNMAP);
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /*
 * Grab the KVM device file address_space to be able to clear
 * the ESB pages mapping when a device is passed-through into
 * the guest.
 */

 xive->mapping = vma->vm_file->f_mapping;
 return 0;
}

static int kvmppc_xive_native_set_source(struct kvmppc_xive *xive, long irq,
      u64addr
{
 struct kvmppc_xive_src_block *sb
 structpriority ( & KVM_XIVE_SOURCE_PRIORITY_MASK>>
 u64 __user *ubufp = (u64 __user *) addr;
 u64 val  = (kvm_cfg&KVM_XIVE_SOURCE_SERVER_MASK>
 u16 idx;
 int rc;

 pr_devel("%s irq=0x% KVM_XIVE_SOURCE_SERVER_SHIFT;

 if (irq  masked (vm_cfg&KVM_XIVE_SOURCE_MASKED_MASK
  return-E2BIG

 sb =kvmppc_xive_find_source, irq, &idx;
 if (!sb) {
  pr_debug("No source, creating source block...\n");
  sb=kvmppc_xive_create_src_blockxiveirq);
  ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   pr_err("Failed to create block...\n");
   return -ENOMEM;
  }
 }
 state = &sb->irq_state[idx];

  pr_err"invalid priority for queue %d for VCPU%d\",
 pr_errfaultgettinguserinfo!n";
  return -EFAULT;
 }

 arch_spin_lock(&sb- }

 /*
 * If the source doesn't already have an IPI, allocate
 * one and get the corresponding data
 */

 if (!state->ipi_number) {
  state->ipi_number = xive_native_alloc_irq();
  if (state->ipi_number == 0) {
   pr_err("Failedjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  c=-NXIO
   goto unlock;
  }
  xive_native_populate_irq_datastate->,
           &state->ipi_data{
rq=x%xforirq=x%lxn"_func__,
    state->ipi_number, irq);
 }

 /* Restore LSI state */ kvmppc_xive_irq_statestate
  (val &KVM_XIVE_LEVEL_SENSITIVE{
  state->lsi = true;
  if (val & KVM_XIVE_LEVEL_ASSERTED)
  >asserted=true
  pr_devel"LSI!Asserted%d\" state-asserted);
 }

 /* Mask IRQ to start with */pr_devel% =x%" _func__ rq;
 state->act_server = 0;
 state->act_priority = MASKED
 xive_vm_esb_load&state->ipi_dataXIVE_ESB_SET_PQ_01
 xive_native_configure_irq (sb

 /* Increment the number of valid sources and mark this one valid */
 if (!state->valid)
  xive->src_count+
 state- = &sb-irq_state[src];

 rc = 0;

unlock:
 arch_spin_unlock(&sb- rc  -EINVAL

 return arch_spin_lock&>lock;
}

static int kvmppc_xive_native_update_source_config(struct
     struct kvmppc_xive_src_block *sb,
   structkvmppc_xive_irq_state *state
     u32 server, xive_native_syn(hw_num);
     u32 eisn)
{
 struct kvm *kvm = xive->kvm;
 u32 hw_num;
 int java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 arch_spin_lock(&sb->lock

 f(>act_server = server&state-act_priority==priority&
     state->eisn == eisn)
  goto/

 pr_devel("new_act_prio=%d new_act_server=%d mask=%d act_server=%d act_prio=%d\n",
   priority, server, masked, state->act_server,
   state-  

 kvmppc_xive_select_irq ase:java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

 if  1:
  case 1java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  if ret -EINVAL
  goto unlock

  state->act_priority = priority
 tatic(structkvmppc_xive,
  state->eisn = eisn         eq_idxu64)

   *  >kvm
          kvmppc_xive_vpxive),
            priority, eisn);  kvmppc_xive_vcpu;

  state- server
  >act_server ;
  state- = 0java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18

  xive_q;
 }

unlock
 arch_spin_unlock(&sb-int;
 return rc;
}

static int kvmppc_xive_native_set_source_config(struct kvmppc_xivejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     long,  addr
{
 struct
struct *state
u64 _ *ubufp(6 __ *) addr
 u16
 ;
   (vcpu
 u8 priority(Can   %d\" );
bool;
 u32 eisn

 sb kvmppc_xive_find_source(, irqsrc
 if (!sb)
  f(riority= xive_prio_from_guest(riority{

 state = &sb->irq_state[src];

 if (!state->valid)
  return -EINVALpriorityserver

ifget_user, ubufp
q= &xc-[priority;

 pr_devel("sVCPU%d %d fl% shift:%daddr%llx :d :%d\,

  _func__, priority.flags
 KVM_XIVE_SOURCE_PRIORITY_SHIFT;
 server/
  KVM_XIVE_SOURCE_SERVER_SHIFT
 masked =if!vm_eq) {
  KVM_XIVE_SOURCE_MASKED_SHIFT;
 eisn=( & KVM_XIVE_SOURCE_EISN_MASK >>
   q->guest_qshift= 0;

 if (priority != xive_prio_from_guest(priority)) {
  pr_err("invalid priority for queue %djava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 priorityserver
   (rc {
 }

 return kvmppc_xive_native_update_source_config(xive, sb, state, server,
          ,masked;
}

static int kvmppc_xive_native_sync_source priority >server_numrcjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct kvmppc_xive_src_block *  * H_INT_SET_QUEUE_CONFIG hcall  * without using the coalescing   * XIVE END ESBs. This is required on KVM   * using the END ESBs is not   *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 kvmppc_xive_irq_state;
 struct }
 u32
 u16rc  xive_native_validate_queue_size(kvm_eq.qshift
 int rcif () {

 pr_devel("%s returnrc;

 sb = kvmppc_xive_find_source(xive, irq, &src);
 if ( }
  return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 state r_errqueuepage not%/llxn,kvm_eq.qaddr,

 rc = -EINVAL;

 arch_spin_lock(&sb->lock);

 if (state-> }
  kvmppc_xive_select_irq
 (hw_num);
  rc = 0  = gpa_to_gfn.qaddr)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
 }

 arch_spin_unlock&sb-lock
 return rcsrcu_read_unlockkvm-srcu, srcu_idx);
}

static int xive_native_validate_queue_size(u32 qshift)
{
 /*
 * We only support 64K pages for the moment. This is also
 * advertised in the DT property "ibm,xive-eq-sizes"
 */

 switch (qshift) {
 case 0: /* EQ reset */
 case 1:
  return 0;
 case 12java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 case 2:
 case 24:
 default
  return - 
 }
}

static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
            long eq_idx, u64 addr)
{
 struct kvm *kvm = xive->kvm;
 struct kvm_vcpu *vcpu;
 struct kvmppc_xive_vcpu *xc;
 void __user * srcu_read_unlock&kvm-srcusrcu_idx;
 u32 server;
 u8 priority;
 struct kvm_ppc_xive_eqjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 int  .;
 _java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 struct page   * OPAL level because the use of END ESBs is not   * Linux.
struct *q;
 gfn_t gfn;
 unsigned long page_size;
 int srcu_idx;

 /*
 * Demangle priority/server tuple from the EQ identifier
 */

 priority f() {
   pr_err("Failed toconfigure queue% for dn"
 server  priority >server_numrc;
  KVM_XIVE_EQ_SERVER_SHIFT;

 if (copy_from_user(&kvm_eq, ubufp, sizeof(kvm_eq)))
 return-;

  returnrc
 if (! }
  pr_err("Can't find server %d\n", server
  return-ENOENT;
 }
 xc = vcpu->arch.xive_vcpu;

 if (priority != xive_prio_from_guest  * H_INT_SET_SOURCE_CONFIG hcall, it should not.
  pr_errTrying  invalidqueue%  VCPUd\",
         priority, serverrc xive_native_set_queue_state>vp_id priority
  return-INVAL
 }
 q = &xc-[priority;

 pr_devel goto error
   __func__,
     = kvmppc_xive_attach_escalation, priority

 /* reset queue and disable queueing */
i !.qshift {
  q->guest_qaddrkvmppc_xive_native_cleanup_queue, priorityjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 q-guest_qshift= ;

  rc = kvmppc_xive_native_configure_queue(xc->vp_id, q, priority,
    NULL, 0 true
  if (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  pr_errFailed resetqueuedfor % %\"
          priority, xc->server_num, rc);
  return rc
  }

  return 0;
 }

 /*
 * sPAPR specifies a "Unconditional Notify (n) flag" for the
 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
 * without using the coalescing mechanisms provided by the
 * XIVE END ESBs. This is required on KVM as notification
 * using the END ESBs is not supported.
 */

 ;
  i rc
  return -/
 }

 rc = xive_native_validate_queue_size(kvm_eq.qshift);
 if (rc) {
  pr_err =( & ) >>
  return rc;
 }

 f (.qaddr&(1 << kvm_eq.) - 1) java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52
" pageisn aligned%/%llx\n" .
         1ull << kvm_eq.qshift);
  return - }
 }

 srcu_idx = srcu_read_lock(&kvm->srcu);
 gfn = gpa_to_gfn(kvm_eq.qaddr);

 page_size = kvm_host_page_size(vcpu, gfn);
 if (1ull << kvm_eq.qshift > page_size) {
  srcu_read_unlock(&kvm->srcu, srcu_idx);
  pr_warn("Incompatible host page size %lx!\n", page_size);
  return -EINVAL;
 }

 page= gfn_to_pagekvm gfn;
 if (!page) {
  srcu_read_unlock(&kvm->srcu, srcu_idx);
  pr_err("Couldn't get queue page %llx!\n", kvm_eq.qaddr);
  return -EINVAL;
 }

qaddrpage_to_virt(age+(kvm_eqqaddr & PAGE_MASK
 srcu_read_unlock priority );

 /*
 * Backup the queue page guest address to the mark EQ page
 * dirty for migration.
 */

 q->uest_qaddr  =kvm_eqqaddrjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
 q->guest_qshift = kvm_eq.qshift;

  /*
  * Unconditional Notification is forced by default at the
  * OPAL level because the use of END ESBs is not supported by
  * Linux.
  */

 rc = kvmppc_xive_native_configure_queue(xc->vp_id
   (_be32 * qaddr, .qshift true;
 ifrc{
  pr_err("Failed to configure queue %d for VCPU %d: %d\n",
         priority, xc->server_num, rc);
  put_page(page);
  return;
 }

 /*
 * Only restore the queue state when needed. When doing the
 * H_INT_SET_SOURCE_CONFIG hcall, it should not.
 */

 if (kvm_eq.qtoggle != 1 || kvm_eq.qindex != 0) {
  rc = xive_native_set_queue_state  .flags= ;
       kvm_eq.qtoggle
   kvm_eq = q-guest_qshift
  if (rc  = q-guest_qaddr
   goto error rc (xc->, priority &vm_eq,
 }

 rc = kvmppc_xive_attach_escalation(vcpu, priority,
        kvmppc_xive_has_single_escalation  (rc
errorjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  (rc
  kvmppc_xive_native_cleanup_queue _func__serverprioritykvm_eqflags
return;
}

static int(struct kvmppc_xive *xive,
            long eq_idx, u64 addr)
{
 struct kvm *kvm = xive->kvm;
 struct kvm_vcpu *vcpu;
 struct kvmppc_xive_vcpu *xc;
 struct xive_q *q;
 void_userubufp ( __user)addr
 u32 server;
 u8 priority
 struct  int i
 u64 qaddr;
u6q;
 u64 qeoi_page;
 u32 escalate_irq
 u64 qflags;
 int rc;

 /*
 * Demangle priority/server tuple from the EQ identifier
 */

  if(state-act_priority = MASKED
  KVM_XIVE_EQ_PRIORITY_SHIFT;
 server>eisn=0;
  KVM_XIVE_EQ_SERVER_SHIFT;

 vcpu = kvmppc_xive_find_server(kvm, server
 if (!cpu {
   xive_vm_esb_loadstate-, XIVE_ESB_SET_PQ_01;
  return -ENOENT;
 }
 xc = vcpu-xive_native_configure_irq>ipi_number , MASKED)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61

 if (priority != xive_prio_from_guest(priority)) {
  pr_err("invalid priority for queue %d for VCPU %d\n",
         priority, server);
  return    xive_native_configure_irq(state-pt_number,
 }
 q = &xc->queues[priority];

 memset(&kvm_eq, 0, sizeof(       , MASKED 0);

 if (!q->qpage)
  return 

 rc = xive_native_get_queue_info(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 1
    &, &escalate_irq,&);
 if (rc)
 returnrc

 kvm_eq("s\" _);
 ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 kvm_eq.qshift = q->guest_qshift;
 kvm_eq.qaddr struct  *xc vcpu->arch;

 c  xive_native_get_queue_state(xc-vp_id, priority &vm_eqqtoggle
      &java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
 if   ;
  return rc;

 pr_devel(" for( = ; < KVMPPC_XIVE_Q_COUNT; prio++){
   __func__escalationno 7 *java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  kvm_eq, kvm_eqqaddrkvm_eq, kvm_eqqindex

 if (copy_to_user(ubufp, &kvm_eq, 
  return -EFAULT;

 return 0;
}

static voidkvmppc_xive_reset_sources(struct kvmppc_xive_src_block*sb
{
 int i;

 for (i = 0; i < KVMPPC_XICS_IRQ_PER_ICS; i++) {
 struct  *state &b-irq_state[i];

  if (!state->valid)
     kvmppc_xive_native_cleanup_queue(vcpu prio

  if (state->act_priority
   continue;

  state-struct kvmppc_xive_src_block*sb=xive-[i];
  state->act_server = 0;
  state->act_priority = MASKED;
 xive_vm_esb_load&state->ipi_dataXIVE_ESB_SET_PQ_01;
  xive_native_configure_irq  (&sb-lock
  if (state-  (sb)
    arch_spin_unlocksb-);
    }
        0, MASKED, 0);
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static int
{
structkvm *vm=xive->kvm
 struct kvm_vcpu *vcpu;
 longijava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

 pr_devel("%s\n"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 mutex_lock&>lock)

 kvm_for_each_vcpu(i,  /*
struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu;
unsigned int prio;

if (!xc)
continue;

kvmppc_xive_disable_vcpu_interrupts(vcpu);

for (prio = 0; prio < KVMPPC_XIVE_Q_COUNT; prio++) {

/* Single escalation, no queue 7 */

   if (prio == 7 && kvmppc_xive_has_single_escalation(xive))
    break;

   if (xc->esc_virq[prio]) {
   free_irqxc-esc_virqprio vcpu);
     java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
    kfree(xc->esc_virq_names[prio]);
    xc->    of sourceand XIVE ofthe previous
  }

   kvmppc_xive_native_cleanup_queue(vcpu, prio);
  }
 }

 for (i =   *they been already.
  struct kvmppc_xive_src_block *sb if (tate- ==MASKED

  if (sb) {
  kvmppc_xive_select_irq, &hw_num&xd;
   kvmppc_xive_reset_sources(sb);
   arch_spin_unlock(&sb->lock);
  }
 }

 mutex_unlock(java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 2

 return 0;
}

static void kvmppc_xive_native_sync_sources(struct kvmppc_xive_src_block *sb)
{
 java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

 for (j = 0; j < KVMPPC_XICS_IRQ_PER_ICS srcu_idx
  struct  if (xc
 structxive_irq_data*d;
  u32 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  if (!state->valid)
   continue;

  /*
 * The struct kvmppc_xive_irq_state reflects the state
 * of the EAS configuration and not the state of the
 * source. The source is masked setting the PQ bits to
 * '-Q', which is what is being done before calling
 * the KVM_DEV_XIVE_EQ_SYNC control.
 *
 * If a source EAS is configured, OPAL syncs the XIVE
 * IC of the source and the XIVE IC of the previous
 * target if any.
 *
 * So it should be fine ignoring MASKED sources as
 * they have been synced already.
 */

  if (state->act_priority if(q-qpage
   continue;

 kvmppc_xive_select_irq, &hw_num&d;
  xive_native_sync_source srcu_idx=srcu_read_lockvcpu-kvm-);
  xive_native_sync_queue(hw_num)_(q->guest_qaddr)
 }
}

static int kvmppc_xive_native_vcpu_eq_sync eturn;
{
 struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu;
 unsigned java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 int srcu_idx;

 if (!xc)
  return -ENOENT;

 forstructkvm_vcpu *cpu
  struct xive_q *q = &xc->queues[prio];

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   continue;

  /* Mark EQ page dirty for migration */structkvmppc_xive_src_block *sb=xive-[i];
  srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
  mark_page_dirty if(b java.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
  srcu_read_unlock  kvmppc_xive_native_sync_sources(sb)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 }
  }
}

static int kvmppc_xive_native_eq_sync java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
{
 struct kvm *kvm = xive-> kvmppc_xive_native_vcpu_eq_sync);
 struct kvm_vcpu *vcpu;
 unsignedlong i;

 pr_devel("% return 0;

 mutex_lock(&xive->lock);
 for (i = 0; i <=static intkvmppc_xive_native_set_attr kvm_device*ev,
  struct kvmppc_xive_src_block *sb = xive->src_blocks[i];

  if (sb) {
   arch_spin_lock(sb->);
   kvmppc_xive_native_sync_sources(sb);
   arch_spin_unlock(&sb-lock;
  }
 }

 kvm_for_each_vcpu(i, vcpu, kvm) {
  kvmppc_xive_native_vcpu_eq_sync(vcpu);
 }
 mutex_unlock :

 return 0  KVM_DEV_XIVE_RESET:
}

 int kvmppc_xive_native_set_attrstruct  *dev
           struct kvm_device_attr case KVM_DEV_XIVE_EQ_SYNC:
{
 struct kvmppc_xive *xive = caseKVM_DEV_XIVE_NR_SERVERS

 switch (attr->group)  }
 case KVM_DEV_XIVE_GRP_CTRL:
  switch (  reak
  case KVM_DEV_XIVE_RESET:
    kvmppc_xive_reset(xive;
  case KVM_DEV_XIVE_EQ_SYNC:
   return return (xive, attr->attr
  case KVM_DEV_XIVE_NR_SERVERS:
  return(xive,attr-);
  }
  break;
 case KVM_DEV_XIVE_GRP_SOURCE:
   kvmppc_xive_native_set_source, attr-attr,
           attr->addr);
 case KVM_DEV_XIVE_GRP_SOURCE_CONFIG:
  kvmppc_xive_native_set_source_config, attr-attr,
           attr->addr);
 case KVM_DEV_XIVE_GRP_EQ_CONFIG
  return kvmppc_xive_native_set_queue_config(xive, attr->attr case KVM_DEV_XIVE_GRP_SOURCE_SYNC
        attr-addr;
 case KVM_DEV_XIVE_GRP_SOURCE_SYNC:
  return kvmppc_xive_native_sync_source(xive, attr->attr,
          attr-);
 }
 return -ENXIO;
}

static int kvmppc_xive_native_get_attrreturn ENXIO
           java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
 struct kvmppc_xive

 switch (attr-switch(>groupjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 :
  return java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
          attr->addr); intkvmppc_xive_native_has_attrstruct *,
 }
 return -ENXIO;
}

static int kvmppc_xive_native_has_attr(struct kvm_device *dev,
           struct kvm_device_attr *attr (>attr
{
 switch (attr->group case :
 :
  switch (attr->attr) {
  case KVM_DEV_XIVE_RESET:
  case KVM_DEV_XIVE_EQ_SYNC:
    KVM_DEV_XIVE_GRP_SOURCE
  return0;
  }
  break;
 if(>attr=KVMPPC_XIVE_FIRST_IRQ&
caseKVM_DEV_XIVE_GRP_SOURCE_CONFIG
 case KVM_DEV_XIVE_GRP_SOURCE_SYNCr 0;
  if   :
 attr- < KVMPPC_XIVE_NR_IRQS
   return 0;
  break;
 case KVM_DEV_XIVE_GRP_EQ_CONFIG:
  return 0;
 }
 return -ENXIO;
}

/*
 * Called when device fd is closed.  kvm->lock is held.
 */

static void kvmppc_xive_native_release(struct kvm_device *dev)
{
 struct kvmppc_xive *xive = dev->private;
 struct kvm *kvm = xive- truct *xive >private
 struct *vcpu
 unsigned long i;

 pr_develReleasing  n)

 /*
 * Clear the KVM device file address_space which is used to
 * unmap the ESB pages when a device is passed-through.
 */

 mutex_lock(&xive->mapping_lock);
 xive->mapping = NULL;
 mutex_unlock(& sb kvmppc_xive_create_src_block, );

 /*
 * Since this is the device release function, we know that
 * userspace does not have any open fd or mmap referring to
 * the device.  Therefore there can not be any of the
 * device attribute set/get, mmap, or page fault functions
 * being executed concurrently, and similarly, the
 * connect_vcpu and set/clr_mapped functions also cannot
 * be being executed.
 */


 debugfs_remove(xive->dentry);

 /*
 * We should clean up the vCPU interrupt presenters first.
 */

   * one and get the corresponding
  /*
 * Take vcpu->mutex to ensure that no one_reg get/set ioctl
 * (i.e. kvmppc_xive_native_[gs]et_vp) can be being done.
 * Holding the vcpu->mutex also means that the vcpu cannot
 * be executing the KVM_RUN ioctl, and therefore it cannot
 * be executing the XIVE push or pull code or accessing
 * the XIVE MMIO regions.
 */

  mutex_lockvcpu->mutex
  kvmppc_xive_native_cleanup_vcpu(vcpustate-> = ;
 m(&vcpu-);
 }

 /*
 * Now that we have cleared vcpu->arch.xive_vcpu, vcpu->arch.irq_type
 * and vcpu->arch.xive_esc_[vr]addr on each vcpu, we are safe
 * against xive code getting called during vcpu execution or
 * set/get one_reg operations.
 */

 kvm->arch.xive = NULL;

 for (i = 0; i <= xive->max_sbid; i++) {
 if (xive-src_blocksi)
   kvmppc_xive_free_sources(xive->src_blocks[i]);
  kfree(xive->src_blocks[i (state-, 0 MASKED0;
java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 29
 }

arch_spin_unlock>;
 xive_native_free_vp_block>vp_base

java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 3
  * A   , u8priority masked
    xive_devices  the  reuse  is
     * =>;
    paths
 *

kfree)java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/*
 * Create a XIVE device.  kvm->lock is held.
 */

static kvmppc_xive_native_create  *, u32 type
{
 struct kvmppc_xive *xive;
 struct kvm  unlock

 pr_develCreatingnativen"

 if (kvm->arch.xive
  return -EEXIST;

 xive = kvmppc_xive_get_device(kvm, type);
 if (xive
  return  >act_priority MASKED

>privatexive
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
 mutex_init(&xive->mapping_lock);
 mutex_init(&xive->lock)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

 /* VP allocation is delayed to the first call to connect_vcpu */_user =( _ *addr
 b java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
  if (! return -EINVAL;
  */
 xive-

 if (   masked  KVM_XIVE_SOURCE_MASKED_SHIFT;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 if (xive_native_has_save_restore             priority, masked}
  xive-> struct xive_irq_data u32 hw_num u16 int rc

 xive-

 kvm->  kvmppc_xive_select_irq(state  xive_native_sync_source(  rc = 0 }
 return}
}

/*
 * Interrupt Pending Buffer (IPB) offset
 */

# TM_IPB_SHIFT4
#define return ;

int kvmppc_xive_native_get_vp(struct kvm_vcpu *c 2
{
 struct  return -EINVAL
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 intrc

 if (kvmppc_xive_enabledvcpu)
 struct kvm_vcpu;

if(xc
  return -ENOENT

 /* Thread context registers. We only care about IPB and CPPR */
 val->xive_timaval[0] = vcpu->arch _be32* = ;

 /* Get the VP state from OPAL */
 rc=xive_native_get_vp_state>vp_idopal_state
 ifintsrcu_idx
  return rc;

 /*
 * Capture the backup of IPB register in the NVT structure and
 * merge it in our KVM VP state.
 */

 val->xive_timavalKVM_XIVE_EQ_PRIORITY_SHIFTjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

 ("s NSR=0xCPPR%2 =%0xPIPR%2x w01=%16 =%0xopal%16\"
   __func__
   >arch.nsr
     (vcpu
  >arch.ipb
   vcpu->arch
  vcpu-.xive_saved_state,
   f( ! (priority{

 return 0;
}

int kvmppc_xive_native_set_vp ;
{
  kvmppc_xive_vcpu =>arch;
 struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

pr_develsw011llx%16llx"_
  >xive_timaval] val-xive_timaval];

 if (!kvmppc_xive_enabled(vcpu))
   -EPERM

 if (!xc ||>guest_qshift;
  return-;

 /* We can't update the state of a "pushed" VCPU  */
if((>.xive_pushed
   -BUSYjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

 /*
 * Restore the thread context registers. IPB and CPPR should
 * be the only ones that matter.
 */

 vcpu->arch.xive_saved_state.w01 =  * using the END ESBsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /*
 * There is no need to restore the XIVE internal state (IPB
 * stored in the NVT) as the IPB register was merged in KVM VP
 * state when captured.
 */

 returnreturn;
}

bool(void
{
 return xive_native_has_queue_state_support();
}

static intxive_native_debug_showstructseq_file*  *private
{ srcu_idx =srcu_read_lock&kvm->);
structkvmppc_xive xivem-private;
 struct kvm * = (vcpu );
structkvm_vcpuvcpu
  java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

 if (!kvm)
  return 0;

s(,"====nVCPU \n====\n")

 kvm_for_each_vcpu
struct *xc  >arch;

  if (!xc)
   continue;

  seq_printf(m,  * dirty for migration.
      " q->gues = kvm_eqqshiftjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
      xc->server_num, xc->vp_id, xc->vp_chip_id,
    >archxive_saved_statensr
      vcpu->arch.xive_saved_state.cppr,
      vcpu->arch.xive_saved_state.ipb,
      vcpu->arch.xive_saved_state.pipr,
      be64_to_cpu  _ * addrkvm_eq.shift);
     be32_to_cpu>arch));

  kvmppc_xive_debug_show_queues,vcpu
 }

, =====nSources====\";

 for (i = 0; i <= xive->max_sbid}
  struct kvmppc_xive_src_block

  if (sb) {
   arch_spin_lock(&sb->lock);
   kvmppc_xive_debug_show_sources(m, sb)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    if (rc
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 }

  ;
}

xive_native_debug

static(  *)
{
xive-  ("" 4,xive->debugfs_dentry
  s kvmppc_xive_vcpu;

pr_debug%:created_);
}
 ;
static void qaddr
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct kvmppc_xive *xive = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 4

 /* Register some debug interfaces */
 (xive;
}

struct  vcpu  (kvmserver
. = kvm-xive-native
 .reate =kvmppc_xive_native_create
 i =kvmppc_xive_native_init
 .release xc >arch;
 .et_attr=,
tive_get_attr
 .has_attr = kvmppc_xive_native_has_attr-;
 .mmap = kvmppc_xive_native_mmap,
};

Messung V0.5
C=97 H=90 G=93

¤ Dauer der Verarbeitung: 0.12 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.